/* ══════════════════════════════════════════════════════════════════════════
   DEEP LUXURY — sitewide
   The homepage's masonry gallery, lightbox and mouse-tilt, generalised for
   every page (Stage 53). Written against the tokens already declared in
   site.css (--ink, --brand-lift, --deep, --paper, --band, --line, --radius,
   --shadow, --font-display, --ease…) rather than a parallel set of names, so
   there is exactly one palette for the whole site to change.
   Respects prefers-reduced-motion throughout: see the block at the foot.
   ═══════════════════════════════════════════════════════════════════════ */

/* ---- masonry gallery ------------------------------------------------------ */
.gal-grid{columns:4;column-gap:clamp(.7rem,1.2vw,1.1rem);margin:0}
@media(max-width:72rem){.gal-grid{columns:3}}
@media(max-width:48rem){.gal-grid{columns:2}}
@media(max-width:26rem){.gal-grid{columns:1}}

.gal-item{break-inside:avoid;margin:0 0 clamp(.7rem,1.2vw,1.1rem);position:relative;display:block;
  border-radius:var(--radius);overflow:hidden;background:var(--band);cursor:pointer;
  box-shadow:0 14px 30px -22px rgba(26,20,16,.6);
  transition:box-shadow .6s var(--ease),transform .6s var(--ease)}
.gal-item img{width:100%;height:auto;display:block;transition:transform 1.6s var(--ease)}
.gal-item::after{content:"";position:absolute;inset:0;border:1px solid rgba(255,253,250,0);border-radius:var(--radius);
  transition:border-color .6s var(--ease);pointer-events:none}
.gal-item:hover,.gal-item:focus-visible{transform:translateY(-4px);box-shadow:0 34px 56px -28px rgba(26,20,16,.62)}
/* The shared hover/focus rule above must not silence the keyboard-focus ring:
   the border it draws in its place (below) sits inside the photo and measures
   under 3:1 against a light image, so a keyboard user tabbing to a gallery
   tile needs the real site-wide ring, not just that border. */
.gal-item:hover img,.gal-item:focus-visible img{transform:scale(1.045)}
.gal-item:hover::after,.gal-item:focus-visible::after{border-color:rgba(255,253,250,.45)}
.gal-item figcaption{position:absolute;left:0;right:0;bottom:0;padding:1.6rem .9rem .8rem;
  background:linear-gradient(180deg,transparent,rgba(18,14,11,.84));
  color:var(--paper);font-size:.74rem;
  opacity:0;transform:translateY(6px);transition:opacity .5s var(--ease),transform .5s var(--ease)}
.gal-item:hover figcaption,.gal-item:focus-visible figcaption{opacity:1;transform:none}

/* ---- lightbox — the photograph entire, never cropped ---------------------- */
.lb{position:fixed;inset:0;z-index:900;display:none;place-items:center;
  background:rgba(12,9,7,.94);-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);padding:clamp(1rem,4vw,3rem)}
.lb.is-open{display:grid}
.lb__frame{position:relative;max-width:min(96vw,64rem);display:flex;flex-direction:column;gap:.9rem;animation:ebg-lb-in .5s var(--ease)}
@keyframes ebg-lb-in{from{opacity:0;transform:scale(.97) translateY(10px)}to{opacity:1;transform:none}}
.lb__frame img{max-width:100%;max-height:76vh;width:auto;height:auto;object-fit:contain;border-radius:var(--radius);margin-inline:auto;
  box-shadow:0 40px 90px -30px rgba(0,0,0,.9),0 0 0 1px rgba(220,192,138,.24)}
.lb__cap{display:flex;justify-content:space-between;gap:1rem;align-items:baseline;color:rgba(239,230,218,.8);font-size:.78rem;margin:0}
.lb__cap b{font-family:var(--font-display);font-weight:400;font-size:1.4rem;color:#EFE6DA}
.lb__cap span{font-size:.58rem;letter-spacing:.24em;text-transform:uppercase;color:var(--brand-lift);white-space:nowrap}
.lb__nav{position:absolute;top:44%;transform:translateY(-50%);width:3rem;height:3rem;display:grid;place-items:center;
  border:1px solid rgba(220,192,138,.34);border-radius:50%;color:var(--brand-lift);background:transparent;
  transition:background .4s var(--ease),color .4s var(--ease),border-color .4s var(--ease)}
.lb__nav:hover{background:var(--brand-lift);color:var(--deep);border-color:var(--brand-lift)}
.lb__nav--prev{left:-4.5rem}
.lb__nav--next{right:-4.5rem}
@media(max-width:64rem){.lb__nav--prev{left:.2rem}.lb__nav--next{right:.2rem}.lb__nav{background:rgba(18,14,11,.62)}}
.lb__close{position:absolute;top:-2.4rem;right:0;font-size:.6rem;letter-spacing:.24em;text-transform:uppercase;color:rgba(239,230,218,.7);background:transparent;
  min-height:44px;min-width:44px;padding:.6rem;display:inline-flex;align-items:center;justify-content:flex-end}
.lb__close:hover{color:var(--brand-lift)}

/* ---- tilt cards ------------------------------------------------------------
   A gentle mouse-follow sheen and a lift, driven by deep-luxury.js setting
   --mx/--my as the pointer moves. The sheen is a pseudo-element, so it costs
   no extra markup on any of the card partials that opt in with [data-tilt]. */
[data-tilt]{will-change:transform}
[data-tilt]{position:relative}
[data-tilt]::after{content:"";position:absolute;inset:0;z-index:3;pointer-events:none;border-radius:inherit;
  background:radial-gradient(320px circle at var(--mx,50%) var(--my,50%),rgba(255,253,250,.16),transparent 62%);
  opacity:0;transition:opacity .4s var(--ease)}
[data-tilt]:hover::after,[data-tilt]:focus-within::after{opacity:1}

/* ---- reduced motion --------------------------------------------------------
   The gallery and lightbox stay fully usable — this only removes the parts
   that move on their own or that JS declines to run in the first place. */
@media(prefers-reduced-motion:reduce){
  .gal-item,.gal-item img,.gal-item::after,.gal-item figcaption,.lb__nav,.lb__close,[data-tilt]::after{transition:none}
  .lb__frame{animation:none}
}
