/* ================================================================
   L'Ecole Russe — russkaia-chkola.com
   Mood board : "Cahier d'ecolier sovietique"
   ================================================================ */

/* Google Fonts — Libre Caslon Display + Source Serif 4 + Caveat + Rubik Mono One + Fredoka (cyrillic subset) */
@import url('https://fonts.googleapis.com/css2?family=Libre+Caslon+Display&family=Source+Serif+4:ital,opsz,wght@0,8..60,300..700;1,8..60,400;1,8..60,600&family=Caveat:wght@400;600&family=Rubik+Mono+One&family=Fredoka:wght@400;500;600;700&display=swap&subset=cyrillic');

/* ----------------------------------------------------------------
   Design tokens — palette principale "Cahier d'ecolier sovietique"
   ---------------------------------------------------------------- */
:root {
  /* Couleurs */
  --encre-noire:         #151515;
  --bleu-carnet:         #274C77;
  --bleu-carnet-clair:   #4A7AAF;
  --rouge-correction:    #B81D24;
  --ocre-parche:         #C2924D;
  --papier-ivoire:       #F4ECDA;
  --papier-gris:         #E3DCC8;

  /* Derives opacite */
  --encre-80: rgba(21,21,21,.8);
  --encre-60: rgba(21,21,21,.6);
  --encre-40: rgba(21,21,21,.4);
  --encre-20: rgba(21,21,21,.2);
  --encre-10: rgba(21,21,21,.1);
  --ivoire-95: rgba(244,236,218,.95);
  --ivoire-75: rgba(244,236,218,.75);
  --ivoire-40: rgba(244,236,218,.4);
  --bleu-20: rgba(39,76,119,.2);
  --bleu-10: rgba(39,76,119,.1);

  /* Polices */
  --ff-display: 'Libre Caslon Display', Georgia, 'Times New Roman', serif;
  --ff-body: 'Source Serif 4', Georgia, serif;
  --ff-accent: 'Caveat', 'Brush Script MT', cursive;
  --ff-cyrillic: 'Rubik Mono One', 'Courier New', monospace;

  /* Mesures */
  --measure-article: 680px;
  --measure-wide: 1280px;
  --measure-hero: 1440px;
  --gutter: clamp(1rem, 4vw, 2rem);

  /* Transitions */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 300ms;
  --dur: 500ms;
  --dur-slow: 700ms;
}

/* Palette enfants — override via wrapper .theme-kids */
.theme-kids {
  --accent-primary: #E63946;     /* rouge pompier */
  --accent-yellow:  #FFD60A;     /* jaune solaire */
  --accent-green:   #8FCB9B;     /* vert pomme */
  --accent-blue:    #A8DADC;     /* bleu ciel */
  --ff-display: 'Fredoka', 'Comic Sans MS', sans-serif;
}

/* ----------------------------------------------------------------
   Reset + base
   ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--ff-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--encre-noire);
  background: var(--papier-ivoire);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--bleu-carnet); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; transition: color var(--dur-fast) var(--ease); }
a:hover { color: var(--rouge-correction); }

h1, h2, h3, h4 {
  font-family: var(--ff-display);
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--encre-noire);
  line-height: 1.2;
  margin-top: 2em;
  margin-bottom: 0.6em;
}
h1 { font-size: clamp(2rem, 5vw, 3.25rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.2rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.5rem); }
h4 { font-size: 1.1rem; }
p { margin: 0 0 1.1em; }

/* Pattern lignage cahier SVG en data-URI (background) */
.lignage {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='24'><line x1='0' y1='23' x2='100' y2='23' stroke='%23A8C4E0' stroke-width='1' opacity='0.35'/></svg>");
  background-repeat: repeat;
}

/* ----------------------------------------------------------------
   Utility containers
   ---------------------------------------------------------------- */
.container { width: 100%; max-width: var(--measure-wide); margin: 0 auto; padding: 0 var(--gutter); }
.container-article { width: 100%; max-width: var(--measure-article); margin: 0 auto; padding: 0 var(--gutter); }
.container-hero { width: 100%; max-width: var(--measure-hero); margin: 0 auto; padding: 0 var(--gutter); }

/* ----------------------------------------------------------------
   Kickers cyrilliques cachet rouge
   ---------------------------------------------------------------- */
