/* ==========================================================================
   /gallery: full-height horizontal photo strip + borderless viewer
   Every photo is exactly the strip's height and keeps its own ratio, so tops and bottoms always line up.
   ========================================================================== */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.page-strip {
  --hs-gap: 6px;
  --hs-backdrop: rgba(255, 255, 255, .86);
  --hs-shadow: 0 30px 70px -28px rgba(11, 11, 11, .38), 0 8px 22px -12px rgba(11, 11, 11, .18);
  --hs-chip: rgba(255, 255, 255, .78);
  --hs-chip-line: rgba(11, 11, 11, .08);
}
[data-theme="dark"] .page-strip {
  --hs-backdrop: rgba(8, 8, 8, .88);
  --hs-shadow: 0 30px 80px -24px rgba(0, 0, 0, .85), 0 8px 24px -12px rgba(0, 0, 0, .6);
  --hs-chip: rgba(28, 27, 24, .78);
  --hs-chip-line: rgba(255, 255, 255, .08);
}
.page-strip img { -webkit-user-drag: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }

/* ---------- Strip ---------- */
.hs { position: relative; height: calc(100vh - var(--header-h)); height: calc(100svh - var(--header-h)); min-height: 320px; overflow: hidden; background: var(--bg); }
.hs-track {
  display: flex; gap: var(--hs-gap); height: 100%;
  overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain;
  scrollbar-width: none; -ms-overflow-style: none;
  cursor: grab; outline: none; touch-action: pan-x pan-y;
}
.hs-track::-webkit-scrollbar { display: none; }
.hs-track.is-dragging { cursor: grabbing; }
.hs-track.is-dragging .hs-link { pointer-events: none; }
.hs-track:focus-visible { box-shadow: inset 0 0 0 2px var(--gold); }

.hs-item {
  flex: none; margin: 0; height: 100%; aspect-ratio: var(--ar);
  position: relative; overflow: hidden; background: var(--surface-2);
}
@keyframes hs-in { from { opacity: 0; transform: translateX(48px); } }
.hs-link { display: block; width: 100%; height: 100%; cursor: inherit; -webkit-tap-highlight-color: transparent; animation: hs-in .9s var(--ease) both; animation-delay: calc(var(--i) * 60ms + 80ms); }
.hs-link:focus-visible { outline: 2px solid var(--gold); outline-offset: -4px; }
.hs-item picture { display: block; width: 100%; height: 100%; }
.hs-img {
  display: block; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transform: scale(1.04); filter: blur(10px);
  transition: opacity .7s var(--ease), transform 1.1s var(--ease), filter .7s var(--ease);
  will-change: transform;
}
.hs-img.is-loaded { opacity: 1; transform: scale(1); filter: none; }
@media (hover: hover) and (pointer: fine) {
  .hs-track:not(.is-dragging):not(.is-moving) .hs-item:hover .hs-img.is-loaded { transform: scale(1.025); }
  .hs-track.has-hover:not(.is-dragging) .hs-item { transition: opacity .45s var(--ease); }
  .hs-track.has-hover:not(.is-dragging) .hs-item:not(:hover) { opacity: .55; }
}
/* Speed feedback: photos breathe in a touch while the strip is flying. */
.hs-track.is-moving .hs-item picture { transform: scale(var(--hs-squash, 1)); transition: transform .25s var(--ease); }
.hs-item picture { transition: transform .5s var(--ease); }

/* ---------- Edge arrows ---------- */
.hs-arrow {
  position: absolute; top: 50%; z-index: 3; width: 52px; height: 52px; margin-top: -26px; border-radius: 50%;
  display: grid; place-items: center; color: var(--text);
  background: var(--hs-chip); border: 1px solid var(--hs-chip-line); box-shadow: var(--shadow-md);
  backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4);
  opacity: 0; transition: opacity .35s var(--ease), transform .35s var(--ease-spring), background .2s;
}
.hs-arrow svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hs-arrow--prev { left: 20px; transform: translateX(-10px); }
.hs-arrow--next { right: 20px; transform: translateX(10px); }
.hs:hover .hs-arrow, .hs-arrow:focus-visible { opacity: 1; transform: none; }
.hs-arrow:hover { transform: scale(1.08); }
.hs-arrow:active { transform: scale(.94); }
.hs-arrow[disabled] { opacity: 0 !important; pointer-events: none; }
@media (hover: none) { .hs-arrow { display: none; } }

