/* ===========================================================================
   Detail pages, one per gallery folder (generador/detalles.py; Alberto, 23-11-2026: «a vista de página, con
   una animación que explique lo que estás leyendo; si puede ser, sin hacer scroll»). The first screen holds
   the whole explanation: the copy and its four steps on the left, the film telling those same four steps on
   the right. The hero IS the .loop-film (vibilog-peliculas.js plays it), so each step lights while the film
   tells it. Below: three notes, the questions and the close.
   One clock for every detail film: ONE 20 s cycle, infinite (1 % = 200 ms); chapters at
   2.5–24 · 24–46 · 46–68 · 68–90 %; the result held at 90 % (data-rest 18000), which is every element's BASE
   style (no JS, reduced motion, waiting its turn); fade in 0–2.5 % and out 96–100 %. Each film's drawing:
   generador/peliculas/detalle-<caso>.html; its keyframes: vibilog-peliculas-<slug>.css.
   =========================================================================== */
.dt-hero{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.12fr);gap:28px clamp(36px,4.6vw,72px);align-items:center;min-height:calc(100svh - var(--hdr));padding-block:28px 36px}
.dt-copy{min-width:0}
.dt-copy .eyebrow{margin:0 0 16px}
.dt-copy h1{margin:0;font-size:clamp(36px,4.1vw,62px);line-height:1;letter-spacing:-.045em;font-weight:650;text-wrap:balance}
.dt-copy h1 span{color:var(--blue)}
.dt-copy .lead{margin:16px 0 0;max-width:540px;font-size:17px;line-height:1.55;color:var(--muted);text-wrap:pretty}
.dt-copy .actions{display:flex;flex-wrap:wrap;align-items:center;gap:16px 26px;margin-top:26px}
.dt-film{min-width:0}
.dt-film .film-stage{aspect-ratio:4/3;border-radius:16px}
.dt-film .loop-foot{margin-top:12px}

/* The four steps: a grey line on the left of each; the film's chapter fills it in blue and lights its text */
.dt-steps{display:grid;gap:12px;max-width:540px;margin:24px 0 0;padding:0;list-style:none}
.dt-steps li{position:relative;display:grid;grid-template-columns:30px minmax(0,1fr);column-gap:4px;padding-left:18px}
.dt-steps li::before,.dt-steps li::after{content:"";position:absolute;left:0;top:3px;bottom:3px;width:2px;border-radius:1px}
.dt-steps li::before{background:var(--line)}
.dt-steps li::after{background:var(--blue);transform-origin:50% 0}
.dt-steps .n{grid-row:1/3;padding-top:2px;font-size:14px;font-weight:600;color:var(--blue);font-variant-numeric:tabular-nums}
.dt-steps b{font-size:17px;font-weight:600;line-height:1.3;letter-spacing:-.02em}
.dt-steps p{margin:2px 0 0;font-size:16px;line-height:1.45;color:var(--muted);text-wrap:pretty}

/* Three notes under the first screen, and the questions close after them */
.dt-notes{padding-block:28px 0}
.dt-notes ul{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:24px 40px;margin:0;padding:0;list-style:none}
.dt-notes li{padding-top:18px;border-top:1px solid var(--line)}
.dt-notes b{display:block;font-size:18px;font-weight:600;letter-spacing:-.02em}
.dt-notes p{margin:8px 0 0;font-size:16px;line-height:1.55;color:var(--muted);text-wrap:pretty}
.dt-notes .textlink{position:relative;display:inline-block;margin-top:12px;color:var(--ink)}
.dt-notes .textlink::before{content:"";position:absolute;inset:-11px -6px}
.dt-notes+.faq-section{padding-top:64px}

