/* ============================================================
   BRIAR GALLERY — Airbnb-style property presentation
   in the Beacon black-and-gold theme.
   Scoped bgal-* / bsleep-* / bamen-* / bfacts-*.
   ============================================================ */

/* .btn sets display:flex, which beats the hidden attribute on its own. */
[hidden] { display: none !important; }

/* ---------- Hero grid: 1 large + 2x2, Airbnb layout ---------- */
.bgal-hero {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 8px;
  border-radius: 18px;
  overflow: hidden;
  position: relative;
  aspect-ratio: 2/1;
}
/* :not(.bgal-showall) matters. Without it this rule outranks .bgal-showall on
   specificity and forces the overlay button back to position:relative with no
   padding, so it lays out as a grid cell instead of floating on the image. */
.bgal-hero button:not(.bgal-showall) {
  padding: 0; border: 0; background: none; cursor: pointer; overflow: hidden; position: relative;
}
.bgal-hero button:first-child { grid-row: 1 / span 2; }
.bgal-hero img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s var(--ease); }
.bgal-hero button:not(.bgal-showall):hover img { transform: scale(1.04); }
.bgal-hero button:not(.bgal-showall)::after {
  content: ""; position: absolute; inset: 0; background: rgba(10,13,18,0); transition: background .3s;
}
.bgal-hero button:not(.bgal-showall):hover::after { background: rgba(10,13,18,.18); }
.bgal-showall {
  position: absolute; right: 16px; bottom: 16px; z-index: 2;
  display: inline-flex; align-items: center; gap: 9px;
  background: rgba(10,13,18,.92); border: 1px solid var(--gold-2); color: var(--c-ink);
  border-radius: 10px; padding: 11px 16px; font-size: .86rem; font-weight: 600;
  cursor: pointer; font-family: var(--font-sans); backdrop-filter: blur(6px);
}
.bgal-showall:hover { background: var(--c-bg-elev); border-color: var(--gold-3); }
@media (max-width: 760px) {
  .bgal-hero { grid-template-columns: 1fr; grid-template-rows: none; aspect-ratio: 4/3; }
  /* Collapse to a single tile, but never hide the Show all button: on a phone
     it is the main way into the photo tour. */
  .bgal-hero button:not(:first-child):not(.bgal-showall) { display: none; }
  .bgal-hero button:first-child { grid-row: auto; }
  /* min-height keeps it on the 44px tap-target floor. */
  .bgal-showall { right: 12px; bottom: 12px; padding: 12px 16px; font-size: .82rem; min-height: 44px; }
}

/* ---------- Facts strip: entire home / guests / bedrooms / beds / baths ---------- */
.bfacts { display: flex; flex-wrap: wrap; gap: 10px 26px; align-items: center; margin: 22px 0 0;
          color: var(--c-ink-mute); font-size: .95rem; }
.bfacts b { color: var(--c-ink); font-weight: 600; }
.bfacts span { display: inline-flex; align-items: center; gap: 8px; }
.bfacts svg { color: var(--gold-3); flex: 0 0 auto; }

/* ---------- Horizontal photo rail ---------- */
.bgal-railwrap { position: relative; margin-top: 22px; }
/* Snap is "proximity", not "mandatory", and there is no scroll-behavior:smooth
   here. With mandatory snap Chrome cancels programmatic smooth scrolls and
   springs back to the current snap point, which silently broke the arrow
   buttons. Proximity still snaps a finger swipe tidily but lets scrollBy()
   through. The arrows pass behavior:"smooth" themselves. */