.kicker-cyrillic {
  display: inline-block;
  font-family: var(--ff-cyrillic);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  color: var(--rouge-correction);
  padding: 0.4em 0.85em;
  border: 2px solid var(--rouge-correction);
  border-radius: 4px;
  transform: rotate(-1.5deg);
  background: rgba(184,29,36,.04);
}
.kicker-fr {
  display: inline-block;
  font-family: var(--ff-body);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ocre-parche);
}

/* ----------------------------------------------------------------
   Signatures visuelles
   ---------------------------------------------------------------- */

/* Wavy underline rouge sous H1 (SVG inline via pseudo) */
.h1-wavy { position: relative; display: inline-block; padding-bottom: 0.2em; }
.h1-wavy::after {
  content: '';
  position: absolute;
  bottom: -0.1em;
  left: 0;
  width: 100%;
  height: 12px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12' preserveAspectRatio='none'><path d='M0,6 Q25,0 50,6 T100,6 T150,6 T200,6' stroke='%23B81D24' stroke-width='2.5' fill='none'/></svg>") no-repeat center / 100% 100%;
  opacity: 0;
  transform: scaleX(0);
  transform-origin: left center;
  transition: opacity var(--dur) var(--ease), transform var(--dur-slow) var(--ease);
}
.reveal.visible .h1-wavy::after,
.h1-wavy.visible::after { opacity: 1; transform: scaleX(1); }

/* Lettrine cyrillique au 1er paragraphe */
.lettrine::first-letter {
  font-family: var(--ff-display);
  font-size: 4.5em;
  float: left;
  line-height: 0.85;
  padding: 0.06em 0.15em 0 0;
  color: var(--bleu-carnet);
  font-weight: 400;
}

/* Pull quote — carte postale vintage */
.pullquote {
  margin: 2.2em 0;
  padding: 1.2em 1.5em 1.2em 1.8em;
  border-left: 4px solid var(--rouge-correction);
  background: var(--papier-gris);
  font-family: var(--ff-accent);
  font-size: 1.45rem;
  line-height: 1.4;
  color: var(--encre-noire);
  position: relative;
}
.pullquote .pullquote-ru {
  display: block;
  font-family: var(--ff-cyrillic);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--rouge-correction);
  opacity: 0.7;
  margin-bottom: 0.5em;
}
.pullquote cite {
  display: block;
  font-family: var(--ff-body);
  font-size: 0.9rem;
  font-style: normal;
  color: var(--encre-60);
  margin-top: 0.7em;
}

/* Numerotation 01. 02. 03. */
.num-lesson {
  font-family: var(--ff-display);
  font-size: 2.8rem;
  color: var(--ocre-parche);
  line-height: 1;
  margin-right: 0.4em;
  display: inline-block;
  vertical-align: middle;
}

/* Card fiche pedagogique (coin plie + badge) */
.fiche-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--encre-10);
  padding: 1.5rem 1.5rem 1.2rem;
  box-shadow: 0 2px 6px rgba(21,21,21,.05), 0 8px 20px rgba(21,21,21,.04);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  overflow: hidden;
}
.fiche-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 24px; height: 24px;
  background: linear-gradient(225deg, var(--papier-gris) 50%, transparent 50%);
  border-left: 1px solid var(--encre-10);
  border-bottom: 1px solid var(--encre-10);
}
.fiche-card:hover { transform: translateY(-3px); box-shadow: 0 6px 12px rgba(21,21,21,.08), 0 18px 32px rgba(21,21,21,.06); }
.fiche-card h3 { margin-top: 0.2em; font-size: 1.2rem; }
.fiche-card .level-badge { display: inline-block; margin-bottom: 0.6rem; }

