/* Gallery — Emerald Collection */
.page-gallery {
  background: var(--ivory);
}

.page-gallery .site-main {
  width: 100%;
  max-width: none;
  margin: 0;
}

.gallery-page {
  overflow: hidden;
  color: var(--green);
}

.gallery-page img {
  max-width: 100%;
  display: block;
}

/* —— Hero —— */
.gallery-hero {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  height: 320px;
  max-height: 320px;
  padding: 48px 24px;
  text-align: center;
  color: var(--ivory);
  background:
    radial-gradient(ellipse at 20% 0, #205a4c, transparent 55%),
    linear-gradient(135deg, #103a32, #0b2b25);
  overflow: hidden;
}

.gallery-hero-veil,
.gallery-hero-frame {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.gallery-hero-frame {
  inset: 16px;
  border: 1px solid rgba(197, 164, 107, .35);
}

.gallery-hero-frame::before,
.gallery-hero-frame::after {
  content: "";
  position: absolute;
  width: 56px;
  height: 56px;
  border: 2px solid var(--gold);
}

.gallery-hero-frame::before {
  top: -1px;
  left: -1px;
  border-right: 0;
  border-bottom: 0;
}

.gallery-hero-frame::after {
  right: -1px;
  bottom: -1px;
  border-left: 0;
  border-top: 0;
}

.gallery-hero-copy {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
}

.gallery-kicker {
  margin: 0 0 12px;
  color: #dec494;
  font-size: .68rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  font-weight: 700;
  font-family: Cairo, "Segoe UI", Tahoma, sans-serif;
}

.gallery-hero h1 {
  margin: 0 0 12px;
  color: var(--white);
  font-family: "Cormorant Garamond", Cairo, serif;
  font-size: clamp(1.9rem, 4vw, 3rem);
  font-weight: 600;
  line-height: 1.35;
}

.gallery-lead {
  margin: 0 auto;
  max-width: 34rem;
  line-height: 1.85;
  color: rgba(247, 243, 233, .86);
  font-weight: 600;
  font-size: .95rem;
}

/* —— Stream —— */
.gallery-stream {
  display: flex;
  flex-direction: column;
}

.gallery-section {
  width: min(1040px, calc(100% - 40px));
  margin: auto;
  padding: 56px 0 40px;
}

.gallery-section-head {
  max-width: 640px;
  margin: 0 auto 32px;
  text-align: center;
}

.gallery-eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0 0 10px;
  color: #896a38;
  font-size: .72rem;
  font-weight: 800;
  font-family: Cairo, "Segoe UI", Tahoma, sans-serif;
}

.gallery-eyebrow::before,
.gallery-eyebrow::after {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--gold);
}

.gallery-section h2,
.gallery-cta h2 {
  margin: 0 0 12px;
  color: var(--green);
  font-family: "Cormorant Garamond", Cairo, serif;
  font-size: clamp(1.5rem, 2.8vw, 2.2rem);
  font-weight: 600;
  line-height: 1.5;
}

.gallery-text {
  margin: 0;
  line-height: 1.9;
  color: #4e645b;
  font-weight: 600;
  font-size: .95rem;
}

/* —— Grid (uniform tile size) —— */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.gallery-tile {
  position: relative;
  display: block;
  width: 100%;
  height: 220px;
  min-width: 0;
  padding: 0;
  border: 1px solid rgba(197, 164, 107, .4);
  background: #1a2f2a;
  cursor: zoom-in;
  overflow: hidden;
  font: inherit;
  color: inherit;
  text-align: start;
}

.gallery-tile-media {
  position: absolute !important;
  inset: 0;
  overflow: hidden;
}

.gallery-tile-media img {
  position: absolute !important;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  object-fit: cover !important;
  object-position: center;
  transition: transform .55s ease, filter .35s ease;
}

.gallery-tile:hover .gallery-tile-media img,
.gallery-tile:focus-visible .gallery-tile-media img {
  transform: scale(1.05);
  filter: brightness(1.04);
}

.gallery-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(8, 31, 27, .72));
  opacity: .55;
  transition: opacity .3s ease;
  pointer-events: none;
}

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

.gallery-tile-cap {
  position: absolute;
  inset-inline: 14px;
  inset-block-end: 14px;
  z-index: 2;
  color: var(--ivory);
  font-weight: 800;
  font-size: .86rem;
  font-family: Cairo, "Segoe UI", Tahoma, sans-serif;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .4);
  opacity: 0;
  transform: translateY(8px);
  transition: .28s ease;
  pointer-events: none;
}

