/* Ressources CFA Production → cream / navy / coral */
:root {
  --cream: #f7f1e8;
  --cream-dark: #ebe3d6;
  --navy: #1a2b4a;
  --navy-mid: #2c4068;
  --coral: #e07a5f;
  --coral-dark: #c45d44;
  --ink: #2a2a2a;
  --muted: #5a5a5a;
  --white: #ffffff;
  --shadow: 0 8px 28px rgba(26, 43, 74, 0.12);
  --radius: 16px;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--cream);
  color: var(--ink);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--navy-mid); text-decoration-thickness: 1px; }
a:hover { color: var(--coral-dark); }

.site-header {
  background: var(--navy);
  color: var(--white);
  padding: 1rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.site-header .brand {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--white);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.site-header .brand span {
  display: block;
  font-weight: 400;
  font-size: 0.78rem;
  opacity: 0.85;
  margin-top: 0.15rem;
}

.nav-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.nav-links a {
  color: var(--cream);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid transparent;
}

.nav-links a:hover,
.nav-links a.active {
  border-color: var(--coral);
  color: var(--white);
  background: rgba(224, 122, 95, 0.2);
}

main { flex: 1; }

.hero {
  position: relative;
  min-height: 420px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--white);
  overflow: hidden;
  background: var(--navy);
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.45;
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 3rem 1.5rem;
  max-width: 720px;
}

.hero h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  line-height: 1.2;
}

.hero .tagline {
  font-size: 1.1rem;
  opacity: 0.95;
  margin: 0 0 1.75rem;
}

.btn {
  display: inline-block;
  background: var(--coral);
  color: var(--white);
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  box-shadow: 0 4px 14px rgba(224, 122, 95, 0.4);
}

.btn:hover {
  background: var(--coral-dark);
  color: var(--white);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--cream);
  box-shadow: none;
}

.btn-outline:hover {
  background: rgba(255,255,255,0.12);
  border-color: var(--white);
}

.section {
  padding: 3rem 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
}

.section h2 {
  color: var(--navy);
  font-size: 1.65rem;
  margin: 0 0 0.5rem;
  text-align: center;
}

.section .lead {
  text-align: center;
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto 2rem;
}

.lang-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.lang-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  text-align: center;
  box-shadow: var(--shadow);
  border: 2px solid transparent;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, transform 0.15s;
}

.lang-card:hover {
  border-color: var(--coral);
  transform: translateY(-3px);
  color: inherit;
}

.lang-card .flag {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.lang-card h3 {
  margin: 0 0 0.4rem;
  color: var(--navy);
  font-size: 1.35rem;
}

.lang-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.specialty-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}

.specialty-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s, box-shadow 0.2s;
}

.specialty-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(26, 43, 74, 0.18);
  color: inherit;
}

.specialty-card .thumb {
  aspect-ratio: 4/3;
  object-fit: cover;
  width: 100%;
  background: var(--cream-dark);
}

.specialty-card .body {
  padding: 1rem 1.1rem 1.2rem;
}

.specialty-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  color: var(--navy);
}

.specialty-card p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.diagrams-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.diagram-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.diagram-card h3 {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  color: var(--navy);
  text-align: center;
}

.diagram-card svg,
.diagram-card img {
  width: 100%;
  height: auto;
}

.credit-bar {
  background: var(--cream-dark);
  padding: 1.25rem 1.5rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
  border-top: 1px solid rgba(26, 43, 74, 0.08);
}

.credit-bar strong { color: var(--navy); }

.site-footer {
  background: var(--navy);
  color: rgba(255,255,255,0.85);
  padding: 1.5rem;
  text-align: center;
  font-size: 0.88rem;
}

.site-footer a { color: var(--coral); }

/* Inner pages */
.page-hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  color: var(--white);
  padding: 2.5rem 1.5rem;
  text-align: center;
}

