/* Le Soutien Scolaire — feuille de style publique */
:root {
  --bg: #e3e5ff;
  --bg-alt: #d6d9ff;
  --surface: #f6f5ff;
  --text: #55397f;
  --heading: #402266;
  --purple: #6a3fb0;
  --purple-dark: #402266;
  --accent: #e8590c;
  --accent-dark: #c2470a;
  --yellow: #ffd44a;
  --line: #c3c0ee;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(64, 34, 102, .12);
  --font: "Kumbh Sans", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 1.0625rem; line-height: 1.7; color: var(--text); background: var(--bg); }
img { max-width: 100%; height: auto; }
a { color: var(--accent-dark); text-underline-offset: 3px; }
a:hover { color: var(--purple-dark); }
h1, h2, h3, h4 { color: var(--heading); line-height: 1.2; font-weight: 700; letter-spacing: -.01em; margin: 0 0 .6em; text-wrap: balance; }
h1 { font-size: clamp(2rem, 4.6vw, 3.1rem); }
h2 { font-size: clamp(1.55rem, 3vw, 2.1rem); }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.1rem; }
p { margin: 0 0 1.1em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.wrap { width: min(1180px, 100% - 2.5rem); margin-inline: auto; }
.narrow { width: min(860px, 100% - 2.5rem); }
.center { text-align: center; }
.skip { position: absolute; left: -999px; top: 0; background: #fff; padding: .6rem 1rem; z-index: 100; }
.skip:focus { left: .5rem; top: .5rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .8rem; font-weight: 700; color: var(--purple); margin-bottom: .4rem; }
.lead { font-size: 1.2rem; }

/* Boutons */
.btn { display: inline-block; background: var(--accent); color: #fff; font-weight: 700; text-decoration: none; padding: .8rem 1.7rem; border-radius: 30px; border: 2px solid var(--accent); cursor: pointer; font: inherit; font-weight: 700; line-height: 1.3; box-shadow: 0 8px 18px rgba(232, 89, 12, .28); transition: background .15s, transform .15s; }
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; transform: translateY(-1px); }
.btn-small { padding: .5rem 1.1rem; font-size: .95rem; box-shadow: none; }
.btn-ghost { background: transparent; color: var(--purple-dark); border-color: var(--purple-dark); box-shadow: none; }
.btn-ghost:hover { background: var(--purple-dark); border-color: var(--purple-dark); color: #fff; }

/* En-tête */
.site-header { background: var(--purple-dark); color: #fff; position: sticky; top: 0; z-index: 50; }
.site-header .wrap { width: min(1400px, 100% - 2.5rem); }
.header-in { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 68px; }
.logo { color: #fff; font-weight: 800; font-size: 1.35rem; text-decoration: none; letter-spacing: -.02em; white-space: nowrap; }
.logo:hover { color: var(--yellow); }
.nav { display: flex; align-items: center; gap: 1.2rem; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: .2rem; align-items: center; }
.nav li { position: relative; }
.nav a:not(.btn) { color: #fff; text-decoration: none; padding: .55rem .6rem; display: block; border-radius: 8px; font-weight: 600; font-size: .93rem; white-space: nowrap; }
.nav .btn { white-space: nowrap; }
.nav a:not(.btn):hover, .nav a[aria-current="page"] { background: rgba(255, 255, 255, .14); }
.nav .sub { display: none; position: absolute; left: 0; top: 100%; background: var(--purple-dark); min-width: 230px; padding: .4rem; border-radius: 0 0 12px 12px; flex-direction: column; align-items: stretch; box-shadow: var(--shadow); }
.nav .has-sub:hover .sub, .nav .has-sub:focus-within .sub { display: flex; }
.nav-toggle { display: none; background: none; border: 0; padding: .6rem; cursor: pointer; }
.nav-toggle span { display: block; width: 26px; height: 3px; background: #fff; margin: 5px 0; border-radius: 2px; }

/* Bandeau de titre */
.hero-band { background: linear-gradient(135deg, #6a3fb0 0%, #4a2580 55%, #402266 100%); color: #fff; padding: 2.6rem 0 3rem; text-align: center; position: relative; overflow: hidden; }
.hero-band::before, .hero-band::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .08); }
.hero-band::before { width: 260px; height: 260px; left: -70px; top: -90px; }
.hero-band::after { width: 180px; height: 180px; right: -40px; bottom: -70px; background: rgba(255, 212, 74, .18); }
.hero-band h1 { color: #fff; margin: 0; position: relative; }
.hero-sub { margin: .8rem 0 0; opacity: .9; }
.crumbs ol { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: .3rem .5rem; font-size: .9rem; position: relative; }
.crumbs li + li::before { content: "›"; margin-right: .5rem; opacity: .7; }
.crumbs a { color: #fff; }
.crumbs [aria-current] { opacity: .8; }

/* Accueil */
.home-hero { padding: 3.5rem 0 2rem; background: radial-gradient(circle at 15% 20%, #f1f0ff 0, transparent 40%), radial-gradient(circle at 85% 70%, #d3cdfb 0, transparent 45%), var(--bg); }
.home-hero-in { display: grid; grid-template-columns: 1.05fr .95fr; gap: 2.5rem; align-items: center; }
.home-hero h1 { position: relative; padding-bottom: .5rem; }
.home-hero h1::after { content: ""; display: block; width: 130px; height: 8px; border-radius: 6px; background: var(--yellow); margin-top: 1rem; }
.home-hero-img { width: 100%; }
.levels { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2rem; }
.level { background: var(--surface); border-radius: var(--radius); padding: 1.7rem 1.4rem; text-decoration: none; color: var(--text); box-shadow: var(--shadow); display: flex; flex-direction: column; transition: transform .15s; }
.level:hover { transform: translateY(-4px); color: var(--text); }
.level svg { color: var(--accent); margin-bottom: .9rem; }
.level h2 { font-size: 1.2rem; margin-bottom: .4rem; }
.level p { flex: 1; font-size: .98rem; }
.more { font-weight: 700; color: var(--accent-dark); text-decoration: none; }
.more::after { content: " →"; }
.home-prose { max-width: 820px; }

/* Sections */
.section { padding: 3.5rem 0; }
.section-alt { background: var(--bg-alt); }
.section > .wrap > h2.center { margin-bottom: 2rem; }

/* Contenu rédactionnel */
.prose { overflow-wrap: break-word; }
.prose h2 { margin-top: 2.2rem; scroll-margin-top: 90px; }
.prose h3 { margin-top: 1.7rem; }
.prose h4 { margin-top: 1.3rem; }
.prose > :first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.4rem; margin: 0 0 1.2em; }
.prose li { margin-bottom: .45em; }
.prose li > p { margin: 0; }
.prose li::marker { color: var(--accent); font-weight: 700; }
.prose strong { color: var(--heading); }
.prose img { border-radius: var(--radius); display: block; margin-inline: auto; }
.prose figure { margin: 1.8rem 0; }
.prose figcaption { text-align: center; font-size: .9rem; margin-top: .5rem; }
.prose blockquote { margin: 1.5rem 0; padding: 1rem 1.4rem; background: var(--surface); border-left: 5px solid var(--yellow); border-radius: 0 var(--radius) var(--radius) 0; }
.prose blockquote > :last-child { margin-bottom: 0; }
.prose hr { border: 0; border-top: 2px solid var(--line); margin: 2.2rem 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; background: var(--surface); border-radius: 12px; overflow: hidden; display: block; overflow-x: auto; }
.prose th, .prose td { padding: .7rem .9rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { background: var(--purple-dark); color: #fff; }
.prose iframe { max-width: 100%; border: 0; border-radius: var(--radius); }
.cta-box { background: var(--purple-dark); color: #fff; border-radius: var(--radius); padding: 1.8rem; margin: 2rem 0; text-align: center; }
.cta-box h2, .cta-box h3, .cta-box strong { color: #fff; margin-top: 0; }
.children { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .8rem; }
.children a { display: block; background: var(--surface); padding: .9rem 1.1rem; border-radius: 12px; text-decoration: none; font-weight: 700; color: var(--heading); box-shadow: var(--shadow); }
.children a:hover { color: var(--accent-dark); }

/* Sommaire */
.toc { background: var(--surface); border-radius: var(--radius); padding: 1.3rem 1.6rem; margin: 0 0 2rem; box-shadow: var(--shadow); }
.toc-title { font-weight: 800; color: var(--heading); margin-bottom: .5rem; }
.toc ol { margin: 0; padding-left: 1.3rem; }
.toc li { margin: .25rem 0; }

/* Articles */
.post-meta { font-size: .95rem; margin-bottom: 1.5rem; }
.post-cover { margin: 0 0 2rem; }
.post-cover img { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); aspect-ratio: 16 / 9; object-fit: cover; }
.tags { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 2rem; }
.tags.center { justify-content: center; margin: 0 0 2rem; }
.tags a { background: var(--surface); border: 1px solid var(--line); padding: .25rem .8rem; border-radius: 30px; font-size: .88rem; text-decoration: none; color: var(--text); }
.tags a:hover { border-color: var(--accent); color: var(--accent-dark); }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.6rem; margin-bottom: 2rem; }
.card { background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.card-img img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.card-body { padding: 1.2rem 1.3rem 1.4rem; display: flex; flex-direction: column; flex: 1; }
.card-date { font-size: .85rem; margin-bottom: .4rem; color: var(--purple); font-weight: 600; }
.card h3 { font-size: 1.12rem; margin-bottom: .5rem; }
.card h3 a { color: var(--heading); text-decoration: none; }
.card h3 a:hover { color: var(--accent-dark); }
.card-body > p:not(.card-date) { font-size: .95rem; flex: 1; }
.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; }
.pagination a, .pagination span { padding: .45rem .9rem; border-radius: 10px; background: var(--surface); text-decoration: none; font-weight: 700; color: var(--heading); }
.pagination span { background: var(--purple-dark); color: #fff; }

/* Appel à contact */
.cta { background: var(--purple-dark); color: #e9e2fb; padding: 3rem 0; }
.cta-in { display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.cta h2 { color: #fff; }
.cta .eyebrow { color: var(--yellow); }
.cta p { margin-bottom: 0; max-width: 640px; }
.cta .btn { white-space: nowrap; }

/* Formulaires */
.form { background: var(--surface); padding: 1.8rem; border-radius: var(--radius); box-shadow: var(--shadow); margin-top: 1.5rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.2rem; }
.form label { display: block; font-weight: 700; color: var(--heading); margin-bottom: .3rem; font-size: .95rem; }
.form input, .form select, .form textarea { width: 100%; padding: .7rem .85rem; border: 2px solid var(--line); border-radius: 10px; font: inherit; color: #2c1a47; background: #fff; }
.form input:focus, .form select:focus, .form textarea:focus { border-color: var(--purple); outline: none; }
.form-note { font-size: .88rem; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.notice { padding: 1rem 1.2rem; border-radius: 12px; margin-bottom: 1.5rem; }
.notice ul { margin: 0; padding-left: 1.2rem; }
.notice.ok { background: #dcf5e3; color: #17512a; border: 1px solid #9dd8ae; }
.notice.err { background: #fde3e0; color: #7c1d14; border: 1px solid #f0aaa2; }

/* Test en ligne */
.quiz { background: var(--surface); padding: 1.6rem; border-radius: var(--radius); box-shadow: var(--shadow); margin: 1.5rem 0; }
.quiz fieldset { border: 0; border-bottom: 1px solid var(--line); margin: 0 0 1.1rem; padding: 0 0 1.1rem; }
.quiz legend { font-weight: 700; color: var(--heading); margin-bottom: .5rem; padding: 0; }
.quiz label { display: block; padding: .3rem 0; cursor: pointer; }
.quiz input[type="radio"] { accent-color: var(--accent); margin-right: .5rem; }
.quiz-error { color: #a12318; font-weight: 700; }
.quiz-result { background: var(--surface); padding: 1.4rem 1.6rem; border-radius: var(--radius); border-left: 6px solid var(--yellow); margin: 1.2rem 0; box-shadow: var(--shadow); }
.quiz-result h3 { margin-top: 0; }
.quiz-score { font-size: 1.3rem; font-weight: 800; color: var(--heading); }

/* Pied de page */
.site-footer { background: #2c1648; color: #cfc4ea; padding: 2.8rem 0 1.2rem; }
.footer-in { display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.footer-logo { color: #fff; font-weight: 800; font-size: 1.25rem; margin-bottom: .4rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 2.5rem; }
.site-footer li { margin-bottom: .4rem; }
.site-footer a { color: #fff; }
.site-footer a:hover { color: var(--yellow); }
.copyright { text-align: center; font-size: .88rem; margin: 2rem 0 0; padding-top: 1.2rem; border-top: 1px solid rgba(255, 255, 255, .15); }

@media (max-width: 1340px) {
  .nav-toggle { display: block; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--purple-dark); flex-direction: column; align-items: stretch; padding: 1rem 1.25rem 1.5rem; box-shadow: var(--shadow); max-height: calc(100vh - 68px); overflow-y: auto; }
  .nav.open { display: flex; }
  .nav ul { flex-direction: column; align-items: stretch; }
  .nav .sub { display: flex; position: static; box-shadow: none; padding: 0 0 0 1rem; background: none; }
  .nav .btn { text-align: center; }
  .levels { grid-template-columns: repeat(2, 1fr); }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .home-hero-in { grid-template-columns: 1fr; }
  .home-hero-img { max-width: 440px; margin-inline: auto; }
  .cta-in { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 620px) {
  .levels, .cards, .form-row { grid-template-columns: 1fr; }
  .section { padding: 2.5rem 0; }
  .site-footer ul { columns: 1; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .level { transition: none; }
}
