/* Shared homepage photo rail + full gallery page */

.life-gallery { overflow-x: clip; background: var(--paper); }
.life-gallery .section-heading { margin-bottom: clamp(2rem, 4vw, 3.4rem); }
.life-gallery__aside { display: grid; justify-items: end; gap: 1rem; }
.life-gallery__controls { display: flex; align-items: center; gap: .65rem; }
.gallery-arrow {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease, opacity 180ms ease;
}
.gallery-arrow:hover:not(:disabled) { background: var(--ink); color: var(--white); transform: translateY(-2px); }
.gallery-arrow:disabled { cursor: default; opacity: .35; }
.gallery-arrow svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.gallery-arrow--previous svg { transform: rotate(180deg); }

.photo-rail {
  display: grid;
  grid-auto-columns: minmax(320px, 36%);
  grid-auto-flow: column;
  gap: 1rem;
  margin-right: calc((100vw - var(--shell)) / -2);
  padding: 0 max(1rem, calc((100vw - var(--shell)) / 2)) 0 0;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-padding-inline: 0 1rem;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.photo-rail::-webkit-scrollbar { display: none; }
.photo-slide { min-width: 0; scroll-snap-align: start; }
.photo-slide > button { display: grid; width: 100%; padding: 0; border: 0; background: transparent; color: inherit; cursor: zoom-in; text-align: left; }
.photo-slide__image { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; background: #d9cbb8; }
.photo-slide__image::after { position: absolute; inset: 0; border: 1px solid rgba(11,25,35,.08); content: ""; pointer-events: none; }
.photo-slide__image img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.9) contrast(1.02); transition: transform 500ms cubic-bezier(.2,.7,.2,1), filter 300ms ease; }
.photo-slide button:hover img,
.photo-slide button:focus-visible img { filter: saturate(1.04) contrast(1.02); transform: scale(1.025); }
.photo-slide__caption { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .3rem 1rem; align-items: end; padding: 1rem .15rem 0; }
.photo-slide__caption small { grid-column: 1 / -1; color: var(--brick); font-size: .58rem; font-weight: 850; letter-spacing: .11em; text-transform: uppercase; }
.photo-slide__caption strong { color: var(--ink); font-family: var(--display); font-size: clamp(1.3rem, 2vw, 1.8rem); font-weight: 600; line-height: 1.08; }
.life-gallery__footer { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; margin-top: 1.9rem; }
.life-gallery__footer p { max-width: 640px; margin: 0; color: var(--muted); font-size: .78rem; }

.gallery-page { background: var(--cream); }
.gallery-page .desktop-nav a[aria-current="page"]::after { transform: scaleX(1); }
.gallery-page .mobile-menu a[aria-current="page"] { color: var(--gold); }

.gallery-hero {
  position: relative;
  min-height: 490px;
  isolation: isolate;
  overflow: hidden;
  background: var(--ink-deep);
  color: var(--white);
}
.gallery-hero__image,
.gallery-hero__shade { position: absolute; z-index: -2; inset: 0; width: 100%; height: 100%; }
.gallery-hero__image { object-fit: cover; object-position: 50% 52%; filter: saturate(.8) contrast(1.06); }
.gallery-hero__shade {
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(5,15,22,.94) 0%, rgba(5,15,22,.72) 45%, rgba(5,15,22,.22) 75%, rgba(5,15,22,.48) 100%),
    linear-gradient(0deg, rgba(5,15,22,.82), transparent 62%);
}
.gallery-hero__inner { display: grid; min-height: inherit; max-width: 820px; align-content: center; padding-block: clamp(3.5rem, 6vw, 5rem); }
.gallery-hero h1 { margin: 0 0 1.4rem; color: var(--white); font-size: clamp(4.6rem, 8vw, 7rem); line-height: .88; }
.gallery-hero h1 em { color: var(--gold); font-weight: inherit; }
.gallery-hero__inner > p:not(.eyebrow) { max-width: 610px; margin-bottom: 2rem; color: rgba(255,255,255,.82); font-size: clamp(1.05rem, 1.7vw, 1.28rem); }
.gallery-hero__details { display: flex; flex-wrap: wrap; gap: .75rem 1.6rem; margin-top: clamp(1.25rem, 2.5vw, 2rem); color: rgba(255,255,255,.67); font-size: .7rem; font-weight: 750; }
.gallery-hero__details span { display: inline-flex; align-items: center; gap: .55rem; }
.gallery-hero__details span::before { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); content: ""; }

.gallery-collection { padding-block: clamp(2.5rem, 5vw, 4.5rem); scroll-margin-top: 82px; background: var(--paper); }
.gallery-collection__intro { margin-bottom: 1.5rem; }
.gallery-collection__intro h2 { margin-bottom: .65rem; font-size: clamp(2.65rem, 5vw, 4.2rem); }
.gallery-collection__intro p:not(.eyebrow) { max-width: 680px; margin-bottom: 0; color: var(--muted); font-size: 1rem; }
.gallery-collection__intro .eyebrow { margin-bottom: .8rem; }

.gallery-filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--line); }
.gallery-filters button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: .55rem 1rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: .875rem;
  font-weight: 650;
  line-height: 1.3;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease;
}
.gallery-filters button:hover { border-color: var(--ink); background: var(--cream); }
.gallery-filters button[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--white); }

