/* Gallery page (user, 2026-10-13; V3 change 2026-10-23). No page reference image. Loaded AFTER home-3.css; body classes
   "home-3 page-gallery". Locked rules kept: one content width, type scale, no eyebrows (lead line under the H2),
   photo border rule (photo on white = #E9F6FC frame). COLOURS = existing tokens only; every role LOCKED in
   project-notes/gallery-page-2026-10-13.md + v3-design-2026-10-23.md (7).
   1. HERO = the home hero (home-3.css, .hero1--page).
   2. A DAY IN PICTURES (white): V3 = 6 SQUARE cards (photo + caption), a plain grid: 2 columns (>= 768, max 960px wide) / 1 (max 420px), gap 32-56px.
   3. FULL-SCREEN VIEWER (js/gallery.js builds it): the photo FILLS the screen without losing its shape (user rule):
      width = min(100vw, 100dvh x ratio) - as wide OR as tall as the screen allows, on every device and in both phone
      directions. Backdrop = navy #0D2B4E at 96% (user). Close, previous / next, counter + caption sit OVER the photo. */

/* 2. A DAY IN PICTURES ----------------------------------------------------------------------------------------- */
.page-gallery .gal-head{text-align:center;margin-bottom:clamp(30px,4.5vw,48px)}
.page-gallery .gal-head h2{font-size:var(--fs-h2)}
.page-gallery .gal-head .lead{margin:8px auto 0;max-width:720px}
/* plain grid, no masonry, 2 columns from 768 (client). MORE BREATHING ROOM (user, 2026-10-23: "very cluttered" -
   smaller cards, more space between them both ways): the grid is max 960px wide, centred (cards were 676px at 1440,
   now 452px); phone = 1 column, max 420px, centred; gap 18px -> 32px at 768, 56px from 1400 (rows and columns). */
.page-gallery .gal-grid{list-style:none;margin:0 auto;padding:0;display:grid;grid-template-columns:minmax(0,1fr);
  gap:clamp(32px,4vw,56px);max-width:420px}
@media (min-width:768px){ .page-gallery .gal-grid{grid-template-columns:repeat(2,minmax(0,1fr));max-width:960px} }
.page-gallery .gal-item{margin:0}
/* CARD = white, photo on WHITE = #E9F6FC 6px frame (photo border rule), radius 22, the soft site shadow; the photo sits
   flush inside the frame and the caption under it (overflow:hidden gives the photo the inner radius, 16px) */
.page-gallery .gl-item{display:block;background:#fff;border:6px solid var(--sky-100);border-radius:22px;
  box-shadow:var(--shadow-sm);overflow:hidden;transition:transform .18s,box-shadow .18s}
/* every card photo has the SAME shape: square 1:1 (the crop is baked into gal-0N-card.jpg, so no object-position).
   width + aspect-ratio => height:auto too (learnings 2026-10-08) */
.page-gallery .gl-item img{display:block;width:100%;height:auto;aspect-ratio:1/1;object-fit:cover;background:var(--sky-100)}
/* caption = the grey caption line of the site cards (16px, --muted) */
.page-gallery .gl-cap{display:block;padding:14px 18px 16px;font-size:var(--fs-body);line-height:1.5;color:var(--muted)}
/* HOVER = the site card (-4px + bigger shadow, .18s), mouse only */
@media (hover:hover){ .page-gallery .gl-item:hover{transform:translateY(-4px);box-shadow:var(--shadow)} }
.page-gallery .gl-item:focus-visible{outline:3px solid var(--dolphin);outline-offset:3px}

/* 3. FULL-SCREEN VIEWER ---------------------------------------------------------------------------------------- */
body.gl-open{overflow:hidden}   /* the page does not scroll behind the viewer */
.gl-lb{position:fixed;inset:0;z-index:1000;display:grid;place-items:center;background:rgba(13,43,78,.96);overflow:hidden}
.gl-lb[hidden]{display:none}
.gl-lb-fig{margin:0;display:grid;place-items:center;width:100vw;height:100vh;height:100dvh}
.gl-lb-fig picture{display:contents}
/* FILL the screen, keep the shape: as wide as the screen, unless that makes it taller than the screen - then as tall
   as the screen. --ar (width / height) is set by js/gallery.js. Also grows a file that is smaller than the screen. */
.gl-lb-img{display:block;width:min(100vw,calc(100vh * var(--ar,1.333)));width:min(100vw,calc(100dvh * var(--ar,1.333)));
  height:auto;aspect-ratio:var(--ar,1.333);object-fit:contain;transition:opacity .2s}
.gl-lb-img.is-loading{opacity:.35}
.gl-lb-img.is-broken{visibility:hidden}
.gl-lb-err{position:absolute;margin:0;color:#fff;font-weight:700}
.gl-lb-err[hidden]{display:none}
/* top bar (counter + close) and caption sit OVER the photo; soft navy fades keep white text readable on any photo */
.gl-lb-bar{position:absolute;top:0;left:0;right:0;z-index:2;display:flex;align-items:center;justify-content:space-between;
  gap:16px;padding:12px clamp(12px,2vw,20px);background:linear-gradient(rgba(13,43,78,.7),rgba(13,43,78,0));pointer-events:none}
.gl-lb-bar>*{pointer-events:auto}
.gl-lb-count{margin:0;color:#fff;font-weight:700;font-size:var(--fs-body)}
.gl-lb-cap{position:absolute;left:0;right:0;bottom:0;z-index:2;margin:0;padding:40px clamp(16px,4vw,48px) 18px;
  text-align:center;color:#fff;font-size:var(--fs-body);line-height:1.5;
  background:linear-gradient(rgba(13,43,78,0),rgba(13,43,78,.8))}
.gl-lb-cap[hidden]{display:none}
/* buttons: 48px navy discs (60%) with white icons; hover / focus = Dolphin */
.gl-lb-btn{display:grid;place-items:center;width:48px;height:48px;padding:0;border:0;border-radius:50%;cursor:pointer;
  background:rgba(13,43,78,.6);color:#fff;transition:background-color .18s}
.gl-lb-btn svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round}
@media (hover:hover){ .gl-lb-btn:hover{background:var(--dolphin)} }
.gl-lb-btn:focus-visible{outline:3px solid #fff;outline-offset:2px;background:var(--dolphin)}
.gl-lb-prev,.gl-lb-next{position:absolute;top:50%;z-index:2;translate:0 -50%}
.gl-lb-prev{left:clamp(8px,1.5vw,20px)}
.gl-lb-next{right:clamp(8px,1.5vw,20px)}
