/* ═══════════════════════════════════════════════════════════════
   Focus view (js/focus-view.js): one big poster at a time, the third view beside Grid and List.
   The poster's width is worked out from the screen's height (--mfv-w), so the whole of it always fits under the toolbar;
   its height comes from padding, not aspect-ratio (Safari). Colours: css/theme.css tokens only.
     .mfv-track  the row of posters, as wide as the screen; JS places each slide and moves them all together
     .mfv-stage  over the middle one: what you press, with the info panel
     .mfv-side   over the parts of its neighbours at the screen's edges (computers and tablets)
═══════════════════════════════════════════════════════════════ */
.mfv { --mfv-w:calc(clamp(330px, 100svh - 216px - var(--mfv-bar, 0px), 780px) * 2 / 3);
  position:relative; isolation:isolate; display:flex; flex-direction:column; align-items:center; gap:14px; padding:6px 0 4px;
  scroll-margin-block:calc(var(--nav-h) + 60px + var(--mfv-bar, 0px)) 16px; touch-action:pan-y pinch-zoom; -webkit-user-select:none; user-select:none; }
.is-prof { --mfv-bar:146px; }   /* a profile: its name and tabs stay under the top bar */
.mfv[hidden] { display:none; }

/* the row (--mfv-out, --mfv-vw: from the page's column out to the screen's edges) */
.mfv-track { position:absolute; inset-block:0; left:var(--mfv-out, 0); width:var(--mfv-vw, 100%); overflow:hidden; pointer-events:none; }
.mfv-slide { position:absolute; top:6px; left:calc(50% - var(--mfv-w) / 2); width:var(--mfv-w); will-change:transform; opacity:calc(1 - var(--far, 0) * .5); }
.mfv-slide::before { content:''; display:block; padding-top:150%; }
.mfv-art, .mss-teen .mfv-slide .mfv-art[data-age] { position:absolute; }
.mfv-art { inset:0; border-radius:14px; overflow:hidden; background:var(--mc-po, var(--surface-card)) center / cover no-repeat; transition:transform .3s var(--ease); }
.mfv-art img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; opacity:0; transition:opacity .2s var(--ease); }
.mfv-art img.in { opacity:1; }
.mfv-art .img-fallback { position:absolute; inset:0; display:grid; place-items:center; background:var(--mc-po, var(--surface-card)); color:var(--text-muted); font:400 120px/1 var(--bebas); }

/* the middle one */
.mfv-stage { position:relative; z-index:2; width:var(--mfv-w); max-width:100%; }
.mfv-card { position:relative; display:block; width:100%; height:0; padding:150% 0 0; border:0; border-radius:14px; background:none; font:inherit; color:inherit; text-align:start; cursor:pointer;
  -webkit-tap-highlight-color:transparent; -webkit-touch-callout:none; }
.mfv-card:focus-visible { outline:2px solid var(--mc-focus); outline-offset:4px; }
.mss-teen .mfv-card[data-age].age-locked::after { display:none; }   /* the poster itself has the 16+ / 18+ lock */
.mfv.is-skel .mfv-card { background-color:var(--mc-po, var(--surface-card)); }

/* the glass: on the lower part of the poster, so the picture stays in view. Dark enough to read over any poster even where the blur isn't drawn */
.mfv-info { position:absolute; inset:auto 12px 12px; display:flex; flex-direction:column; gap:7px; padding:14px 16px 15px; border-radius:var(--radius-sm);
  border:1px solid color-mix(in srgb, var(--text-on-photo) 14%, transparent); background:color-mix(in srgb, var(--p-deep-forest) 86%, transparent); -webkit-backdrop-filter:blur(12px); backdrop-filter:blur(12px); color:var(--text-on-photo);
  opacity:0; transform:translateY(6px); transition:opacity .2s var(--ease), transform .2s var(--ease); }
