.gallery-page {
  background: #f3eee5;
  color: #17130f;
}

.gallery-page main {
  overflow: visible;
}

.gallery-page-hero {
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto;
  padding: clamp(70px, 9vw, 130px) 0 clamp(42px, 6vw, 82px);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr);
  align-items: end;
  gap: clamp(36px, 8vw, 130px);
}

.gallery-page-hero h1 {
  max-width: 820px;
  margin: 0;
  color: #17130f;
  font-family: var(--font-serif);
  font-size: clamp(48px, 7vw, 98px);
  font-weight: 400;
  letter-spacing: -.045em;
  line-height: .96;
}

.gallery-page-hero h1 em {
  color: #a67c37;
  font-weight: 400;
}

.gallery-page-intro {
  padding-left: 28px;
  border-left: 1px solid #cdbb99;
}

.gallery-page-intro p {
  margin: 0;
  color: #5d554b;
  font-size: clamp(16px, 1.5vw, 20px);
  line-height: 1.8;
}

.gallery-page-intro span {
  display: block;
  margin-top: 22px;
  color: #8a6b34;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.gallery-viewer {
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto clamp(72px, 9vw, 130px);
}

.gallery-stage {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(122, 91, 40, .25);
  background: #11100e;
  box-shadow: 0 28px 75px rgba(42, 31, 20, .17);
}

.gallery-stage figure {
  position: relative;
  aspect-ratio: 16 / 10;
  margin: 0;
}

.gallery-stage figure::after {
  position: absolute;
  inset: 62% 0 0;
  background: linear-gradient(0deg, rgba(9, 8, 7, .82), transparent);
  pointer-events: none;
  content: "";
}

.gallery-stage img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #0d0c0a;
  transition: opacity .22s ease;
}

.gallery-stage img.is-loading {
  opacity: .35;
}

.gallery-stage figcaption {
  position: absolute;
  right: 76px;
  bottom: 32px;
  left: 76px;
  z-index: 2;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 25px;
  color: #fff;
}

.gallery-stage figcaption span {
  color: #e2c98f;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .14em;
}

.gallery-stage figcaption strong {
  font-family: var(--font-serif);
  font-size: clamp(24px, 3vw, 42px);
  font-weight: 400;
}

.gallery-control {
  position: absolute;
  top: 50%;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .42);
  border-radius: 50%;
  background: rgba(15, 13, 10, .63);
  color: #fff;
  font-size: 21px;
  cursor: pointer;
  transform: translateY(-50%);
  backdrop-filter: blur(8px);
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}

.gallery-control:hover,
.gallery-control:focus-visible {
  border-color: #e0c174;
  background: #b88a3f;
  outline: none;
  transform: translateY(-50%) scale(1.04);
}

.gallery-control-prev { left: 22px; }
.gallery-control-next { right: 22px; }

.gallery-progress {
  height: 2px;
  margin: 24px 0 20px;
  overflow: hidden;
  background: #d8cdbb;
}

.gallery-progress span {
  display: block;
  width: calc(100% / 29);
  height: 100%;
  background: #a7782d;
  transform-origin: left center;
  transition: width .3s ease;
}

.gallery-filmstrip {
  display: flex;
  gap: 11px;
  padding: 0 0 12px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-color: #a7782d #ded5c7;
  scrollbar-width: thin;
}

.gallery-thumb {
  position: relative;
  flex: 0 0 clamp(112px, 12vw, 154px);
  aspect-ratio: 4 / 3;
  padding: 0;
  overflow: hidden;
  border: 2px solid transparent;
  background: #d7cec0;
  cursor: pointer;
  opacity: .58;
  scroll-snap-align: center;
  transition: border-color .2s ease, opacity .2s ease, transform .2s ease;
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.gallery-thumb:hover,
.gallery-thumb:focus-visible {
  opacity: .9;
  outline: none;
}

.gallery-thumb.is-active {
  border-color: #a7782d;
  opacity: 1;
  transform: translateY(-2px);
}

.gallery-viewer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  margin-top: 20px;
}

.gallery-viewer-footer p {
  margin: 0;
  color: #6b6258;
  font-size: 14px;
}

.gallery-viewer-footer a {
  flex: 0 0 auto;
  color: #70511f;
  font-size: 13px;
  font-weight: 850;
  text-decoration: none;
}

.gallery-viewer-footer a:hover,
.gallery-viewer-footer a:focus-visible {
  color: #a7782d;
  outline: none;
}

@media (max-width: 780px) {
  .gallery-page-hero {
    width: min(100% - 32px, 1240px);
    grid-template-columns: 1fr;
    gap: 30px;
    padding-top: 56px;
  }

  .gallery-page-intro {
    padding-left: 18px;
  }

  .gallery-viewer {
    width: min(100% - 24px, 1240px);
  }

  .gallery-stage figure {
    aspect-ratio: 4 / 3;
  }

  .gallery-stage figcaption {
    right: 58px;
    bottom: 18px;
    left: 58px;
  }

  .gallery-control {
    width: 42px;
    height: 42px;
  }

  .gallery-control-prev { left: 10px; }
  .gallery-control-next { right: 10px; }
}

@media (max-width: 520px) {
  .gallery-page-hero h1 {
    font-size: 48px;
  }

  .gallery-stage figure {
    aspect-ratio: 1 / 1;
  }

  .gallery-stage figcaption {
    right: 16px;
    bottom: 15px;
    left: 16px;
    align-items: flex-start;
    flex-direction: column-reverse;
    gap: 3px;
  }

  .gallery-stage figcaption strong {
    max-width: calc(100% - 88px);
    font-size: 23px;
  }

  .gallery-control {
    top: auto;
    bottom: 13px;
    transform: none;
  }

  .gallery-control:hover,
  .gallery-control:focus-visible {
    transform: scale(1.04);
  }

  .gallery-control-prev { right: 58px; left: auto; }
  .gallery-control-next { right: 10px; }

  .gallery-viewer-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-stage img,
  .gallery-thumb,
  .gallery-progress span,
  .gallery-control {
    transition: none;
  }
}

