.gallery-page {
  background: var(--paper);
}

.gallery-hero {
  position: relative;
  display: grid;
  height: min(500px, calc(100vh - 150px));
  min-height: 420px;
  overflow: hidden;
  color: var(--white);
  background: var(--forest-deep);
}

.gallery-hero > img,
.gallery-hero::after {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.gallery-hero > img {
  object-position: center 42%;
  object-fit: cover;
}

.gallery-hero::after {
  background: linear-gradient(90deg, rgba(7, 31, 57, 0.92), rgba(7, 31, 57, 0.6) 52%, rgba(7, 31, 57, 0.18));
  content: "";
}

.gallery-hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(calc(100% - 48px), var(--content));
  flex-direction: column;
  justify-content: center;
  margin: 0 auto;
}

.gallery-hero h1 {
  max-width: 880px;
  font-size: clamp(2.8rem, 5vw, 4.5rem);
}

.gallery-hero p:not(.eyebrow) {
  max-width: 700px;
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.02rem;
}

.gallery-intro,
.gallery-heading,
.gallery-grid,
.gallery-video {
  width: min(calc(100% - 48px), var(--content));
  margin-inline: auto;
}

.gallery-intro {
  display: grid;
  align-items: end;
  padding: 88px 0;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 80px;
}

.gallery-intro h2,
.gallery-heading h2 {
  max-width: 760px;
  font-size: clamp(2.1rem, 3.7vw, 3.55rem);
}

.gallery-intro > p {
  max-width: 560px;
  margin: 0;
}

.gallery-band {
  padding: 92px 0;
  background: var(--white);
}

.gallery-band-blue {
  color: var(--white);
  background: var(--forest-deep);
}

.gallery-heading {
  display: grid;
  align-items: end;
  margin-bottom: 42px;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 64px;
}

.gallery-heading > p {
  max-width: 500px;
  margin: 0;
}

.gallery-heading-light h2 {
  color: var(--white);
}

.gallery-heading-light > p {
  color: rgba(255, 255, 255, 0.68);
}

.gallery-grid {
  display: grid;
  grid-auto-rows: 220px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.gallery-item {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  background: var(--paper-warm);
  border-radius: 4px;
}

.gallery-item-tall {
  grid-row: span 2;
}

.gallery-item-wide {
  grid-column: span 2;
}

.gallery-item button {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  overflow: hidden;
  color: var(--white);
  background: transparent;
  border: 0;
  cursor: zoom-in;
  text-align: left;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 350ms ease;
}

.gallery-item button::after {
  position: absolute;
  inset: 35% 0 0;
  background: linear-gradient(transparent, rgba(7, 31, 57, 0.84));
  content: "";
}

.gallery-item button:hover img,
.gallery-item button:focus-visible img {
  transform: scale(1.025);
}

.gallery-item span {
  position: absolute;
  z-index: 1;
  right: 18px;
  bottom: 16px;
  left: 18px;
  font-size: 0.9rem;
  font-weight: 600;
}

.gallery-item small {
  display: block;
  margin-bottom: 2px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
}

.gallery-grid-interior {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.gallery-grid-interior .gallery-item {
  grid-row: span 2;
}

.gallery-grid-concepts {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.gallery-grid-concepts .gallery-item {
  min-height: 320px;
  grid-row: span 2;
}

.gallery-video {
  display: grid;
  align-items: center;
  margin-top: 64px;
  padding-top: 64px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  grid-template-columns: 0.65fr 1.35fr;
  gap: 72px;
}

.gallery-video h3 {
  color: var(--white);
  font-size: clamp(1.8rem, 3vw, 2.7rem);
}

.gallery-video p:not(.eyebrow) {
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.65);
}

.gallery-video video {
  width: 100%;
  max-height: 640px;
  background: #061a2d;
  border-radius: 4px;
}

.gallery-lightbox {
  width: min(92vw, 1180px);
  max-width: none;
  max-height: 90vh;
  padding: 0;
  overflow: visible;
  color: var(--white);
  background: #061a2d;
  border: 0;
  border-radius: 4px;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.5);
}

.gallery-lightbox::backdrop {
  background: rgba(3, 14, 26, 0.86);
  backdrop-filter: blur(8px);
}

.gallery-lightbox img {
  width: 100%;
  max-height: calc(90vh - 58px);
  object-fit: contain;
}

.gallery-lightbox p {
  min-height: 58px;
  margin: 0;
  padding: 17px 64px 17px 20px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.78rem;
}

.gallery-lightbox-close {
  position: absolute;
  z-index: 2;
  right: 10px;
  bottom: 9px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.1);
}

@media (max-width: 1000px) {
  .gallery-grid,
  .gallery-grid-interior {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .gallery-grid-interior .gallery-item:last-child {
    grid-column: span 2;
  }
}

@media (max-width: 760px) {
  .gallery-hero {
    height: 520px;
  }

  .gallery-hero::after {
    background: linear-gradient(0deg, rgba(7, 31, 57, 0.95), rgba(7, 31, 57, 0.28));
  }

  .gallery-hero-inner,
  .gallery-intro,
  .gallery-heading,
  .gallery-grid,
  .gallery-video {
    width: min(calc(100% - 32px), var(--content));
  }

  .gallery-hero h1 {
    font-size: 2.65rem;
  }

  .gallery-intro,
  .gallery-heading,
  .gallery-video {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .gallery-intro,
  .gallery-band {
    padding-top: 68px;
    padding-bottom: 68px;
  }

  .gallery-grid,
  .gallery-grid-interior,
  .gallery-grid-concepts {
    grid-auto-rows: 200px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gallery-grid-interior .gallery-item:last-child {
    grid-column: auto;
  }

  .gallery-grid-concepts .gallery-item {
    min-height: 0;
    grid-row: span 1;
  }

  .gallery-video {
    margin-top: 48px;
    padding-top: 48px;
  }
}

@media (max-width: 480px) {
  .gallery-grid,
  .gallery-grid-interior,
  .gallery-grid-concepts {
    grid-template-columns: 1fr;
  }

  .gallery-item,
  .gallery-item-tall,
  .gallery-item-wide,
  .gallery-grid-interior .gallery-item,
  .gallery-grid-concepts .gallery-item {
    min-height: 270px;
    grid-column: auto;
    grid-row: auto;
  }

  .gallery-item-tall {
    min-height: 400px;
  }
}

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