/* =========================================================================
   Cabinhub News — article lightbox skin (PORT-UX)

   PhotoSwipe 5.4.4 ships its own base stylesheet (vendor/photoswipe/
   photoswipe.css, loaded first). This file only re-tints it to Cabinhub and
   adds the trigger affordance. No upstream visual identity survives: the scrim
   is our near-black paper, the icons are our paper colour, and the motion
   budget is the reader's.

   The upstream root sets --pswp-bg:#000 and --pswp-icon-color:#fff. We override
   both to tokens-fixed values (not theme tokens: a lightbox scrim is dark in
   BOTH themes, the way a photograph is viewed, so it does not follow --ink
   which flips light in dark mode). */

/* Double-class so these win over the upstream `.pswp { --pswp-bg:#000 }` no
   matter which stylesheet is parsed last — the vendor CSS is injected lazily,
   AFTER this eager sheet. (0,2,0) beats the upstream (0,1,0). */
.pswp.pswp {
  --pswp-bg: rgba(20, 16, 13, 0.94);       /* #14100D at 94% — our ink, fixed */
  --pswp-icon-color: #F7F5F2;              /* paper */
  --pswp-icon-color-secondary: #8F7B6D;    /* rule-strong */
}

/* The trigger. An image carrying data-pswp-src is zoomable; say so with the
   cursor and, when it is reached by keyboard, a focus ring on the accent. */
.detail img.thumb__img.is-zoomable { cursor: zoom-in; }

.detail img.thumb__img.is-zoomable:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--r-md);
}

@media (forced-colors: active) {
  .detail img.thumb__img.is-zoomable:focus-visible { outline-color: Highlight; }
}

/* Reduced motion: no zoom-from-thumbnail flight. js/lightbox.js already passes
   showHideAnimationType:'none'; this catches the CSS-side transition too. */
@media (prefers-reduced-motion: reduce) {
  .pswp { --pswp-transition-duration: 0ms; }
}

/* The caption band. PhotoSwipe core ships no caption; js/lightbox.js registers
   .pswp__caption and fills it from the figure's own figcaption (story caption,
   credit/licence, AI label). Pinned to the bottom, over the scrim, wrapped to a
   readable measure, on our paper colour. It sits above PhotoSwipe's own controls
   and never captures pointer events, so it can never trap a tap meant for the
   image. */
.pswp.pswp .pswp__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 40%;
  overflow-y: auto;
  box-sizing: border-box;
  padding: 0.75rem clamp(1rem, 4vw, 2rem) 1rem;
  color: #F7F5F2;
  background: linear-gradient(to top, rgba(20, 16, 13, 0.85), rgba(20, 16, 13, 0));
  font-size: 0.875rem;
  line-height: 1.45;
  text-align: center;
  pointer-events: none;
}

/* The image gets a reserved caption area through PhotoSwipe's paddingFn. */
.pswp.pswp .pswp__caption {
  min-height:min(86px,17dvh);max-height:clamp(86px,17dvh,164px);
  display:flex;flex-flow:column;align-items:flex-start;gap:.34rem;
  padding:.7rem max(1rem,calc((100vw - 72rem)/2)) max(.85rem,env(safe-area-inset-bottom));
  background:#201e1c;border-top:1px solid #48443e;text-align:start;pointer-events:auto;
  overscroll-behavior:contain
}
.pswp .gallery-ordinal {color:#f5ceaa;font:650 .78rem/1.25 var(--font-ui)}
.pswp .gallery-caption {font:400 .94rem/1.4 var(--font-ui);color:#faf6ef}
