/* Facile Anglais — maquette de la refonte */
:root {
  --bg: #fbf8f3;
  --surface: #ffffff;
  --surface-2: #f3eee6;
  --ink: #1b2231;
  --muted: #5a6475;
  --line: #e6dfd3;
  --brand: #1d4f91;
  --brand-ink: #ffffff;
  --accent: #e0492a;
  --ok: #17835a;
  --ok-bg: #e3f4ec;
  --ko: #c0392b;
  --ko-bg: #fbe7e4;
  --hl: #ffe08a;
  --c-cours: #1d4f91;
  --c-exos: #e0492a;
  --c-videos: #7a3fb0;
  --c-jeux: #1f8a70;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(27 34 49 / .06), 0 6px 20px rgb(27 34 49 / .06);
  --font-title: "Nunito", system-ui, sans-serif;
  --font-body: "Atkinson Hyperlegible", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12161f; --surface: #1a202c; --surface-2: #222938; --ink: #ecedf1; --muted: #a5adbb;
    --line: #2e3647; --brand: #6ea3ea; --brand-ink: #0f1420; --accent: #ff7a5c;
    --ok: #4cc795; --ok-bg: #16392c; --ko: #ff7f73; --ko-bg: #422220; --hl: #6b5514;
    --c-cours: #6ea3ea; --c-exos: #ff7a5c; --c-videos: #b98ae6; --c-jeux: #4cc7a8;
    --shadow: 0 1px 2px rgb(0 0 0 / .3); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #12161f; --surface: #1a202c; --surface-2: #222938; --ink: #ecedf1; --muted: #a5adbb;
  --line: #2e3647; --brand: #6ea3ea; --brand-ink: #0f1420; --accent: #ff7a5c;
  --ok: #4cc795; --ok-bg: #16392c; --ko: #ff7f73; --ko-bg: #422220; --hl: #6b5514;
  --c-cours: #6ea3ea; --c-exos: #ff7a5c; --c-videos: #b98ae6; --c-jeux: #4cc7a8;
  --shadow: 0 1px 2px rgb(0 0 0 / .3); color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 18px/1.6 var(--font-body);
}
h1, h2, h3 { font-family: var(--font-title); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 900; }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 800; }
h3 { font-size: 1.15rem; font-weight: 800; }
a { color: var(--brand); text-underline-offset: 3px; }
img { max-width: 100%; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* En-tête */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.site-header .wrap { display: flex; align-items: center; gap: 24px; height: 64px; }
.logo { font: 900 1.35rem var(--font-title); color: var(--ink); text-decoration: none; white-space: nowrap; }
.logo span { color: var(--accent); }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 700; padding: 8px 12px; border-radius: 10px; font-size: .95rem; }
.nav a:hover, .nav a[aria-current] { background: var(--surface-2); }
.menu-toggle { display: none; margin-left: auto; }
@media (max-width: 820px) {
  .nav { display: none; }
  .menu-toggle { display: block; }
  .menu-toggle summary { list-style: none; cursor: pointer; font-weight: 800; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; }
  .menu-toggle summary::-webkit-details-marker { display: none; }
  .menu-toggle[open] .nav { display: flex; flex-direction: column; position: absolute; left: 0; right: 0; top: 64px; background: var(--surface); padding: 8px 16px 16px; border-bottom: 1px solid var(--line); }
}

