/* Braials — Briefwisseling
 * Contemporary personal correspondence: ivory stock, wine-red and navy
 * airmail geometry. Decorative rules contain no invented postal information.
 * Load after lesson-template.css. Fonts: Fraunces / Work Sans.
 */
:root {
  --ink: #253344;
  --ink-mid: #4c555f;
  --ink-soft: #62666b;
  --paper: #efece4;
  --paper-warm: #f4efe5;
  --white: #fffdf7;
  --paper-2: #f8f4eb;
  --border: #c9c3b8;
  --line: #c9c3b8;
  --ocean: #314e70;
  --ocean-dark: #233c59;
  --ocean-light: #e9eef2;
  --gold: #8c3e47;
  --gold-dark: #743039;
  --gold-light: #f3e8e6;
  --forest: #39684c;
  --forest-light: #eaf0e7;
  --ember: #a0432c;
  --ember-light: #f8eae2;
  --plum: #71516d;
  --plum-light: #f0e9ee;
  --correct: #2c6943;
  --correct-bg: #eaf3e8;
  --incorrect: #a12e38;
  --incorrect-bg: #fbecee;
  --radius: 4px;
  --shadow: 0 2px 5px rgba(37, 51, 68, .035);
  --shadow-md: 0 5px 18px rgba(55, 45, 32, .06);
  --shadow-lg: 0 5px 18px rgba(55, 45, 32, .06);
  --font-heading: 'Fraunces', Georgia, serif;
  --font-body: 'Work Sans', system-ui, sans-serif;
  --header-bg: #fffdf7;
}
html { scrollbar-color: #91887a var(--paper); }
body {
  color: var(--ink);
  background: var(--paper);
  background-image: none;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.75;
}
h1, h2, h3 { font-family: var(--font-heading); letter-spacing: -.02em; }
::selection { background: var(--gold-light); color: var(--gold-dark); }

/* The edge is abstract airmail geometry; all real text remains lesson data. */
.header {
  width: calc(100% - 2.4rem);
  max-width: 800px;
  margin: 2rem auto 0;
  padding: 2.2rem 2.4rem 2rem;
  background: var(--header-bg);
  color: var(--ink);
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 3px;
  box-shadow: var(--shadow-md);
}
.header::before {
  inset: 0 0 auto;
  width: auto;
  height: 7px;
  border: 0;
  border-radius: 0;
  background: repeating-linear-gradient(125deg, var(--gold) 0 13px, var(--white) 13px 24px, var(--ocean) 24px 37px, var(--white) 37px 48px);
}
.header::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 4px;
  background: repeating-linear-gradient(125deg, var(--gold) 0 13px, var(--white) 13px 24px, var(--ocean) 24px 37px, var(--white) 37px 48px);
}
.header-inner { padding: 0; border-left: 2px solid var(--gold); padding-left: 1.2rem; }
.header-tag {
  padding: 0 0 .2rem;
  margin-bottom: .65rem;
  color: var(--gold-dark);
  background: transparent;
  border: 0;
  border-radius: 0;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .1em;
}
.header h1 {
  color: var(--ink);
  font-size: clamp(1.9rem, 4.7vw, 2.8rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -.035em;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.header p { color: var(--ink-mid); opacity: 1; font-size: 1rem; margin-top: .85rem; max-width: 38rem; }
.container { max-width: 840px; padding: 1.6rem 1.2rem 4rem; }
.progress-wrap { background: var(--white); border: 1px solid var(--border); box-shadow: none; }
.prog-track { height: 5px; border-radius: 0; }
.prog-fill { border-radius: 0; background: var(--gold); }
.sec, .section {
  text-align: left;
  margin: 2rem 0 1rem;
  padding: .9rem 0 0;
  border: 0;
  border-top: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  animation: none;
}
.sec-tag { padding: 0; background: transparent; border-radius: 0; color: var(--gold-dark); font-size: .75rem; letter-spacing: .08em; box-shadow: none; }
.sec h2, .section h2 { font-size: 1.55rem; font-weight: 600; }
.sec-sub { color: var(--ink-mid); font-size: 1rem; }

/* Paper sheets and understated document numbering. */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1.55rem 1.7rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-md);
  animation: none;
  transition: none;
}
.card:nth-child(n), .blok:nth-child(n) > .card { border-left: 1px solid var(--border); }
.card:hover { transform: none; box-shadow: var(--shadow-md); }
.card-head { gap: .85rem; align-items: flex-start; padding-bottom: .95rem; margin-bottom: 1.1rem; border-bottom: 1px solid var(--border); }
.card:nth-child(n) .card-num, .blok:nth-child(n) > .card .card-num {
  width: 2rem;
  height: 2rem;
  background: transparent;
  color: var(--gold-dark);
  border: 1px solid var(--gold);
  border-radius: 50%;
  box-shadow: none;
  font-family: var(--font-body);
  font-size: .875rem;
  font-weight: 600;
}
.card-title { color: var(--ink); font-size: 1.25rem; font-weight: 600; line-height: 1.4; }
.card-instr { color: var(--ink-mid); font-size: .9375rem; line-height: 1.65; margin: .3rem 0 0; }
.leestekst-card { padding: 2rem 2.3rem; outline: 1px solid #ded8cc; outline-offset: -9px; }
.leestekst-card .card-head { border-bottom: 3px double var(--border); padding-bottom: 1rem; margin-bottom: 1.6rem; }
.leestekst-card p { font-size: 1rem; line-height: 1.9; margin-bottom: 1.05rem; }
.info { border: 1px solid var(--border); border-left: 3px solid var(--gold); border-radius: 2px; box-shadow: none; font-size: 1rem; animation: none; }
.info h3 { font-size: 1.15rem; font-weight: 600; }
.info.ocean { background: var(--ocean-light); border-left-color: var(--ocean); }
.info.forest { background: var(--forest-light); border-left-color: var(--forest); }
.info.warning { background: var(--ember-light); border-left-color: var(--ember); }
.scenario-box { background: var(--paper-2); border-radius: 3px; font-size: 1rem; }

/* Each speaker keeps the same page side across consecutive turns. */
.dialogue { gap: .8rem; padding: .25rem 0; }
.dialogue-bubble { min-width: 0; max-width: 88%; padding: .9rem 1.1rem; font-size: 1rem; line-height: 1.75; overflow-wrap: anywhere; box-shadow: none; }
.dialogue-bubble.speaker-a { align-self: flex-start; color: var(--ink); background: var(--ocean-light); border: 1px solid #c1ccd7; border-left: 3px solid var(--ocean); border-radius: 2px; }
.dialogue-bubble.speaker-b { align-self: flex-end; color: var(--ink); background: var(--gold-light); border: 1px solid #dbc4c3; border-right: 3px solid var(--gold); border-radius: 2px; }
.dialogue-bubble strong { display: block; color: var(--ocean-dark); margin-bottom: .3rem; font-size: .875rem; font-weight: 600; letter-spacing: .01em; text-transform: none; }
.dialogue-bubble.speaker-b strong { color: var(--gold-dark); }
.dialogue-bubble.speaker-a + .dialogue-bubble.speaker-a,
.dialogue-bubble.speaker-b + .dialogue-bubble.speaker-b { margin-top: -.3rem; }

/* Dark ink on light fields; text-size selectors defeat the base full width. */
input[type="text"], textarea, select {
  font-family: var(--font-body);
  font-size: 1rem;
  max-width: 100%;
  color: var(--ink);
  background: var(--white);
  border: 1px solid #8c9298;
  border-bottom: 2px solid var(--ocean);
  border-radius: 3px;
  box-shadow: none;
}
input[type="text"].inline { width: 9.5rem; }
input[type="text"].narrow { width: 7.5rem; }
input[type="text"].wide { width: 17.5rem; }
input[type="text"]:not(:placeholder-shown):not(:focus) { border-color: var(--ocean); }
input[type="text"]:focus, textarea:focus, select:focus { border-color: var(--ocean); box-shadow: none; }
input::placeholder, textarea::placeholder { color: var(--ink-soft); opacity: 1; }
:is(button, a, input, textarea, select):focus-visible,
input[type="text"]:focus-visible { outline: 3px solid var(--ocean); outline-offset: 3px; }
input.input-ok { color: var(--correct); border-color: var(--correct); background: var(--correct-bg); }
input.input-no { color: var(--incorrect); border-color: var(--incorrect); background: var(--incorrect-bg); }
.btn, .btn-show { min-height: 2.75rem; border-radius: 3px; font-size: .9375rem; font-weight: 600; box-shadow: none; }
.btn { background: var(--ocean); color: #fff; padding: .6rem 1.1rem; }
.btn:hover { background: var(--ocean-dark); transform: none; box-shadow: none; }
.btn:active { transform: none; }
.btn-show { background: var(--white); color: var(--gold-dark); border: 1px solid var(--gold); }
.btn-show:hover { background: var(--gold-light); color: var(--gold-dark); border-color: var(--gold-dark); }
.mc-radio label, .mco { background: var(--white); border: 1px solid var(--border); border-radius: 3px; padding: .8rem 1rem; font-size: 1rem; }
.mc-radio label:hover, .mco:hover { background: var(--ocean-light); border-color: var(--ocean); }
.mc-radio label:has(input[type="radio"]:checked), .mco.sel { background: var(--ocean-light); border-color: var(--ocean); color: var(--ink); }
.mc-radio input[type="radio"] { accent-color: var(--ocean); }
.mc-radio label.ok, .mc-radio label.ok:has(input[type="radio"]:checked), .mco.ok { background: var(--correct-bg); color: var(--correct); border-color: var(--correct); }
.mc-radio label.no, .mc-radio label.no:has(input[type="radio"]:checked), .mco.no { background: var(--incorrect-bg); color: var(--incorrect); border-color: var(--incorrect); }
.fb { border-radius: 3px; font-size: .9375rem; }
.fb.ok { background: var(--correct-bg); color: var(--correct); border-color: var(--correct); animation: none; }
.fb.no { background: var(--incorrect-bg); color: var(--incorrect); border-color: var(--incorrect); animation: none; }
.model-answer { background: var(--gold-light); color: var(--ink); border-left-color: var(--gold); border-radius: 3px; font-size: 1rem; }
.model-answer strong { color: var(--gold-dark); }
.row { font-size: 1rem; border-bottom-color: var(--border); }
.row:nth-child(even) { background: var(--paper-2); }
.eng { color: var(--ink-soft); font-size: .875rem; }
.ww-chip { color: #fff; }

/* Vocabulary slips and games share the complete correspondence palette. */
.vocab-list { gap: .6rem; }
.vocab-item:nth-child(n) { background: var(--white); border: 1px solid var(--border); border-bottom: 2px solid var(--gold); border-radius: 3px; box-shadow: none; }
.vocab-item:nth-child(n):hover { background: var(--paper-2); transform: none; box-shadow: none; }
.vocab-item:nth-child(n) .dutch { color: var(--ocean-dark); font-size: 1rem; }
.vocab-item .english { color: var(--ink-mid); font-size: .9375rem; }
.vocab-play-btn { background: var(--ocean); }
.vocab-play-btn:hover { background: var(--ocean-dark); transform: none; }
.pov-situatie, .tb-tekst, .hint-item, .galg-item { background: var(--paper-2); border-color: var(--border); border-radius: 3px; }
button.pov-optie, button.mem-kaart, button.cat-chip, button.zin-chip, button.galg-letter { min-height: 2.75rem; border-radius: 3px; font-size: 1rem; }
.card[data-game] {
  --game-mist: #8a4900;
  --game-mist-border: #a05a09;
  --game-mist-bg: #fff1d6;
  border-top-color: var(--gold);
}
.footer { color: var(--ink-soft); border-top-color: var(--border); }

@media (max-width: 600px) {
  .header { width: calc(100% - 1.4rem); margin-top: .7rem; padding: 1.65rem 1.25rem 1.5rem; }
  .header-inner { padding-left: .85rem; }
  .header h1 { font-size: clamp(1.75rem, 7.5vw, 2.3rem); }
  .header p { font-size: .9375rem; }
  .container { padding: 1.1rem .7rem 2.5rem; }
  .card { padding: 1.1rem; }
  .card-head { gap: .7rem; }
  .card-title { font-size: 1.15rem; }
  .leestekst-card { padding: 1.5rem 1.2rem; outline-offset: -6px; }
  .leestekst-card p { line-height: 1.85; }
  .dialogue-bubble { max-width: 94%; padding: .85rem; }
  .vocab-list { grid-template-columns: 1fr; }
  input[type="text"].wide { width: 100%; }
  .mc-radio label, .mco { padding: .75rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  body, .header, .card, .dialogue-bubble.speaker-a, .dialogue-bubble.speaker-b { background: #fff !important; color: #000 !important; box-shadow: none; }
  .header { width: 100%; margin: 0; padding: 1rem; border: 1px solid #777; }
  .header::before, .header::after { display: none; }
  .header h1, .header p, .header-tag, .dialogue-bubble strong, .dialogue-bubble.speaker-b strong, .model-answer, .model-answer strong { color: #000; }
  .header-inner { border-left-color: #777; }
  .card { break-inside: auto; }
  .card-head { break-after: avoid; }
  .leestekst-card { outline-color: #aaa; }
  .dialogue-bubble.speaker-a, .dialogue-bubble.speaker-b { border: 1px solid #777; break-inside: avoid; }
  .ww-chip { color: #000; background: #fff; }
  input[type="text"], textarea, select { background: #fff; color: #000; border-color: #777; }
}
