.gallery-page {
  background: #141210;
  color: #f8f2e8;
}

.gallery-page .site-header {
  background: rgba(17, 15, 13, .92);
  border-bottom-color: rgba(255, 255, 255, .12);
}

.gallery-hero {
  position: relative;
  min-height: min(900px, 92vh);
  display: grid;
  align-items: end;
  overflow: hidden;
  background: #17130f;
}

.gallery-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 8, 7, .02) 24%, rgba(10, 8, 7, .2) 52%, rgba(10, 8, 7, .92) 100%);
  pointer-events: none;
}

.gallery-hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 48%;
}

.gallery-hero-copy {
  position: relative;
  z-index: 1;
  width: min(1460px, calc(100% - 80px));
  margin: 0 auto;
  padding: 170px 0 clamp(54px, 8vw, 110px);
}

.gallery-hero-copy h1 {
  max-width: 900px;
  margin: 12px 0 20px;
  font-size: clamp(4.4rem, 10.5vw, 10rem);
  line-height: .82;
  letter-spacing: -.06em;
  color: #fff;
}

.gallery-hero-copy p:last-child {
  max-width: 660px;
  margin: 0;
  font-size: clamp(1.05rem, 1.8vw, 1.38rem);
  line-height: 1.6;
  color: #f0e4d3;
}

.gallery-intro {
  padding: clamp(62px, 8vw, 110px) 0 34px;
  background: #f5eee3;
  color: #171411;
}

.gallery-intro-grid {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: clamp(42px, 8vw, 120px);
  align-items: end;
}

.gallery-intro h2 {
  margin: 12px 0 0;
  font-size: clamp(2.7rem, 5.8vw, 5.7rem);
  line-height: .94;
}

.gallery-intro-copy {
  max-width: 680px;
  font-size: 1.08rem;
  line-height: 1.75;
  color: #44392f;
}

.gallery-filter-wrap {
  position: sticky;
  z-index: 8;
  top: var(--header-height);
  padding: 18px 0;
  background: rgba(245, 238, 227, .96);
  border-top: 1px solid rgba(36, 27, 20, .12);
  border-bottom: 1px solid rgba(36, 27, 20, .15);
  backdrop-filter: blur(14px);
}

.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.gallery-filter {
  padding: 10px 16px;
  border: 1px solid #6d5a48;
  border-radius: 999px;
  background: transparent;
  color: #2d251e;
  font: 750 .76rem/1 var(--sans);
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, transform .2s ease;
}

.gallery-filter:hover,
.gallery-filter:focus-visible,
.gallery-filter.is-active {
  background: #171411;
  color: #fff8ed;
  transform: translateY(-1px);
}

.gallery-archive {
  padding: clamp(38px, 5vw, 72px) 0 clamp(80px, 10vw, 150px);
  background: #f5eee3;
}

.gallery-mosaic {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-flow: dense;
  gap: clamp(10px, 1.4vw, 20px);
}

.gallery-tile {
  position: relative;
  grid-column: span 4;
  min-height: 380px;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: #211c18;
  color: #fff;
  text-align: left;
  cursor: zoom-in;
}

.gallery-tile.wide { grid-column: span 8; }
.gallery-tile.tall { min-height: 590px; }
.gallery-tile.hero-tile { grid-column: span 8; min-height: 660px; }

.gallery-tile[hidden] { display: none; }

.gallery-tile img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .75s cubic-bezier(.2, .7, .2, 1), filter .45s ease;
}

.gallery-tile::after {
  content: "";
  position: absolute;
  inset: 45% 0 0;
  background: linear-gradient(transparent, rgba(10, 8, 7, .82));
  opacity: .82;
  transition: opacity .35s ease;
}

.gallery-tile span {
  position: absolute;
  z-index: 1;
  right: 24px;
  bottom: 22px;
  left: 24px;
  font: 800 .76rem/1.35 var(--sans);
  letter-spacing: .11em;
  text-transform: uppercase;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .65);
}