/* ---------- HUD: counter, scrubber, hint ---------- */
.hs-hud {
  position: absolute; left: 50%; bottom: 18px; z-index: 3; transform: translateX(-50%);
  display: flex; align-items: center; gap: 14px; padding: 8px 16px; border-radius: 999px;
  background: var(--hs-chip); border: 1px solid var(--hs-chip-line); box-shadow: var(--shadow-sm);
  backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4);
  font: 500 .78rem/1 var(--font-mono); color: var(--muted); white-space: nowrap;
  animation: hs-hud-in .8s .5s var(--ease) both;
}
@keyframes hs-hud-in { from { opacity: 0; transform: translate(-50%, 14px); } }
.hs-count b { color: var(--text); font-weight: 500; display: inline-block; min-width: 2ch; text-align: right; }
.hs-count i { font-style: normal; opacity: .5; margin: 0 .35em; }
.hs-scrub { position: relative; width: clamp(90px, 18vw, 220px); height: 18px; cursor: pointer; touch-action: none; }
.hs-scrub::before, .hs-scrub span { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2px; margin-top: -1px; border-radius: 2px; }
.hs-scrub::before { background: var(--line-strong); }
.hs-scrub span { background: var(--text); transform-origin: left; transform: scaleX(0); }
.hs-scrub:hover::before, .hs-scrub.is-active::before, .hs-scrub:hover span, .hs-scrub.is-active span { height: 4px; margin-top: -2px; }
.hs-hint { transition: opacity .5s, max-width .6s var(--ease); max-width: 26ch; overflow: hidden; }
.hs-hint.is-gone { opacity: 0; max-width: 0; margin-left: -14px; }

/* ---------- Cursor follower (desktop) ---------- */
.hs-cursor {
  position: fixed; left: 0; top: 0; z-index: 4; pointer-events: none;
  width: 78px; height: 78px; margin: -39px 0 0 -39px; border-radius: 50%;
  display: grid; place-items: center; color: #0B0B0B; background: rgba(255, 255, 255, .9);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .35);
  font: 600 .72rem/1 var(--font-body); letter-spacing: .08em; text-transform: uppercase;
  opacity: 0; scale: .3; transform: translate3d(var(--x, -200px), var(--y, -200px), 0);
  transition: opacity .25s, scale .35s var(--ease);
}
.hs-cursor.is-on { opacity: 1; scale: 1; }
.hs-cursor.is-drag { scale: .78; }
@media (hover: none), (pointer: coarse) { .hs-cursor { display: none; } }
.hs.has-cursor .hs-track { cursor: none; }

/* ---------- Empty ---------- */
.hs-empty { min-height: calc(100svh - var(--header-h)); display: grid; place-content: center; justify-items: center; gap: 12px; text-align: center; padding: 48px var(--gutter); }
.hs-empty-icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--accent-text); }
.hs-empty-icon .icon { width: 28px; height: 28px; }
.hs-empty p { margin: 0 0 8px; }
.hs-empty p a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Viewer ---------- */
.hs-modal {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0;
  border: 0; background: transparent; color: var(--text); overflow: hidden; outline: none;
}
.hs-modal::backdrop { background: var(--hs-backdrop); backdrop-filter: blur(20px) saturate(1.2); -webkit-backdrop-filter: blur(20px) saturate(1.2); opacity: var(--hs-bd, 1); transition: opacity .35s var(--ease); }
.hs-modal:not([open]) { display: none; }
.hs-modal.is-closing::backdrop { opacity: 0; }
/* Some browsers can't style ::backdrop with variables; this layer does the dimming too. */
.hs-modal::before { content: ""; position: fixed; inset: 0; background: var(--hs-backdrop); opacity: var(--hs-bd, 1); transition: opacity .35s var(--ease); }
.hs-modal.is-closing::before { opacity: 0; }

.hs-stage { position: absolute; inset: 0; display: grid; place-items: center; padding: 72px clamp(16px, 7vw, 120px) 112px; touch-action: none; cursor: zoom-in; }
.hs-stage.is-zoomed { cursor: grab; }
.hs-stage.is-panning { cursor: grabbing; }
.hs-full {
  display: block; max-width: 100%; max-height: 100%; width: auto; height: auto;
  border: 0; border-radius: 4px; box-shadow: var(--hs-shadow); background: var(--surface-2);
  transform-origin: 0 0; will-change: transform; user-select: none;
}
.hs-full.is-swapping { transition: opacity .25s; }

