* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: url('images/BG NSCC Stella Maris 1.png') no-repeat center center / cover;
  color: #ffffff;
}

.overlay {
  /* background: rgba(255, 255, 255, 0.3); */
  min-height: 100vh;
  min-width: 100vw;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem;
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 5.5rem;
  text-shadow: 0 4px 7px rgb(0, 0, 0);
}

p.subtitle {
  font-size: 1.3rem;
  font-weight: bold;
  margin-bottom: 2rem;  
  text-shadow: 0 1px 3px rgb(0, 0, 0);
}

.branches {
  display: flex;
  width: 100%;
  height: auto;
  gap: 2.8rem;
  flex-wrap: wrap;
  justify-content: center;
}

.branch-card {
  position: relative;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0);
  width: 360px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 340px;
  color: white;
  background-size: cover;
  background-position: center;
  /* Removed background-blend-mode to reveal images */
  transition: box-shadow 0.3s ease-in-out, transform 0.3s ease-in-out;
  overflow: hidden;
}

/* .branch-card::before { */
  /* content: ""; */
  /* position: absolute; */
  /* inset: 0; */
  /* background: rgba(0, 0, 0, 0.15); Lighter overlay for clarity */
  /* Removed blur for image clarity */
  /* z-index: 0; */
/* } */

.branch-card h3,
.branch-card p,
.branch-card a {
  position: relative;
  z-index: 1;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6); /* Optional: enhances text readability */
}


.branch-card a {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.6rem 1.2rem;
  background: #2563eb;
  color: white;
  text-decoration: none;
  border-radius: 8px;
}

.branch-card img {
  width: 100%;              /* fill card width */
  height: auto;             /* maintain aspect ratio */
  margin-bottom: 0;         /* remove margin to fill cleanly */
  display: block;           /* remove inline spacing */
  object-fit: cover;        /* fill container while maintaining aspect ratio */
}

.branch-card h3 {
  margin: 0.5rem 0;
}

.branch-card p {
  font-size: 0.95rem;
  flex-grow: 1;
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  text-align: center;
  margin: 0;
}

/* Hover Glow Effects */
.branch-card:hover {
  transform: scale(1.1);
}

/* Unique background images and glow */
.branch-card:nth-child(1) {
  background-image: url('images/mpc.png');
}
.branch-card:nth-child(1):hover {
  box-shadow: 0 0 20px 6px rgba(0, 255, 255, 0.7); /* cyan glow */
}

.branch-card:nth-child(2) {
  background-image: url('images/fed.png');
}
.branch-card:nth-child(2):hover {
  box-shadow: 0 0 20px 6px rgba(255, 165, 0, 0.7); /* orange glow */
}

.branch-card:nth-child(3) {
  background-image: url('images/mbai.png');
}
.branch-card:nth-child(3):hover {
  box-shadow: 0 0 20px 6px rgba(138, 43, 226, 0.7); /* purple glow */
}

.contact {
  margin-top: 2rem;
}

.contact p {
  font-size: 1.2rem;
  color:white;
  margin-bottom: 1rem;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}
.contact a {
  color: #000747;
  font-size: 1.3rem;
  font-weight: bold;
  border: 3px solid #02007e;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  text-decoration: none;
  text-shadow: 0 7px 7px rgb(255, 255, 255);
  
}

/* Phones */
@media (max-width: 600px) {
  h1 {
    font-size: 1.8rem;
  }
  p.subtitle {
    font-size: 1rem;
  }
  .branches {
    gap: 1rem;
  }
  .branch-card {
    width: 100%;
    padding: 0.5rem;
    height: 340px;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
  }

  .image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
  }

  .branch-card p {
    font-size: 0.95rem;
  }
  .branch-card h3 {
    font-size: 1.2rem;
  }
  .branch-card a {
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
  }
  .overlay {
    padding: 1rem;
  }
}

/* Tablets */
@media (min-width: 601px) and (max-width: 1024px) {
  h1 {
    font-size: 2.2rem;
  }
  p.subtitle {
    font-size: 1.1rem;
  }
  .branch-card {
    width: 45%;
  }
}


/* Large Desktops and 4K */
@media (min-width: 1440px) {
  .overlay {
    max-width: 1400px;
    margin: 0 auto;
  }
  h1 {
    font-size: 3rem;
  }
  p.subtitle {
    font-size: 1.3rem;
  }
  .branch-card {
    width: 280px;
    height: 260px;
  }
  .branch-card p {
    font-size: 1rem;
  }
}