.mfv-t { font:600 22px/1.2 var(--serif); overflow-wrap:anywhere; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.mfv-sub { margin-top:-4px; font:600 13px/1.4 var(--sans); }
.mfv-sub:empty, .mfv-meta:empty, .mfv-ov:empty { display:none; }
.mfv-meta { display:flex; flex-wrap:wrap; align-items:baseline; gap:2px 14px; font:600 13.5px/1.3 var(--sans); }
.mfv-sc { min-width:0; overflow-wrap:anywhere; }
.mfv-sc b { font:400 24px/1 var(--bebas); letter-spacing:.3px; color:var(--st); }
.mfv-ov { font:500 13.5px/1.5 var(--sans); display:-webkit-box; -webkit-line-clamp:4; -webkit-box-orient:vertical; overflow:hidden; }
@media (hover:hover) and (pointer:fine) { .mfv-card:hover .mfv-info { opacity:1; transform:none; } }
.mfv-card:focus-visible .mfv-info, .mfv.is-peek .mfv-info, .mfv:has(.is-cur .img-fallback) .mfv-info { opacity:1; transform:none; }   /* no picture: the info is all there is */
.mss-teen .mfv-card[data-age]:not(.age-ok) .mfv-ov { display:none; }

/* the part of the one before / after at the screen's edge: press it. Nothing there at the first / last */
.mfv-side { position:absolute; z-index:2; top:6px; width:var(--mfv-side, 0); height:calc(var(--mfv-w) * 1.5); padding:0; border:0; border-radius:14px; background:none; cursor:pointer; -webkit-tap-highlight-color:transparent; }
.mfv-side.is-prev { inset-inline-start:var(--mfv-out, 0); }
.mfv-side.is-next { inset-inline-end:var(--mfv-out, 0); }
.mfv-side[hidden] { display:none; }
.mfv-side:focus-visible { outline:2px solid var(--mc-focus); outline-offset:-4px; }
@media (hover:hover) and (pointer:fine) {
  .mfv:has(.mfv-side.is-prev:hover) .mfv-slide.is-prev, .mfv:has(.mfv-side.is-next:hover) .mfv-slide.is-next { opacity:calc(1 - var(--far, 0) * .1); }
  .mfv:has(.mfv-side.is-prev:hover) .mfv-slide.is-prev .mfv-art, .mfv:has(.mfv-side.is-next:hover) .mfv-slide.is-next .mfv-art { transform:scale(1.03); }
}

.mfv.is-drag, .mfv.is-drag * { cursor:grabbing; }

/* where you are */
.mfv-pos { position:relative; display:flex; flex-direction:column; align-items:center; gap:7px; pointer-events:none; font:600 13px/1 var(--sans); font-variant-numeric:tabular-nums; color:var(--text-muted); }
.mfv.is-one .mfv-pos { visibility:hidden; }
.mfv-pos span { unicode-bidi:plaintext; }
.mfv-pos i { width:120px; height:2px; border-radius:1px; overflow:hidden; background:var(--border-default); }
.mfv-pos i[hidden] { display:none; }
.mfv-pos u { display:block; height:100%; background:var(--text-link); transform-origin:left; transition:transform .25s var(--ease); }
[dir="rtl"] .mfv-pos u { transform-origin:right; }

/* tablets: the bottom bar is on screen too */
@media (min-width:768px) and (max-width:1199px) {
  .mfv { --mfv-w:min(62vw, clamp(330px, 100svh - 330px - var(--mfv-bar, 0px), 780px) * 2 / 3); scroll-margin-bottom:calc(var(--bnav-top) + 40px); }
}

/* ── Phones: only the poster, across most of the screen; swipe to move ── */
@media (max-width:767px) {
  .is-prof { --mfv-bar:132px; }
  .mfv { --mfv-w:min(84vw, max(200px, (100svh - 226px - var(--mfv-bar, 0px)) * 2 / 3));
    scroll-margin-block:calc(var(--nav-h) + 8px + var(--mfv-bar, 0px)) calc(var(--bnav-top) + 40px); }   /* clear of the bottom bar's raised button */
  .mfv-slide { opacity:1; }
  .mfv-side { width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }   /* still there for screen readers */
}

/* ── The preview (touch): over the page, as large as the screen allows ── */
.mfv-peek { position:fixed; inset:0; z-index:1200; display:none; background:var(--bg-app); }
.mfv-peek.open { display:block; animation:mfvIn .2s var(--ease); }
.mfv-peek-in { position:absolute; inset:0; display:flex; flex-direction:column; justify-content:center; padding:calc(env(safe-area-inset-top) + 62px) 12px calc(env(safe-area-inset-bottom) + 10px); box-sizing:border-box; outline:none; }
.mfv-x { position:absolute; z-index:3; top:calc(env(safe-area-inset-top) + 10px); inset-inline-end:12px; display:grid; place-items:center; width:44px; height:44px; padding:0;
  border:1px solid var(--border-default); border-radius:var(--radius-sm); background:var(--surface-card); color:var(--text-supporting); cursor:pointer; }
.mfv-x:focus-visible { outline:2px solid var(--mc-focus); outline-offset:2px; }
.mfv.is-peek { --mfv-w:min(100vw - 24px, (100dvh - 116px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) * 2 / 3, 640px); padding:0; touch-action:none; }
.mfv.is-peek .mfv-slide { top:0; opacity:1; }
.mfv.is-peek .mfv-side { width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
.mfv.is-peek :is(.mfv-stage, .mfv-track) { animation:mfvUp .24s var(--ease); }
@keyframes mfvIn { from { opacity:0; } }
@keyframes mfvUp { from { transform:scale(.92); } }

@media (prefers-reduced-motion:reduce) {
  .mfv-peek.open, .mfv.is-peek :is(.mfv-stage, .mfv-track) { animation:none; }
  .mfv-info, .mfv-art, .mfv-art img, .mfv-pos u { transition:none; }
}