/* Badges niveau A1/A2/B1/B2 */
.level-badge {
  display: inline-block;
  font-family: var(--ff-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 0.25em 0.75em;
  border-radius: 2px;
  background: var(--bleu-10);
  color: var(--bleu-carnet);
  border: 1px solid var(--bleu-20);
}
.level-badge.a1, .level-badge.a2 { background: #E8F0F7; color: var(--bleu-carnet); }
.level-badge.b1 { background: #F7ECCF; color: #8a6012; border-color: #d9b671; }
.level-badge.b2 { background: #F7DCD9; color: var(--rouge-correction); border-color: #d98a86; }
.level-badge.kids { background: #FFF4C8; color: #7a5800; border-color: #ffd580; }

/* FAQ accordeon — `+` → coche rouge ✓ */
.faq-list { margin: 2em 0; border-top: 1px solid var(--encre-10); }
.faq-item { border-bottom: 1px solid var(--encre-10); }
.faq-q {
  width: 100%;
  padding: 1.1rem 2.5rem 1.1rem 0;
  background: transparent;
  border: 0;
  text-align: left;
  font-family: var(--ff-display);
  font-size: 1.15rem;
  color: var(--bleu-carnet);
  cursor: pointer;
  position: relative;
  transition: color var(--dur-fast) var(--ease);
}
.faq-q:hover { color: var(--rouge-correction); }
.faq-q::after {
  content: '+';
  position: absolute;
  right: 0.2rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.6rem;
  color: var(--rouge-correction);
  font-weight: 300;
  font-family: var(--ff-body);
  transition: transform var(--dur) var(--ease);
}
.faq-item.open .faq-q::after {
  content: '✓';
  font-size: 1.3rem;
  font-weight: 600;
}
.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--dur) var(--ease);
}
.faq-item.open .faq-a { max-height: 800px; }
.faq-a-inner { padding: 0 0 1.2rem; }

/* Bloc exercice */
.exercise-block {
  margin: 2em 0;
  padding: 1.4rem 1.6rem;
  background: var(--papier-gris);
  border: 2px dashed var(--ocre-parche);
  border-radius: 6px;
  position: relative;
}
.exercise-block::before {
  content: '✎';
  position: absolute;
  top: 0.8rem; right: 1rem;
  font-size: 1.6rem;
  color: var(--ocre-parche);
  opacity: 0.5;
}
.exercise-block .num-lesson { font-size: 1.8rem; margin-right: 0.3em; vertical-align: -0.1em; }
.exercise-block h4 { margin-top: 0; font-family: var(--ff-body); font-weight: 600; font-size: 1.05rem; }
.exercise-answer {
  max-height: 0; overflow: hidden;
  transition: max-height var(--dur) var(--ease);
  background: var(--ivoire-95);
  border-left: 3px solid var(--rouge-correction);
}
.exercise-block.revealed .exercise-answer { max-height: 400px; }
.exercise-answer-inner { padding: 1rem 1.2rem; }
.exercise-toggle {
  background: var(--bleu-carnet);
  color: var(--papier-ivoire);
  border: 0;
  padding: 0.5rem 1rem;
  font-family: var(--ff-body);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  cursor: pointer;
  margin-top: 0.8rem;
  transition: background var(--dur-fast) var(--ease);
}
.exercise-toggle:hover { background: var(--rouge-correction); }

/* AlphabetRow (table alphabet) */
.alphabet-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-family: var(--ff-body);
}
.alphabet-table th, .alphabet-table td {
  padding: 0.7em 0.8em;
  border-bottom: 1px solid var(--encre-10);
  text-align: left;
}
.alphabet-table th {
  background: var(--papier-gris);
  font-family: var(--ff-body);
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--encre-60);
  font-weight: 600;
}
.alphabet-table .alphabet-letter {
  font-family: var(--ff-display);
  font-size: 1.8rem;
  color: var(--bleu-carnet);
  width: 14%;
}
.alphabet-table .alphabet-api { font-family: 'Courier New', monospace; color: var(--rouge-correction); font-size: 0.95rem; }
.alphabet-table .alphabet-translit { color: var(--ocre-parche); font-weight: 600; }

/* VocabPair */
.vocab-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-family: var(--ff-body);
}
.vocab-table td { padding: 0.55em 0.8em; border-bottom: 1px dotted var(--encre-10); }
.vocab-table .vocab-fr { color: var(--encre-noire); font-weight: 600; }
.vocab-table .vocab-ru { font-family: var(--ff-display); color: var(--bleu-carnet); font-size: 1.05rem; }
.vocab-table .vocab-pron { font-family: 'Courier New', monospace; color: var(--encre-60); font-size: 0.88rem; }

/* ConjugationTable */
.conjug-table {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin: 1.5em 0;
}
.conjug-cell {
  padding: 0.8rem 1rem;
  background: #fff;
  border: 1px solid var(--encre-10);
  border-left: 3px solid var(--bleu-carnet);
}
.conjug-cell.perfectif { border-left-color: var(--rouge-correction); }
.conjug-cell .conjug-pronom { font-size: 0.78rem; color: var(--encre-60); font-family: var(--ff-body); letter-spacing: 0.08em; text-transform: uppercase; }
.conjug-cell .conjug-verb { font-family: var(--ff-display); font-size: 1.2rem; color: var(--bleu-carnet); }