/* The shared clock: the film's drawing, its caption and the steps beside it */
.dt-hero.is-playing .film-stage *,.dt-hero.is-playing .loop-cap span,.dt-hero.is-playing .dt-steps li,.dt-hero.is-playing .dt-steps li::after{animation-duration:20s;animation-iteration-count:infinite;animation-fill-mode:both;animation-timing-function:cubic-bezier(.2,0,0,1)}
.dt-hero.is-playing .rw{animation-name:dt-fade}
.dt-hero.is-playing .dt-steps li:nth-child(1){animation-name:dt-s1}
.dt-hero.is-playing .dt-steps li:nth-child(2){animation-name:dt-s2}
.dt-hero.is-playing .dt-steps li:nth-child(3){animation-name:dt-s3}
.dt-hero.is-playing .dt-steps li:nth-child(4){animation-name:dt-s4}
.dt-hero.is-playing .dt-steps li:nth-child(1)::after{animation-name:dt-k1}
.dt-hero.is-playing .dt-steps li:nth-child(2)::after{animation-name:dt-k2}
.dt-hero.is-playing .dt-steps li:nth-child(3)::after{animation-name:dt-k3}
.dt-hero.is-playing .dt-steps li:nth-child(4)::after{animation-name:dt-k4}
.dt-hero.is-playing .dt-steps li::after{animation-timing-function:linear}
.dt-hero.is-playing .loop-cap span:nth-child(1){animation-name:dt-c1}
.dt-hero.is-playing .loop-cap span:nth-child(2){animation-name:dt-c2}
.dt-hero.is-playing .loop-cap span:nth-child(3){animation-name:dt-c3}
.dt-hero.is-playing .loop-cap span:nth-child(4){animation-name:dt-c4}
@keyframes dt-fade{0%{opacity:0}2.5%,96%{opacity:1}100%{opacity:0}}
@keyframes dt-s1{0%{opacity:.42}2.5%,96%{opacity:1}100%{opacity:.42}}
@keyframes dt-s2{0%,24%{opacity:.42}25.5%,96%{opacity:1}100%{opacity:.42}}
@keyframes dt-s3{0%,46%{opacity:.42}47.5%,96%{opacity:1}100%{opacity:.42}}
@keyframes dt-s4{0%,68%{opacity:.42}69.5%,96%{opacity:1}100%{opacity:.42}}
@keyframes dt-k1{0%,2.5%{transform:scaleY(0)}23.5%,96%{transform:none}100%{transform:scaleY(0)}}
@keyframes dt-k2{0%,24%{transform:scaleY(0)}45.5%,96%{transform:none}100%{transform:scaleY(0)}}
@keyframes dt-k3{0%,46%{transform:scaleY(0)}67.5%,96%{transform:none}100%{transform:scaleY(0)}}
@keyframes dt-k4{0%,68%{transform:scaleY(0)}88%,96%{transform:none}100%{transform:scaleY(0)}}
@keyframes dt-c1{0%,22.5%{opacity:1;transform:none}24%,100%{opacity:0;transform:translateY(-4px)}}
@keyframes dt-c2{0%,24%{opacity:0;transform:translateY(4px)}25.5%,44.5%{opacity:1;transform:none}46%,100%{opacity:0;transform:translateY(-4px)}}
@keyframes dt-c3{0%,46%{opacity:0;transform:translateY(4px)}47.5%,66.5%{opacity:1;transform:none}68%,100%{opacity:0;transform:translateY(-4px)}}
@keyframes dt-c4{0%,68%{opacity:0;transform:translateY(4px)}69.5%,100%{opacity:1;transform:none}}
@media print{.dt-hero *,.dt-hero *::after{animation:none!important}}
/* At a phone's width the films' letters are ~7 px and the system font switches to its optical «text» cut, 4–9 % wider
   than the desktop drawing every box was measured on (Fable, 23-11: bubbles and amounts ran out of their boxes). A touch
   of tracking takes the difference back in both engines (within 0–4 % of the desktop). Not font-optical-sizing:none as
   well: WebKit obeys it AND the tracking and squeezes the words 11–21 % («Hola,Laura»). */
