/* Gallery — "Our rooms" collapse/expand viewer (Figma 843:528, reworked).
   Brown band, shown on desktop AND mobile. Collapsed = scrolling thumbnail
   strip + arrows + "Expand". Expanded (.gallery.is-expanded) = big image with
   caption above the strip + "Hide". Background lives in one var for easy
   tweaking. */
.gallery {
  --gal-bg: #8a6d16;
  background: var(--gal-bg);
  color: #fff;
  position: relative;
  z-index: 2;                 /* cleanly clips the rooms mic overflowing from above */
  padding-block: calc(78.6 * var(--px)) calc(48 * var(--px));   /* top 40 -> 78.6 (first text 65px) */
  text-align: center;
}
.gallery__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: calc(48 * var(--px));
  margin-bottom: calc(24 * var(--px));
}

/* Break out wider than the 1140 content cap so the strip fills the band. */
@media (min-width: 601px) {
  .gallery .container { width: min(100%, calc(896 * var(--fpx))); max-width: 100%; }
}

/* ---- Big viewer (expanded only) ---- */
.gallery__viewer { display: none; margin: 0 0 calc(20 * var(--px)); }
.gallery.is-expanded .gallery__viewer { display: block; }
/* Fixed 3:2 frame so EVERY photo displays at the same size — the image covers
   the frame (crops to fill) instead of each aspect ratio sizing its own box. */
.gallery__big {
  width: min(100%, calc(680 * var(--fpx)));
  aspect-ratio: 3 / 2;
  margin: 0 auto;
  overflow: hidden;
  border: calc(2.848 * var(--fpx)) solid #fff;
  border-radius: calc(12 * var(--fpx));
  background: #1a2740;
}
.gallery__big-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery__caption {
  margin-top: calc(10 * var(--px));
  font-family: var(--font-sans);
  font-size: calc(16 * var(--px));
  min-height: 1.1em;          /* reserve the line even when a photo has no venue caption */
}

/* ---- Row: arrows + scrolling thumbnail track ---- */
.gallery__row { display: flex; align-items: center; justify-content: center; gap: calc(24 * var(--fpx)); }
/* Track is the clipping viewport (exactly 4 tiles wide); the belt is the row of
   tiles that the conveyor translates and recycles. */
.gallery__track {
  overflow: hidden;
  width: calc(748 * var(--fpx));   /* 4 × 172 + 3 × 20 gaps = exactly 4 tiles */
  max-width: 100%;
  padding-block: calc(6 * var(--fpx));
  box-sizing: content-box;
}
.gallery__belt {
  display: flex;
  gap: calc(20 * var(--fpx));
  will-change: transform;
}
.gallery__item {
  flex: 0 0 auto;
  width: calc(172 * var(--fpx));   /* smaller again; strip container narrowed to match so 4 still fill it */
  height: calc(130 * var(--fpx));
  border: calc(2.848 * var(--fpx)) solid #fff;
  border-radius: calc(12 * var(--fpx));
  overflow: hidden;
  background: #d9d9d9;
  padding: 0;
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.18s ease;
}
.gallery__item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery__item:hover { transform: scale(1.03); }

/* Keep the 4-across strip when expanded; just dim non-active thumbs. */
.gallery.is-expanded .gallery__item { opacity: 0.55; }
.gallery.is-expanded .gallery__item.is-active { opacity: 1; outline: calc(3 * var(--fpx)) solid #fff; outline-offset: calc(2 * var(--fpx)); }

/* ---- Arrows ---- */
.gallery__arrow {
  width: calc(44 * var(--fpx)); height: calc(44 * var(--fpx));
  display: grid; place-items: center; flex: 0 0 auto;
  border: 0; background: none; cursor: pointer;
}
.gallery__arrow img { width: 100%; height: 100%; }
.gallery__arrow--prev img { transform: rotate(-90deg); }
.gallery__arrow--next img { transform: rotate(90deg); }

/* ---- Expand / Retract toggle ---- */
.gallery__toggle {
  margin: calc(18 * var(--px)) auto 0;
  display: inline-flex; align-items: center; gap: calc(10 * var(--px));
  border: 0; background: none; color: #fff; cursor: pointer;
  font-family: var(--font-display); font-weight: 700; font-size: calc(26 * var(--px)); letter-spacing: 0.01em;
}
.gallery__caret {
  width: 0; height: 0;
  border-left: calc(7 * var(--px)) solid transparent; border-right: calc(7 * var(--px)) solid transparent;
  border-top: calc(9 * var(--px)) solid #fff;        /* down caret = Expand */
  transition: transform 0.2s ease;
}
.gallery.is-expanded .gallery__caret { transform: rotate(180deg); }  /* up caret = Retract */

/* ---- Mobile (shown here now; was hidden before) ---- */
@media (max-width: 600px) {
  .gallery { padding-block: 28px 32px; }
  .gallery__title { font-size: 32px; margin-bottom: 16px; }
  .gallery__row { gap: 6px; }
  /* Exactly TWO thumbnails visible on any phone: the track is a query container
     and each tile is half its inline size (minus one belt gap), so 2 tiles +
     1 gap == the track width regardless of screen. The conveyor JS reads the
     rendered tile width, so responsive tiles are fine. */
  .gallery__track { width: 100%; container-type: inline-size; }
  .gallery__belt { gap: 10px; }
  .gallery__item {
    box-sizing: border-box;               /* borders count INSIDE the width, so 2 fit exactly */
    width: calc(50vw - 52px);             /* fallback if container queries unsupported */
    width: calc((100cqi - 10px) / 2 - 1px);   /* -1px safety against sub-pixel clip */
    height: auto; aspect-ratio: 150 / 112;
    border-width: 2px; border-radius: 10px;
  }
  .gallery.is-expanded .gallery__item { width: 92px; height: 68px; aspect-ratio: auto; }
  .gallery__big { width: 92%; border-width: 2px; }   /* 3:2 frame inherited from base */
  .gallery__caption { font-size: 14px; }
  .gallery__arrow { width: 30px; height: 30px; }
  .gallery__toggle { font-size: 15px; }
}