/* ----------------------------------------------------------------
   Hero
   ---------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 72vh;
  display: flex;
  align-items: center;
  padding: 6rem 0 4rem;
  overflow: hidden;
  background: var(--papier-ivoire);
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='24'><line x1='0' y1='23' x2='100' y2='23' stroke='%23A8C4E0' stroke-width='1' opacity='0.3'/></svg>");
  background-repeat: repeat;
}
.hero.has-image::before {
  content: '';
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(15,30,46,.45), rgba(15,30,46,.72) 55%, rgba(15,30,46,.88)),
    radial-gradient(ellipse at 30% 50%, rgba(15,30,46,.3), transparent 65%);
  z-index: 1;
}
.hero.has-image .hero-content {
  text-shadow: 0 2px 14px rgba(0,0,0,.55);
}
.hero.has-image .hero-content h1 {
  text-shadow: 0 3px 20px rgba(0,0,0,.7), 0 1px 3px rgba(0,0,0,.9);
}
.hero-bg {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
}
.hero.has-image .hero-content {
  color: var(--papier-ivoire);
  text-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.hero.has-image .hero-content h1 { color: var(--papier-ivoire); }
.hero-content {
  position: relative;
  z-index: 2;
  max-width: 820px;
}
.hero-kicker { margin-bottom: 1.5rem; }
.hero h1 { margin-top: 0.4rem; margin-bottom: 1rem; }
.hero-desc {
  font-family: var(--ff-accent);
  font-size: clamp(1.1rem, 2.2vw, 1.6rem);
  line-height: 1.4;
  max-width: 640px;
  margin-bottom: 2rem;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.8rem; }
.btn {
  display: inline-block;
  padding: 0.8em 1.6em;
  font-family: var(--ff-body);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-decoration: none;
  border: 2px solid var(--rouge-correction);
  transition: all var(--dur-fast) var(--ease);
  cursor: pointer;
}
.btn-primary { background: var(--rouge-correction); color: var(--papier-ivoire); }
.btn-primary:hover { background: transparent; color: var(--papier-ivoire); }
.btn-ghost { background: transparent; color: var(--papier-ivoire); }
.btn-ghost:hover { background: var(--rouge-correction); color: var(--papier-ivoire); }
.btn-dark { background: var(--bleu-carnet); color: var(--papier-ivoire); border-color: var(--bleu-carnet); }
.btn-dark:hover { background: var(--rouge-correction); border-color: var(--rouge-correction); }

.scroll-indicator {
  position: absolute;
  bottom: 2rem; left: 50%;
  transform: translateX(-50%);
  font-family: var(--ff-body);
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  color: var(--papier-ivoire);
  z-index: 2;
  opacity: 0.8;
  text-transform: uppercase;
}
.scroll-indicator::after {
  content: ''; display: block; width: 1px; height: 32px; margin: 0.6rem auto 0; background: var(--papier-ivoire);
  animation: scrollPulse 1.8s var(--ease) infinite;
}
@keyframes scrollPulse { 0%,100% { transform: scaleY(1); opacity: 0.8; } 50% { transform: scaleY(0.4); opacity: 0.3; } }

/* Hero article (breadcrumb + meta slots) */
.hero-article { min-height: 52vh; padding-top: 9rem; padding-bottom: 3rem; }
.hero-breadcrumb { font-size: 0.82rem; letter-spacing: 0.05em; margin-bottom: 1.2rem; }
.hero-breadcrumb a { color: inherit; text-decoration: none; opacity: 0.8; }
.hero-breadcrumb a:hover { opacity: 1; }
.hero-meta { font-family: var(--ff-body); font-size: 0.85rem; opacity: 0.85; margin-top: 1rem; }
.hero-meta time + span::before { content: ' · '; margin: 0 0.4em; opacity: 0.5; }