.gallery-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; gap: 1.25rem; }
.gallery-card { min-width: 0; }
.gallery-card__button { display: grid; width: 100%; grid-template-rows: auto auto; align-content: start; gap: .6rem; padding: 0; border: 0; background: transparent; color: inherit; cursor: zoom-in; text-align: left; }
.gallery-card__image { display: block; width: 100%; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 4px; background: #d9cbb8; }
.gallery-card__image img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.9) contrast(1.02); transition: transform 520ms cubic-bezier(.2,.7,.2,1), filter 300ms ease; }
.gallery-card__button:hover img,
.gallery-card__button:focus-visible img { filter: saturate(1.05) contrast(1.02); transform: scale(1.03); }
.gallery-card__label { display: -webkit-box; min-height: 1.35em; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; color: var(--ink); font-family: var(--sans); font-size: 1rem; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.gallery-more { display: flex; justify-content: center; margin-top: 1.75rem; }
.gallery-more .button { border-radius: 4px; font-size: 1rem; letter-spacing: 0; }

.gallery-lightbox {
  width: 100vw;
  max-width: none;
  height: 100svh;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: rgba(4,11,16,.98);
  color: var(--white);
}
.gallery-lightbox::backdrop { background: rgba(4,11,16,.94); }
.gallery-lightbox__shell { display: grid; height: 100%; grid-template-rows: auto minmax(0, 1fr) auto; padding: 1rem clamp(1rem, 3vw, 2.5rem) 1.25rem; }
.gallery-lightbox__top { display: flex; min-height: 58px; align-items: center; justify-content: space-between; gap: 1rem; }
.gallery-lightbox__top p { margin: 0; color: rgba(255,255,255,.66); font-size: .67rem; font-weight: 800; letter-spacing: .08em; }
.gallery-lightbox__close,
.gallery-lightbox__nav {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 50%;
  background: rgba(255,255,255,.03);
  color: var(--white);
  cursor: pointer;
}
.gallery-lightbox__close:hover,
.gallery-lightbox__nav:hover { border-color: var(--gold); background: var(--gold); color: var(--ink-deep); }
.gallery-lightbox__close svg,
.gallery-lightbox__nav svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.gallery-lightbox__nav--previous svg { transform: rotate(180deg); }
.gallery-lightbox__stage { position: relative; display: grid; min-height: 0; place-items: center; padding: .75rem 5rem; touch-action: pan-y pinch-zoom; }
.gallery-lightbox__stage img { width: auto; max-width: 100%; height: auto; max-height: calc(100svh - 190px); object-fit: contain; box-shadow: 0 28px 90px rgba(0,0,0,.45); }
.gallery-lightbox__nav { position: absolute; z-index: 2; top: 50%; transform: translateY(-50%); }
.gallery-lightbox__nav--previous { left: 0; }
.gallery-lightbox__nav--next { right: 0; }
.gallery-lightbox__caption { display: grid; min-height: 64px; grid-template-columns: minmax(0, 1fr) auto; gap: .35rem 1rem; align-items: end; max-width: 980px; width: 100%; margin: 0 auto; padding-top: .8rem; }
.gallery-lightbox__caption small { grid-column: 1 / -1; color: var(--gold); font-size: .57rem; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.gallery-lightbox__caption strong { font-family: var(--display); font-size: clamp(1.35rem, 2.5vw, 2rem); font-weight: 600; line-height: 1.05; }
.gallery-lightbox__hint { color: rgba(255,255,255,.48); font-size: .6rem; white-space: nowrap; }

@media (max-width: 1120px) {
  .photo-rail { grid-auto-columns: minmax(310px, 44%); }
}

@media (max-width: 900px) {
  .gallery-collection { scroll-margin-top: 66px; }
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .life-gallery__aside { justify-items: start; }
  .life-gallery .section-heading--split { gap: 1.25rem; }
  .photo-rail { grid-auto-columns: minmax(270px, 86%); margin-right: -20px; padding-right: 20px; }
  .photo-slide__image { aspect-ratio: 4 / 4.5; }
  .life-gallery__footer { display: grid; }
  .life-gallery__footer .button { width: 100%; justify-content: center; }

  .gallery-hero { min-height: 480px; }
  .gallery-hero h1 { font-size: clamp(3.8rem, 17vw, 5rem); }
  .gallery-hero__shade { background: linear-gradient(0deg, rgba(5,15,22,.9), rgba(5,15,22,.35) 75%, rgba(5,15,22,.5)); }
  .gallery-filters { gap: .45rem; }
  .gallery-filters button { padding-inline: .75rem; }
  .gallery-grid { gap: .85rem; }
  .gallery-lightbox__shell { padding: .65rem .75rem 1rem; }
  .gallery-lightbox__stage { padding: .5rem 0 4rem; }
  .gallery-lightbox__stage img { max-height: calc(100svh - 210px); }
  .gallery-lightbox__nav { top: auto; bottom: .25rem; }
  .gallery-lightbox__nav--previous { left: calc(50% - 62px); }
  .gallery-lightbox__nav--next { right: calc(50% - 62px); }
  .gallery-lightbox__caption { min-height: 82px; grid-template-columns: 1fr; }
  .gallery-lightbox__hint { display: none; }
}

@media (max-width: 340px) {
  .gallery-grid { grid-template-columns: 1fr; }
  .gallery-card__label { height: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .photo-slide__image img,
  .gallery-card__image img,
  .gallery-arrow,
  .gallery-filters button { transition: none; }
}

@media print {
  .life-gallery__controls,
  .gallery-filters,
  .gallery-more,
  .gallery-lightbox { display: none !important; }
  .photo-rail { display: grid; grid-template-columns: repeat(2, 1fr); margin: 0; overflow: visible; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-card { break-inside: avoid; }
}
