/*! BFM v2 — Gallery (page-gallery.php). Full-v2 "gallery" route re-skinned to navy/amber.
   The <main> carries .ba-apply (ba-apply.css): the 1180px full-bleed section padding, the eyebrow and the
   title/lead type. This file is ONLY the delta: the 12-column mosaic (the mock's .ggrid / .gcell with
   big / tall / wide sizing), the hover caption + zoom badge, and the lightbox (.lb).
   Loaded after ba-apply. Tokens only; type in rem (html is 62.5% => 1rem = 10px). */

/* ============================================================ 1. HEAD */
.ba-gallery__head{padding-top:5.6rem; padding-bottom:1rem}
.ba-gallery .ba-apply__lead{max-width:60ch}
.ba-gallery__mosaic{padding-top:.8rem; padding-bottom:6.4rem}
.ba-gallery__empty{margin:2.4rem 0 0; font-size:1.7rem; color:var(--ink)}
.ba-gallery__empty a{color:var(--sky); text-decoration:underline; text-underline-offset:.2rem}

/* ============================================================ 2. MOSAIC — 12 cols; big 6x2, tall 3x2, wide 6x1, std 3x1 */
.ba-ggrid{display:grid; grid-template-columns:repeat(12,1fr); grid-auto-rows:15rem; gap:1.4rem; margin-top:2.4rem}
.ba-gcell{
  position:relative; display:block; grid-column:span 3; grid-row:span 1; overflow:hidden;
  border:1.5px solid var(--line); border-radius:var(--r-md); background:var(--navy-050); box-shadow:var(--shadow-sm);
  cursor:zoom-in; transition:transform .16s, box-shadow .16s, border-color .16s;
}
.ba-gcell:hover,.ba-gcell:focus-visible{transform:translate(-2px,-2px); box-shadow:var(--shadow-md); border-color:var(--navy)}
.ba-gcell img{display:block; width:100%; height:100%; object-fit:cover}
.ba-gcell--tall{grid-row:span 2}
.ba-gcell--wide{grid-column:span 6}
.ba-gcell--big{grid-column:span 6; grid-row:span 2}

/* hover/focus caption (only photos that have a real caption carry one) */
.ba-gcell__cap{
  position:absolute; left:0; right:0; bottom:0; display:flex; align-items:center; gap:.7rem; padding:2.6rem 1.4rem 1.1rem;
  font-family:var(--disp); font-weight:700; font-size:1.35rem; line-height:1.3; color:#fff;
  background:linear-gradient(0deg, rgba(13,47,77,.86), transparent); opacity:0; transition:opacity .16s; pointer-events:none;
}
.ba-gcell:hover .ba-gcell__cap,.ba-gcell:focus-visible .ba-gcell__cap{opacity:1}
.ba-gcell__pin,.ba-lb__cap svg{flex:none; width:1.5rem; height:1.5rem; fill:none; stroke:var(--amber); stroke-width:2; stroke-linecap:round; stroke-linejoin:round}

/* zoom badge */
.ba-gcell__zoom{
  position:absolute; top:1rem; right:1rem; display:grid; place-items:center; width:3.2rem; height:3.2rem; border-radius:50%;
  background:var(--card); border:1.5px solid var(--navy); color:var(--navy); box-shadow:var(--shadow-sm);
  opacity:0; transition:opacity .16s; pointer-events:none;
}
.ba-gcell:hover .ba-gcell__zoom,.ba-gcell:focus-visible .ba-gcell__zoom{opacity:1}
.ba-gcell__zoom svg{width:1.6rem; height:1.6rem; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round}
@media (hover:none){.ba-gcell__zoom{opacity:1}}   /* no hover on touch: keep the "tap to enlarge" cue visible */

/* ============================================================ 3. LIGHTBOX (.lb) */
.ba-lb{position:fixed; inset:0; z-index:1000; display:grid; place-items:center}
.ba-lb[hidden]{display:none}
.ba-lb__scrim{position:absolute; inset:0; background:rgba(8,28,47,.9)}
.ba-lb__fig{position:relative; z-index:2; display:flex; flex-direction:column; align-items:center; margin:0; max-width:min(92vw,100rem); max-height:90vh}
.ba-lb__img{max-width:100%; max-height:78vh; width:auto; height:auto; object-fit:contain; border:2px solid var(--paper); border-radius:var(--r-md); background:var(--navy-900); box-shadow:0 3rem 8rem rgba(0,0,0,.5)}
.ba-lb__cap{display:flex; align-items:center; justify-content:center; gap:.9rem; margin-top:1.4rem; font-family:var(--disp); font-weight:700; font-size:1.5rem; color:var(--paper); text-align:center}
.ba-lb__cap[hidden]{display:none}
.ba-lb__close{
  position:absolute; top:-1.4rem; right:-1.4rem; z-index:3; display:grid; place-items:center; width:4.4rem; height:4.4rem; padding:0;
  border-radius:50%; border:2px solid var(--navy-900); background:var(--amber); color:var(--navy-900); box-shadow:var(--shadow-pop); cursor:pointer;
}
.ba-lb__close:hover{background:#ffb23e}
.ba-lb__close:focus-visible{outline:.3rem solid #fff; outline-offset:.3rem}
.ba-lb__close svg{width:2rem; height:2rem; fill:none; stroke:currentColor; stroke-width:2.4; stroke-linecap:round}
body.ba-lb-open{overflow:hidden}

/* ============================================================ 4. RESPONSIVE */
@media (max-width:991.98px){        /* tablet: 6-up half cells, big full width */
  .ba-gallery__head{padding-top:4rem}
  .ba-ggrid{grid-auto-rows:12rem}
  .ba-gcell,.ba-gcell--wide{grid-column:span 6}
  .ba-gcell--big{grid-column:span 12}
}
@media (max-width:559.98px){        /* phone: two columns; wide + big span both */
  .ba-ggrid{grid-template-columns:repeat(2,1fr); grid-auto-rows:11rem; gap:1rem}
  .ba-gcell{grid-column:span 1}
  .ba-gcell--wide,.ba-gcell--big{grid-column:span 2}
  .ba-gallery__mosaic{padding-bottom:4.8rem}
  .ba-lb__close{top:-1.2rem; right:-.6rem}
}
@media (prefers-reduced-motion:reduce){
  .ba-gcell,.ba-gcell__cap,.ba-gcell__zoom{transition:none}
  .ba-gcell:hover,.ba-gcell:focus-visible{transform:none}
}
@media (forced-colors:active){
  .ba-gcell,.ba-gcell__zoom,.ba-lb__close{border:.2rem solid CanvasText}
}