/* Accueil */
.hero { padding: 56px 0 40px; }
.hero p.lead { font-size: 1.2rem; color: var(--muted); max-width: 40ch; margin: 0 0 24px; }
.hero mark { background: linear-gradient(transparent 60%, var(--hl) 60%); color: inherit; }
.search { display: flex; max-width: 560px; background: var(--surface); border: 2px solid var(--line); border-radius: 999px; padding: 6px; box-shadow: var(--shadow); }
.search:focus-within { border-color: var(--brand); }
.search input { flex: 1; min-width: 0; border: 0; background: none; font: inherit; color: var(--ink); padding: 8px 16px; outline: none; }
.search button { border: 0; background: var(--brand); color: var(--brand-ink); font: 800 1rem var(--font-title); padding: 10px 20px; border-radius: 999px; cursor: pointer; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.chip { display: inline-block; background: var(--surface); border: 1px solid var(--line); color: var(--ink); border-radius: 999px; padding: 4px 14px; font-size: .9rem; text-decoration: none; }
.chip:hover { border-color: var(--brand); color: var(--brand); }

.rubrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 8px 0 56px; }
@media (max-width: 900px) { .rubrics { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .rubrics { grid-template-columns: 1fr; } }
.rubric { --c: var(--brand); background: var(--surface); border-radius: var(--radius); padding: 20px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); border-top: 5px solid var(--c); display: flex; flex-direction: column; transition: transform .15s; }
.rubric:hover { transform: translateY(-3px); }
.rubric .icon { font-size: 1.8rem; line-height: 1; margin-bottom: 12px; }
.rubric h3 { margin-bottom: 4px; }
.rubric p { margin: 0 0 12px; color: var(--muted); font-size: .95rem; }
.rubric .count { margin-top: auto; font: 800 .9rem var(--font-title); color: var(--c); }
.r-cours { --c: var(--c-cours); } .r-exos { --c: var(--c-exos); } .r-videos { --c: var(--c-videos); } .r-jeux { --c: var(--c-jeux); }

section.block { margin-bottom: 56px; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.block-head a { font-weight: 700; }

.levels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 720px) { .levels { grid-template-columns: 1fr; } }
.level { background: var(--surface); border-radius: var(--radius); padding: 16px 20px; box-shadow: var(--shadow); }
.level h3 { font-size: 1rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.level .chips { margin-top: 0; }
.level .chip { background: var(--surface-2); border-color: transparent; font-weight: 700; }

.method { background: var(--brand); color: var(--brand-ink); border-radius: calc(var(--radius) * 1.5); padding: 32px; }
.method a { color: inherit; }
.method p { max-width: 60ch; opacity: .9; }
.lessons { display: flex; gap: 12px; overflow-x: auto; padding: 8px 0 4px; scroll-snap-type: x mandatory; }
.lesson { flex: 0 0 200px; scroll-snap-align: start; background: rgb(255 255 255 / .12); border-radius: 12px; padding: 14px; text-decoration: none; }
.lesson:hover { background: rgb(255 255 255 / .2); }
.lesson b { display: block; font: 900 .8rem var(--font-title); text-transform: uppercase; letter-spacing: .08em; opacity: .8; }
.lesson span { font-weight: 700; }

.popular { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 32px; }
@media (max-width: 720px) { .popular { grid-template-columns: 1fr; } }
.popular li { border-bottom: 1px solid var(--line); }
.popular a { display: flex; gap: 12px; align-items: baseline; padding: 12px 0; color: var(--ink); text-decoration: none; }
.popular a:hover .t { color: var(--brand); text-decoration: underline; }
.tag { flex: none; font: 800 .7rem var(--font-title); text-transform: uppercase; letter-spacing: .06em; padding: 2px 8px; border-radius: 6px; color: #fff; background: var(--c-cours); }
.tag.exos { background: var(--c-exos); } .tag.videos { background: var(--c-videos); } .tag.jeux { background: var(--c-jeux); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tag { color: #10141c; } }
:root[data-theme="dark"] .tag { color: #10141c; }

/* Pages de contenu */
.crumbs { font-size: .9rem; color: var(--muted); padding: 20px 0 0; }
.crumbs a { color: var(--muted); }
.page-head { padding: 12px 0 24px; }
.page-head .meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--muted); font-size: .95rem; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 40px; align-items: start; padding-bottom: 64px; }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } }
.prose { background: var(--surface); border-radius: var(--radius); padding: clamp(20px, 4vw, 40px); box-shadow: var(--shadow); }
.prose h2 { margin-top: 1.6em; }
.prose h2:first-child { margin-top: 0; }
.rule { background: var(--surface-2); border-left: 4px solid var(--c-cours); border-radius: 8px; padding: 10px 16px; font-weight: 700; }
.example { display: flex; gap: 14px; align-items: flex-start; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin: 12px 0 20px; }
.example .en { font-size: 1.1rem; }
.example .en strong { color: var(--accent); }
.example .fr { color: var(--muted); font-style: italic; }
.play { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--brand); color: var(--brand-ink); cursor: pointer; display: grid; place-items: center; }
.play:hover { filter: brightness(1.1); }
.play svg { width: 18px; height: 18px; }
.play.playing { background: var(--accent); }