.page-hero h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.page-hero p {
  margin: 0;
  opacity: 0.9;
  max-width: 560px;
  margin-inline: auto;
}

.breadcrumb {
  max-width: 1100px;
  margin: 1rem auto 0;
  padding: 0 1.5rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.breadcrumb a { color: var(--navy-mid); }

.content-block {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

.content-block h2 {
  color: var(--navy);
  font-size: 1.3rem;
  margin: 1.75rem 0 0.6rem;
}

.content-block ul {
  padding-left: 1.2rem;
}

.content-block li { margin-bottom: 0.4rem; }

.visual-banner {
  border-radius: var(--radius);
  overflow: hidden;
  margin: 1.5rem 0;
  box-shadow: var(--shadow);
}

.visual-banner img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
}

.stub-note {
  background: var(--white);
  border-left: 4px solid var(--coral);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1.5rem 0;
  box-shadow: var(--shadow);
}

.chip {
  display: inline-block;
  background: var(--cream-dark);
  color: var(--navy);
  font-size: 0.8rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  margin: 0.2rem;
}

@media (max-width: 600px) {
  .hero { min-height: 360px; }
  .section { padding: 2rem 1rem; }
}


/* Specialty illustrations + "Correspond à" captions */
.specialty-card .thumb.thumb-svg {
  object-fit: contain;
  background: var(--cream);
  padding: 0.35rem;
}

.specialty-card .corresponds {
  margin: 0.55rem 0 0;
  font-size: 0.82rem;
  color: var(--navy-mid);
  line-height: 1.4;
  border-top: 1px solid rgba(26, 43, 74, 0.08);
  padding-top: 0.5rem;
}

.specialty-card .corresponds strong {
  color: var(--navy);
  font-weight: 600;
}

.page-hero .hero-illu {
  margin: 1.25rem auto 0.75rem;
  max-width: 280px;
  background: rgba(247, 241, 232, 0.12);
  border-radius: var(--radius);
  padding: 0.5rem;
}

.page-hero .hero-illu img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  background: var(--cream);
}

.page-hero .corresponds {
  margin: 0.75rem auto 0;
  max-width: 520px;
  font-size: 0.98rem;
  opacity: 0.95;
  line-height: 1.45;
}

.page-hero .corresponds strong {
  font-weight: 600;
}

.visual-with-caption {
  margin: 1.5rem 0;
}

.visual-with-caption .visual-banner {
  margin: 0;
}

.visual-with-caption .corresponds {
  margin: 0.75rem 0 0;
  font-size: 0.95rem;
  color: var(--navy-mid);
  text-align: center;
  line-height: 1.45;
}

.visual-with-caption .corresponds strong {
  color: var(--navy);
}

.specialty-illu-inline {
  max-width: 320px;
  margin: 0 auto 1rem;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--cream);
}

.specialty-illu-inline img {
  width: 100%;
  height: auto;
}

/* Classroom enrichment blocks (specialty pages) */
.content-block h3 {
  color: var(--navy-mid);
  font-size: 1.05rem;
  margin: 1.25rem 0 0.45rem;
}

.content-block p {
  margin: 0.55rem 0;
  line-height: 1.55;
}

.content-block ol {
  padding-left: 1.2rem;
  margin: 0.5rem 0 1rem;
}

.content-block ol li { margin-bottom: 0.4rem; }

.vocab-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0 1.25rem;
  font-size: 0.92rem;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.vocab-table th,
.vocab-table td {
  text-align: left;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid rgba(26, 43, 74, 0.08);
  vertical-align: top;
}

.vocab-table th {
  background: var(--cream-dark);
  color: var(--navy);
  font-weight: 600;
  font-size: 0.82rem;
}

.vocab-table tr:last-child td { border-bottom: none; }

.vocab-table td:first-child {
  font-weight: 600;
  color: var(--navy);
  white-space: nowrap;
  width: 32%;
}

.timed-steps {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 1.25rem;
}

.timed-steps li {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.45rem;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  align-items: start;
}