.gallery-tile:hover .gallery-tile-cap,
.gallery-tile:focus-visible .gallery-tile-cap {
  opacity: 1;
  transform: translateY(0);
}

.gallery-tile-zoom {
  position: absolute;
  top: 12px;
  inset-inline-end: 12px;
  z-index: 2;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(197, 164, 107, .55);
  background: rgba(16, 58, 50, .55);
  color: var(--gold);
  font-size: 1.15rem;
  font-weight: 700;
  opacity: 0;
  transition: opacity .25s ease;
  pointer-events: none;
}

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

/* —— CTA —— */
.gallery-cta {
  width: min(760px, calc(100% - 40px));
  margin: 12px auto 64px;
  padding: 40px 28px;
  text-align: center;
  border: 1px solid rgba(197, 164, 107, .4);
  background: linear-gradient(180deg, #fffdf8, #f3ebe0);
}

.gallery-cta .gallery-eyebrow {
  justify-content: center;
}

.gallery-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 22px;
}

.gallery-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 22px;
  text-decoration: none;
  font-weight: 800;
  font-size: .86rem;
  border: 1px solid var(--gold);
  font-family: Cairo, "Segoe UI", Tahoma, sans-serif;
}

.gallery-btn-gold {
  background: linear-gradient(110deg, #b8924a, #ddc28f 48%, #c5a46b);
  color: #103a32;
}

.gallery-btn-line {
  background: transparent;
  color: var(--green);
}

.gallery-empty {
  width: min(820px, calc(100% - 40px));
  margin: 48px auto;
  padding: 40px 24px;
  border: 1px dashed rgba(197, 164, 107, .5);
  background: rgba(255, 255, 254, .9);
  text-align: center;
  color: rgba(16, 58, 50, .7);
  font-weight: 700;
}

/* —— Lightbox —— */
body.gallery-lightbox-open {
  overflow: hidden;
}

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

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: grid;
  place-items: center;
  padding: 18px;
}

.gallery-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 24, 20, .88);
  backdrop-filter: blur(6px);
}

.gallery-lightbox-dialog {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  max-height: min(90vh, 880px);
  display: grid;
  place-items: center;
}

.gallery-lightbox-dialog figure {
  margin: 0;
  width: 100%;
  text-align: center;
}

.gallery-lightbox-dialog img {
  width: auto;
  max-width: 100%;
  max-height: 70vh;
  height: auto;
  object-fit: contain;
  background: #0b2b25;
  border: 1px solid rgba(197, 164, 107, .4);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
}

.gallery-lightbox-dialog figcaption {
  margin-top: 12px;
  color: var(--ivory);
  font-weight: 700;
  font-family: Cairo, "Segoe UI", Tahoma, sans-serif;
}

.gallery-lightbox-close,
.gallery-lightbox-nav {
  border: 1px solid rgba(197, 164, 107, .45);
  background: rgba(16, 58, 50, .92);
  color: var(--ivory);
  cursor: pointer;
}

.gallery-lightbox-close {
  position: absolute;
  top: -4px;
  inset-inline-end: 0;
  z-index: 3;
  width: 40px;
  height: 40px;
  font-size: 1.45rem;
}

.gallery-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  font-size: 1.55rem;
}

.gallery-lightbox-nav.prev { inset-inline-start: 0; }
.gallery-lightbox-nav.next { inset-inline-end: 0; }

.gallery-lightbox-count {
  margin-top: 10px;
  color: rgba(247, 243, 233, .72);
  font-weight: 800;
  font-size: .86rem;
  font-family: Cairo, "Segoe UI", Tahoma, sans-serif;
}

.gallery-page .reveal-ready {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .65s ease, transform .65s ease;
}

.gallery-page .reveal-ready.is-in {
  opacity: 1;
  transform: none;
}

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

  .gallery-tile {
    height: 190px;
  }
}

@media (max-width: 560px) {
  .gallery-hero {
    height: 280px;
    max-height: 280px;
  }

  .gallery-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .gallery-tile {
    height: 140px;
  }

  .gallery-section {
    padding: 40px 0 28px;
  }

  .gallery-lightbox-nav {
    width: 38px;
    height: 38px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-page .reveal-ready {
    opacity: 1;
    transform: none;
  }

  .gallery-tile-media img {
    transition: none;
  }
}
