/* Ember & Oak — Gallery Page */

/* ── Suppress ember glow on all gallery sections ── */

.page-hero--gallery.section--dark::after,
.gallery-chapter.section--dark::after,
.gallery-interlude.section--dark::after,
.gallery-private.section--dark::after,
.gallery-cta.section--dark::after {
  display: none;
}

/* ── Hero ── */

.page-hero--gallery {
  min-height: 40vh;
}

/* ── Gallery Grid ── */

.gallery-grid {
  columns: 1;
  column-gap: var(--sp-3);
}

@media (min-width: 600px)  { .gallery-grid { columns: 2; } }
@media (min-width: 1024px) { .gallery-grid { columns: 3; } }

.gallery-item {
  break-inside: avoid;
  margin-bottom: var(--sp-3);
  overflow: hidden;
}

.gallery-item img {
  width: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--dur-base) var(--ease-out);
}

.gallery-item:hover img {
  transform: scale(1.02);
}

/* ── CTA ── */

.gallery-cta__title {
  font-size: var(--t-h1);
  line-height: 0.95;
  letter-spacing: -0.02em;
  margin-top: var(--sp-3);
  margin-bottom: var(--sp-8);
}

.gallery-cta__title em {
  font-style: italic;
  color: var(--c-ember);
}

/* ── Hero: background image ── */

.page-hero--gallery {
  min-height: 55vh;
  background-image: url('../img/interior-evening-service.webp');
  background-size: cover;
  background-position: center;
  position: relative;
}

.page-hero--gallery::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(14,11,8,0.6) 0%, rgba(14,11,8,0.88) 100%);
}

.page-hero--gallery .container { position: relative; }

/* ── Gallery Chapters ── */

.gallery-chapter__header {
  margin-bottom: var(--sp-12);
}

.gallery-chapter__title {
  font-size: var(--t-h1);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-top: var(--sp-3);
  margin-bottom: var(--sp-6);
}

.gallery-chapter__title em {
  font-style: italic;
  color: var(--c-ember);
}

/* ── Gallery items: figure + caption ── */

.gallery-item {
  position: relative;
  cursor: zoom-in;
}

.gallery-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--sp-8) var(--sp-4) var(--sp-3);
  background: linear-gradient(transparent, rgba(14,11,8,0.88));
  font-family: var(--f-body);
  font-size: var(--t-label);
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--c-ash);
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease-out);
  pointer-events: none;
}

.gallery-item:hover .gallery-caption,
.gallery-item:focus-within .gallery-caption {
  opacity: 1;
}

/* ── Stagger: nth-child delays on individual items ── */

.gallery-grid .gallery-item:nth-child(2).reveal { transition-delay: 80ms; }
.gallery-grid .gallery-item:nth-child(3).reveal { transition-delay: 160ms; }
.gallery-grid .gallery-item:nth-child(4).reveal { transition-delay: 240ms; }

@media (prefers-reduced-motion: reduce) {
  .gallery-grid .gallery-item.reveal {
    transition-delay: 0ms !important;
  }
}

/* ── Interlude (pullquote break) ── */

.gallery-interlude {
  padding-block: var(--sp-24);
}

.gallery-interlude__inner {
  max-width: 680px;
}

.gallery-interlude__attr {
  margin-top: var(--sp-6);
  padding-left: var(--sp-8);
  font-size: var(--t-label);
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--c-ash);
}

/* ── Private Dining split ── */

.gallery-private {
  padding-block: var(--sp-20);
}

.gallery-private__image {
  overflow: hidden;
}

.gallery-private__image img {
  width: 100%;
  object-fit: cover;
  display: block;
  aspect-ratio: 4 / 5;
  -webkit-mask-image:
    linear-gradient(to right,  transparent 0%, black 12%, black 88%, transparent 100%),
    linear-gradient(to bottom, transparent 0%, black 10%, black 90%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to right,  transparent 0%, black 12%, black 88%, transparent 100%),
    linear-gradient(to bottom, transparent 0%, black 10%, black 90%, transparent 100%);
  mask-composite: intersect;
}

.gallery-private__copy h2 {
  margin-top: var(--sp-3);
  margin-bottom: var(--sp-6);
  font-size: var(--t-h2);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.gallery-private__copy h2 em {
  font-style: italic;
  color: var(--c-ember);
}

.gallery-private__copy p {
  color: var(--c-ash);
  font-size: clamp(1rem, 1.5vw, 1.0625rem);
  line-height: 1.85;
  max-width: 55ch;
}

/* ── Lightbox ── */

.gallery-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(14, 11, 8, 0.97);
  z-index: var(--z-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.gallery-lightbox__stage {
  position: relative;
  max-width: min(90vw, 1100px);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-4);
  transform: scale(0.92);
  opacity: 0;
  transition:
    transform var(--dur-slow) var(--ease-out),
    opacity   var(--dur-slow) var(--ease-out);
}

.gallery-lightbox.is-open .gallery-lightbox__stage {
  transform: scale(1);
  opacity: 1;
}

.gallery-lightbox__img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  display: block;
}

.gallery-lightbox__caption {
  font-family: var(--f-body);
  font-size: var(--t-label);
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--c-ash);
  text-align: center;
}

.gallery-lightbox__close {
  position: absolute;
  top: calc(-1 * var(--sp-12));
  right: 0;
  background: none;
  border: none;
  color: var(--c-ash);
  font-size: 1.75rem;
  cursor: pointer;
  line-height: 1;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  transition: color var(--dur-fast) var(--ease-out);
}

.gallery-lightbox__close:hover { color: var(--c-parchment); }

.gallery-lightbox__prev,
.gallery-lightbox__next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: 1px solid rgba(122, 106, 88, 0.3);
  color: var(--c-ash);
  font-size: 1.25rem;
  padding: var(--sp-4) var(--sp-6);
  min-width: 44px;
  min-height: 44px;
  cursor: pointer;
  transition:
    color        var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out);
}

.gallery-lightbox__prev { left: calc(-1 * var(--sp-20)); }
.gallery-lightbox__next { right: calc(-1 * var(--sp-20)); }

.gallery-lightbox__prev:hover,
.gallery-lightbox__next:hover {
  color: var(--c-parchment);
  border-color: var(--c-ember);
}

@media (max-width: 768px) {
  .gallery-lightbox__prev { left: var(--sp-2); }
  .gallery-lightbox__next { right: var(--sp-2); }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-lightbox__stage {
    transform: scale(1);
    opacity: 1;
    transition: none;
  }
}