.gallery-tile:hover img,
.gallery-tile:focus-visible img {
  transform: scale(1.045);
  filter: saturate(1.08) contrast(1.03);
}

.gallery-tile:hover::after,
.gallery-tile:focus-visible::after { opacity: 1; }

.gallery-tile:focus-visible { outline: 3px solid #edcb72; outline-offset: 4px; }

.gallery-closing {
  position: relative;
  min-height: 660px;
  display: grid;
  align-items: center;
  overflow: hidden;
}

.gallery-closing::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(14, 11, 9, .9) 0%, rgba(14, 11, 9, .58) 48%, rgba(14, 11, 9, .12) 78%);
}

.gallery-closing > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 55%;
}

.gallery-closing-card {
  position: relative;
  z-index: 1;
  width: min(1460px, calc(100% - 80px));
  margin: 0 auto;
  padding: 90px 0;
}

.gallery-closing-card > div { max-width: 610px; }
.gallery-closing h2 { margin: 12px 0 20px; font-size: clamp(3rem, 6vw, 6rem); color: #fff; }
.gallery-closing p { max-width: 540px; font-size: 1.14rem; line-height: 1.7; color: #f1e4d4; }

.gallery-lightbox {
  width: 100vw;
  max-width: none;
  height: 100vh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(8, 7, 6, .96);
  color: #fff;
}

.gallery-lightbox::backdrop { background: rgba(8, 7, 6, .96); }
.gallery-lightbox[open] { display: grid; grid-template-rows: minmax(0, 1fr) auto; }
.lightbox-stage { position: relative; min-height: 0; display: grid; place-items: center; padding: 68px 90px 20px; }
.lightbox-stage img { max-width: 100%; max-height: calc(100vh - 150px); object-fit: contain; }
.lightbox-caption { min-height: 70px; margin: 0; padding: 18px 90px 28px; text-align: center; font: 800 .78rem/1.4 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: #eed9ba; }
.lightbox-close,
.lightbox-nav { position: absolute; z-index: 2; display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid rgba(255,255,255,.42); border-radius: 50%; background: rgba(18,15,13,.65); color: #fff; font: 400 1.6rem/1 var(--sans); cursor: pointer; }
.lightbox-close { top: 22px; right: 24px; }
.lightbox-nav { top: 50%; transform: translateY(-50%); }
.lightbox-prev { left: 22px; }
.lightbox-next { right: 22px; }
.lightbox-close:hover,
.lightbox-nav:hover { background: #fff; color: #171411; }

@media (max-width: 980px) {
  .gallery-hero-copy,
  .gallery-closing-card { width: min(100% - 44px, 1460px); }
  .gallery-intro-grid { grid-template-columns: 1fr; gap: 28px; }
  .gallery-tile,
  .gallery-tile.wide { grid-column: span 6; }
  .gallery-tile.hero-tile { grid-column: span 12; min-height: 580px; }
}

@media (max-width: 680px) {
  .gallery-hero { min-height: 78vh; }
  .gallery-hero-copy h1 { font-size: clamp(3.7rem, 20vw, 6rem); }
  .gallery-filter-wrap { top: 70px; overflow-x: auto; }
  .gallery-filters { width: max-content; flex-wrap: nowrap; padding-right: 24px; }
  .gallery-mosaic { grid-template-columns: 1fr; }
  .gallery-tile,
  .gallery-tile.wide,
  .gallery-tile.hero-tile { grid-column: 1; min-height: 430px; }
  .gallery-tile.tall { min-height: 540px; }
  .gallery-closing { min-height: 590px; }
  .gallery-closing::after { background: linear-gradient(180deg, rgba(14,11,9,.12), rgba(14,11,9,.9) 72%); }
  .gallery-closing-card { align-self: end; padding-bottom: 58px; }
  .lightbox-stage { padding: 64px 12px 10px; }
  .lightbox-caption { padding: 16px 56px 24px; }
  .lightbox-nav { width: 42px; height: 42px; top: auto; bottom: 18px; }
  .lightbox-prev { left: 12px; }
  .lightbox-next { right: 12px; }
}

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