/* Feuille de style partagée — Cours de japonais de voyage
   Inspiration Tufte : sobre, lisible, beau à l'impression. */

:root {
  --ink: #1a1a1a;
  --paper: #fdfcf8;
  --muted: #6b6657;
  --rule: #e2ddcf;
  --accent: #b03a2e;      /* rouge japonais discret (sceau / hinomaru) */
  --accent-soft: #f6e9e6;
  --jp: #2c3e50;
  --good: #2e7d52;
  --maxw: 42rem;
}

* { box-sizing: border-box; }

html { font-size: 18px; }

body {
  margin: 0 auto;
  max-width: var(--maxw);
  padding: 3rem 1.5rem 6rem;
  background: var(--paper);
  color: var(--ink);
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* En-tête de leçon */
.lesson-kicker {
  font-family: ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.6rem;
}

h1 {
  font-size: 2rem;
  line-height: 1.15;
  margin: 0 0 0.4rem;
  font-weight: 600;
}

.subtitle {
  color: var(--muted);
  font-style: italic;
  margin: 0 0 2rem;
}

h2 {
  font-size: 1.25rem;
  margin: 2.4rem 0 0.8rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--rule);
  font-weight: 600;
}

h3 { font-size: 1.05rem; margin: 1.6rem 0 0.5rem; }

p { margin: 0.8rem 0; }

a { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--accent-soft); }
a:hover { border-bottom-color: var(--accent); }

/* Japonais mis en avant */
.jp {
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
  color: var(--jp);
}

/* Bouton de prononciation 🔊 (composant speak.js) */
button.speak {
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.9rem;
  line-height: 1;
  padding: 0.1em 0.35em;
  margin-left: 0.15em;
  vertical-align: middle;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 4px;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.15s, background 0.15s;
}
button.speak:hover {
  opacity: 1;
  background: var(--accent-soft);
  border-color: var(--accent);
}
button.speak:active { transform: translateY(1px); }
@media print { button.speak { display: none; } }

/* Carte de phrase : la brique principale des leçons de vocabulaire */
.phrase {
  margin: 1.1rem 0;
  padding: 1rem 1.2rem;
  background: #fff;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  page-break-inside: avoid;
}
.phrase .kana {
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
  font-size: 1.5rem;
  color: var(--jp);
  line-height: 1.3;
}
.phrase .romaji { font-style: italic; color: var(--muted); margin: 0.15rem 0 0.35rem; }
.phrase .gloss { font-size: 0.95rem; margin: 0; }
.phrase .note { font-size: 0.85rem; color: var(--muted); margin: 0.4rem 0 0; }

/* Encadré « pourquoi / astuce » */
.aside {
  margin: 1.4rem 0;
  padding: 0.9rem 1.1rem;
  background: var(--accent-soft);
  border-radius: 4px;
  font-size: 0.92rem;
}
.aside strong { color: var(--accent); }

/* Citations / sources */
.cite { font-size: 0.85rem; color: var(--muted); }

/* Quiz interactif */
.quiz {
  margin: 1.2rem 0;
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: #fff;
  page-break-inside: avoid;
}
.quiz .q { font-weight: 600; margin-bottom: 0.7rem; }
.quiz .opt {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  margin: 0.35rem 0;
  padding: 0.55rem 0.8rem;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.quiz .opt:hover { border-color: var(--accent); }
.quiz .opt.correct { background: #e7f4ec; border-color: var(--good); color: var(--good); }
.quiz .opt.wrong { background: #fbeae8; border-color: var(--accent); color: var(--accent); }
.quiz .feedback { margin-top: 0.7rem; font-size: 0.9rem; min-height: 1.2rem; }
.quiz .feedback.show-good { color: var(--good); }
.quiz .feedback.show-bad { color: var(--accent); }

/* Navigation bas de page */
.lesson-nav {
  margin-top: 3rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--rule);
  font-size: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.4rem;
}

/* Rappel « pose une question à ton prof » */
.ask-teacher {
  margin-top: 2.4rem;
  padding: 1rem 1.2rem;
  border: 1px dashed var(--accent);
  border-radius: 6px;
  font-size: 0.92rem;
  background: #fff;
}

/* Pied de progression */
.footer-note { margin-top: 2rem; font-size: 0.8rem; color: var(--muted); text-align: center; }

@media print {
  body { background: #fff; max-width: none; padding: 0; font-size: 12pt; }
  .quiz .opt { cursor: default; }
  .lesson-nav, .ask-teacher { page-break-inside: avoid; }
  a { color: var(--ink); border: none; }
}
