/* ============================================================
   Gallery - Tabs (Figma node 550:29). A gold eyebrow, serif heading and
   ornamental divider over a row of circular category tabs, then a justified
   image grid whose photos crop to a uniform height with widths cycling through
   a wide / medium / narrow rhythm (spans applied to the VISIBLE images by
   gallery-tabs.js so the pattern survives filtering). Clicking an image opens a
   Swiper lightbox. Navy-leaf decals frame the sides.
   ============================================================ */
.gallery-tabs {
  --dpx: calc(100vw / 1920);   /* viewport-proportional unit for the edge leaves */
  position: relative;
  overflow: hidden;
  background: #fff;
  padding: calc(80 / var(--root-font-size) * 1rem) calc(24 / var(--root-font-size) * 1rem);
}
@media screen and (max-width: 1024px) {
  .gallery-tabs { padding: calc(48 / var(--root-font-size) * 1rem) calc(24 / var(--root-font-size) * 1rem); }
}

/* ---- navy-leaf decals (same pre-oriented strips + treatment as Testimonials) ---- */
.gallery-tabs__leaf {
  position: absolute;
  z-index: 1;
  background-repeat: no-repeat;
  background-size: contain;
  pointer-events: none;
}
/* pre-oriented strips flanking the header (the full-width grid below would
   cover vertically-centred ones, so they're anchored to the top band where the
   title + tabs leave side whitespace — same decals + treatment as Testimonials) */
.gallery-tabs__leaf--l,
.gallery-tabs__leaf--r {
  top: calc(20 * var(--dpx));
  height: calc(560 * var(--dpx));
}
.gallery-tabs__leaf--l { left: 0; width: calc(285 * var(--dpx)); background-position: left top; }
.gallery-tabs__leaf--r { right: 0; width: calc(273 * var(--dpx)); background-position: right top; }
.gallery-tabs__leaf--top,
.gallery-tabs__leaf--bottom { display: none; }
/* mobile (Figma 902:1404): the edge strips give way to a horizontal navy-leaf
   branch at the top (over the title) and a mirrored one at the bottom (below the
   grid), both behind the content */
@media screen and (max-width: 1024px) {
  .gallery-tabs__leaf--l,
  .gallery-tabs__leaf--r { display: none; }
  /* in-flow bands: the top one sits in its own space above the title, the bottom
     one below the grid — not overlapping the content (Figma mobile 902:1404) */
  .gallery-tabs__leaf--top,
  .gallery-tabs__leaf--bottom {
    display: block;
    position: relative;
    inset: auto;
    width: min(100%, calc(320 / var(--root-font-size) * 1rem));
    height: calc(150 / var(--root-font-size) * 1rem);
    margin-inline: auto;
    background-position: center;
  }
  /* negative margins cancel the section's 48px vertical padding so each band
     sits flush against the very top / very bottom edge of the section */
  .gallery-tabs__leaf--top {
    margin-top: calc(-48 / var(--root-font-size) * 1rem);
    margin-bottom: calc(24 / var(--root-font-size) * 1rem);
    transform: scaleY(-1);   /* swapped: top shows the mirrored branch */
  }
  .gallery-tabs__leaf--bottom {
    margin-top: calc(24 / var(--root-font-size) * 1rem);
    margin-bottom: calc(-53 / var(--root-font-size) * 1rem);
  }
}

.gallery-tabs__inner {
  position: relative;
  z-index: 2; /* content sits above the edge decals (z-index 1) */
  max-width: calc(1616 / var(--root-font-size) * 1rem);
  margin: 0 auto;
}

