/* Feuille de style partagée — cours Angular moderne (teach/angular)
   Inspirée de Tufte : lecture confortable, belle à l'écran et à l'impression.
   Chaque leçon lie ce fichier : <link rel="stylesheet" href="../assets/styles.css"> */

:root {
  --ink: #1a1a1a;
  --ink-soft: #4a4a4a;
  --paper: #fdfcf9;
  --rule: #e3ddd0;
  --angular: #b32b2b;      /* rouge Angular */
  --angular-soft: #f6e7e7;
  --net: #5c2d91;          /* violet .NET, pour les analogies */
  --net-soft: #efe9f6;
  --warn: #9a6700;
  --warn-soft: #fdf4e0;
  --code-bg: #2b2b33;
  --code-ink: #f3f3f0;
  --accent: #0b6e6e;
  --max: 42rem;
}

* { box-sizing: border-box; }

html { font-size: 18px; }

body {
  margin: 0 auto;
  padding: 3rem 1.5rem 6rem;
  max-width: var(--max);
  background: var(--paper);
  color: var(--ink);
  font-family: Charter, Georgia, Cambria, "Times New Roman", serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* ---- En-tête de leçon ---- */
.lesson-meta {
  font-family: "Iosevka", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.6rem;
  margin-bottom: 1.5rem;
}
.lesson-meta .num { color: var(--angular); font-weight: 700; }

/* ---- Navbar : retour au dashboard ---- */
.lesson-topnav {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase;
  margin-bottom: 1rem;
}
.lesson-topnav a { color: var(--ink-soft); border-bottom: none; }
.lesson-topnav a:hover { color: var(--accent); }
@media print { .lesson-topnav { display: none; } }

h1 {
  font-size: 2rem;
  line-height: 1.15;
  font-weight: 700;
  margin: 0 0 0.3rem;
  letter-spacing: -0.01em;
}
.subtitle {
  font-style: italic;
  color: var(--ink-soft);
  font-size: 1.1rem;
  margin: 0 0 2rem;
}

h2 {
  font-size: 1.3rem;
  margin: 2.6rem 0 0.8rem;
  padding-top: 0.4rem;
  font-weight: 700;
}
h3 { font-size: 1.05rem; margin: 1.8rem 0 0.5rem; }

p { margin: 0.8rem 0; }
strong { font-weight: 700; }

a { color: var(--accent); text-decoration: none; border-bottom: 1px solid rgba(11,110,110,0.3); }
a:hover { border-bottom-color: var(--accent); }

/* ---- Encarts ---- */
.box {
  border-radius: 6px;
  padding: 1rem 1.2rem;
  margin: 1.4rem 0;
  font-size: 0.96rem;
}
.box .box-label {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  display: block;
  margin-bottom: 0.4rem;
}

/* Encart analogie — le cœur de la pédagogie de ce cours */
.analogy { background: var(--net-soft); border-left: 4px solid var(--net); }
.analogy .box-label { color: var(--net); }

/* Encart mission — pourquoi ça compte pour Alliance */
.mission { background: #eef6f6; border-left: 4px solid var(--accent); }
.mission .box-label { color: var(--accent); }

/* Encart piège / vigilance tech lead */
.warn { background: var(--warn-soft); border-left: 4px solid var(--warn); }
.warn .box-label { color: var(--warn); }

/* Encart à retenir */
.key { background: var(--angular-soft); border-left: 4px solid var(--angular); }
.key .box-label { color: var(--angular); }

/* ---- Code ---- */
pre, code {
  font-family: "Iosevka", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
}
code {
  background: #efeae0;
  padding: 0.1em 0.35em;
  border-radius: 3px;
  font-size: 0.85em;
}
pre {
  background: var(--code-bg);
  color: var(--code-ink);
  padding: 1.1rem 1.2rem;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 0.82rem;
  line-height: 1.5;
  margin: 1.2rem 0;
}
pre code { background: none; padding: 0; color: inherit; font-size: inherit; }
.c-key { color: #c792ea; }     /* mots-clés */
.c-str { color: #c3e88d; }     /* chaînes */
.c-com { color: #7f848e; font-style: italic; } /* commentaires */
.c-typ { color: #82aaff; }     /* types */
.c-fn  { color: #ffcb6b; }     /* fonctions/décorateurs */

/* ---- Tableau de comparaison ---- */
table { border-collapse: collapse; width: 100%; margin: 1.4rem 0; font-size: 0.92rem; }
th, td { text-align: left; padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-family: ui-monospace, monospace; font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); }

/* ---- Source primaire ---- */
.primary-source {
  border: 1px dashed var(--angular);
  border-radius: 6px;
  padding: 0.9rem 1.1rem;
  margin: 2rem 0;
  font-size: 0.92rem;
  background: #fff;
}
.primary-source .box-label { color: var(--angular); font-weight: 700; font-family: ui-monospace, monospace; font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; }

/* ---- Pied : rappel prof + navigation ---- */
.teacher-reminder {
  margin-top: 3rem;
  padding: 1rem 1.2rem;
  background: #1a1a1a;
  color: #f3f3f0;
  border-radius: 8px;
  font-size: 0.95rem;
}
.teacher-reminder strong { color: #ffcb6b; }

.lesson-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-family: ui-monospace, monospace;
  font-size: 0.8rem;
}

/* ---- Quiz (cf. quiz.js) ---- */
.quiz {
  margin: 1.6rem 0;
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 1.1rem 1.2rem;
  background: #fff;
}
.quiz .q { font-weight: 700; margin-bottom: 0.7rem; }
.quiz .opts { display: grid; gap: 0.5rem; }
.quiz button.opt {
  text-align: left;
  font-family: inherit;
  font-size: 0.92rem;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--paper);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.quiz button.opt:hover { border-color: var(--accent); }
.quiz button.opt.correct { background: #e3f4e3; border-color: #2e8b2e; }
.quiz button.opt.wrong { background: #f8e3e3; border-color: var(--angular); }
.quiz .feedback { margin-top: 0.7rem; font-size: 0.9rem; min-height: 1.2rem; }
.quiz .feedback.ok { color: #2e8b2e; }
.quiz .feedback.ko { color: var(--angular); }

/* ---- Impression ---- */
@media print {
  body { background: #fff; color: #000; max-width: 100%; padding: 0; }
  pre { background: #f4f4f4; color: #111; border: 1px solid #ccc; }
  .teacher-reminder { background: #f4f4f4; color: #111; border: 1px solid #999; }
  .quiz button.opt { border: 1px solid #999; }
  .lesson-nav, .quiz .feedback { display: none; }
  a { color: #000; }
}