.hs-mbtn {
  position: absolute; z-index: 2; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  color: var(--text); background: var(--hs-chip); border: 1px solid var(--hs-chip-line); box-shadow: var(--shadow-sm);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  transition: transform .3s var(--ease-spring), opacity .3s, background .2s;
}
.hs-mbtn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hs-mbtn:hover { transform: scale(1.08); }
.hs-mbtn:active { transform: scale(.92); }
.hs-mbtn[disabled] { opacity: 0; pointer-events: none; }
.hs-close { top: 18px; right: 18px; }
.hs-mnav { top: 50%; margin-top: -23px; }
.hs-mnav--prev { left: 18px; }
.hs-mnav--next { right: 18px; }
@media (hover: none) { .hs-mnav { display: none; } }

.hs-info {
  position: absolute; left: 0; right: 0; bottom: 22px; z-index: 2; padding: 0 clamp(16px, 4vw, 40px);
  display: flex; align-items: center; justify-content: space-between; gap: 16px; pointer-events: none;
}
.hs-info > * { pointer-events: auto; }
.hs-meta { min-width: 0; display: grid; gap: 2px; }
.hs-meta strong { font-family: var(--font-display); font-weight: 700; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hs-meta span { color: var(--muted); font-size: .88rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 60ch; }
.hs-meta span:empty { display: none; }
.hs-pill {
  flex: none; display: inline-flex; align-items: center; gap: 2px; padding: 4px; border-radius: 999px;
  background: var(--hs-chip); border: 1px solid var(--hs-chip-line); box-shadow: var(--shadow-sm);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); font: 500 .76rem/1 var(--font-mono); color: var(--muted);
}
.hs-pill > i { width: 1px; height: 18px; background: var(--line); margin: 0 4px; }
.hs-pill-count { padding: 0 10px; color: var(--text); }
.hs-pill button, .hs-pill a { height: 34px; min-width: 34px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center; color: var(--text); transition: background .2s; cursor: pointer; }
.hs-pill button:hover, .hs-pill a:hover { background: var(--line); }
.hs-pill svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hs-zoomval { font: inherit; min-width: 52px !important; }

/* Opening / closing choreography; a tap on touch screens hides the chrome. */
html.hs-lock { overflow: hidden; }
@keyframes hs-fade { from { opacity: 0; } }
@keyframes hs-rise { from { opacity: 0; transform: translateY(12px); } }
.hs-modal[open]::before, .hs-modal[open]::backdrop { animation: hs-fade .4s var(--ease) backwards; }
.hs-modal[open] .hs-info { animation: hs-rise .5s .12s var(--ease) backwards; }
.hs-modal[open] .hs-mbtn { animation: hs-fade .4s .1s var(--ease) backwards; }
.hs-modal.is-closing .hs-info, .hs-modal.is-closing .hs-mbtn { opacity: 0; transition: opacity .2s; animation: none; }
.hs-modal.is-immersive .hs-info, .hs-modal.is-immersive .hs-mbtn { opacity: 0; pointer-events: none; transition: opacity .25s; animation: none; }

.hs-toast { position: absolute; left: 50%; top: 24px; z-index: 3; margin: 0; padding: 9px 16px; border-radius: 999px; transform: translate(-50%, -12px); opacity: 0; background: var(--text); color: var(--bg); font-size: .85rem; transition: opacity .3s, transform .4s var(--ease); pointer-events: none; }
.hs-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 720px) {
  .page-strip { --hs-gap: 4px; }
  .hs-hud { bottom: 12px; gap: 10px; padding: 7px 12px; }
  .hs-hint { display: none; }
  .hs-stage { padding: 64px 12px 120px; }
  .hs-info { flex-direction: column; align-items: stretch; gap: 10px; bottom: 16px; }
  .hs-meta { text-align: center; }
  .hs-pill { align-self: center; }
  .hs-close { top: 12px; right: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .hs-link, .hs-hud { animation: none; }
  .hs-img { transition: opacity .3s; transform: none !important; filter: none; }
  .hs-track.is-moving .hs-item picture { transform: none; }
}
