/* Feuille de style commune — cours de tchèque. Inspiration Tufte : texte serif, marges larges, notes en marge. */
:root {
  --bg: #fffff8;
  --ink: #111;
  --muted: #5f5f5a;
  --rule: #d9d6c8;
  --accent: #8a1c1c;      /* rouge sombre : formes à retenir */
  --ok: #1f6b3a;
  --ok-bg: #e7f3ea;
  --bad: #9b2222;
  --bad-bg: #f8e6e4;
  --panel: #f5f3e7;
  --almost: #7a5a00;
  --almost-bg: #f7efd6;
  --measure: 38rem;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151513; --ink: #e9e7de; --muted: #a3a097; --rule: #3a3933;
    --accent: #e08a7a; --ok: #8fd1a2; --ok-bg: #1d3325; --bad: #f0a097; --bad-bg: #3a1f1c; --panel: #1f1e1a; --almost: #e6c46a; --almost-bg: #352d17;
  }
}
:root[data-theme="dark"] {
  --bg: #151513; --ink: #e9e7de; --muted: #a3a097; --rule: #3a3933;
  --accent: #e08a7a; --ok: #8fd1a2; --ok-bg: #1d3325; --bad: #f0a097; --bad-bg: #3a1f1c; --panel: #1f1e1a; --almost: #e6c46a; --almost-bg: #352d17;
}

* { box-sizing: border-box; }
html { font-size: 18px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  line-height: 1.55;
  padding: 3rem 1rem 5rem;
}
main { max-width: 56rem; margin: 0 auto; }
main > * { max-width: var(--measure); }
h1 { font-weight: 400; font-size: 2.1rem; line-height: 1.15; margin: 0 0 .3rem; }
h2 { font-weight: 400; font-style: italic; font-size: 1.45rem; margin: 2.6rem 0 .6rem; }
h3 { font-weight: 600; font-size: 1rem; margin: 1.6rem 0 .3rem; }
.subtitle { font-style: italic; color: var(--muted); font-size: 1.15rem; margin: 0 0 2rem; }
a { color: inherit; text-decoration-color: var(--accent); text-underline-offset: 2px; }
.cs { font-family: inherit; }
strong.form, .form { color: var(--accent); font-weight: 600; }
.muted { color: var(--muted); }
hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5rem 0; }

/* Notes en marge (passent dans le texte sur mobile) */
.note-wrap { position: relative; }
.sidenote {
  float: right; clear: right; width: 15rem; margin: .2rem -17.5rem 1rem 0;
  font-size: .82rem; line-height: 1.4; color: var(--muted);
}
@media (max-width: 960px) {
  main > * { max-width: none; }
  .sidenote { float: none; width: auto; margin: .5rem 0 1rem; padding-left: .8rem; border-left: 2px solid var(--rule); }
}

/* Tableaux */
table { border-collapse: collapse; margin: 1rem 0 1.4rem; font-size: .95rem; width: 100%; }
th, td { text-align: left; padding: .35rem .7rem .35rem 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-weight: 400; font-style: italic; color: var(--muted); }
tr:last-child td { border-bottom: 0; }

/* Encadrés */
.panel { background: var(--panel); padding: 1rem 1.2rem; border-radius: 4px; margin: 1.2rem 0; }
.goal { border-left: 3px solid var(--accent); padding-left: 1rem; margin: 1.2rem 0; }
.source { font-size: .92rem; }
.ask { font-style: italic; color: var(--muted); }

/* Boutons */
button {
  font: inherit; font-size: .9rem; cursor: pointer;
  background: transparent; color: var(--ink);
  border: 1px solid var(--rule); border-radius: 4px; padding: .3rem .8rem;
}
button:hover { border-color: var(--ink); }
button.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
button.say { border: 0; padding: 0 .25rem; font-size: 1rem; vertical-align: baseline; }
button.say::before { content: "🔊"; }

