/* Home portfolio viewer — full-bleed image + bottom thumbnail strip (home-viewer.php) */

html:has(.jv), html:has(.jv) body { height: 100%; overflow: hidden; background: #fff; }

.jv {
  --thumb-h: 64px;
  --thumb-gap: 6px;
  --jv-fg: #1f2227;
  --jv-accent: rgba(31, 34, 39, .9);   /* frame colour; viewer.js sets it from each image */
  --strip-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  position: fixed;
  inset: 0;
  color: var(--jv-fg);
}

/* Stage */
.jv-stage { position: absolute; inset: 0; }

.jv-slide {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  transition: opacity .7s ease;
}
.jv-slide.is-active { opacity: 1; z-index: 1; }

.jv-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--fx, 50%) 50%;
  user-select: none;
  -webkit-user-drag: none;
}

/* The <picture> fills the slide so the img inside can cover it */
.jv-slide picture { display: block; width: 100%; height: 100%; }

@media (orientation: portrait) {
  .jv-contain img { object-fit: contain; }
  .has-portrait img { object-fit: cover; object-position: 50% 50%; }   /* made for this shape */
}

/* Thumbnail strip */
.jv-thumbs {
  position: absolute;
  left: 0;
  right: 0;
  bottom: var(--strip-bottom);
  height: var(--thumb-h);
  padding: 4px 0;        /* design.css pads every <nav>; 4px keeps the frame inside the edge mask */
  box-sizing: content-box;
  z-index: 5;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 15%, #000 85%, transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 15%, #000 85%, transparent 100%);
}

.jv-track {
  display: flex;
  gap: var(--thumb-gap);
  height: var(--thumb-h);
  transition: transform .6s cubic-bezier(.2, .7, .2, 1);
  will-change: transform;
}

.jv-thumb {
  flex: 0 0 auto;
  height: 100%;
  aspect-ratio: 16 / 10;
  padding: 0;
  margin: 0;
  border: 0;
  background: none;
  cursor: grab;
}
.jv-thumb img { width: 100%; height: 100%; object-fit: cover; }
.jv-thumb:focus-visible { outline: 2px solid var(--jv-fg); outline-offset: 2px; }

/* Fixed highlight frame in the centre; the strip slides under it. The 3px ring between
   the outline and the thumbnail is frosted glass over the photo; the mask cuts out the
   middle so the thumbnail itself stays sharp. */
.jv-frame {
  position: absolute;
  bottom: var(--strip-bottom);
  left: 50%;
  width: calc(var(--thumb-h) * 1.6 + 8px);
  height: calc(var(--thumb-h) + 8px);
  padding: 3px;
  transform: translateX(-50%);
  z-index: 6;
  border: 1px solid var(--jv-accent);
  background: rgba(255, 255, 255, .14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45);
  -webkit-backdrop-filter: blur(6px) saturate(1.4);
          backdrop-filter: blur(6px) saturate(1.4);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  transition: border-color .5s ease;
  pointer-events: none;
}

@media (max-width: 760px) {
  .jv { --thumb-h: 44px; --thumb-gap: 4px; }
  .jv { --strip-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
}

@media (prefers-reduced-motion: reduce) {
  .jv-slide, .jv-track { transition: none; }
}

/* Drag-to-scrub on the strip */
.jv-thumbs { touch-action: pan-y; user-select: none; -webkit-user-select: none; }
/* hand cursor only over a thumbnail; closed hand anywhere while a drag is in progress */
.jv.is-dragging .jv-thumbs, .jv.is-dragging .jv-thumb { cursor: grabbing; }
.jv-thumb img { -webkit-user-drag: none; pointer-events: none; }
.jv.is-dragging .jv-slide { transition-duration: .2s; }   /* image keeps up while scrubbing */

/* White logo + menu over images marked 'nav' => 'light' (set by viewer.js) */
html.jv-nav-light header .logo img { filter: invert(1); }
html.jv-nav-light .nav-container ul li a,
html.jv-nav-light navigate ul li a { color: #fff !important; }
html.jv-nav-light .nav-container ul li a:hover { color: rgba(255, 255, 255, .7) !important; }
html.jv-nav-light .nav-open i { background: #fff; }
header .logo img, .nav-container ul li a, .nav-open i { transition: color .5s ease, filter .5s ease, background-color .5s ease; }
