.gallery-page {
  background: #fbf8f3;
  color: #2c211b;
}

.gallery-hero {
  min-height: 78svh;
  align-items: end;
}

.gallery-hero .hero__media {
  background-image: var(--gallery-hero-image);
  background-position: center;
  background-size: cover;
  filter: saturate(.9) contrast(1.04);
}

.gallery-hero .hero__overlay {
  background: linear-gradient(180deg, rgba(22, 16, 12, .12) 20%, rgba(22, 16, 12, .72) 100%);
}

.gallery-hero .hero__inner {
  width: min(1180px, calc(100% - 64px));
  margin: 0 auto;
  padding: 170px 0 66px;
  text-align: left;
}

.gallery-hero .hero__inner::before,
.gallery-hero .hero__inner::after { display: none; }

.gallery-hero h1 {
  max-width: 950px;
  font-size: clamp(58px, 8vw, 112px);
  font-weight: 500;
  line-height: .88;
}

.gallery-hero .hero__copy {
  max-width: 630px;
  margin-top: 24px;
  color: rgba(255,255,255,.88);
  font-size: 17px;
  line-height: 1.7;
}

.gallery-hero .eyebrow {
  color: #f3d3aa;
  letter-spacing: .18em;
}

.gallery-toolbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px max(24px, calc((100% - 1180px) / 2));
  background: rgba(251,248,243,.94);
  border-bottom: 1px solid #e3d6c9;
  backdrop-filter: blur(14px);
}

.gallery-back {
  color: #5b473b;
  font-size: 13px;
  font-weight: 700;
}

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

.gallery-filter {
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid #d8c7b7;
  border-radius: 2px;
  background: transparent;
  color: #654f42;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.gallery-filter:hover,
.gallery-filter:focus-visible,
.gallery-filter.is-active {
  background: #3b2418;
  border-color: #3b2418;
  color: #fff;
}

.gallery-intro {
  display: grid;
  grid-template-columns: .85fr 1.15fr;
  gap: 90px;
  width: min(1080px, calc(100% - 48px));
  margin: 0 auto;
  padding: 92px 0 70px;
}

.gallery-intro h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(42px, 5vw, 66px);
  font-weight: 500;
  line-height: 1;
}

.gallery-intro p {
  margin: 0;
  color: #6d5a4e;
  font-size: 17px;
  line-height: 1.9;
}

.gallery-kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 20px;
  color: #983d27;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.gallery-kicker::before {
  content: "";
  width: 42px;
  height: 1px;
  background: #a8452e;
}

.gallery-mosaic {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-flow: dense;
  gap: 18px;
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding-bottom: 112px;
}

.gallery-card {
  grid-column: span 4;
  min-height: 350px;
  position: relative;
  overflow: hidden;
  margin: 0;
  border-radius: 3px;
  background: #2d211b;
  cursor: zoom-in;
  opacity: 1;
  transform: none;
}

.gallery-card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.gallery-card.is-filtered { display: none; }
.gallery-card--wide { grid-column: span 8; }
.gallery-card--tall { min-height: 580px; }
.gallery-card--panorama { grid-column: 1 / -1; min-height: 520px; }

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

.gallery-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 48%, rgba(22,15,11,.74));
  pointer-events: none;
}

.gallery-card:hover img,
.gallery-card:focus-within img {
  transform: scale(1.035);
  filter: saturate(1.04);
}

.gallery-card button {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  z-index: 2;
  padding: 24px;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: zoom-in;
  text-align: left;
}

.gallery-card figcaption {
  position: absolute;
  z-index: 3;
  left: 24px;
  right: 24px;
  bottom: 21px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  color: #fff;
  pointer-events: none;
}

.gallery-card figcaption strong {
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 500;
}

.gallery-card figcaption span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.gallery-cta {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 32px;
  padding: 74px max(24px, calc((100% - 1080px) / 2));
  background: #241a15;
  color: #fff;
}

.gallery-cta h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(38px, 4vw, 58px);
  font-weight: 500;
}

.gallery-cta p { margin: 10px 0 0; color: #cdbdb1; }

.gallery-lightbox {
  width: 100vw;
  max-width: none;
  height: 100vh;
  max-height: none;
  padding: 0;
  border: 0;
  background: rgba(19,14,11,.96);
  color: #fff;
}

.gallery-lightbox::backdrop { background: rgba(19,14,11,.94); }
.lightbox-frame { width: 100%; height: 100%; display: grid; grid-template-rows: 1fr auto; padding: 58px 76px 34px; }
.lightbox-frame img { width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.lightbox-caption { display: flex; justify-content: space-between; gap: 24px; padding-top: 18px; color: #ddcfc4; }
.lightbox-close,
.lightbox-nav {
  position: absolute;
  z-index: 2;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255,255,255,.34);
  border-radius: 50%;
  background: rgba(27,20,16,.5);
  color: #fff;
  cursor: pointer;
  font: 400 28px/1 var(--sans);
}
.lightbox-close { top: 18px; right: 22px; }
.lightbox-nav { top: 50%; transform: translateY(-50%); }
.lightbox-nav--prev { left: 18px; }
.lightbox-nav--next { right: 18px; }

@media (max-width: 900px) {
  .gallery-toolbar { align-items: flex-start; flex-direction: column; }
  .gallery-intro { grid-template-columns: 1fr; gap: 30px; }
  .gallery-card { grid-column: span 6; }
  .gallery-card--wide { grid-column: span 6; }
  .gallery-card--panorama { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .gallery-hero .hero__inner { width: min(100% - 32px, 1180px); padding-bottom: 42px; }
  .gallery-hero h1 { font-size: clamp(50px, 16vw, 72px); }
  .gallery-toolbar { position: sticky; top: 0; padding: 16px; }
  .gallery-filters { flex-wrap: nowrap; width: 100%; overflow-x: auto; padding-bottom: 3px; }
  .gallery-filter { flex: 0 0 auto; }
  .gallery-intro { width: min(100% - 32px, 1080px); padding: 66px 0 48px; }
  .gallery-mosaic { width: min(100% - 24px, 1180px); gap: 12px; }
  .gallery-card,
  .gallery-card--wide,
  .gallery-card--panorama { grid-column: 1 / -1; min-height: 310px; }
  .gallery-card--tall { min-height: 460px; }
  .gallery-cta { grid-template-columns: 1fr; }
  .lightbox-frame { padding: 64px 14px 24px; }
  .lightbox-nav { top: auto; bottom: 78px; }
  .lightbox-caption { padding-inline: 54px; }
}

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