.bgal-rail {
  display: flex; gap: 14px; overflow-x: auto;
  scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch;
  padding-bottom: 6px; scrollbar-width: thin;
  scrollbar-color: var(--gold-1) transparent;
}
.bgal-rail::-webkit-scrollbar { height: 8px; }
.bgal-rail::-webkit-scrollbar-track { background: var(--c-bg-inset); border-radius: 4px; }
.bgal-rail::-webkit-scrollbar-thumb { background: var(--gold-1); border-radius: 4px; }
.bgal-rail::-webkit-scrollbar-thumb:hover { background: var(--gold-2); }
.bgal-item {
  flex: 0 0 340px; margin: 0; scroll-snap-align: start;
  border: 1px solid var(--c-line-soft); border-radius: 14px; overflow: hidden;
  background: var(--c-bg-inset); cursor: pointer;
}
.bgal-item img { width: 100%; aspect-ratio: 3/2; object-fit: cover; display: block; transition: transform .6s var(--ease); }
.bgal-item:hover img { transform: scale(1.05); }
.bgal-item figcaption { padding: 11px 14px; font-size: .82rem; color: var(--c-ink-mute); }
.bgal-item figcaption b { display: block; color: var(--gold-3); font-size: .68rem;
  letter-spacing: .14em; text-transform: uppercase; margin-bottom: 4px; font-weight: 600; }
@media (max-width: 620px) { .bgal-item { flex-basis: 78vw; } }

.bgal-arrow {
  position: absolute; top: calc(50% - 34px); transform: translateY(-50%); z-index: 3;
  width: 44px; height: 44px; border-radius: 50%; cursor: pointer;
  background: rgba(10,13,18,.92); border: 1px solid var(--gold-2); color: var(--gold-3);
  display: grid; place-items: center; backdrop-filter: blur(6px); transition: background .2s, opacity .2s;
}
.bgal-arrow:hover { background: var(--c-bg-elev); color: var(--gold-4); }
.bgal-arrow[disabled] { opacity: .3; cursor: default; }
.bgal-arrow.prev { left: -14px; }
.bgal-arrow.next { right: -14px; }
@media (max-width: 900px) { .bgal-arrow { display: none; } }