.timed-steps .t {
  font-weight: 700;
  color: var(--coral);
  font-size: 0.85rem;
  white-space: nowrap;
}

.exercise-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.15rem;
  margin: 0.75rem 0;
  border-left: 4px solid var(--navy-mid);
}

.exercise-card h3 {
  margin-top: 0;
  color: var(--navy);
}

.exercise-card .prompt {
  background: var(--cream);
  padding: 0.65rem 0.8rem;
  border-radius: 8px;
  margin: 0.5rem 0;
  font-size: 0.92rem;
}

.exercise-card .criteria {
  margin: 0.4rem 0 0;
  padding-left: 1.1rem;
  font-size: 0.9rem;
}

.callout-box {
  background: var(--cream);
  border-left: 4px solid var(--coral);
  padding: 1rem 1.15rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1rem 0 1.5rem;
  box-shadow: var(--shadow);
}

.callout-box strong { color: var(--navy); }

.doc-metier {
  background: var(--white);
  border: 1px dashed rgba(26, 43, 74, 0.25);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  margin: 0.75rem 0 1.5rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86rem;
  line-height: 1.55;
  white-space: pre-wrap;
  box-shadow: var(--shadow);
}

.chips-row {
  margin: 0.5rem 0 1rem;
}

@media (max-width: 600px) {
  .timed-steps li {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }
  .vocab-table td:first-child { white-space: normal; width: auto; }
}

/* BO enrichment */
.cours-box p { margin: 0.55rem 0 0; line-height: 1.55; }
.support-card .doc-metier { margin-top: 0.6rem; }

/* Classroom materials · exercices / corrigés */
.exercise-card.exo {
  border-left-color: var(--coral);
}

.credit-inline {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0.25rem 0 0.75rem;
}

details.corrige {
  background: var(--cream-dark);
  border: 1px dashed rgba(196, 93, 68, 0.45);
  border-radius: 10px;
  padding: 0.55rem 0.85rem;
  margin: 0.85rem 0 0.4rem;
}

details.corrige > summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--coral-dark);
  list-style: none;
}

details.corrige > summary::-webkit-details-marker { display: none; }
details.corrige > summary::before {
  content: "▸ ";
  color: var(--coral);
}
details.corrige[open] > summary::before { content: "▾ "; }

.corrige-body {
  margin-top: 0.55rem;
  font-size: 0.92rem;
}

.corrige-body h4 {
  margin: 0.6rem 0 0.25rem;
  color: var(--navy);
  font-size: 0.98rem;
}

.doc-metier.modele-annote {
  border-style: solid;
  border-color: rgba(224, 122, 95, 0.35);
  background: #fffdf9;
}

@media print {
  details.corrige { border-style: solid; break-inside: avoid; }
  details.corrige > summary { color: var(--navy); }
  details.corrige:not([open]) > .corrige-body,
  details.corrige > .corrige-body {
    display: block !important;
  }
  details.corrige > summary::before { content: "Corrigé · "; }
}