@media (max-width:600px),(max-width:932px) and (max-height:500px){
  .dt-film .rw{letter-spacing:-.03em}
  /* the titles and figures that carry their own tracking get the same -.03em on top (Fable, 23-11: 8–11 % wider) */
  .dt-film .rw :is(.dfa-t,.ddg-who,.ddg-t,.ddg-v,.ddg-ct,.dav-t,.dll-h,.dll-num,.dat-t,.dsi-pn,.dsi-ttl,.dcl-t,.dcl-hi,.n-logo,.p-logo){letter-spacing:-.05em}
  .dt-film .rw :is(.dfa-n,.dav-time,.p-title){letter-spacing:-.06em}
}
.dt-film .loop-cap span{text-wrap:balance}

/* A short window (a laptop at 720 px): the same screen, tighter */
@media (min-width:901px) and (max-height:820px){
  .dt-hero{padding-block:20px 24px}
  .dt-copy h1{font-size:clamp(34px,3.6vw,52px)}
  .dt-copy .lead{margin-top:12px;font-size:16px}
  .dt-steps{gap:9px;margin-top:18px}
  .dt-copy .actions{margin-top:20px}
}
/* Tablet and phone: one column, the film between the lead and the steps it tells */
@media (max-width:900px){
  .dt-hero{grid-template-columns:minmax(0,1fr);gap:0;min-height:0;padding-block:28px 12px}
  .dt-copy{display:contents}
  .dt-copy .eyebrow{order:1}
  .dt-copy h1{order:2}
  .dt-copy .lead{order:3}
  .dt-film{order:4;margin-top:22px}
  .dt-steps{order:5;max-width:none;margin-top:22px}
  .dt-copy .actions{order:6}
}
@media (max-width:760px){
  .dt-notes ul{grid-template-columns:minmax(0,1fr);gap:20px}
  .dt-notes+.faq-section{padding-top:48px}
}
/* A phone on its side (≤ 932 × 500; Alberto, 23-11-2026: «que se vea bien en cada resolución»): below the lead the film never
   fitted the short screen whole. Copy and film go side by side again; the film is as large as the screen's height allows,
   whole with its caption, and stays in view while the steps beside it are read. Its camera is the phone's (the films'
   own max-width:600px blocks say the same), closer than the desktop's, for letters this small. */
@media (max-width:932px) and (max-height:500px){
  .dt-hero{grid-template-columns:minmax(0,1fr) auto;gap:0 28px;align-items:start;min-height:0;padding-block:20px 16px}
  .dt-copy{display:block}
  .dt-copy h1{font-size:30px}
  .dt-copy .lead{margin-top:10px;font-size:15px}
  .dt-steps{gap:8px;margin-top:14px}
  .dt-copy .actions{margin-top:16px}
  .dt-film{order:0;margin-top:0;position:sticky;top:calc(var(--hdr) + 10px);width:calc((100svh - var(--hdr) - 96px) * 4 / 3)}
  /* its caption a size down, so that beside so narrow a film it keeps to two lines and the whole film fits */
  .dt-film .loop-foot{margin-top:8px;gap:10px}
  .dt-film .loop-cap{font-size:13px}
  .dt-film .loop-note{margin-top:2px;font-size:11.5px}
}
/* the shortest of them (an old 4-inch phone, 568 × 320): a tighter top and a smaller caption, or the film's foot falls below */
@media (max-width:932px) and (max-height:340px){
  .dt-hero{padding-top:10px}
  .dt-film{top:calc(var(--hdr) + 6px)}
  .dt-film .loop-cap{font-size:12px}
}
/* An upright screen wider than 900 px (a 13-inch tablet, a turned monitor): filling the screen's height left ~300 px empty
   above the title and below the film (revisor, 23-11-2026); the hero hugs its content */
@media (min-width:901px) and (orientation:portrait){.dt-hero{min-height:0;padding-block:64px 48px}}