/* ---- head ---- */
.gallery-tabs__head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(15 / var(--root-font-size) * 1rem);          /* Figma head gap */
  text-align: center;
  margin-bottom: calc(71 / var(--root-font-size) * 1rem); /* head→tabs gap per Figma (355→426) */
}
.gallery-tabs__eyebrow {
  font-family: "Lato", sans-serif;
  font-weight: 400;
  font-size: calc(15 / var(--root-font-size) * 1rem);
  line-height: calc(30 / var(--root-font-size) * 1rem);
  letter-spacing: calc(3.6 / var(--root-font-size) * 1rem);
  text-transform: uppercase;
  color: #3F434B;
  margin: 0;
}
.gallery-tabs__title {
  font-family: "Libre Caslon Text", serif;
  font-weight: 400;
  font-size: calc(60 / var(--root-font-size) * 1rem);    /* Figma H1 desktop */
  line-height: calc(74 / var(--root-font-size) * 1rem);
  color: #3F434B;
  margin: 0;
}
/* mobile head typography + spacing (Figma mobile 902:1404) */
@media screen and (max-width: 1024px) {
  .gallery-tabs__head {
    gap: calc(8 / var(--root-font-size) * 1rem);
    margin-bottom: calc(34 / var(--root-font-size) * 1rem);
  }
  .gallery-tabs__eyebrow { font-size: calc(14 / var(--root-font-size) * 1rem); }
  .gallery-tabs__title {
    font-size: calc(38 / var(--root-font-size) * 1rem);
    line-height: calc(45 / var(--root-font-size) * 1rem);
  }
}
.gallery-tabs__divider {
  display: inline-flex;
  align-items: center;
  gap: calc(12 / var(--root-font-size) * 1rem);
  margin-top: calc(20 / var(--root-font-size) * 1rem);   /* Figma OrnamentalDivider pt-20 */
}
.gallery-tabs__divider .line {
  display: block;
  width: calc(56 / var(--root-font-size) * 1rem);
  height: 1px;
  background: #B58C21;
}
.gallery-tabs__divider .line:first-child { background: rgba(184, 148, 63, 0.45); }
.gallery-tabs__divider .diamond {
  display: block;
  width: calc(10 / var(--root-font-size) * 1rem);
  height: calc(10 / var(--root-font-size) * 1rem);
  background: #B58C21;
  transform: rotate(45deg);
}

/* ---- circular category tabs ---- */
.gallery-tabs__tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: calc(40 / var(--root-font-size) * 1rem);
  margin-bottom: calc(48 / var(--root-font-size) * 1rem);
}
.gallery-tabs__tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(15 / var(--root-font-size) * 1rem);
  width: calc(103 / var(--root-font-size) * 1rem);
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.gallery-tabs__tab-icon {
  box-sizing: border-box; /* keep the outer diameter fixed when the border thickens */
  width: calc(92 / var(--root-font-size) * 1rem);
  height: calc(92 / var(--root-font-size) * 1rem);
  border-radius: 50%;
  border: 1px solid #D3D2CD;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: border-color 200ms ease-out, border-width 200ms ease-out;
}
.gallery-tabs__tab-icon img {
  display: block;
  width: calc(50 / var(--root-font-size) * 1rem);
  height: calc(50 / var(--root-font-size) * 1rem);
  object-fit: contain;
}
.gallery-tabs__tab:hover .gallery-tabs__tab-icon { border-color: #B58C21; }
/* active: a solid 2px gold ring directly on the circle (no gap, no outer ring) */
.gallery-tabs__tab.is-active .gallery-tabs__tab-icon {
  border: 2px solid #B58C21;
}
.gallery-tabs__tab-label {
  font-family: "Lato", sans-serif;
  font-weight: 400;
  font-size: calc(15 / var(--root-font-size) * 1rem);
  line-height: calc(20 / var(--root-font-size) * 1rem);
  letter-spacing: calc(2.25 / var(--root-font-size) * 1rem);
  text-transform: uppercase;
  color: #000;
  text-align: center;
}
/* mobile: 3 tabs per row with smaller 55px circles (Figma mobile 902:1404).
   Tabs are a third of the row each, so full rows fill the width; justify-content
   is flex-start (not center) so a partial last row — e.g. 5 items => 3 + 2 —
   lines its items up under the columns above rather than centring them. */
@media screen and (max-width: 767px) {
  .gallery-tabs__tabs {
    justify-content: flex-start;
    gap: calc(24 / var(--root-font-size) * 1rem) calc(7 / var(--root-font-size) * 1rem);
    margin-bottom: calc(40 / var(--root-font-size) * 1rem);
  }
  .gallery-tabs__tab {
    width: calc((100% - (14 / var(--root-font-size) * 1rem)) / 3);
    gap: calc(8 / var(--root-font-size) * 1rem);   /* Figma circle→label gap */
  }
  .gallery-tabs__tab-icon {
    width: calc(55 / var(--root-font-size) * 1rem);
    height: calc(55 / var(--root-font-size) * 1rem);
  }
  .gallery-tabs__tab-icon img {
    width: calc(30 / var(--root-font-size) * 1rem);
    height: calc(30 / var(--root-font-size) * 1rem);
  }
  .gallery-tabs__tab-label {
    font-size: calc(12 / var(--root-font-size) * 1rem);   /* Figma mobile tab label */
    line-height: calc(20 / var(--root-font-size) * 1rem);
    letter-spacing: calc(1.8 / var(--root-font-size) * 1rem);
  }
}

/* ---- justified image grid ---- */
.gallery-tabs__grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: calc(32 / var(--root-font-size) * 1rem);
  grid-auto-rows: calc(400 / var(--root-font-size) * 1rem);
}
@media screen and (max-width: 1024px) {
  .gallery-tabs__grid { grid-auto-rows: calc(280 / var(--root-font-size) * 1rem); gap: calc(20 / var(--root-font-size) * 1rem); }
}
.gallery-tabs__cell {
  grid-column: span 4;   /* default; gallery-tabs.js sets the wide/medium/narrow rhythm on the visible cells */
  min-width: 0;
  overflow: hidden;
  transition: opacity 300ms ease, transform 300ms ease;
}
.gallery-tabs__cell.is-hidden { display: none; }
/* filter crossfade: gallery-tabs.js adds .is-switching to fade every cell out,
   swaps the filter while hidden, then removes it to fade the new set in */