/* La colonne s'étire sur toute la hauteur de l'article : seule la pub (.ad-sticky) y reste collée */
.aside { align-self: stretch; display: flex; flex-direction: column; gap: 16px; }
.card { background: var(--surface); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card h3 { font-size: 1rem; }
.card ol, .card ul { margin: 0; padding-left: 1.2em; }
.card li { margin: 6px 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; padding: 12px 20px; font: 800 1rem var(--font-title); text-decoration: none; cursor: pointer; background: var(--brand); color: var(--brand-ink); }
.btn.alt { background: var(--surface-2); color: var(--ink); }
.btn.accent { background: var(--accent); color: #fff; }
.levels-links { display: grid; gap: 8px; }
.levels-links .btn { justify-content: space-between; width: 100%; }

/* Quiz */
.quiz { background: var(--surface); border-radius: var(--radius); padding: clamp(20px, 4vw, 40px); box-shadow: var(--shadow); }
.progress { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin-bottom: 8px; }
.progress div { height: 100%; width: 0; background: var(--c-exos); transition: width .3s; }
.q-count { font: 800 .9rem var(--font-title); color: var(--muted); margin-bottom: 20px; }
.q-text { font-size: 1.35rem; font-weight: 700; margin: 0 0 20px; }
.q-text .gap { display: inline-block; min-width: 5ch; border-bottom: 3px solid var(--c-exos); color: var(--c-exos); text-align: center; }
.choices { display: grid; gap: 10px; }
.choice { text-align: left; font: inherit; font-size: 1.1rem; color: var(--ink); background: var(--surface); border: 2px solid var(--line); border-radius: 12px; padding: 14px 18px; cursor: pointer; display: flex; gap: 12px; align-items: center; }
.choice:hover:not(:disabled) { border-color: var(--brand); }
.choice kbd { font: 800 .8rem var(--font-title); background: var(--surface-2); border-radius: 6px; padding: 2px 8px; color: var(--muted); }
.choice.right { border-color: var(--ok); background: var(--ok-bg); }
.choice.wrong { border-color: var(--ko); background: var(--ko-bg); }
.choice:disabled { cursor: default; }
.feedback { min-height: 3em; margin: 16px 0 0; font-weight: 700; }
.feedback.ok { color: var(--ok); } .feedback.ko { color: var(--ko); }
.quiz-foot { display: flex; justify-content: flex-end; margin-top: 8px; }
.result { text-align: center; }
.result .score { font: 900 4rem var(--font-title); color: var(--c-exos); line-height: 1; margin: 8px 0; }
.recap { text-align: left; list-style: none; padding: 0; margin: 24px 0; }
.recap li { border-bottom: 1px solid var(--line); padding: 10px 0; }
.recap .bad { color: var(--ko); text-decoration: line-through; margin-right: 8px; }
.recap .good { color: var(--ok); font-weight: 700; }

/* Pied de page */
.site-footer { background: var(--surface); border-top: 1px solid var(--line); padding: 40px 0; font-size: .95rem; color: var(--muted); }
.site-footer .cols { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 24px; }
@media (max-width: 720px) { .site-footer .cols { grid-template-columns: 1fr 1fr; } }
.site-footer h4 { font-family: var(--font-title); color: var(--ink); margin: 0 0 8px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: 4px 0; }
.site-footer a { color: var(--muted); }

/* Contenu importé de l'ancien site */
.prose > :first-child { margin-top: 0; }
.prose img { height: auto; border-radius: 8px; }
.prose table { border-collapse: collapse; width: 100%; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; vertical-align: top; }
.prose th { background: var(--surface-2); font-family: var(--font-title); }
.prose tr:nth-child(even) td { background: color-mix(in srgb, var(--surface-2) 45%, transparent); }
.table-wrap { overflow-x: auto; margin: 16px 0; }
.prose .play { width: 34px; height: 34px; vertical-align: middle; margin: 0 6px; }
.prose .play svg { width: 14px; height: 14px; }
.credit { font-size: .8rem; color: var(--muted); }
.note { background: var(--surface-2); border-radius: 12px; padding: 12px 16px; color: var(--muted); }

.vocab-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin: 16px 0; }
.vocab { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.vocab img { width: 100%; aspect-ratio: 1; object-fit: contain; background: #fff; border-radius: 0; padding: 8px; }
.vocab figcaption { display: flex; gap: 8px; align-items: center; padding: 10px; border-top: 1px solid var(--line); margin-top: auto; }
.vocab figcaption span { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.vocab small { color: var(--muted); }
.prose .vocab .play { margin: 0; }

.yt { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: 12px; overflow: hidden; margin: 16px 0; }
.yt iframe, .yt-play, .yt-play img { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.yt-play { padding: 0; cursor: pointer; background: #000; }
.yt-play img { object-fit: cover; border-radius: 0; opacity: .85; }
.yt-play::after { content: ""; position: absolute; left: 50%; top: 50%; width: 68px; height: 48px; transform: translate(-50%, -50%); border-radius: 12px; background: #e0492a url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9 7v10l8-5z'/%3E%3C/svg%3E") center / 32px no-repeat; }
.embed iframe { width: 100%; min-height: 550px; border: 0; border-radius: 12px; }

/* Listes et rubriques */
.intro { color: var(--muted); max-width: 65ch; }
.subhubs { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin: 16px 0 40px; }
.subhub { background: var(--surface); border-radius: 12px; padding: 16px 18px; box-shadow: var(--shadow); text-decoration: none; color: var(--ink); display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.subhub:hover { color: var(--brand); }
.subhub b { font-family: var(--font-title); }
.subhub span { color: var(--muted); font-size: .9rem; white-space: nowrap; }
.list { list-style: none; padding: 0; margin: 0 0 48px; columns: 2 320px; column-gap: 32px; }
.list li { break-inside: avoid; border-bottom: 1px solid var(--line); }
.list a { display: block; padding: 10px 0; color: var(--ink); text-decoration: none; }
.list a:hover { color: var(--brand); text-decoration: underline; }
.level-group h2 { margin-top: 32px; }
.card .chips { margin-top: 0; }

.steps { list-style: none; padding: 0; margin: 0; counter-reset: step; display: grid; gap: 10px; }
.steps li a { counter-increment: step; display: flex; gap: 14px; align-items: center; background: var(--surface); border-radius: 12px; padding: 14px 18px; box-shadow: var(--shadow); text-decoration: none; color: var(--ink); }
.steps li a::before { content: counter(step); flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font: 900 .95rem var(--font-title); }
.steps li.done a::before { content: "✓"; background: var(--ok); color: #fff; }
.steps .t { font-weight: 700; }
.steps .tag { margin-left: auto; }
.pager { display: flex; justify-content: space-between; gap: 12px; margin: 24px 0 64px; flex-wrap: wrap; }

.results { list-style: none; padding: 0; }
.results li { border-bottom: 1px solid var(--line); }
.results a { display: flex; gap: 12px; align-items: baseline; padding: 12px 0; text-decoration: none; color: var(--ink); }
.results a:hover .t { color: var(--brand); text-decoration: underline; }
.page-search { margin-bottom: 24px; }

/* Textes à trous */
input.blank { font: inherit; font-weight: 700; color: var(--brand); width: 9ch; min-width: 5ch; padding: 2px 8px; margin: 2px 2px; border: 0; border-bottom: 3px solid var(--c-exos); background: var(--surface-2); border-radius: 6px 6px 0 0; text-align: center; }
input.blank:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
input.blank.right { border-color: var(--ok); background: var(--ok-bg); color: var(--ok); }
input.blank.wrong { border-color: var(--ko); background: var(--ko-bg); color: var(--ko); }
.q-text img { display: block; max-width: 100%; height: auto; margin: 8px 0; border-radius: 8px; }
.bank { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.bank button { font: inherit; background: var(--surface); border: 2px solid var(--line); border-radius: 10px; padding: 6px 14px; cursor: pointer; color: var(--ink); }
.bank button:hover:not(:disabled) { border-color: var(--brand); }
.bank button:disabled { opacity: .35; cursor: default; }
.match { display: grid; gap: 8px; margin-bottom: 8px; }
.match-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 12px; align-items: center; border-bottom: 1px solid var(--line); padding: 6px 0; }
.match-row span { font-weight: 700; }
.match-row small { grid-column: 2; color: var(--ok); font-weight: 700; }
.match select { font: inherit; padding: 8px 10px; border: 2px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); min-width: 0; }
.match select.right { border-color: var(--ok); background: var(--ok-bg); }
.match select.wrong { border-color: var(--ko); background: var(--ko-bg); }
@media (max-width: 480px) { .match-row { grid-template-columns: 1fr; gap: 4px; } .match-row small { grid-column: 1; } }
.quiz + .quiz { margin-top: 24px; }

/* Ted et Betty */
.hero { display: flow-root; }
.hero-art { float: right; width: min(46%, 520px); height: auto; margin: -8px 0 16px 24px; }
.hero-art.small { float: none; display: block; width: min(100%, 360px); margin: 0 0 12px; }
@media (max-width: 720px) { .hero-art { float: none; display: block; width: min(100%, 420px); margin: 0 auto 16px; } }
.duo { display: inline-flex; vertical-align: middle; margin-right: 12px; }
.duo img { width: 44px; height: 44px; border-radius: 50%; border: 2px solid rgb(255 255 255 / .8); }
.duo img + img { margin-left: -12px; }
.mascot { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 16px 0 4px; }
.mascot img { width: 80px; height: 80px; border-radius: 50%; flex: none; }
.bubble { position: relative; background: var(--surface-2); border-radius: 16px; padding: 10px 16px; margin: 0; font-weight: 700; max-width: 32ch; text-align: left; }
.bubble::before { content: ""; position: absolute; left: -8px; top: 50%; transform: translateY(-50%); border: 8px solid transparent; border-left: 0; border-right-color: var(--surface-2); }

/* Publicité : hauteur réservée pour éviter que la page ne « saute », masquée si Google n'a rien à afficher */
.ad { margin: 28px 0; text-align: center; }
.ad .adsbygoogle { display: block; }
.ad-label { display: block; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.ad-in-article .adsbygoogle, .ad-liste .adsbygoogle { min-height: 200px; }
.ad-fin .adsbygoogle { min-height: 250px; }
.ad-colonne .adsbygoogle { min-height: 600px; }
.ad:has(ins[data-ad-status="unfilled"]) { display: none; }
.ad-sticky { position: sticky; top: 88px; }
.aside .ad { margin: 0; }
@media (max-width: 900px) { .ad-sticky { display: none; } }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); text-decoration: underline; cursor: pointer; }
.prose .quiz { box-shadow: none; border: 1px solid var(--line); margin: 24px 0; }
