/* Styles for Current Openings Page */
.page-title {
  padding: 10px 4%;
  background: #0060c9;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 100px 0px 100px;
  border-radius: 8px;
}
.page-title h2 {
  font-size: 18px;
  text-transform: uppercase;
}
.page-title small {
  font-size: 12px;
}
/* Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.grid#gallery {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 18px;
  align-items: start;
  margin: 18px 0;
}

/* card / figure */
figure.card {
  margin: 0;
  background: #ffffff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(17, 24, 39, 0.06);
  border: 1px solid rgba(15, 23, 42, 0.04);
  transition: transform 220ms ease, box-shadow 220ms ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

/* hover / focus lift */
figure.card:focus-within,
figure.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 30px rgba(17, 24, 39, 0.10);
}

/* image */
.thumb {
  display: block;
  width: 100%;
  height: 220px;
  object-position: center;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  background: linear-gradient(180deg, #f6f7fb 0%, #ffffff 100%);
  transition: transform 300ms ease;
}

/* subtle zoom on hover */
figure.card:hover .thumb,
figure.card:focus-within .thumb {
  transform: scale(1.03);
}

/* meta (title + date) */
figcaption.meta {
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  background: linear-gradient(180deg, rgba(255,255,255,0), rgba(250,250,255,0.4));
}

.meta .title {
  font-size: 13px;
  font-weight: 700;
  color: #0a2540;
  text-transform: none;
  line-height: 1;
}

.meta .date {
  font-size: 12px;
  color: #55607a;
  background: rgba(3,102,214,0.06);
  padding: 4px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

/* accessible focus ring when using keyboard */
figure.card:focus-within {
  outline: none;
  box-shadow: 0 0 0 4px rgba(59,134,246,0.12);
}
/* Full screen viewer overlay */
.viewer {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(4,8,24,0.72);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
  z-index: 1200;
}

/* open state */
.viewer.open {
  opacity: 1;
  pointer-events: auto;
}

/* the displayed image */
#viewerImg {
  max-width: min(92vw, 1100px);
  max-height: min(88vh, 1400px);
  width: auto;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(2,8,23,0.6);
  transform-origin: center;
  transition: transform 240ms cubic-bezier(.2,.9,.25,1);
}

/* small caption or control area (optional) */
.viewer .caption {
  margin-top: 10px;
  color: #e6eefc;
  font-size: 13px;
  text-align: center;
}

/* close button */
#closeBtn {
  position: fixed;
  top: 18px;
  right: 18px;
  background: rgba(255,255,255,0.06);
  color: #fff;
  border-radius: 8px;
  padding: 8px 10px;
  font-weight: 700;
  cursor: pointer;
  z-index: 1300;
  user-select: none;
  backdrop-filter: blur(4px);
  transition: transform 160ms ease, background 160ms ease;
}
#closeBtn:hover { 
  transform: scale(1.05); 
  background: rgba(255,255,255,0.09); 
}

/* keyboard focus for close */
#closeBtn:focus { 
  outline: none; 
  box-shadow: 0 0 0 4px rgba(255,255,255,0.08); 
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .page-title {
    margin: 10px 60px 0 60px;
    padding: 12px 4%;
  }

  .container {
    max-width: 960px;
    padding: 18px;
  }

  /* 3 columns instead of 5 */
  .grid#gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin: 16px 0;
  }

  figure.card .thumb {
    height: 200px;
  }

  #viewerImg {
    max-width: min(90vw, 1000px);
    max-height: min(86vh, 1200px);
  }
}

/* Tablets / larger phones landscape — <= 768px */
@media (max-width: 768px) {
  .page-title {
    margin: 10px 28px 0 28px;
    padding: 10px 3%;
    gap: 6px;
  }
  /* let the title stack on tight widths */
  .page-title {
    flex-direction: column;
    align-items: flex-start;
    row-gap: 6px;
  }
  .container {
    max-width: 720px;
    padding: 14px;
  }
  /* 2 columns instead of 3 */
  .grid#gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
  figure.card {
    border-radius: 10px;
  }
  .thumb {
    height: 180px;
  }
  .meta .title {
    font-size: 13px; 
  }
  .meta .date {
    font-size: 11px;
    padding: 3px 7px;
  }
  #closeBtn {
    top: 14px;
    right: 14px;
    padding: 7px 9px;
  }
  #viewerImg {
    max-width: min(94vw, 820px);
    max-height: min(84vh, 1100px);
  }
}

/* Small phones — <= 480px */
@media (max-width: 480px) {
  .page-title {
    margin: 8px 14px 0 14px;
    padding: 10px 3%;
  }
  .page-title h2 {
    font-size: 15px;
  }
  .page-title small {
    font-size: 11px;
  }
  .container {
    padding: 12px;
    max-width: 100%;
  }
  /* single column layout */
  .grid#gallery {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  figure.card {
    flex-direction: column;
  }
  .thumb {
    height: 160px;
  }
  figcaption.meta {
    padding: 10px;
    gap: 6px;
  }
  .meta .title {
    font-size: 14px;
    font-weight: 700;
  }
  .meta .date {
    font-size: 11px;
    padding: 3px 6px;
  }
  #closeBtn {
    top: 10px;
    right: 10px;
    padding: 6px 8px;
    font-size: 13px;
  }
  #viewerImg {
    max-width: 96vw;
    max-height: 80vh;
    box-shadow: 0 12px 36px rgba(2,8,23,0.5);
  }
  .viewer .caption {
    font-size: 12px;
    padding: 0 8px;
  }
}

/* Optional: improve touch targets on small devices */
@media (max-width: 768px) {
  figure.card,
  #closeBtn {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
}