/* Shared base: reset, image placeholders, lightbox, a11y. Themes layer on top. */
*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{margin:0;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}
img{display:block;max-width:100%;height:auto}
a{color:inherit}
button{font:inherit;color:inherit;background:none;border:0;padding:0;cursor:pointer}
:focus-visible{outline:1px solid currentColor;outline-offset:3px}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.skip{position:fixed;left:8px;top:-60px;z-index:100;padding:8px 12px;background:#000;color:#fff;font:12px/1 system-ui;text-decoration:none}
.skip:focus{top:8px}

/* Progressive image: dominant colour → blurred 24px LQIP → real image fades in */
.pic{display:block;position:relative;background:var(--c) var(--lqip) center/cover no-repeat;aspect-ratio:var(--ratio);overflow:hidden}
.pic img{width:100%;height:100%;object-fit:cover;opacity:0;transition:opacity .6s ease}
.pic img.is-loaded{opacity:1}
.no-js .pic img{opacity:1}

/* Cross-document view transitions (Chrome 126+, Safari 18.2+). Ignored elsewhere. */
@view-transition{navigation:auto}
::view-transition-old(root),::view-transition-new(root){animation-duration:.35s}
::view-transition-group(*){animation-duration:.5s;animation-timing-function:cubic-bezier(.2,.7,.1,1)}

/* Lightbox (shared, themed via custom properties) */
.lb{position:fixed;inset:0;width:100%;height:100%;max-width:none;max-height:none;margin:0;padding:0;border:0;
  background:var(--lb-bg,#fff);color:var(--lb-fg,#111);overscroll-behavior:contain}
.lb[open]{display:grid;grid-template-rows:1fr auto}
.lb::backdrop{background:var(--lb-bg,#fff)}
.lb__stage{position:relative;display:grid;grid-template:minmax(0,1fr)/minmax(0,1fr);place-items:center;min-height:0;padding:clamp(12px,4vh,48px) clamp(12px,6vw,96px) 0;touch-action:pan-y}
.lb__stage img{max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain;user-select:none;-webkit-user-drag:none}
.lb__bar{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:14px clamp(12px,3vw,32px) max(14px,env(safe-area-inset-bottom));font:var(--lb-font,12px/1.3 system-ui);letter-spacing:var(--lb-track,.02em)}
.lb__cap{flex:1;text-align:center;opacity:.75;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.lb__nav{position:absolute;top:0;bottom:0;width:30%;cursor:none}
.lb__nav--prev{left:0}.lb__nav--next{right:0}
.lb:focus{outline:0}
.lb__nav:focus-visible{outline-offset:-8px}   /* keyboard users still see which zone is focused, drawn inside the image area */
@media (hover:none){.lb__nav:focus{outline:0}}
.lb__cursor{position:fixed;pointer-events:none;font:var(--lb-font,12px system-ui);transform:translate(-50%,-50%);z-index:2;opacity:0;transition:opacity .15s}
.lb__stage:hover .lb__cursor{opacity:1}
@media (hover:none){.lb__nav{cursor:auto}.lb__cursor{display:none}}

@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.01ms!important;transition-duration:.01ms!important;scroll-behavior:auto!important}
  @view-transition{navigation:none}
}