/* ----------------------------------------------------------------
   Header / Navigation
   ---------------------------------------------------------------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  background: var(--ivoire-95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  transition: box-shadow var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.site-header.scrolled { box-shadow: 0 2px 14px rgba(21,21,21,.08); }
.header-inner {
  max-width: var(--measure-wide);
  margin: 0 auto;
  padding: 0.9rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.logo-link {
  display: flex; align-items: center; gap: 0.6rem;
  text-decoration: none; color: var(--encre-noire);
  font-family: var(--ff-display); font-size: 1.3rem; font-weight: 400;
}
.logo-link .logo-kicker {
  font-family: var(--ff-cyrillic); font-size: 0.62rem; letter-spacing: 0.2em;
  color: var(--rouge-correction); display: block; margin-top: -4px;
}
.main-nav { display: flex; gap: 1.3rem; align-items: center; }
.main-nav a {
  color: var(--encre-noire);
  text-decoration: none;
  font-family: var(--ff-body);
  font-size: 0.92rem;
  padding: 0.3rem 0.1rem;
  position: relative;
}
.main-nav a::after {
  content: ''; position: absolute; left: 0; bottom: 0;
  width: 100%; height: 2px; background: var(--rouge-correction);
  transform: scaleX(0); transform-origin: left;
  transition: transform var(--dur-fast) var(--ease);
}
.main-nav a:hover::after, .main-nav a.active::after { transform: scaleX(1); }
.lang-switcher a {
  font-family: var(--ff-cyrillic);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  padding: 0.3em 0.6em;
  border: 1px solid var(--encre-20);
  color: var(--encre-noire);
  text-decoration: none;
  transition: all var(--dur-fast) var(--ease);
}
.lang-switcher a:hover, .lang-switcher a.active { background: var(--bleu-carnet); color: var(--papier-ivoire); border-color: var(--bleu-carnet); }

.hamburger {
  display: none;
  background: transparent; border: 0;
  width: 36px; height: 36px;
  cursor: pointer; padding: 0;
  position: relative;
}
.hamburger span {
  position: absolute; left: 6px; right: 6px; height: 2px;
  background: var(--encre-noire);
  transition: all var(--dur-fast) var(--ease);
}
.hamburger span:nth-child(1) { top: 11px; }
.hamburger span:nth-child(2) { top: 17px; }
.hamburger span:nth-child(3) { top: 23px; }
body.nav-open .hamburger span:nth-child(1) { transform: rotate(45deg); top: 17px; }
body.nav-open .hamburger span:nth-child(2) { opacity: 0; }
body.nav-open .hamburger span:nth-child(3) { transform: rotate(-45deg); top: 17px; }

/* ----------------------------------------------------------------
   Article layout — TOC + body + FAQ + related
   ---------------------------------------------------------------- */
.article-summary {
  max-width: var(--measure-article);
  margin: 3rem auto 2rem;
  padding: 0 var(--gutter) 2rem;
  font-family: var(--ff-accent);
  font-size: 1.3rem;
  line-height: 1.5;
  color: var(--encre-80);
  border-bottom: 1px solid var(--encre-10);
  text-align: left;
}

.article-wrapper {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 3rem;
  max-width: var(--measure-wide);
  margin: 2.5rem auto 4rem;
  padding: 0 var(--gutter);
}
.toc-sticky {
  position: sticky;
  top: 100px;
  align-self: start;
  padding: 1.5rem 0;
  border-top: 2px solid var(--rouge-correction);
  border-bottom: 1px solid var(--encre-10);
  font-size: 0.88rem;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
}
.toc-sticky .toc-title {
  font-family: var(--ff-body); font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ocre-parche); margin-bottom: 1em; font-weight: 600;
}
.toc-sticky ol { list-style: none; padding: 0; margin: 0; counter-reset: toc; }
.toc-sticky li { counter-increment: toc; margin-bottom: 0.6em; }
.toc-sticky li::before {
  content: counter(toc, decimal-leading-zero) ".";
  font-family: var(--ff-display);
  color: var(--ocre-parche);
  margin-right: 0.4em;
}
.toc-sticky a { color: var(--encre-noire); text-decoration: none; }
.toc-sticky a:hover { color: var(--rouge-correction); }