/* Exercices (drill.js) */
.drill { border: 1px solid var(--rule); border-radius: 6px; padding: 1.2rem 1.3rem; margin: 1.2rem 0 2rem; }
.drill .meta { display: flex; justify-content: space-between; font-size: .82rem; color: var(--muted); margin-bottom: .8rem; }
.drill .fr { font-style: italic; color: var(--muted); margin-bottom: .4rem; }
.drill .line { font-size: 1.25rem; line-height: 2.1; }
.drill input {
  font: inherit; font-size: 1.15rem; color: var(--ink); background: transparent;
  border: 0; border-bottom: 2px solid var(--ink); width: 12rem; max-width: 100%; padding: 0 .2rem;
}
.drill input:focus { outline: none; border-bottom-color: var(--accent); }
.drill .hint { color: var(--muted); font-size: 1rem; }
.drill .feedback { margin-top: .9rem; padding: .7rem .9rem; border-radius: 4px; display: none; }
.drill .feedback.ok { display: block; background: var(--ok-bg); color: var(--ok); }
.drill .feedback.bad { display: block; background: var(--bad-bg); color: var(--bad); }
.drill .feedback.almost { display: block; background: var(--almost-bg); color: var(--almost); }
.drill .feedback .answer { color: var(--ink); font-weight: 600; }
.drill .actions { margin-top: .9rem; display: flex; gap: .5rem; flex-wrap: wrap; }
.drill .done { font-size: 1.1rem; }
.tts-warning { font-size: .85rem; color: var(--bad); background: var(--bad-bg); padding: .5rem .8rem; border-radius: 4px; display: none; }
.tts-warning.show { display: block; }
kbd { font-family: ui-monospace, Consolas, monospace; font-size: .8rem; border: 1px solid var(--rule); border-radius: 3px; padding: 0 .3rem; }

/* Saisie des lettres tchèques (czech.js) */
.czech-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; margin: .4rem 0 .2rem; }
.czech-bar button {
  font-size: 1rem; min-width: 2rem; padding: .1rem .35rem; line-height: 1.5;
  border-color: var(--rule); color: var(--ink);
}
.czech-bar .czech-shift { color: var(--muted); }
.czech-bar .czech-shift[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.czech-help { flex-basis: 100%; font-size: .75rem; color: var(--muted); margin-top: .15rem; }
.czech-help kbd { font-size: .7rem; }
.line:has(:disabled) + .czech-bar { opacity: .35; pointer-events: none; }
u.czech-wrong { text-decoration: underline 2px; text-decoration-color: currentColor; text-underline-offset: 3px; font-weight: 700; }

nav.course { font-size: .85rem; color: var(--muted); margin-bottom: 2.5rem; }
nav.course a { margin-right: 1rem; }

@media print {
  body { background: #fff; padding: 0; }
  button, .drill, .czech-bar, .tts-warning, /* Saisie des lettres tchèques (czech.js) */
.czech-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; margin: .4rem 0 .2rem; }
.czech-bar button {
  font-size: 1rem; min-width: 2rem; padding: .1rem .35rem; line-height: 1.5;
  border-color: var(--rule); color: var(--ink);
}
.czech-bar .czech-shift { color: var(--muted); }
.czech-bar .czech-shift[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.czech-help { flex-basis: 100%; font-size: .75rem; color: var(--muted); margin-top: .15rem; }
.czech-help kbd { font-size: .7rem; }
.line:has(:disabled) + .czech-bar { opacity: .35; pointer-events: none; }
u.czech-wrong { text-decoration: underline 2px; text-decoration-color: currentColor; text-underline-offset: 3px; font-weight: 700; }

nav.course { display: none !important; }
  .sidenote { color: #444; }
}

/* Sommaire (index.html) */
ol.toc { list-style: none; padding: 0; margin: 1rem 0 2rem; counter-reset: lesson; }
ol.toc li { counter-increment: lesson; display: grid; grid-template-columns: 2.2rem 1fr; padding: .7rem 0; border-bottom: 1px solid var(--rule); }
ol.toc li::before { content: counter(lesson); font-size: 1.4rem; color: var(--accent); line-height: 1.2; }
ol.toc a { font-size: 1.1rem; }
ol.toc .desc { grid-column: 2; color: var(--muted); font-size: .92rem; }
ul.refs { padding-left: 1.1rem; }
ul.refs li { margin: .3rem 0; }