/* Developed example tables · limites métier */
.exemples-limites {
  margin: 1.5rem 0 2rem;
}
.tableau-exemple-title {
  margin: 1.1rem 0 0.45rem;
  color: var(--navy);
  font-size: 1.02rem;
}
.tableau-exemple-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 0 1.1rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: var(--white);
}
.tableau-exemple {
  width: 100%;
  min-width: 36rem;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: var(--white);
}
.tableau-exemple th,
.tableau-exemple td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid rgba(26, 43, 74, 0.1);
  vertical-align: top;
  line-height: 1.4;
}
.tableau-exemple th {
  background: var(--navy);
  color: #fff;
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.01em;
}
/* Entrées colorées → limites (Je peux / interdit / pro) — doux, contraste lisible */
.tableau-exemple.cols-limites th:nth-child(1),
.tableau-exemple.cols-3:not(.cols-savoir) th:nth-child(1) {
  background: #d8efe0; color: #1e5a38; /* Je peux → vert doux */
}
.tableau-exemple.cols-limites th:nth-child(2),
.tableau-exemple.cols-3:not(.cols-savoir) th:nth-child(2) {
  background: #fde4dc; color: #8b3a2b; /* Interdit → corail doux */
}
.tableau-exemple.cols-limites th:nth-child(3),
.tableau-exemple.cols-3:not(.cols-savoir) th:nth-child(3) {
  background: #dce6f5; color: #1a2b4a; /* Pro → navy doux */
}
.tableau-exemple.cols-limites td:nth-child(1),
.tableau-exemple.cols-3:not(.cols-savoir) td:nth-child(1) {
  border-left: 4px solid #5a9e74;
  background: #f3faf6;
}
.tableau-exemple.cols-limites td:nth-child(2),
.tableau-exemple.cols-3:not(.cols-savoir) td:nth-child(2) {
  border-left: 4px solid #e07a5f;
  background: #fff7f4;
}
.tableau-exemple.cols-limites td:nth-child(3),
.tableau-exemple.cols-3:not(.cols-savoir) td:nth-child(3) {
  border-left: 4px solid #5a7ab0;
  background: #f4f7fc;
}
/* Entrées colorées → savoir (Situation / Je sais / je demande) */
.tableau-exemple.cols-savoir th:nth-child(1) {
  background: #eef1f5; color: #2a3340; /* Situation */
}
.tableau-exemple.cols-savoir th:nth-child(2) {
  background: #d4eaf2; color: #1a5a6e; /* Je sais → bleu-vert */
}
.tableau-exemple.cols-savoir th:nth-child(3) {
  background: #fff3cd; color: #6b5200; /* Je ne sais pas → ambre */
}
.tableau-exemple.cols-savoir td:nth-child(1) {
  border-left: 4px solid #9aa3b2;
  background: #f7f8fa;
}
.tableau-exemple.cols-savoir td:nth-child(2) {
  border-left: 4px solid #4a90a8;
  background: #f0f8fb;
}
.tableau-exemple.cols-savoir td:nth-child(3) {
  border-left: 4px solid #d4a017;
  background: #fffbf0;
}
.tableau-exemple th {
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.tableau-exemple tr:last-child td { border-bottom: none; }
.tableau-exemple .cell-blank {
  color: var(--muted, #888);
  min-height: 2.2rem;
  height: 2.4rem;
  background: #fffef8 !important;
}
.trace-blank-lab { margin: 0.75rem 0 0.35rem; }
.callout-box .tableau-exemple-wrap { box-shadow: none; margin-top: 0.55rem; }
.callout-box .tableau-exemple { min-width: 32rem; font-size: 0.86rem; }

@media (max-width: 700px) {
  .tableau-exemple { min-width: 28rem; font-size: 0.84rem; }
  .tableau-exemple.stack-mobile { min-width: 0; }
  .tableau-exemple.stack-mobile thead { display: none; }
  .tableau-exemple.stack-mobile tr {
    display: block;
    margin-bottom: 0.75rem;
    border: 1px solid rgba(26, 43, 74, 0.12);
    border-radius: 8px;
    overflow: hidden;
  }
  .tableau-exemple.stack-mobile td {
    display: block;
    border-left-width: 4px !important;
    border-bottom: 1px solid rgba(26, 43, 74, 0.06);
  }
  .tableau-exemple.stack-mobile td::before {
    display: block;
    font-weight: 700;
    font-size: 0.75rem;
    color: var(--navy);
    margin-bottom: 0.2rem;
  }
}

@media print {
  .tableau-exemple-wrap { box-shadow: none; overflow: visible; }
  .tableau-exemple { min-width: 0; font-size: 0.8rem; }
  .tableau-exemple .cell-blank { min-height: 1.8rem; }
  .tableau-exemple th, .tableau-exemple td {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