.article-body {
  font-size: 1.05rem;
  line-height: 1.75;
  max-width: var(--measure-article);
  margin-right: auto;
}
.article-body h2 { position: relative; padding-bottom: 0.3em; }
.article-body h2::after {
  content: '';
  display: block;
  width: 60px; height: 2px;
  background: var(--ocre-parche);
  margin-top: 0.4em;
}
.article-body img { margin: 2rem auto; border-radius: 4px; box-shadow: 0 8px 24px rgba(21,21,21,.08); }
.article-body a { color: var(--bleu-carnet); text-decoration: underline; text-underline-offset: 3px; }
.article-body ul, .article-body ol { padding-left: 1.4em; }
.article-body li { margin-bottom: 0.5em; }
.article-body table { width: 100%; border-collapse: collapse; margin: 1.5em 0; font-size: 0.95rem; }
.article-body th, .article-body td { padding: 0.6em 0.8em; border-bottom: 1px solid var(--encre-10); text-align: left; }
.article-body th { background: var(--papier-gris); font-weight: 600; font-family: var(--ff-body); }
.article-body code { font-family: 'Courier New', monospace; background: var(--papier-gris); padding: 0.1em 0.35em; border-radius: 3px; font-size: 0.92em; }
.article-body blockquote {
  margin: 1.8em 0;
  padding: 0 1.2em;
  border-left: 3px solid var(--rouge-correction);
  font-family: var(--ff-accent);
  font-size: 1.3rem;
  font-style: italic;
  color: var(--encre-80);
}

/* ----------------------------------------------------------------
   Related cards grid (fin d'article + sections magazine)
   ---------------------------------------------------------------- */
.related-section {
  max-width: var(--measure-wide);
  margin: 5rem auto 4rem;
  padding: 0 var(--gutter);
}
.related-section .kicker-fr { display: block; margin-bottom: 0.6em; }
.related-section h2 { margin-top: 0.2em; margin-bottom: 2rem; }
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.8rem;
}
.related-card {
  display: block;
  background: #fff;
  border: 1px solid var(--encre-10);
  text-decoration: none;
  color: inherit;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  overflow: hidden;
}
.related-card:hover { transform: translateY(-4px); box-shadow: 0 10px 30px rgba(21,21,21,.1); }
.related-card .card-image { aspect-ratio: 3/2; background-size: cover; background-position: center; }
.related-card .card-inner { padding: 1.2rem 1.4rem 1.5rem; }
.related-card h3 { margin-top: 0.5em; font-size: 1.15rem; color: var(--encre-noire); }
.related-card p { font-size: 0.9rem; color: var(--encre-60); margin: 0.4em 0 0; }

/* ----------------------------------------------------------------
   Grille uniforme homepage (8 cards taille identique 3:2)
   ---------------------------------------------------------------- */
.asym-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin: 3rem 0;
}
.a-card-sq,
.a-card-po,
.a-card-feature { grid-column: span 1; aspect-ratio: 3/2; }
.a-card-sq, .a-card-po, .a-card-feature {
  position: relative;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  color: var(--papier-ivoire);
  text-decoration: none;
}
.a-card-sq::before, .a-card-po::before, .a-card-feature::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(15,30,46,0.1), rgba(15,30,46,0.6) 70%, rgba(15,30,46,0.85));
  transition: opacity var(--dur) var(--ease);
}
.a-card-sq:hover::before, .a-card-po:hover::before, .a-card-feature:hover::before { opacity: 0.95; }
.a-card-content { position: absolute; bottom: 1rem; left: 1.2rem; right: 1.2rem; z-index: 2; }
.a-card-content .kicker-fr { color: var(--ocre-parche); font-size: 0.72rem; }
.a-card-content h3 { margin-top: 0.3em; color: var(--papier-ivoire); font-size: 1.15rem; }

/* ----------------------------------------------------------------
   Footer
   ---------------------------------------------------------------- */
.site-footer {
  background: var(--bleu-carnet);
  color: var(--papier-ivoire);
  padding: 4rem 0 2rem;
  margin-top: 6rem;
}
.footer-inner { max-width: var(--measure-wide); margin: 0 auto; padding: 0 var(--gutter); }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 2rem; margin-bottom: 3rem; }
.footer-grid h4 { color: var(--papier-ivoire); font-family: var(--ff-body); font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase; margin: 0 0 1em; font-weight: 600; }
.footer-grid a { color: var(--papier-ivoire); opacity: 0.8; text-decoration: none; display: block; padding: 0.25em 0; font-size: 0.92rem; }
.footer-grid a:hover { opacity: 1; color: var(--ocre-parche); }
.footer-brand .logo-link { color: var(--papier-ivoire); }
.footer-brand p { opacity: 0.8; font-size: 0.92rem; }
.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid rgba(244,236,218,.15);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
  font-size: 0.82rem; opacity: 0.7;
}
.footer-heritage { font-family: var(--ff-accent); font-size: 1.15rem; opacity: 0.75; margin-top: 2rem; }