.gallery-tabs__grid.is-switching .gallery-tabs__cell {
  opacity: 0;
  transform: translateY(10px);
}
@media (prefers-reduced-motion: reduce) {
  .gallery-tabs__cell { transition: none; }
  .gallery-tabs__grid.is-switching .gallery-tabs__cell { opacity: 1; transform: none; }
}
.gallery-tabs__item {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  overflow: hidden;
}
.gallery-tabs__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 500ms ease-out;
}
.gallery-tabs__item:hover .gallery-tabs__img { transform: scale(1.04); }

/* video cells — a subtle play icon centred over the thumbnail: a thin white
   ring on a soft dark disc with a white triangle; it firms up on hover */
.gallery-tabs__cell--video .gallery-tabs__item { position: relative; }
.gallery-tabs__play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: calc(64 / var(--root-font-size) * 1rem);
  height: calc(64 / var(--root-font-size) * 1rem);
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  background: rgba(20, 22, 26, 0.35);
  pointer-events: none;
  transition: background-color 250ms ease-out, transform 250ms ease-out;
}
.gallery-tabs__play::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 54%;                 /* nudge right so the triangle looks optically centred */
  transform: translate(-50%, -50%);
  border-top: calc(9 / var(--root-font-size) * 1rem) solid transparent;
  border-bottom: calc(9 / var(--root-font-size) * 1rem) solid transparent;
  border-left: calc(15 / var(--root-font-size) * 1rem) solid #fff;
}
.gallery-tabs__item:hover .gallery-tabs__play {
  background: rgba(20, 22, 26, 0.55);
  transform: translate(-50%, -50%) scale(1.06);
}
@media screen and (max-width: 767px) {
  .gallery-tabs__play {
    width: calc(44 / var(--root-font-size) * 1rem);
    height: calc(44 / var(--root-font-size) * 1rem);
  }
  .gallery-tabs__play::after {
    border-top-width: calc(7 / var(--root-font-size) * 1rem);
    border-bottom-width: calc(7 / var(--root-font-size) * 1rem);
    border-left-width: calc(11 / var(--root-font-size) * 1rem);
  }
}
@media (prefers-reduced-motion: reduce) {
  .gallery-tabs__play { transition: none; }
}

/* mobile: a simple 2-column grid (the justified rhythm needs the wide desktop row).
   Cells take the Figma image ratio (146.5×130) so their height scales with the
   column width instead of a fixed row height. */
@media screen and (max-width: 767px) {
  .gallery-tabs__grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: auto;
  }
  .gallery-tabs__cell {
    grid-column: auto !important;
    aspect-ratio: 146.5 / 130;
  }
}

/* ---- lightbox (built by gallery-tabs.js, reuses Swiper) ---- */
.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(20, 22, 26, 0.94);
  opacity: 0;
  visibility: hidden;
  transition: opacity 250ms ease-out, visibility 250ms ease-out;
}
.gallery-lightbox.is-open { opacity: 1; visibility: visible; }
/* main image slider — fills the screen but leaves room at the bottom for the
   counter and the thumbnail strip (padding on the slide, so the image never
   sits under them) */
