/* ==========================================================================
   GITHUB EPISODE PAGES (preview 7) — one page per episode, 7 x de / en / he.
   Loaded AFTER ../kurse.css, which already carries the tokens, the top bar, the
   exit sign, the station strip, the YouTube facade and the footer. This file only
   adds what an episode page has and the overview does not:
   strip (stops as links) · video · lesson · shot (screenshots with arrows) · task · links · pager
   Sections are named like the data-sid of the HTML they style.
   ========================================================================== */

/* ======== PAGE — undo the overview's episode-card rule on <body class="github ep"> ======== */
/* kurse.css styles the overview's cards as .ep{ overflow:hidden }. The same class sits on this page's <body>, and
   overflow:hidden on <body> goes to the viewport: no wheel, swipe or key could scroll an episode (Beri 2026-10-19,
   measured with hub/tests/scroll.cjs). Only the overflow is undone here, the page keeps its look. */
body.ep{ overflow:visible; }

/* ======== SIGN — a little tighter than on the overview: the video must fit the first screen ======== */
.ep .sign h1{ margin:.5rem 0 .1rem; font-size:clamp(1.9rem,4.6vw,3rem); }

/* ======== STRIP — the seven stops, this time each one is a link to its episode ======== */
/* kurse.css draws the line; --k (set inline) is the lit stop, so the coloured track runs up to "you are here". */
.ep .strip-wrap{ margin:1.1rem 0 0; padding:.6rem 0 .5rem; }
.ep .stop a{ display:grid; justify-items:center; gap:.35rem; min-height:44px; text-decoration:none; color:inherit; border-radius:8px; }
.ep .stop a:hover .dot{ background:var(--lit); }
.ep .stop a:hover .lb{ color:var(--ink); }
.ep .stop a[aria-current] .dot{ background:var(--c); box-shadow:0 0 0 5px var(--lit); }
.ep .stop a[aria-current] .lb{ color:var(--ink); }

/* ======== VIDEO — the episode on top, as big as still fits the first screen ======== */
.video{ margin:.4rem 0 0; max-width:46rem; }
/* the local poster sits under the facade; the bottom fades dark so the white caption stays readable */
.ep .yt{ background-color:var(--ink); background-size:cover; background-position:center; border-radius:12px; overflow:hidden; }
/* the stills carry the video's own burned-in subtitle in their bottom fifth: a solid ink band covers it,
   so the caption never sits on top of other text */
