:root {
  --g-navy: #103d74;
  --g-red: #db3f34;
  --g-gold: #f5c51d;
  --g-pale: #f1f7fc;
  --g-line: #c9ddec;
}

.public-gallery-page {
  background: var(--g-pale);
  color: #102b50;
}

.gallery-shell {
  width: min(1320px, calc(100% - 48px));
  margin: auto;
}

.gallery-hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  min-height: 670px;
  padding: 180px 0 105px;
  overflow: hidden;
  background: #0a2c59;
  color: #fff;
}

.gallery-hero-media,
.gallery-hero-shade {
  position: absolute;
  inset: 0;
  margin: 0;
}

.gallery-hero-media {
  z-index: 0;
  overflow: hidden;
  background: #0a2c59;
}

.gallery-hero-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.gallery-hero-campus .gallery-hero-media img {
  object-position: center 54%;
}

.gallery-hero-lfi .gallery-hero-media img {
  object-position: center 58%;
}

.gallery-hero-shade {
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(5, 27, 56, .97) 0%, rgba(8, 39, 78, .91) 40%, rgba(14, 57, 105, .68) 72%, rgba(11, 43, 82, .54) 100%),
    linear-gradient(0deg, rgba(4, 20, 40, .52), rgba(8, 42, 80, .08) 60%);
}

.gallery-hero .gallery-shell {
  position: relative;
  z-index: 2;
}

.gallery-hero p,
.gallery-heading p {
  font: 700 12px/1.4 Montserrat, Arial, sans-serif;
  letter-spacing: .25em;
  color: var(--g-gold);
}

.gallery-hero h1 {
  max-width: 1000px;
  margin: 18px 0 26px;
  color: #fff;
  font-size: clamp(54px, 8vw, 110px);
  line-height: .9;
  letter-spacing: -.06em;
  text-shadow: 0 8px 34px rgba(4, 20, 40, .34);
}

.gallery-hero span {
  display: block;
  max-width: 680px;
  color: #edf5fb;
  font-size: 19px;
  line-height: 1.7;
  text-shadow: 0 3px 20px rgba(4, 20, 40, .42);
}

.gallery-collection {
  padding: 90px 0 140px;
}

.gallery-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 42px;
}

.gallery-heading h2 {
  margin: 8px 0;
  font-size: clamp(34px, 5vw, 62px);
  letter-spacing: -.04em;
}

.gallery-heading a {
  padding: 10px 0;
  border-bottom: 2px solid var(--g-gold);
  color: var(--g-navy);
  font-weight: 800;
  text-decoration: none;
}

/* Natural-height masonry preserves every source photo without cropping. */
.gallery-masonry {
  column-count: 3;
  column-gap: 18px;
}

.gallery-card {
  position: relative;
  display: inline-block;
  width: 100%;
  margin: 0 0 18px;
  padding: 0;
  overflow: hidden;
  break-inside: avoid;
  vertical-align: top;
  border: 0;
  border-radius: 22px;
  background: #dce8f2;
  cursor: pointer;
  text-align: left;
}

.gallery-card img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  transition: transform .5s ease;
}

.gallery-card:hover img {
  transform: scale(1.025);
}

.gallery-card > span {
  position: absolute;
  inset: auto 0 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 42px 22px 20px;
  color: #fff;
  background: linear-gradient(transparent, rgba(5, 25, 48, .94));
}

.gallery-card small {
  color: var(--g-gold);
  font-weight: 800;
}

.gallery-card strong {
  font-size: 18px;
}

.gallery-card i {
  font-size: 12px;
  font-style: normal;
}

.gallery-lightbox {
  width: min(1180px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 24px;
  background: #081e39;
  color: #fff;
}

.gallery-lightbox::backdrop {
  background: rgba(4, 18, 35, .88);
  backdrop-filter: blur(8px);
}

.gallery-lightbox > button {
  position: absolute;
  z-index: 3;
  top: 14px;
  right: 14px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: #123d74;
  font-size: 28px;
  cursor: pointer;
}

.gallery-lightbox figure {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  max-height: calc(100dvh - 32px);
  margin: 0;
}

.gallery-lightbox img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100dvh - 180px);
  margin: auto;
  object-fit: contain;
  background: #06172d;
}

.gallery-lightbox figcaption {
  padding: 22px 28px;
  background: #081e39;
}

.gallery-lightbox strong {
  font-size: 24px;
}

.gallery-lightbox p {
  margin: 8px 0 0;
  color: #bdd0e3;
}

.gallery-empty {
  padding: 80px;
  border: 1px dashed var(--g-line);
  border-radius: 22px;
  background: #fff;
  text-align: center;
}

.site-header a[data-portal-session-link].button-nav.button-signup,
.site-header .button-nav.button-signup {
  border-color: #173f75 !important;
  background: #173f75 !important;
  color: #fff !important;
}

@media (max-width: 850px) {
  .gallery-hero {
    min-height: 570px;
    padding: 155px 0 85px;
  }

  .gallery-hero-shade {
    background: linear-gradient(90deg, rgba(5, 27, 56, .94), rgba(11, 48, 91, .72));
  }

  .gallery-masonry {
    column-count: 2;
  }

  .gallery-heading {
    display: block;
  }

  .gallery-heading a {
    display: inline-block;
    margin-top: 10px;
  }
}

@media (max-width: 540px) {
  .gallery-shell {
    width: calc(100% - 28px);
  }

  .gallery-hero {
    min-height: 520px;
    padding: 145px 0 70px;
  }

  .gallery-hero-media img {
    object-position: 62% center;
  }

  .gallery-hero-shade {
    background: linear-gradient(90deg, rgba(5, 27, 56, .96), rgba(11, 48, 91, .76));
  }

  .gallery-hero h1 {
    font-size: 49px;
  }

  .gallery-hero span {
    font-size: 15px;
  }

  .gallery-collection {
    padding: 55px 0 90px;
  }

  .gallery-masonry {
    column-count: 1;
  }

  .gallery-card > span {
    grid-template-columns: auto 1fr;
  }

  .gallery-card i {
    display: none;
  }

  .gallery-lightbox {
    width: calc(100% - 18px);
    max-height: calc(100dvh - 18px);
    border-radius: 18px;
  }

  .gallery-lightbox figure {
    max-height: calc(100dvh - 18px);
  }

  .gallery-lightbox img {
    max-height: calc(100dvh - 158px);
  }

  .gallery-lightbox figcaption {
    padding: 18px 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-card img {
    transition: none;
  }
}
