/* La Bougie Académie. Layout: a classroom. Cream wall bands alternate with paper bands; the chalkboard (slate + wood frame) is the one loud object and carries lessons, quizzes and the pop quiz. */
:root {
  --wall: #E7D8BF; --paper: #FBF6EA; --ink: #2B2118; --muted: #5E5245; --line: #CDBB9F;
  --wood: #8A5A30; --green: #1B6B3F; --green-soft: #E3F3E9; --red: #C92A2D; --red-text: #A32226; --on-red: #FFFFFF; --yellow-soft: #FFF1C2;
  --board: #2F4A3E; --board-deep: #24392F; --chalk: #F4F1E8; --chalk-dim: #D9E6DE; --chalk-yellow: #F7D774; --chalk-green: #7CE3A0; --chalk-red: #F28B8B; --chalk-blue: #9CC9F5;
  --display: Caveat, "Comic Sans MS", cursive; --body: Poppins, system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --wall: #231B15; --paper: #32281F; --ink: #F3EADB; --muted: #C9B9A3; --line: #5A4939;
  --wood: #6E4724; --green: #7CE3A0; --green-soft: #1F3A2C; --red: #D8413F; --red-text: #F28B8B; --on-red: #FFFFFF; --yellow-soft: #4A3F1E;
  --board: #2A4337; --board-deep: #1E3028; color-scheme: dark } }
:root[data-theme="dark"] {
  --wall: #231B15; --paper: #32281F; --ink: #F3EADB; --muted: #C9B9A3; --line: #5A4939;
  --wood: #6E4724; --green: #7CE3A0; --green-soft: #1F3A2C; --red: #D8413F; --red-text: #F28B8B; --on-red: #FFFFFF; --yellow-soft: #4A3F1E;
  --board: #2A4337; --board-deep: #1E3028; color-scheme: dark }

html, body { margin: 0; }
body { background: var(--wall); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.55; }
* { box-sizing: border-box; }
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
h1, h2, h3 { text-wrap: balance; line-height: 1.12; }
a { color: var(--green); }
button, input, textarea, select { font-family: inherit; }
:focus-visible { outline: 3px solid var(--chalk-yellow); outline-offset: 3px; }
main:focus { outline: none; }
[hidden] { display: none !important; }

.wrap { max-width: 1040px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.wrap.narrow { max-width: 760px; }
.band { padding-block: 48px; }
.band.tight { padding-block: 28px; }
.band.paper { background: var(--paper); }
.band.slate { background: var(--board); color: var(--chalk); }
.stack { display: flex; flex-direction: column; gap: 24px; }
.stack.s { gap: 8px; } .stack.m { gap: 14px; }
.row { display: flex; flex-wrap: wrap; gap: 16px; }
.row > * { min-width: 0; }
.row.center { align-items: center; } .row.between { justify-content: space-between; }
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--green); }
.h1 { font-size: clamp(30px, 6vw, 44px); font-weight: 800; }
.h2 { font-size: clamp(24px, 5vw, 34px); font-weight: 800; }
.h3 { font-size: 20px; font-weight: 700; }
.lead { font-size: 17px; color: var(--muted); max-width: 62ch; }
.muted { color: var(--muted); } .fine { font-size: 14px; color: var(--muted); }
.prose { display: flex; flex-direction: column; gap: 12px; font-size: 17px; max-width: 66ch; }
.prose ul { padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.num { font-variant-numeric: tabular-nums; }

.btn { font-size: 17px; font-weight: 700; text-decoration: none; border: 0; border-radius: 999px; padding: 12px 24px; min-height: 50px; display: inline-flex; align-items: center; justify-content: center; text-align: center; cursor: pointer; }
.btn.red { background: var(--red); color: var(--on-red); }
.btn.ink { background: var(--ink); color: var(--paper); }
.btn.ghost { background: transparent; color: var(--ink); border: 2px solid var(--ink); }
.btn.chalk { background: var(--chalk-yellow); color: #2B2118; }
.btn.chalk-ghost { background: transparent; color: var(--chalk); border: 2px solid var(--chalk); }
.btn.small { font-size: 15px; min-height: 44px; padding: 8px 18px; }
.btn:disabled { opacity: 0.45; cursor: default; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--green); font-size: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; min-height: 44px; display: inline-flex; align-items: center; }
.slate .linkbtn, .board .linkbtn, .board a { color: var(--chalk-yellow); }

/* header + nav */
.preview { background: #2B2118; color: #FBF6EA; font-size: 14px; padding-block: 8px; }
header.top { background: var(--paper); border-bottom: 3px solid var(--wood); position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; }
header.top .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 16px; padding-block: 8px; }
.brand { font-weight: 800; font-size: 19px; color: var(--ink); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; gap: 10px; }
nav.main { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; max-width: 100%; }
@media (max-width: 720px) { header.top { position: static; } nav.main a { padding-inline: 10px; } }
nav.main a { color: var(--ink); text-decoration: none; font-weight: 500; font-size: 15px; padding: 8px 12px; min-height: 44px; display: inline-flex; align-items: center; white-space: nowrap; border-radius: 999px; }
nav.main a[aria-current="page"] { background: var(--ink); color: var(--paper); font-weight: 600; }
nav.main a.pill { background: var(--red); color: var(--on-red); font-weight: 700; padding-inline: 18px; }

/* chalkboard */
.board { background: var(--board); color: var(--chalk); border: 12px solid var(--wood); border-radius: 12px; box-shadow: 0 14px 26px rgba(40, 25, 10, 0.28); padding: 22px; }
.board.thin { border-width: 8px; padding: 18px; }
.chalk-title { font-family: var(--display); color: var(--chalk-yellow); line-height: 1.02; font-size: clamp(30px, 6vw, 42px); }
.chalk-big { font-family: var(--display); line-height: 0.95; font-size: clamp(52px, 12vw, 84px); }
.board .eyebrow { color: var(--chalk-yellow); }
.board .muted, .slate .muted, .board .fine { color: var(--chalk-dim); }
.chart { width: 100%; height: auto; display: block; max-width: 640px; margin: 0 auto; }
figure.fig { display: flex; flex-direction: column; gap: 8px; }
figure.fig figcaption { font-size: 14px; color: var(--chalk-dim); text-align: center; }

/* cards */
.card { background: var(--paper); border-radius: 14px; padding: 22px; display: flex; flex-direction: column; gap: 8px; }
.band.paper .card { background: var(--wall); }
.card.line { border: 2px solid var(--line); }
.card.strong { border: 3px solid var(--ink); }
.card.dash { border: 2px dashed var(--wood); background: transparent; }
a.card { text-decoration: none; color: var(--ink); }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.grid.wide { grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.tag { align-self: flex-start; font-weight: 700; font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; padding: 4px 12px; border-radius: 999px; background: var(--yellow-soft); color: var(--ink); }
.tag.ok { background: var(--green-soft); color: var(--green); }
.tag.lock { background: transparent; border: 2px dashed var(--line); color: var(--muted); }
.stat { font-size: 34px; font-weight: 800; line-height: 1; }
.bar { height: 12px; background: var(--line); border-radius: 999px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--green); border-radius: 999px; }
.board .bar { background: rgba(244, 241, 232, 0.2); } .board .bar > i { background: var(--chalk-yellow); }

/* chips + options */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font-size: 15px; font-weight: 600; color: var(--ink); background: var(--paper); border: 2px solid var(--ink); border-radius: 999px; padding: 8px 16px; min-height: 44px; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.board .chip { color: var(--chalk); background: transparent; border-color: var(--chalk); }
.board .chip[aria-pressed="true"] { background: var(--chalk-yellow); border-color: var(--chalk-yellow); color: #2B2118; }
.opts { display: flex; flex-direction: column; gap: 10px; }
.opt { font-size: 16px; font-weight: 600; text-align: left; color: var(--chalk); background: var(--board-deep); border: 2px solid var(--chalk); border-radius: 12px; padding: 12px 16px; min-height: 52px; cursor: pointer; }
.opt:disabled { cursor: default; opacity: 0.5; }
.opt.good { border-color: var(--chalk-green); color: var(--chalk-green); opacity: 1; }
.opt.bad { border-color: var(--chalk-red); color: var(--chalk-red); opacity: 1; }
.quiz { display: flex; flex-direction: column; gap: 16px; }
.quiz .meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; font-weight: 700; color: var(--chalk-yellow); font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; }
.quiz .q { font-family: var(--display); font-size: clamp(28px, 6vw, 38px); line-height: 1.08; }
.quiz .fb { font-size: 17px; }

/* forms */
label { font-weight: 600; font-size: 15px; }
.field { display: flex; flex-direction: column; gap: 6px; }
input[type="email"], input[type="text"], textarea { font-size: 16px; padding: 12px 16px; border: 2px solid var(--ink); border-radius: 12px; background: var(--paper); color: var(--ink); min-height: 48px; width: 100%; }
.band.paper input, .band.paper textarea, .card input, .card textarea { background: var(--wall); }
.check { display: flex; align-items: flex-start; gap: 12px; font-weight: 400; }
.check input { flex: 0 0 auto; width: 24px; height: 24px; margin: 2px 0 0; accent-color: var(--green); }
.status { font-weight: 600; color: var(--green); }
.status.err { color: var(--red-text); }
.note { background: var(--green-soft); border: 2px solid var(--green); border-radius: 12px; padding: 14px 16px; }
.warnbox { background: var(--yellow-soft); border-radius: 12px; padding: 14px 16px; }

/* lesson */
.steps { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; list-style: none; counter-reset: s; }
.steps li { counter-increment: s; font-size: 14px; font-weight: 600; padding: 6px 14px; border-radius: 999px; border: 2px solid var(--line); color: var(--muted); }
.steps li::before { content: counter(s) ". "; }
.steps li.done { border-color: var(--green); color: var(--green); background: var(--green-soft); }
.parts { display: flex; flex-wrap: wrap; gap: 24px; }
.parts .pic { flex: 0 1 220px; min-width: 0; margin: 0 auto; }
.parts .pic svg { width: 100%; height: auto; display: block; }
.parts .side { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.parts .explain { font-size: 17px; min-height: 5.5em; }
.parts .explain strong { color: var(--chalk-yellow); }
.memo { background: var(--paper); border: 2px dashed var(--wood); border-radius: 14px; padding: 22px; display: flex; flex-direction: column; gap: 10px; }
.band.paper .memo { background: var(--wall); }
.memo ul { padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.lessonrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 14px 16px; border-radius: 12px; background: var(--paper); text-decoration: none; color: var(--ink); min-height: 60px; }
.band.paper .lessonrow { background: var(--wall); }
.lessonrow .n { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%; background: var(--board); color: var(--chalk-yellow); font-family: var(--display); font-size: 24px; display: inline-flex; align-items: center; justify-content: center; }
.lessonrow .t { flex: 1 1 200px; min-width: 0; font-weight: 600; }

/* video cards */
.vid { text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 8px; }
.vid .thumb { background: var(--board); border: 6px solid var(--wood); border-radius: 8px; aspect-ratio: 16 / 10; max-width: 100%; padding: 12px; display: flex; flex-direction: column; justify-content: space-between; }
.vid .thumb .t { font-family: var(--display); font-size: 25px; line-height: 1.05; color: var(--chalk); }
.vid .thumb .b { display: flex; align-items: center; justify-content: space-between; }
.vid .play { width: 36px; height: 36px; border-radius: 50%; background: var(--chalk); display: inline-flex; align-items: center; justify-content: center; }
.vid .dur { font-size: 13px; font-weight: 600; color: var(--chalk); background: rgba(0, 0, 0, 0.35); padding: 3px 10px; border-radius: 999px; }
.vid .n { font-size: 13px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--green); }
.vid.quizcard .thumb { background: var(--board-deep); } .vid.quizcard .thumb .t { color: var(--chalk-red); }

details { background: var(--wall); border-radius: 12px; padding: 2px 20px; }
.band:not(.paper) details { background: var(--paper); }
summary { font-weight: 700; font-size: 17px; padding: 14px 0; cursor: pointer; min-height: 44px; }
details p { color: var(--muted); padding-bottom: 16px; }

.who { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; }
.who .photo { flex: 0 0 auto; width: 132px; height: 132px; border-radius: 50%; border: 3px dashed var(--wood); display: flex; align-items: center; justify-content: center; text-align: center; font-size: 14px; font-weight: 600; color: var(--muted); }

.warn { background: #2B2118; color: #FBF6EA; padding-block: 16px; font-size: 15px; }
footer.foot .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px; padding-block: 24px; }
footer.foot nav { display: flex; flex-wrap: wrap; gap: 0 20px; }
footer.foot a { min-height: 44px; display: inline-flex; align-items: center; }

/* pop quiz + modal */
.overlay { position: fixed; inset: 0; z-index: 30; background: rgba(27, 20, 14, 0.78); display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; padding: calc(env(safe-area-inset-top, 0px) + 56px) max(16px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 32px) max(16px, env(safe-area-inset-left, 0px)); }
.overlay .board { width: 100%; max-width: 600px; background: var(--board-deep); animation: pop 0.45s ease-out both; display: flex; flex-direction: column; gap: 16px; }
.stamp { align-self: flex-start; background: #C92A2D; color: #FFFFFF; font-weight: 800; font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase; padding: 6px 14px; border-radius: 999px; transform: rotate(-3deg); }
@keyframes pop { 0% { transform: scale(0.7) rotate(-3deg); opacity: 0; } 60% { transform: scale(1.04) rotate(1deg); opacity: 1; } 100% { transform: scale(1) rotate(0); } }
@media (prefers-reduced-motion: reduce) { .overlay .board { animation: none; } }

/* certificate */
.cert { background: var(--paper); border: 4px solid var(--ink); border-radius: 10px; padding: 10px; box-shadow: 0 14px 26px rgba(40, 25, 10, 0.25); }
.cert .in { border: 2px dashed var(--wood); border-radius: 6px; padding: 28px 20px 20px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; }
.cert .lvl { font-family: var(--display); font-size: clamp(40px, 9vw, 64px); line-height: 0.95; color: var(--green); }
.cert .who2 { font-size: clamp(26px, 5vw, 38px); font-weight: 800; border-bottom: 3px solid var(--ink); padding: 0 16px 6px; overflow-wrap: anywhere; max-width: 100%; }

table.t { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
table.t th, table.t td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.scroll { overflow-x: auto; }

select { font-size: 16px; padding: 12px 16px; border: 2px solid var(--ink); border-radius: 12px; background: var(--paper); color: var(--ink); min-height: 48px; width: 100%; max-width: 100%; }
.card select, .band.paper select { background: var(--wall); }
.board input[type="text"] { background: var(--board-deep); color: var(--chalk); border-color: var(--chalk); }

/* advent calendar */
.aventbar { background: var(--red); color: var(--on-red); padding-block: 12px; }
.aventbar p { flex: 1 1 260px; font-size: 16px; }
.doors { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.door { position: relative; min-height: 150px; border-radius: 14px; padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: #FFFFFF; background: #A32226; box-shadow: inset 0 0 0 3px rgba(0, 0, 0, 0.12); outline: 3px dashed rgba(247, 215, 116, 0.9); outline-offset: -9px; }
.door:nth-child(even) { background: #1B6B3F; }
.door .top { display: flex; align-items: center; justify-content: space-between; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #FFE9A8; padding: 4px 6px 0; }
.door .num { font-size: 52px; line-height: 1; font-weight: 800; padding-left: 6px; }
.door .t { font-size: 14px; font-weight: 600; line-height: 1.25; padding: 0 6px 4px; margin-top: auto; }
.door .ic { display: inline-flex; }
.door.open:hover, .door.open:focus-visible { transform: translateY(-3px); box-shadow: 0 10px 18px rgba(40, 25, 10, 0.3); }
.door.open { transition: transform 0.15s, box-shadow 0.15s; }
.door.today { background: var(--chalk-yellow); color: #2B2118; outline-color: #A32226; }
.door.today .top { color: #A32226; }
.door.locked { filter: saturate(0.55) brightness(0.9); color: rgba(255, 255, 255, 0.85); outline-color: rgba(247, 215, 116, 0.55); }
.door.locked .num { opacity: 0.7; }
@media (max-width: 420px) { .doors { grid-template-columns: repeat(2, 1fr); } .door { min-height: 132px; } .door .num { font-size: 44px; } }
@media (prefers-reduced-motion: reduce) { .door.open { transition: none; } .door.open:hover { transform: none; } }