.ep .yt::after{ content:""; position:absolute; inset:auto 0 0; height:30%; background:var(--ink); box-shadow:0 -18px 24px -6px rgba(27,31,42,.55); }
.ep .yt .cap{ z-index:1; color:#fff; font-weight:600; }
.ep .yt .play{ position:relative; z-index:1; box-shadow:0 6px 24px rgba(27,31,42,.35); }
.ep .video iframe{ display:block; width:100%; aspect-ratio:16/9; border:0; border-radius:12px; }
.yt-links{ margin:.6rem 0 0; font-size:.9375rem; }
.yt-links a{ display:inline-block; padding:.35rem 0; font-weight:600; text-underline-offset:3px; }
.ep .yt-note{ margin:.15rem 0 0; }

/* ======== LESSON — short sections a beginner can read top to bottom ======== */
.lesson{ margin:2.4rem 0 0; }
.part{ max-width:40rem; margin:0 0 2.2rem; }
.part p{ margin:0 0 .9rem; }
.part .aside{ color:var(--muted); font-size:.9375rem; }
.steps{ margin:0 0 1rem; padding-inline-start:1.4rem; }
.steps li{ margin:0 0 .5rem; padding-inline-start:.2rem; }
/* a GitHub button or label, written the way it reads on screen (English UI, also on the Hebrew page) */
.ui{ display:inline-block; padding:0 .38em; border:1.5px solid rgba(27,31,42,.28); border-radius:6px; background:#fff;
  font:600 .92em/1.45 var(--sans); white-space:nowrap; }

/* ======== SHOT — a real GitHub screenshot, cropped, with numbered arrows ======== */
/* Every position is a % of the crop (written by github-episodes-src/shots.py), so the arrows stay on
   their element at any width. The frame is always LTR: a screenshot does not mirror on the Hebrew page. */
.shot{ margin:1.2rem 0 1.6rem; max-width:62rem; overflow-x:clip; }
.frame{ position:relative; direction:ltr; width:100%; background:#fff; border:1.5px solid rgba(27,31,42,.18); border-radius:10px;
  box-shadow:0 10px 30px -18px rgba(27,31,42,.45); }
/* the width/height attributes reserve the space (no layout shift); the frame wraps the image exactly */
.frame img{ display:block; width:100%; height:auto; border-radius:9px; }
/* the outline around the element to click */
.hl{ position:absolute; border:3px solid var(--pin); border-radius:7px; pointer-events:none; }
/* the marker: its anchor point IS the arrow tip; --a turns it so the badge sits where there is room */
.mk{ position:absolute; width:0; height:0; transform:rotate(var(--a)); pointer-events:none; }
.mk i{ position:absolute; left:0; top:-2px; width:34px; height:4px; background:var(--pin); border-radius:2px; }
.mk i::before{ content:""; position:absolute; left:-2px; top:-5px; border:7px solid transparent; border-left:0; border-right:10px solid var(--pin); }
.mk b{ position:absolute; left:34px; top:-14px; display:grid; place-items:center; width:28px; height:28px; border-radius:50%;
  background:var(--pin); color:#fff; font:700 .9375rem/1 var(--sans); box-shadow:0 0 0 3px #fff;
  transform:rotate(calc(-1 * var(--a))); }
.shot figcaption{ margin:.7rem 0 0; max-width:40rem; font-size:.9375rem; }
.shot figcaption ol{ margin:0; padding:0; list-style:none; counter-reset:mk; display:grid; gap:.35rem; }
.shot figcaption li{ counter-increment:mk; display:grid; grid-template-columns:1.6rem 1fr; gap:.55rem; align-items:start; }
.shot figcaption li::before{ content:counter(mk); display:grid; place-items:center; width:1.5rem; height:1.5rem; margin-top:.05rem; border-radius:50%;
  background:var(--pin); color:#fff; font:700 .8125rem/1 var(--sans); }

/* ======== TASK — the one-minute job at the end of every episode ======== */
.task{ max-width:40rem; margin:2.6rem 0 0; padding:1.1rem 1.3rem 1.2rem; background:var(--card); border-radius:14px; border-inline-start:8px solid var(--c); }
.task h2{ font-size:1.3rem; margin:0 0 .4rem; }
.task p{ margin:0; }

/* ======== LINKS — real pages only (GitHub sign-up, GitHub Docs, the demo repo) ======== */
.links{ max-width:40rem; margin:2.4rem 0 0; }
.links h2{ font-size:1.3rem; }
.links ul{ margin:0; padding:0; list-style:none; display:grid; gap:.5rem; }
.links li{ padding-inline-start:1.3rem; position:relative; }
.links li::before{ content:""; position:absolute; inset-inline-start:0; top:.55em; width:9px; height:9px; border-radius:50%; border:3px solid var(--c); background:#fff; }
.links a{ font-weight:600; text-underline-offset:3px; overflow-wrap:anywhere; }
.lang-note{ color:var(--muted); font-size:.875rem; }

/* ======== PAGER — previous / next stop, and back to all episodes ======== */
.pn{ display:grid; grid-template-columns:1fr 1fr; gap:.8rem; margin:3rem 0 0; max-width:46rem; }
.pn a{ display:grid; gap:.15rem; min-height:48px; padding:.8rem 1rem; background:var(--card); border:2px solid transparent; border-radius:12px;
  text-decoration:none; font-weight:600; transition:border-color .2s ease; }
.pn a:hover{ border-color:var(--c); }
.pn a span{ font-size:.8125rem; color:var(--muted); font-weight:600; }
.pn-next{ grid-column:2; text-align:end; }
.pn-all{ grid-column:1 / -1; justify-items:center; }

/* ======== PHONE ======== */
@media (max-width:700px){
  .ep .sign h1{ font-size:1.85rem; }
  .ep .strip-wrap{ margin-top:.8rem; }
  .lesson{ margin-top:1.8rem; }
  /* smaller markers: on a phone a wide crop shrinks to a third, the badge must not leave the picture */
  .mk i{ width:16px; height:3px; top:-1.5px; }
  .mk i::before{ top:-4.5px; border-width:6px; border-left:0; border-right-width:8px; }
  .mk b{ left:16px; top:-11px; width:22px; height:22px; font-size:.75rem; box-shadow:0 0 0 2px #fff; }
  .hl{ border-width:2px; border-radius:4px; }
  .pn{ grid-template-columns:1fr; }
  .pn-next{ grid-column:auto; }
}
