/* ==========================================================================
   Walkthrough page (/theatre/<id>): the lights-down stage (video or written outline),
   the steps, the side boxes and the order quiz. Scoped under .walkthrough.
   ========================================================================== */

.walkthrough .stage-wrap { background: var(--theatre); color: #E9DEE6; padding: 28px 0 56px; }
.walkthrough .stage-top { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; margin-bottom: 26px; }
.walkthrough .stage-top h1 { font-size: clamp(34px, 5vw, 64px); color: #F8F2F7; max-width: 20ch; margin-top: 14px; }
.walkthrough .stage-top .crumbs, .walkthrough .stage-top .crumbs a { color: #BFAEBA; }
.walkthrough .stage-top .crumbs a:hover { color: #fff; }
.walkthrough .topmeta { color: #BFAEBA; margin: 0; }
.walkthrough .stage-flag { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 16px 0 0; font-size: 14px; color: #D9CBD5; }
.walkthrough .stage-flag .badge.sample { color: #F2B77A; background: #33241A; border-color: rgba(242, 183, 122, .4); }

/* Video */
.walkthrough .player { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; }
@media (max-width: 1000px) { .walkthrough .player { grid-template-columns: 1fr; } }
.walkthrough .screen { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-m); overflow: hidden; background: #09050A; border: 1px solid var(--theatre-line); }
.walkthrough .screen iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.walkthrough .screen-msg { position: absolute; inset: 0; display: grid; place-content: center; gap: 12px; padding: 24px; text-align: center; color: #E9DEE6; }
.walkthrough .screen-msg p { margin: 0 auto; max-width: 46ch; }
.walkthrough .screen-msg a { color: #fff; }

.walkthrough .controls { display: flex; align-items: center; gap: 14px; margin-top: 14px; }
.walkthrough .controls[hidden] { display: none; }
.walkthrough .pbtn { width: 48px; height: 48px; flex: none; border-radius: 50%; border: 0; background: var(--monitor); color: var(--theatre); display: grid; place-items: center; cursor: pointer; transition: transform .3s var(--ease-out); }
.walkthrough .pbtn:hover { transform: scale(1.06); }
.walkthrough .pbtn:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.walkthrough .pbtn svg { width: 16px; height: 16px; }
.walkthrough .bar-wrap { flex: 1; display: flex; align-items: center; gap: 14px; min-width: 0; }
.walkthrough .time { font-family: var(--f-mono); font-size: 12px; color: #BFAEBA; min-width: 100px; text-align: end; }
/* Chapter bar: an incision with a stitch at each chapter. 44px tall, so it is a real touch target. */
.walkthrough .bar { position: relative; flex: 1; height: 44px; cursor: pointer; touch-action: none; border-radius: 8px; }
.walkthrough .bar:focus-visible { outline: 2px solid var(--monitor); outline-offset: 4px; }
.walkthrough .bar .rail { position: absolute; left: 0; right: 0; top: 21px; height: 2px; background: var(--theatre-line); border-radius: 2px; }
.walkthrough .bar .fill { position: absolute; left: 0; top: 21px; height: 2px; background: var(--monitor); border-radius: 2px; width: 0; }
.walkthrough .bar .knob { position: absolute; top: 14px; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 5px rgba(231, 179, 221, .25); left: 0; }
.walkthrough .bar:focus-visible .knob { box-shadow: 0 0 0 6px rgba(231, 179, 221, .55); }
.walkthrough .bar .tick { position: absolute; top: 11px; width: 2px; height: 22px; margin-left: -1px; background: #7C6479; transform: rotate(22deg); border-radius: 2px; transition: background .3s; }
.walkthrough .bar .tick.passed { background: var(--monitor); }
@media (max-width: 600px) {
  .walkthrough .controls { align-items: flex-start; }
  .walkthrough .bar-wrap { flex-direction: column; align-items: stretch; gap: 0; }
  .walkthrough .time { text-align: start; min-width: 0; }
}
.walkthrough .storyboard-note { font-size: 14px; color: #BFAEBA; margin: 12px 0 0; }
.walkthrough .storyboard-note a { color: #E9DEE6; }
.walkthrough .storyboard-note strong { color: #E9DEE6; font-weight: 500; }

.walkthrough .chapters { background: var(--theatre-2); border: 1px solid var(--theatre-line); border-radius: var(--r-m); padding: 8px; max-height: 560px; overflow: auto; }
.walkthrough .chapters h2 { font-family: var(--f-mono); font-size: 11px; font-weight: 400; letter-spacing: .08em; text-transform: uppercase; color: #BFAEBA; padding: 12px 12px 8px; margin: 0; }
.walkthrough .ch-list { list-style: none; margin: 0; padding: 0; }
.walkthrough .ch-list li { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; padding: 10px 12px; color: #D9CBD5; align-items: baseline; }
.walkthrough .ch-list li:has(.ch) { padding: 0; display: block; }
.walkthrough .ch { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; width: 100%; text-align: start; background: none; border: 0; padding: 12px; border-radius: 10px; cursor: pointer; color: #D9CBD5; transition: background .25s; align-items: baseline; font: inherit; }
.walkthrough .ch:hover { background: #2A1C2A; }
.walkthrough .ch:focus-visible { outline: 2px solid var(--monitor); outline-offset: -2px; }
.walkthrough .n { font-family: var(--f-mono); font-size: 11px; color: #A8949F; }
.walkthrough .tt { font-size: 15px; }
.walkthrough .tm { font-family: var(--f-mono); font-size: 11px; color: #A8949F; }
.walkthrough .ch[aria-current="step"] { background: #2A1C2A; color: #fff; box-shadow: inset 3px 0 0 var(--monitor); }
.walkthrough .ch[aria-current="step"] .n { color: var(--monitor); }
.walkthrough .ch.seen .n::after { content: " ✓"; color: var(--monitor); }

/* Written outline (no video) */
.walkthrough .outline-intro { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; align-items: stretch; }
@media (max-width: 860px) { .walkthrough .outline-intro { grid-template-columns: 1fr; } }
.walkthrough .outline-photo { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-m); overflow: hidden; background: #09050A; border: 1px solid var(--theatre-line); }
.walkthrough .outline-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .85; }
.walkthrough .outline-photo .show-credit { right: 8px; bottom: 8px; max-width: calc(100% - 16px); background: rgba(19, 12, 21, .62); color: rgba(255, 255, 255, .85); padding: 3px 7px; border-radius: 4px; text-shadow: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.walkthrough .outline-card { background: var(--theatre-2); border: 1px solid var(--theatre-line); border-radius: var(--r-m); padding: clamp(20px, 3vw, 32px); display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.walkthrough .outline-card .label { color: #D9CBD5; }
.walkthrough .outline-card p { margin: 0; color: #D9CBD5; max-width: 46ch; }
.walkthrough .outline-card .outline-warn { color: #F2B77A; }
.walkthrough .outline-progress { font-family: var(--f-mono); font-size: 12px; color: var(--monitor) !important; }
.walkthrough .outline-card .btn { margin-top: auto; }

/* Body */
.walkthrough .body-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 64px; padding: 72px 0 40px; }
@media (max-width: 1000px) { .walkthrough .body-grid { grid-template-columns: 1fr; gap: 40px; } }
.walkthrough .dek { font-family: var(--f-display); font-size: clamp(24px, 2.6vw, 34px); line-height: 1.25; letter-spacing: -0.01em; margin: 0 0 40px; }
.walkthrough .steps-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.walkthrough .steps-head h2 { margin: 0; font-weight: 400; }
.walkthrough .read-count { color: var(--muted); margin: 0; }
.walkthrough .steps { list-style: none; margin: 18px 0 0; padding: 0; }
.walkthrough .steps li { display: grid; grid-template-columns: 70px 1fr; gap: 20px; padding: 24px 0; border-top: 1px solid var(--line); scroll-margin-top: calc(var(--head-h, 69px) + 20px); }
@media (max-width: 520px) { .walkthrough .steps li { grid-template-columns: 44px 1fr; gap: 14px; } }
.walkthrough .steps .mono { color: var(--iodine); padding-top: 6px; }
.walkthrough .steps h3 { margin-bottom: 6px; }
.walkthrough .steps p { color: var(--ink-2); margin: 0; }
.walkthrough .steps li.read .mono::after { content: " ✓"; }
.walkthrough .steps li.target { background: linear-gradient(90deg, var(--iodine-soft), transparent 70%); }
.walkthrough .step-tools { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 8px; }
.walkthrough .step-tools:empty { display: none; }
.walkthrough .step-tools button { background: none; border: 0; padding: 0; font: inherit; font-size: 14px; color: var(--drape); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; min-height: 44px; display: inline-flex; align-items: center; gap: 6px; }
.walkthrough .step-tools button svg { width: 14px; height: 14px; }
.walkthrough .step-tools button[aria-pressed="true"] { color: var(--ok); text-decoration: none; }
.walkthrough .edu-note { font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 18px; margin: 0; }

.walkthrough aside .box { border: 1px solid var(--line); border-radius: var(--r-m); padding: 22px; background: var(--card); margin-bottom: 16px; }
.walkthrough aside h2 { font-family: var(--f-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; font-weight: 400; color: var(--muted); margin: 0 0 14px; }
.walkthrough aside ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; font-size: 15px; }
.walkthrough aside ul li { padding-inline-start: 18px; position: relative; }
.walkthrough aside ul li::before { content: ""; position: absolute; inset-inline-start: 0; top: .65em; width: 8px; height: 1.5px; background: var(--drape); transform: rotate(-30deg); }
.walkthrough aside .pitfall ul li::before { background: var(--iodine); }
.walkthrough aside p { margin: 0; font-size: 15px; }
.walkthrough aside .sub, .walkthrough .sub { color: var(--muted); font-size: 14px; }
.walkthrough aside .refs { margin: 12px 0 0; padding-inline-start: 18px; font-size: 14px; display: grid; gap: 6px; }
.walkthrough .faculty { display: flex; gap: 14px; align-items: center; }
.walkthrough .avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--drape-soft); display: grid; place-items: center; font-family: var(--f-display); font-size: 20px; color: var(--drape); flex: none; object-fit: cover; }

/* Check yourself: order the steps */
.walkthrough .quiz { background: var(--paper-2); border-radius: var(--r-l); padding: clamp(24px, 4vw, 48px); margin: 20px 0 80px; }
.walkthrough .quiz h2 { font-size: clamp(30px, 3.6vw, 46px); margin: 14px 0 10px; }
.walkthrough .quiz-lede { color: var(--muted); max-width: 60ch; }
.walkthrough .quiz-state { color: var(--muted); margin: 24px 0 0; }
.walkthrough .qlist { list-style: none; padding: 0; margin: 26px 0; display: grid; gap: 8px; }
.walkthrough .qlist li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 10px 10px 16px; transition: border-color .3s, background .3s; }
.walkthrough .qlist li.ok { border-color: var(--ok); background: var(--ok-soft); }
.walkthrough .qlist li.bad { border-color: var(--iodine); background: var(--iodine-soft); border-style: dashed; }
.walkthrough .qmark { display: flex; align-items: center; gap: 6px; font-family: var(--f-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; min-width: 0; }
.walkthrough .qmark:empty { display: none; }
.walkthrough .qmark svg { width: 14px; height: 14px; flex: none; }
.walkthrough li.ok .qmark { color: var(--ok); }
.walkthrough li.bad .qmark { color: var(--iodine); }
.walkthrough .qlist .pos { color: var(--muted); }
.walkthrough .qlist .qt { display: block; }
.walkthrough .qlist .why { display: block; font-size: 14px; color: var(--ink-2); margin-top: 4px; }
.walkthrough .qlist .arrows { display: flex; gap: 6px; }
.walkthrough .qlist button { width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); cursor: pointer; font-size: 16px; }
.walkthrough .qlist button:hover:not(:disabled) { border-color: var(--ink); }
.walkthrough .qlist button:disabled { opacity: .35; cursor: default; }
@media (max-width: 560px) {
  .walkthrough .qlist li { padding-inline-start: 12px; gap: 10px; }
}
.walkthrough .quiz-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.walkthrough .qres { font-weight: 500; min-height: 1.6em; margin: 0; }
.walkthrough .qres.ok { color: var(--ok); }
.walkthrough .related { padding-bottom: 100px; }
.walkthrough .related .sec-head { margin-bottom: 28px; }
.walkthrough .related h2 { font-size: clamp(28px, 3vw, 40px); }

@media (prefers-reduced-motion: reduce) {
  .walkthrough .pbtn:hover { transform: none; }
}
