/* Energy: Stores and Transfers deck. Layout and palette come from ../assets/companion-deck.css
   (the Year 9 palette); this file adds maths sizing, the interactive models in figures.js,
   the workbook's line drawings (.ef) at slide size, and the news slides of the Year 9 decks. */

/* ----- maths ----- */
mjx-container { line-height: 0; }
.eq-block .eq mjx-container { color: var(--hi); }
.eq-block .eq { font-size: 60px; }
.worked dd mjx-container, .q mjx-container, .points mjx-container { font-size: 100%; }

/* ----- the workbook's drawings on slides ----- */
.ef { --ef-ink: var(--ink); --ef-paper: var(--diagram-bg); }
.fig > svg.ef { position: absolute; inset: 0; width: 100%; height: 100%; }
/* Larger small and heading labels than the printed workbook, for reading from the back of the room. */
.ef text.sm { font-size: 13px; }
.ef text.lg { font-size: 18px; }
.fig-html { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.fig-html .ef-panel figcaption { margin-top: 8px; font-size: 24px; font-weight: 800; text-align: center; }
.bars3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; flex: 1; min-height: 0; }
.bars3 .fig { min-height: 0; }

/* ----- interactive models (data-widget) ----- */
.widget { display: flex; flex-direction: column; flex: 1; min-height: 0; gap: 12px; }
.dk-stage { position: relative; flex: 1; min-height: 0; }
.dk-stage > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.dk { font-family: Arial, Helvetica, sans-serif; overflow: visible; }
.dk text { fill: var(--ink); stroke: none; }
.dk .dk-label { font: 800 24px Arial, sans-serif; }
.dk .dk-label.hot { fill: #c2410c; }
.dk .dk-small { font: 700 20px Arial, sans-serif; fill: var(--muted); }
.dk .dk-tick { font: 600 19px Arial, sans-serif; fill: #4b5563; }
.dk .dk-ink, .dk .ink { stroke: var(--ink); stroke-width: 3; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.dk .solid { fill: var(--ink); }
.dk .dk-ink.thick { stroke-width: 6; }
.dk .dk-ink.thin { stroke-width: 1.6; }
.dk .dk-axis { stroke: var(--ink); stroke-width: 4; fill: none; }
.dk .dk-grid { stroke: rgba(7, 22, 47, .1); stroke-width: 1.5; }
.dk .dk-guide { stroke: var(--ink); stroke-width: 2; stroke-dasharray: 8 7; fill: none; }
.dk .dk-total { stroke: var(--ink); stroke-width: 3; stroke-dasharray: 10 8; }
.dk .dk-bar { stroke: var(--ink); stroke-width: 3; }
.dk .dk-bar.b0 { fill: var(--alt); }
.dk .dk-bar.b1 { fill: var(--cyan); }
.dk .dk-bar.b2 { fill: var(--hot); }
.dk .dk-bar.on { stroke-width: 5; }
.dk .dk-ramp { fill: #e7e2d4; }
.dk .dk-bob { fill: var(--hi); stroke: var(--ink); stroke-width: 4; }
.dk .dk-string { stroke: var(--ink); stroke-width: 3; }
.dk .dk-body { fill: var(--cyan); stroke: var(--ink); stroke-width: 4; stroke-linejoin: round; }
.dk .dk-wheel { fill: var(--ink); }
.dk .dk-lines path { stroke: var(--muted); stroke-width: 5; stroke-linecap: round; fill: none; stroke-dasharray: 26 18; animation: dk-whoosh var(--dur, 1.2s) linear infinite; }
.dk .dk-ruler { fill: #f3e2b3; stroke: var(--ink); stroke-width: 3; }
.dk .dk-mass { fill: #c9ced6; stroke: var(--ink); stroke-width: 2.5; }
.dk .dk-motor { fill: var(--alt); stroke: var(--ink); stroke-width: 3; }
.dk .dk-pointer { stroke: #c2410c; stroke-width: 3; }
.dk .dk-cross { stroke: #1479a8; stroke-width: 4; stroke-linecap: round; fill: none; }
.dk .dk-cross.odd { stroke: #c2410c; }
.dk .dk-fit { stroke: #1479a8; stroke-width: 3; fill: none; }
.dk .dk-rod { fill: #c9ced6; stroke: var(--ink); stroke-width: 3; }
.dk .dk-pin { stroke: var(--ink); stroke-width: 3; }
.dk .dk-wax { fill: #fff3c4; stroke: var(--ink); stroke-width: 2; }
.dk .dk-rod-hot { fill: var(--hot); opacity: 0.55; }
.dk .dk-flame { fill: var(--hot); stroke: var(--ink); stroke-width: 2.5; }
.dk .dk-flame-core { fill: #ffd36b; opacity: 0; transition: opacity .3s; }
.dk .dk-flame-g.lit .dk-flame-core { opacity: 1; }
@keyframes dk-whoosh { to { stroke-dashoffset: -88; } }
.dk-controls { display: flex; flex-wrap: wrap; gap: 12px; }
.dk-controls button { min-height: 52px; padding: 8px 20px; border: 2px solid var(--ink); background: var(--card); font: 900 24px Arial, sans-serif; box-shadow: 4px 4px 0 rgba(7, 22, 47, .15); }
.dk-controls button:hover { background: var(--accent); }
.dk-controls button[aria-pressed="true"] { background: var(--accent); }
.dk-readout { min-height: 46px; margin: 0; padding: 8px 14px; border-left: 6px solid var(--accent); background: var(--note); font-size: 25px; font-weight: 700; line-height: 1.35; }
.thumb-slide .dk-lines path { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .dk .dk-lines path { animation: none; }
  .dk .dk-bar { transition: none; }
}
@media print {
  .dk-controls, .dk-readout { display: none; }
}

/* ----- nine lessons ----- */
.missions.nine { grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); }
.missions.nine .mission { padding: 12px 18px; }
.missions.nine .mission h3 { margin-top: 8px; font-size: 27px; }
.missions.nine .mission p { margin-top: 4px; font-size: 24px; }
.missions.nine .lesson-icon { width: 54px; height: 54px; font-size: 19px; }

/* ----- store cards ----- */
.stores { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.stores.main { grid-template-columns: repeat(5, 1fr); }
.store { padding: 14px 18px; border: 2px solid var(--ink); background: var(--card); box-shadow: 6px 6px 0 var(--accent); }
.store b { display: block; font: 900 26px/1.05 var(--display); text-transform: uppercase; letter-spacing: -.02em; }
.store span { display: block; margin-top: 8px; font-size: 24px; color: var(--muted); line-height: 1.25; }
.store i { display: block; margin-top: 6px; font-size: 24px; font-style: normal; font-weight: 800; }

/* ----- toolkit slide ----- */
.toolkit { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.tool { padding: 12px 14px; border: 2px solid var(--ink); background: var(--card); box-shadow: 5px 5px 0 var(--accent); }
.tool .eq { font-size: 30px; }
.tool p { margin: 6px 0 0; font-size: 19px; color: var(--muted); line-height: 1.3; }
.tool .re { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line); font-size: 24px; font-weight: 700; }

/* ----- ring boxes, as in the workbook ----- */
.ring-box { display: inline-flex; vertical-align: middle; margin: 0 6px; border: 2px solid var(--ink); background: #fff; }
.ring-box > span { padding: 2px 14px; border-left: 1px solid var(--line); font-weight: 800; }
.ring-box > span:first-child { border-left: 0; }
.ring-box > span.right.step.shown { outline: 3px solid #1479a8; outline-offset: -3px; border-radius: 999px; color: #1479a8; opacity: 1; transform: none; }
.ring-box > span.right.step:not(.shown) { opacity: 1; transform: none; }

/* ----- news slides (from the Year 9 Work Like a Physicist deck) ----- */
.masthead { display: flex; align-items: center; gap: 22px; padding-bottom: 14px; border-bottom: 6px double var(--ink); }
.masthead .paper-name { font: 900 44px/1 var(--display); letter-spacing: -.05em; text-transform: uppercase; }
.masthead .dateline { margin-left: auto; font: 900 20px Arial, sans-serif; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.masthead .edition { padding: 6px 14px; border: 2px solid var(--ink); border-radius: 999px; background: var(--accent); font: 900 20px Arial, sans-serif; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
.front { display: grid; grid-template-columns: 690px 1fr; gap: 50px; margin-top: 28px; }
.news-photo { margin: 0; min-height: 0; }
.news-photo img { display: block; width: 100%; height: auto; max-height: 520px; object-fit: cover; border: 2px solid var(--ink); box-shadow: 10px 10px 0 var(--accent); background: #05060c; }
.news-photo figcaption { margin-top: 22px; font-size: 24px; font-weight: 700; line-height: 1.3; }
.news-photo .credit { display: block; margin-top: 5px; font-size: 15px; font-weight: 600; color: var(--muted); text-decoration: none; }
.news-photo .credit a { color: inherit; }
.story { display: flex; flex-direction: column; min-height: 0; }
.story .kicker { align-self: flex-start; margin: 0; padding: 6px 13px; background: var(--ink); color: var(--paper); font: 900 20px Arial, sans-serif; letter-spacing: .2em; text-transform: uppercase; }
.story h2 { margin: 18px 0 20px; font-size: 62px; }
.story .standfirst { margin: 0; font-size: 29px; font-weight: 700; line-height: 1.3; }
.story .follow-up { margin: 22px 0 0; padding: 12px 18px 14px; border-left: 8px solid var(--accent); background: var(--card); font-size: 26px; line-height: 1.3; }
.story .ask { margin: auto 0 0; padding: 14px 20px 16px; border: 2px solid var(--ink); background: var(--accent); font-size: 28px; font-weight: 800; line-height: 1.2; box-shadow: 6px 6px 0 rgba(7, 22, 47, .12); }
.story .follow-up b, .story .ask b { display: block; margin-bottom: 5px; font: 900 20px Arial, sans-serif; letter-spacing: .18em; text-transform: uppercase; }
.story .follow-up b { color: var(--muted); }

/* ----- small layout helpers ----- */
.table-wrap { flex: 1; min-height: 0; }
.data.five td, .data.five th { font-size: 25px; padding: 9px 12px; }
.panel .widget { margin-top: 10px; }

/* Two worked examples share a column on many slides, so the frames are tighter than the shared ones. */
.worked .wq { padding: 10px 18px; font-size: 26px; }
.worked dt { padding: 8px 16px; font-size: 22px; }
.worked dd { padding: 8px 16px; font-size: 28px; }
.col { gap: 18px; }
.bounce-formula > span:first-child { margin-bottom: 22px; }
.bounce-worked dl { grid-template-columns: 140px 1fr; }
.bounce-worked dd { font-size: 26px; }
.data.five td, .data.five th { font-size: 29px; padding: 14px 16px; }
.stores { align-content: center; }
.store { padding: 18px 20px; }
.store b { font-size: 30px; }
.store span { font-size: 25px; }
.store i { font-size: 25px; }
.tool .eq { font-size: 34px; }
.tool p { font-size: 24px; }
.tool .re { font-size: 24px; }

/* ----- models, second pass: fixed sizes, so nothing rescales when a button is pressed ----- */
.dk-controls { flex: none; }
.dk-readout { flex: none; height: 84px; overflow: hidden; display: flex; align-items: center; flex-wrap: wrap; gap: 0 10px; }
.case-card .widget .dk-controls button { min-height: 48px; font-size: 22px; padding: 6px 14px; }
.dk .dk-sky { fill: #e3f1f8; }
.dk .dk-trunk { fill: #8a5a35; stroke: var(--ink); stroke-width: 2.5; }
.dk .dk-canopy { fill: #6fae4f; stroke: var(--ink); stroke-width: 3; }
.dk .dk-road { fill: #5d6470; }
.dk .dk-roadline { fill: #fff; }
.dk .dk-window { fill: #cfe9f6; stroke: var(--ink); stroke-width: 3; stroke-linejoin: round; }
.dk .dk-headlight { fill: #ffe066; stroke: var(--ink); stroke-width: 2.5; }
.dk .dk-taillight { fill: #e0422a; stroke: var(--ink); stroke-width: 2; }
.dk .dk-hub { fill: #c9ced6; }
.dk .dk-dim { stroke: var(--ink); stroke-width: 3; fill: none; }
.dk .dk-head { fill: var(--ink); }
.dk .dk-head.hot { fill: #c2410c; }
.dk .dk-pull { stroke: #c2410c; stroke-width: 5; }
.dk .dk-wall { fill: #c9ced6; stroke: var(--ink); stroke-width: 2; }
.dk .dk-block { fill: var(--alt); stroke: var(--ink); stroke-width: 4; }
.dk .dk-pulley { fill: #c9ced6; stroke: var(--ink); stroke-width: 3; }
.dk .dk-clock { font: 900 30px Arial, sans-serif; }
.dk .dk-shelf { fill: #c8a46a; stroke: var(--ink); stroke-width: 3; }
.dk .dk-ghost { fill: none; stroke: var(--ink); stroke-width: 2.5; stroke-dasharray: 7 6; }
.dk .dk-bookbody { fill: var(--hot); stroke: var(--ink); stroke-width: 3; }
.dk .dk-ball { fill: var(--hot); stroke: var(--ink); stroke-width: 3; }
.dk .dk-sea { fill: #bfe3f2; stroke: var(--ink); stroke-width: 2; }
.dk .dk-hill { fill: #cfe8b0; stroke: var(--ink); stroke-width: 3; stroke-linejoin: round; }
.dk .dk-dot { fill: var(--ink); }
.dk .dk-steps { fill: #e7e2d4; stroke: var(--ink); stroke-width: 3; stroke-linejoin: round; }
.dk .dk-head-c { fill: var(--diagram-bg); stroke: var(--ink); stroke-width: 3; }
/* Text in the models must read from the back of a classroom: sizes are in drawing units. */
.dk .dk-label { font-size: 30px; }
.dk .dk-small { font-size: 25px; }
.dk .dk-tick { font-size: 22px; }
.dk .dk-big { font: 800 34px Arial, sans-serif; }
/* One store per chart: every bar the same colour. */
.dk.one-store .dk-bar { fill: var(--cyan); }
.dk.one-store.elastic .dk-bar { fill: var(--alt); }
.missions.nine .mission p.spec-ref { padding-top: 4px; font-size: 13px; }