/* ----------------------------------------------------------------
   Reveal animation
   ---------------------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease); }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ----------------------------------------------------------------
   Theme kids (sur section enfants)
   ---------------------------------------------------------------- */
.theme-kids {
  background: linear-gradient(180deg, var(--accent-blue) 0%, var(--papier-ivoire) 100%);
}
.theme-kids h1, .theme-kids h2, .theme-kids h3 {
  font-family: var(--ff-display);
  color: var(--bleu-carnet);
}
.theme-kids .hero {
  background: var(--accent-yellow);
  background-image: radial-gradient(circle at 20% 30%, rgba(230,57,70,.08), transparent 40%),
                    radial-gradient(circle at 80% 70%, rgba(39,76,119,.08), transparent 40%);
}
.theme-kids .hero h1 { color: var(--bleu-carnet); }
.theme-kids .btn-primary { background: var(--accent-primary); border-color: var(--accent-primary); }
.theme-kids .kicker-cyrillic { color: var(--accent-primary); border-color: var(--accent-primary); }
.theme-kids .badge-age {
  display: inline-block;
  background: var(--accent-primary);
  color: #fff;
  padding: 0.3em 0.9em;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.alphabet-kids-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}
.alphabet-kids-card {
  background: #fff;
  border: 2px solid var(--bleu-carnet);
  border-radius: 12px;
  padding: 1rem 0.8rem 1.2rem;
  text-align: center;
  transition: transform var(--dur) var(--ease);
  box-shadow: 0 3px 0 var(--bleu-carnet);
}
.alphabet-kids-card:hover { transform: translateY(-3px) rotate(-0.8deg); }
.alphabet-kids-card .letter-big { font-family: var(--ff-display); font-size: 3rem; color: var(--accent-primary); line-height: 1; display: block; margin-bottom: 0.3em; }
.alphabet-kids-card .letter-img { width: 80%; aspect-ratio: 1/1; margin: 0.3em auto; object-fit: contain; }
.alphabet-kids-card .letter-word { font-family: var(--ff-display); font-size: 1rem; color: var(--bleu-carnet); margin-top: 0.4em; }
.alphabet-kids-card .letter-word-fr { font-size: 0.78rem; color: var(--encre-60); margin-top: 0.2em; }

.masha-mascot {
  display: inline-block;
  vertical-align: middle;
  width: 48px;
  height: auto;
}
.masha-mascot.corner {
  position: absolute;
  top: -20px; right: -10px;
  width: 80px;
  transform: rotate(8deg);
  z-index: 5;
}

/* ----------------------------------------------------------------
   Responsive
   ---------------------------------------------------------------- */
@media (max-width: 1024px) {
  .article-wrapper { grid-template-columns: 1fr; gap: 1.5rem; }
  .toc-sticky { position: static; max-height: none; padding: 1.2rem; background: var(--papier-gris); border-radius: 4px; }
  .asym-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  body { font-size: 16px; }
  .main-nav {
    position: fixed; top: 60px; left: 0; right: 0; bottom: 0;
    background: var(--papier-ivoire);
    flex-direction: column;
    padding: 2rem;
    gap: 1rem;
    transform: translateX(100%);
    transition: transform var(--dur) var(--ease);
    z-index: 90;
    overflow-y: auto;
  }
  body.nav-open .main-nav { transform: translateX(0); }
  .main-nav a { font-size: 1.1rem; padding: 0.6rem 0; }
  .hamburger { display: block; }
  .asym-grid { grid-template-columns: 1fr; gap: 1rem; }
  .a-card-sq, .a-card-po, .a-card-feature { aspect-ratio: 16/10; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .conjug-table { grid-template-columns: 1fr 1fr; }
  .hero { min-height: 55vh; padding: 5rem 0 3rem; }
  .hero-article { min-height: 40vh; padding-top: 7rem; }
  .article-body { font-size: 1rem; }
}

@media (max-width: 480px) {
  .alphabet-kids-grid { grid-template-columns: repeat(2, 1fr); }
  .conjug-table { grid-template-columns: 1fr; }
}
