/* === Manga Course — Shared Stylesheet === */
/* Tufte-inspired: clean, readable, generous whitespace */

:root {
  --bg: #faf9f7;
  --ink: #1a1a1a;
  --muted: #6b6b6b;
  --accent: #c0392b;
  --accent-light: #f4e4e1;
  --rule: #d8d4cf;
  --code-bg: #f0ede8;
  --max-width: 38rem;
  --font-serif: Georgia, 'Times New Roman', serif;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Courier New', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font-serif);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.75;
  font-size: 18px;
  -webkit-font-smoothing: antialiased;
}

/* --- Layout --- */
.lesson {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 1.5rem 6rem;
}

/* --- Masthead --- */
.masthead {
  border-bottom: 2px solid var(--ink);
  padding-bottom: 1.5rem;
  margin-bottom: 2.5rem;
}

.masthead .course {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.masthead h1 {
  font-size: 2rem;
  font-weight: normal;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.masthead .subtitle {
  font-size: 1rem;
  color: var(--muted);
  font-style: italic;
}

/* --- Typography --- */
h2 {
  font-size: 1.35rem;
  font-weight: normal;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.3rem;
}

h3 {
  font-size: 1.1rem;
  font-weight: normal;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

p { margin-bottom: 1.2rem; }

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

strong { font-weight: bold; }
em { font-style: italic; }

/* --- Lists --- */
ol, ul { margin-bottom: 1.2rem; padding-left: 1.5rem; }
li { margin-bottom: 0.5rem; }

/* --- Callouts --- */
.callout {
  background: var(--accent-light);
  border-left: 3px solid var(--accent);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  border-radius: 0 4px 4px 0;
}
.callout .label {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: bold;
  margin-bottom: 0.3rem;
}

.tip {
  background: #e8f0f4;
  border-left: 3px solid #2980b9;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  border-radius: 0 4px 4px 0;
}
.tip .label {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #2980b9;
  font-weight: bold;
  margin-bottom: 0.3rem;
}

/* --- Steps (numbered visual) --- */
.step {
  display: flex;
  gap: 1rem;
  margin: 1.5rem 0;
  align-items: flex-start;
}
.step .num {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border: 2px solid var(--ink);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: bold;
}
.step .body { flex: 1; }
.step .body p:last-child { margin-bottom: 0; }

/* --- SVG diagram wrapper --- */
.diagram {
  text-align: center;
  margin: 2rem 0;
}
.diagram svg {
  max-width: 100%;
  height: auto;
}
.diagram .caption {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.5rem;
  font-style: italic;
}

/* --- Quiz --- */
.quiz {
  background: #f5f3f0;
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 1.5rem;
  margin: 2rem 0;
}
.quiz .q-label {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: bold;
  margin-bottom: 0.5rem;
}
.quiz .question { margin-bottom: 1rem; font-weight: bold; }
.quiz .options { list-style: none; padding: 0; }
.quiz .options li {
  padding: 0.6rem 1rem;
  margin: 0.4rem 0;
  background: white;
  border: 2px solid var(--rule);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--font-sans);
  font-size: 0.95rem;
}
.quiz .options li:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}
.quiz .options li.correct {
  border-color: #27ae60;
  background: #e8f8e8;
}
.quiz .options li.wrong {
  border-color: #c0392b;
  background: #fce4e1;
}
.quiz .feedback {
  margin-top: 1rem;
  padding: 0.75rem;
  border-radius: 4px;
  font-size: 0.9rem;
  display: none;
}
.quiz .feedback.show { display: block; }
.quiz .feedback.correct { background: #e8f8e8; color: #1d7a35; }
.quiz .feedback.wrong { background: #fce4e1; color: #a93226; }

/* --- Footer / nav --- */
.lesson-nav {
  border-top: 1px solid var(--rule);
  margin-top: 3rem;
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  font-family: var(--font-sans);
  font-size: 0.85rem;
}

.ask-me {
  background: var(--ink);
  color: white;
  padding: 1rem 1.25rem;
  margin: 2rem 0;
  border-radius: 8px;
  font-family: var(--font-sans);
}
.ask-me .label { font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.7; margin-bottom: 0.3rem; }
.ask-me p { margin-bottom: 0; font-size: 0.95rem; line-height: 1.5; }

/* --- Source citation --- */
.source {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--muted);
  border-top: 1px solid var(--rule);
  padding-top: 1rem;
  margin-top: 2rem;
}

/* --- Reference doc styles --- */
.glossary { }
.glossary .term {
  font-weight: bold;
  color: var(--accent);
}
.glossary .entry {
  margin-bottom: 0.8rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--rule);
}
.glossary .entry:last-child { border-bottom: none; }

/* --- Print --- */
@media print {
  body { background: white; }
  .lesson { max-width: 100%; padding: 1rem; }
  .ask-me, .quiz { display: none; }
  a { color: var(--ink); border-bottom: none; }
}
