/* ===== MarQenti · Prépa Bac Informatique — code layer =====
   Layered AFTER /_assets/deck.css. Reuses its palette (--ink/--accent/--cream/--grey*),
   its fonts (Space Grotesk / Space Mono / Newsreader) and its 16:9 .stage cqh/cqw sizing.
   Palette rule: black · red · grey ONLY. No orange, no yellow.
   Notation rule: everything here renders the OFFICIAL convention (Sept 2024). */

/* ---- the signature pairing: Algorithme | Python ---------------------------- */
.dual{ display:grid; grid-template-columns:1fr 1fr; gap:2.2cqw; margin-top:2.4cqh; align-items:start; }
.dual.stack{ grid-template-columns:1fr; }          /* one above the other when a block is long */
.dual.wide-algo{ grid-template-columns:1.25fr 1fr; }

/* ---- code boxes ----------------------------------------------------------- */
.codebox{ display:flex; flex-direction:column; min-width:0; }
.codebox .hd{ font-family:'Space Mono',monospace; font-size:1.85cqh; letter-spacing:.2em;
  text-transform:uppercase; padding:.85cqh 1.4cqw; background:var(--ink); color:var(--cream); flex:none; }
.codebox.py .hd{ background:var(--accent); color:#fff; }
.codebox .code{ margin:0; background:#fff; border:1px solid rgba(14,14,14,.18); border-top:none;
  font-family:'Space Mono',monospace; font-size:2.25cqh; line-height:1.5; color:var(--ink);
  white-space:pre; overflow-x:auto; padding:1.5cqh 1.3cqw; }
.codebox.sm .code{ font-size:2cqh; line-height:1.42; }
.codebox.xs .code{ font-size:1.8cqh; line-height:1.38; }

/* a standalone code block (not paired) */
.codebox.solo{ margin-top:2.4cqh; max-width:86%; }

/* syntax accents — the ONLY colours allowed */
.kw{ color:var(--accent); font-weight:700; }        /* keywords: Si, Pour, Tant que, Retourner, def… */
.cm{ color:var(--grey); font-style:italic; }        /* comments */
.st{ color:var(--grey-d); }                          /* string literals */

/* ---- TDO / TDNT tables (required in the Problème) -------------------------- */
.tdo{ border-collapse:collapse; margin-top:2cqh; font-family:'Space Mono',monospace;
  font-size:2.1cqh; color:var(--body); }
.tdo caption{ font-family:'Space Mono',monospace; font-size:1.85cqh; letter-spacing:.18em;
  text-transform:uppercase; color:var(--accent); text-align:left; padding-bottom:.8cqh; }
.tdo th{ background:var(--ink); color:var(--cream); font-weight:400; font-size:1.85cqh;
  letter-spacing:.12em; text-transform:uppercase; padding:.85cqh 1.6cqw; text-align:left; }
.tdo td{ border:1px solid rgba(14,14,14,.2); padding:.75cqh 1.6cqw; background:#fff; }
.tdo td.obj{ color:var(--ink); font-weight:700; }

/* ---- table de trace (Ex.1 of the real paper) ------------------------------ */
.trace{ border-collapse:collapse; margin-top:2.2cqh; font-family:'Space Mono',monospace; font-size:2cqh; }
.trace th{ background:var(--grey-d); color:var(--cream); font-weight:400; font-size:1.8cqh;
  letter-spacing:.1em; padding:.75cqh 1.3cqw; }
.trace td{ border:1px solid rgba(14,14,14,.2); padding:.7cqh 1.3cqw; text-align:center;
  background:#fff; color:var(--body); }
.trace td.lab{ background:rgba(14,14,14,.05); text-align:left; color:var(--ink); font-weight:700; }
.trace td.hi{ background:rgba(195,0,30,.08); color:var(--accent); font-weight:700; }

/* ---- exercise card -------------------------------------------------------- */
.exo{ border-left:.7cqw solid var(--accent); background:rgba(14,14,14,.035);
  padding:1.9cqh 2.2cqw; margin-top:2.2cqh; }
.exo .eh{ display:flex; align-items:center; gap:1.4cqw; margin-bottom:1.1cqh; }
.exo .en{ font-family:'Space Mono',monospace; font-size:1.95cqh; letter-spacing:.16em;
  text-transform:uppercase; background:var(--ink); color:var(--cream); padding:.55cqh 1.3cqw; flex:none; }
.exo .pts{ font-family:'Space Mono',monospace; font-size:1.95cqh; font-weight:700; color:var(--accent); }
.exo .src{ font-family:'Space Mono',monospace; font-size:1.75cqh; color:var(--grey);
  margin-left:auto; text-transform:uppercase; letter-spacing:.1em; }
.exo .stmt{ font-family:'Newsreader',serif; font-size:2.9cqh; line-height:1.35; color:var(--body); max-width:100%; }
.exo .stmt b{ color:var(--ink); }
/* the real past-bac closer gets a heavier frame */
.exo.bac{ border-left-color:var(--ink); background:rgba(14,14,14,.06); }
.exo.bac .en{ background:var(--accent); }

/* ---- solution (reuses .reveal-target → auto-opens in print) ---------------- */
.sol{ margin-top:1.6cqh; border-left:.7cqw solid var(--ink); background:#fff;
  padding:1.6cqh 1.8cqw; }
.sol .st-title{ font-family:'Space Mono',monospace; font-size:1.85cqh; letter-spacing:.18em;
  text-transform:uppercase; color:var(--accent); margin-bottom:1cqh; }

/* ---- QCM / vrai-faux ------------------------------------------------------ */
.qcm{ margin-top:2.2cqh; display:flex; flex-direction:column; gap:1.3cqh; }
.qcm .row{ display:flex; gap:1.5cqw; align-items:flex-start;
  font-family:'Newsreader',serif; font-size:2.9cqh; line-height:1.3; color:var(--body); }
.qcm .box{ width:2.5cqh; height:2.5cqh; border:.25cqh solid var(--ink); flex:none; margin-top:.35cqh; }
.qcm .row.ok .box{ background:var(--accent); border-color:var(--accent); }

/* ---- small helpers -------------------------------------------------------- */
.legend{ font-family:'Space Mono',monospace; font-size:1.9cqh; color:var(--grey); margin-top:1.4cqh; }
.two{ display:grid; grid-template-columns:1fr 1fr; gap:2.2cqw; margin-top:2.2cqh; }

@media print{
  .codebox .code{ overflow:visible; white-space:pre-wrap; }
}