/* ---------- Room filter chips ---------- */
.bgal-rooms { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 20px; }
.bgal-room {
  background: none; border: 1px solid var(--c-line); color: var(--c-ink-mute);
  border-radius: 999px; padding: 8px 15px; font-size: .82rem; cursor: pointer;
  font-family: var(--font-sans); transition: all .2s;
}
.bgal-room:hover { border-color: var(--gold-2); color: var(--c-ink); }
.bgal-room[aria-pressed="true"] { background: var(--grad-gold); border-color: transparent; color: #0A0D12; font-weight: 600; }

/* ---------- Lightbox ---------- */
.bgal-lb {
  position: fixed; inset: 0; z-index: 10000; background: rgba(6,8,11,.97);
  display: grid; grid-template-rows: auto 1fr auto; backdrop-filter: blur(4px);
}
.bgal-lb[hidden] { display: none !important; }
.bgal-lb-top { display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; color: var(--c-ink-mute); font-size: .88rem; }
.bgal-lb-close, .bgal-lb-nav {
  background: none; border: 1px solid var(--c-line); color: var(--c-ink);
  border-radius: 50%; width: 42px; height: 42px; cursor: pointer; display: grid; place-items: center;
  transition: background .2s, border-color .2s;
}
.bgal-lb-close:hover, .bgal-lb-nav:hover { background: var(--c-bg-elev); border-color: var(--gold-2); }
.bgal-lb-stage { position: relative; padding: 0 16px; min-height: 0; overflow: hidden; }
/* The image is absolutely positioned, not a centred grid item. Percentage
   heights (max-height:100% or height:100%) do not resolve against a 1fr grid
   row whose items are centre-aligned, so the photo kept rendering at its
   natural size (832px tall inside a 265px stage) and was clipped top and
   bottom. Anchoring to the padding box gives a definite box, and object-fit
   contain then letterboxes the whole photo, always centred, never cropped. */
.bgal-lb-stage img {
  position: absolute; top: 0; left: 16px; right: 16px; bottom: 0;
  width: calc(100% - 32px); height: 100%;
  object-fit: contain; object-position: center; border-radius: 10px;
}
.bgal-lb-nav { position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(10,13,18,.85); backdrop-filter: blur(6px); }
.bgal-lb-nav.prev { left: 18px; }
.bgal-lb-nav.next { right: 18px; }
/* Filmstrip: makes it obvious you can move left and right, and lets you jump
   straight to a room instead of arrowing through 41 photos. */
.bgal-strip { display: flex; gap: 8px; overflow-x: auto; padding: 4px 22px 14px;
  scrollbar-width: thin; scrollbar-color: var(--gold-1) transparent; }
.bgal-strip::-webkit-scrollbar { height: 6px; }
.bgal-strip::-webkit-scrollbar-track { background: rgba(255,255,255,.05); border-radius: 3px; }
.bgal-strip::-webkit-scrollbar-thumb { background: var(--gold-1); border-radius: 3px; }
.bgal-strip button { flex: 0 0 auto; width: 88px; height: 60px; padding: 0; border-radius: 7px;
  overflow: hidden; border: 2px solid transparent; background: none; cursor: pointer; opacity: .5;
  transition: opacity .2s, border-color .2s; }
.bgal-strip button img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bgal-strip button:hover { opacity: .85; }
.bgal-strip button[aria-current="true"] { opacity: 1; border-color: var(--gold-2); }
@media (max-width: 620px) { .bgal-strip button { width: 66px; height: 46px; } .bgal-strip { padding: 4px 12px 12px; } }

.bgal-lb-cap { padding: 14px 22px 6px; text-align: center; color: var(--c-ink-mute); font-size: .9rem; }
.bgal-lb-cap b { display: block; color: var(--gold-3); font-size: .7rem;
  letter-spacing: .16em; text-transform: uppercase; margin-bottom: 6px; }
@media (max-width: 620px) {
  .bgal-lb-nav { width: 38px; height: 38px; }
  .bgal-lb-nav.prev { left: 6px; } .bgal-lb-nav.next { right: 6px; }
}

/* ---------- Where you will sleep ---------- */
.bsleep { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-top: 22px; }
.bsleep article { border: 1px solid var(--c-line-soft); border-radius: 14px; overflow: hidden; background: var(--c-bg-inset); }
.bsleep img { width: 100%; aspect-ratio: 3/2; object-fit: cover; display: block; }
.bsleep .bs-body { padding: 15px 16px; }
.bsleep h3 { font-family: var(--font-display); font-size: 1.15rem; color: var(--c-ink); font-weight: 500; margin-bottom: 4px; }
.bsleep p { font-size: .86rem; color: var(--c-ink-mute); margin: 0; }

/* ---------- What this place offers ---------- */
.bamen { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px 32px; margin-top: 22px; }
.bamen section { margin: 0; }
.bamen h3 { font-size: .72rem; letter-spacing: .15em; text-transform: uppercase;
  color: var(--gold-3); font-weight: 600; margin-bottom: 12px; font-family: var(--font-sans); }
.bamen ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.bamen li { font-size: .9rem; color: var(--c-ink-mute); display: flex; gap: 10px; align-items: flex-start; }
.bamen li svg { color: var(--gold-3); flex: 0 0 auto; margin-top: 3px; }
.bamen li.is-off { color: var(--c-ink-dim); text-decoration: line-through; text-decoration-thickness: 1px; }
.bamen li.is-off svg { color: var(--c-ink-dim); }

/* Walkthrough video at the head of the photo tour, so it is the first thing
   after "Show all photos". Vertical 9:16 source, capped so it never dominates. */
.tour-video { position: relative; max-width: 300px; margin: 0 0 12px; border-radius: 14px;
  overflow: hidden; border: 1px solid var(--c-line); background: #000; aspect-ratio: 9/16; }
.tour-video video { width: 100%; height: 100%; object-fit: cover; display: block; }
.tour-video-note { font-size: .84rem; color: var(--c-ink-dim); margin: 0 0 6px; max-width: 520px; }
@media (max-width: 620px) { .tour-video { max-width: 100%; } }