.gallery-lightbox__swiper { width: 100%; height: 100%; }
.gallery-lightbox__swiper .swiper-slide {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(56 / var(--root-font-size) * 1rem) calc(64 / var(--root-font-size) * 1rem) calc(150 / var(--root-font-size) * 1rem);
  box-sizing: border-box;
}
.gallery-lightbox__swiper .swiper-slide img,
.gallery-lightbox__swiper .swiper-slide video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}
.gallery-lightbox__swiper .swiper-slide video { background: #000; }
.gallery-lightbox__close,
.gallery-lightbox__nav {
  position: absolute;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  width: calc(52 / var(--root-font-size) * 1rem);
  height: calc(52 / var(--root-font-size) * 1rem);
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: transparent;
  color: #fff;
  cursor: pointer;
  transition: background 200ms ease-out, border-color 200ms ease-out;
}
.gallery-lightbox__close:hover,
.gallery-lightbox__nav:hover { background: rgba(255, 255, 255, 0.12); border-color: #fff; }
.gallery-lightbox__close {
  top: calc(24 / var(--root-font-size) * 1rem);
  right: calc(24 / var(--root-font-size) * 1rem);
  border-radius: 50%;
  font-size: calc(24 / var(--root-font-size) * 1rem);
  line-height: 1;
}
.gallery-lightbox__nav { top: 50%; transform: translateY(-50%); }
.gallery-lightbox__nav--prev { left: calc(24 / var(--root-font-size) * 1rem); }
.gallery-lightbox__nav--next { right: calc(24 / var(--root-font-size) * 1rem); }
.gallery-lightbox__nav svg { width: calc(22 / var(--root-font-size) * 1rem); height: auto; }
.gallery-lightbox__nav--prev svg { transform: rotate(180deg); }
.gallery-lightbox__nav.swiper-button-disabled { opacity: 0.3; pointer-events: none; }
.gallery-lightbox__count {
  position: absolute;
  z-index: 5;
  bottom: calc(108 / var(--root-font-size) * 1rem); /* sits just above the thumb strip */
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.8);
  font-family: "Lato", sans-serif;
  font-size: calc(15 / var(--root-font-size) * 1rem);
  letter-spacing: calc(1 / var(--root-font-size) * 1rem);
}
/* ---- thumbnail filmstrip (a second, linked Swiper) ----
   The compound selector (.gallery-lightbox .gallery-lightbox__thumbs) is
   deliberate: it must out-specify Swiper's own `.swiper { position: relative }`
   from swiper-bundle.css, which loads after this file. Without it the strip
   falls back to relative positioning and drops below the viewport. */
.gallery-lightbox .gallery-lightbox__thumbs {
  position: absolute;
  z-index: 5;
  left: calc(24 / var(--root-font-size) * 1rem);
  right: calc(24 / var(--root-font-size) * 1rem);
  bottom: calc(24 / var(--root-font-size) * 1rem);
  width: auto;
  height: calc(72 / var(--root-font-size) * 1rem);
}
.gallery-lightbox__thumbs .swiper-slide {
  width: calc(96 / var(--root-font-size) * 1rem);
  height: 100%;
  box-sizing: border-box;
  border: 2px solid transparent;
  opacity: 0.45;
  cursor: pointer;
  transition: opacity 200ms ease-out, border-color 200ms ease-out;
}
.gallery-lightbox__thumbs .swiper-slide img,
.gallery-lightbox__thumbs .swiper-slide video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* small play triangle marking video thumbs in the strip */
.gallery-lightbox__thumb--video { position: relative; }
.gallery-lightbox__thumb-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-40%, -50%);
  border-top: calc(7 / var(--root-font-size) * 1rem) solid transparent;
  border-bottom: calc(7 / var(--root-font-size) * 1rem) solid transparent;
  border-left: calc(12 / var(--root-font-size) * 1rem) solid #fff;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.6));
  pointer-events: none;
}
.gallery-lightbox__thumbs .swiper-slide:hover { opacity: 0.8; }
/* Swiper's Thumbs module marks the active thumb */
.gallery-lightbox__thumbs .swiper-slide-thumb-active {
  opacity: 1;
  border-color: #B58C21;
}

@media screen and (max-width: 767px) {
  .gallery-lightbox__swiper .swiper-slide {
    padding: calc(16 / var(--root-font-size) * 1rem) calc(16 / var(--root-font-size) * 1rem) calc(126 / var(--root-font-size) * 1rem);
  }
  .gallery-lightbox__nav { display: none; } /* the strip is the navigation on phones */
  /* match the compound specificity of the base rule so this height wins */
  .gallery-lightbox .gallery-lightbox__thumbs { height: calc(54 / var(--root-font-size) * 1rem); }
  .gallery-lightbox__thumbs .swiper-slide { width: calc(72 / var(--root-font-size) * 1rem); }
  .gallery-lightbox__count { bottom: calc(88 / var(--root-font-size) * 1rem); }
}
