/* ============================================================
   THÈME GERMIFLOR — réinterprétation aux couleurs de la marque
   Rouge Germiflor #E1251B + Bleu encre #1F5689 sur fond profond.
   À charger en DERNIER (après wow-modern-import.css) pour
   re-mapper la palette « forest + lime » vers la charte maison.
   ============================================================ */

:root {
  /* Pop primaire (remplace le lime) → rouge Germiflor (légèrement
     éclairci pour rester lisible sur fond sombre) */
  --m-lime:     #EE3B30;
  /* Secondaire (remplace l'emerald) → bleu encre éclairci */
  --m-emerald:  #3E79B8;
  /* Accents famille re-mappés dans le duo rouge / bleu */
  --m-clay:     #E1251B;
  --m-saffron:  #4E86C2;
  --m-rust:     #B81E15;
  --m-lavender: #1F5689;
  --m-sky:      #6BA3D6;
  --m-cream:    #FBF8F2;
  --m-bone:     #ECE6DA;

  /* Fonds profonds : bleu encre au lieu du vert forêt */
  --paper-dark:      #0a1626;
  --paper-dark-2:    #0e2034;
  --paper-dark-edge: #20354e;

  /* tokens de marque utiles */
  --gfm-red:    #E1251B;
  --gfm-blue:   #1F5689;

  /* Accents de famille re-mappés dans le duo rouge / bleu encre
     (au lieu de sienna / sage / wine / ochre) */
  --sienna:      #C4302A;
  --sienna-deep: #9E1B14;
  --sage:        #3E79B8;
  --sage-deep:   #2E6FB0;
  --wine:        #9E1B14;
  --ochre:       #2E6FB0;
}

/* ---------- 1. ENVIRONNEMENT ---------- */

/* Accents de famille : forcés à spécificité supérieure (battent
   :root et [data-theme="dark"] de styles.css).
   minérales→rouge · végétales→bleu · animales→rouge profond · spécifiques→bleu */
html, html:root, body, body.wow,
html[data-theme="dark"], [data-theme="dark"] {
  /* Palette harmonieuse par famille (s'accordent sur fond bleu encre) :
     minérales→terre cuite · végétales→or ambré · animales→grenat · spécifiques→pervenche */
  --sienna:      #D14B3C !important;  /* Matières Minérales — terre cuite */
  --sienna-deep: #B23A2C !important;
  --sage:        #C9A14A !important;  /* Matières Végétales — or ambré */
  --sage-deep:   #B8902E !important;
  --sage-pale:   rgba(201,161,74,0.16) !important;
  --wine:        #B5455F !important;  /* Matières Animales — grenat */
  --ochre:       #6E80CC !important;  /* Matières Spécifiques — pervenche */
  --gold:        #C9A14A !important;
  /* Accents d'ouverture pour Termes & Garanties (barre + chiffre romain) */
  --termes-accent:  #4E86C2 !important;  /* I · Termes \u2014 bleu encre clair */
  --certifs-accent: #3E9A8F !important;  /* VI · Garanties \u2014 sarcelle */
}
html, body { background: #070d16 !important; }

.stage {
  background:
    radial-gradient(ellipse at 18% 12%, rgba(238,59,48,0.10), transparent 55%),
    radial-gradient(ellipse at 82% 18%, rgba(62,121,184,0.10), transparent 50%),
    radial-gradient(ellipse at 75% 88%, rgba(225,37,27,0.08), transparent 55%),
    radial-gradient(ellipse at 25% 80%, rgba(31,86,137,0.10), transparent 55%),
    radial-gradient(ellipse at 50% 50%, rgba(31,86,137,0.06), transparent 70%),
    #070d16 !important;
}
.stage::before {
  background:
    radial-gradient(ellipse at 30% 20%, rgba(31,86,137,0.10), transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(238,59,48,0.06), transparent 55%) !important;
}

/* ---------- 2. PAGES ---------- */
.page {
  background: linear-gradient(180deg, #0e2034 0%, #0a1626 100%) !important;
  border: 1px solid rgba(62,121,184,0.12) !important;
  box-shadow:
    0 2px 4px rgba(0,0,0,0.4),
    0 30px 80px rgba(0,0,0,0.6),
    0 0 0 0.5px rgba(62,121,184,0.08),
    0 0 60px rgba(31,86,137,0.12) !important;
}
.page.fam-minerales {
  background:
    radial-gradient(circle at 95% 5%, rgba(209,75,60,0.18), transparent 40%),
    radial-gradient(circle at 5% 95%, rgba(178,58,44,0.12), transparent 45%),
    linear-gradient(180deg, #0e2034 0%, #0a1626 100%) !important;
}
.page.fam-vegetales {
  background:
    radial-gradient(circle at 95% 5%, rgba(201,161,74,0.18), transparent 40%),
    radial-gradient(circle at 5% 95%, rgba(184,144,46,0.13), transparent 45%),
    linear-gradient(180deg, #0e2034 0%, #0a1626 100%) !important;
}
.page.fam-animales {
  background:
    radial-gradient(circle at 95% 5%, rgba(181,69,95,0.18), transparent 40%),
    radial-gradient(circle at 5% 95%, rgba(140,45,70,0.12), transparent 45%),
    linear-gradient(180deg, #0e2034 0%, #0a1626 100%) !important;
}
.page.fam-specifiques {
  background:
    radial-gradient(circle at 95% 5%, rgba(110,128,204,0.20), transparent 40%),
    radial-gradient(circle at 5% 95%, rgba(80,98,180,0.12), transparent 45%),
    linear-gradient(180deg, #0e2034 0%, #0a1626 100%) !important;
}

/* ---------- 3. ACCENTS lime résiduels (hardcodés) → marque ---------- */
.page { border-color: rgba(62,121,184,0.10) !important; }
.eyebrow { color: var(--m-lime) !important; }
.eyebrow::before, .eyebrow::after { background: var(--m-lime) !important; }

/* bordures & glows lime → bleu encre */
.fiche { border-color: rgba(62,121,184,0.14) !important; }

/* Titre de couverture « Fertilisation » → rouge Germiflor */
.page .display .cover-accent {
  color: var(--gfm-red) !important;
  -webkit-text-fill-color: var(--gfm-red) !important;
}

/* Navigation : pastille active rouge plutôt que lime */
.nav-btn.active, .nav-btn[aria-current="true"] {
  background: var(--gfm-red) !important;
  color: #fff !important;
  border-color: var(--gfm-red) !important;
}

/* Liens / éléments interactifs hover */
a:hover { color: var(--m-lime) !important; }

/* ============================================================
   5. HARMONISATION COMPLÈTE — élimination du vert résiduel
   ============================================================ */
:root, body, body.wow {
  /* Palette emerald (wow-emerald.css) → bleu encre */
  --wem-emerald:      #3E79B8;
  --wem-emerald-deep: #2E6FB0;
  --wem-emerald-soft: #6BA3D6;
  /* Palette « pep » (wow-fx.css) → duo marque */
  --pep-coral:   #E1251B;
  --pep-lime:    #EE3B30;
  --pep-cyan:    #3E79B8;
  --pep-violet:  #1F5689;
  --pep-magenta: #C4302A;
  --pep-yellow:  #4E86C2;
  /* Palette « wow » (wow-effects.css) → duo marque */
  --wow-lime:    #EE3B30;
  --wow-coral:   #E1251B;
  --wow-saffron: #4E86C2;
  --wow-cyan:    #3E79B8;
  --wow-violet:  #1F5689;
  --wow-magenta: #C4302A;
}

/* Eyebrows : rouge sur pages neutres ; couleur de famille sur pages matières */
body .eyebrow,
body .page:not(.fam-minerales):not(.fam-vegetales):not(.fam-animales):not(.fam-specifiques) .eyebrow {
  color: var(--gfm-red) !important;
  -webkit-text-fill-color: var(--gfm-red) !important;
}
body .page.fam-minerales .eyebrow   { color: #D14B3C !important; -webkit-text-fill-color: #D14B3C !important; }
body .page.fam-vegetales .eyebrow   { color: #C9A14A !important; -webkit-text-fill-color: #C9A14A !important; }
body .page.fam-animales .eyebrow    { color: #B5455F !important; -webkit-text-fill-color: #B5455F !important; }
body .page.fam-specifiques .eyebrow { color: #6E80CC !important; -webkit-text-fill-color: #6E80CC !important; }
body .eyebrow::before, body .eyebrow::after { background: currentColor !important; }

/* Chiffre romain des ouvertures \u2192 couleur de chaque partie
   (bat le for\u00e7age cr\u00e8me de wow-final-fixes.css) */
body .chapter-opener.fam-termes .opener-roman      { color: var(--termes-accent) !important; -webkit-text-fill-color: var(--termes-accent) !important; opacity:0.55 !important; }
body .chapter-opener.fam-minerales .opener-roman   { color: var(--sienna) !important; -webkit-text-fill-color: var(--sienna) !important; opacity:0.55 !important; }
body .chapter-opener.fam-vegetales .opener-roman   { color: var(--sage-deep) !important; -webkit-text-fill-color: var(--sage-deep) !important; opacity:0.55 !important; }
body .chapter-opener.fam-animales .opener-roman    { color: var(--wine) !important; -webkit-text-fill-color: var(--wine) !important; opacity:0.55 !important; }
body .chapter-opener.fam-specifiques .opener-roman { color: var(--ochre) !important; -webkit-text-fill-color: var(--ochre) !important; opacity:0.55 !important; }
body .chapter-opener.fam-certifs .opener-roman     { color: var(--certifs-accent) !important; -webkit-text-fill-color: var(--certifs-accent) !important; opacity:0.55 !important; }

/* Italiques d'emphase → rouge */
body em,
body .body em, body .lead em, body .body-text em,
body .foreword em, body .toc em, body .body i, body .lead i {
  color: var(--gfm-red) !important;
  -webkit-text-fill-color: var(--gfm-red) !important;
}

/* Numéros de page → dégradé rouge → bleu encre */
body .page-num {
  background: linear-gradient(135deg, var(--gfm-red), var(--gfm-blue)) !important;
  -webkit-background-clip: text !important;
          background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  color: transparent !important;
}

/* Nav : ombres / bordures lime → bleu encre, actif rouge */
body .nav-bar, body.wow .nav-bar { box-shadow: 0 1px 0 0 rgba(62,121,184,0.14) !important; }
body .nav-chapter.active {
  background: linear-gradient(135deg, var(--gfm-red), var(--gfm-blue)) !important;
  color: #fff !important;
  box-shadow: 0 2px 12px rgba(225,37,27,0.32) !important;
}
body .nav-btn, body .nav-tools .nav-btn { border-color: rgba(62,121,184,0.30) !important; }
body .badge { border-color: rgba(62,121,184,0.28) !important; }

/* Racines décoratives (wow-roots) → couleur de chaque famille */
.page.fam-termes,
.page.fam-certifications,
.page.fam-index { --wr-color: #3E79B8 !important; }
.page.fam-minerales  { --wr-color: #D14B3C !important; }
.page.fam-vegetales  { --wr-color: #C9A14A !important; }
.page.fam-animales   { --wr-color: #B5455F !important; }
.page.fam-specifiques { --wr-color: #6E80CC !important; }

/* Bordures / lueurs lime résiduelles → bleu encre (spécificité haute) */
body .page [style*="--cream"],
body .page [style*="--paper-2"],
body .page [style*="--paper)"] {
  border-color: rgba(62,121,184,0.16) !important;
}

/* ---------- 6. FICHES MATIÈRES + MODALE DÉTAIL (vert résiduel) ---------- */
/* Toutes les bordures lime/emerald des cartes et de la modale → bleu encre */
body .page .fiche, body .page .fiche.has-lore,
body .page .fiche-plate, body .page .fiche-plate.has-photo,
body .page .fiche-stats, body .page .fiche-stat,
body .page .fiche-stat.N, body .page .fiche-stat.P, body .page .fiche-stat.K, body .page .fiche-stat.MO,
body .page .fiche-secondary,
body .fiche .fiche-stats, body .fiche .fiche-stat, body .fiche .fiche-secondary,
body .page .fiche .fiche-stats, body .page .fiche .fiche-stat, body .page .fiche .fiche-secondary,
body .detail-modal, body .detail-photo-frame,
body .detail-npk, body .detail-npk-cell,
body .detail-section, body .detail-section.detail-why,
body .detail-section.detail-history, body .detail-section.detail-advice,
body .detail-section.detail-warning, body .detail-section.detail-meta {
  border-color: rgba(62,121,184,0.18) !important;
}

/* Bouton fermer de la modale */
body .detail-close { border-color: rgba(62,121,184,0.34) !important; }

/* En-tête de modale : voile lime → bleu encre */
body .detail-header {
  background-image: linear-gradient(rgba(62,121,184,0.10), transparent) !important;
}

/* Fond de la modale détail : dégradé vert Wow → bleu encre */
body .detail-modal {
  background-color: #0a1626 !important;
  background-image: linear-gradient(180deg, #0e2034 0%, #0a1626 100%) !important;
}

/* Filets verts dans la modale (sous l'en-tête + sous les titres de section) → bleu encre */
body .detail-header { border-bottom-color: rgba(62,121,184,0.18) !important; border-color: rgba(62,121,184,0.18) !important; }
body .detail-section-title {
  border-bottom-color: rgba(62,121,184,0.22) !important;
  border-color: rgba(62,121,184,0.22) !important;
}

/* Encart « sol idéal » : fond lime → bleu encre */
body .detail-soil-ideal { background-color: rgba(62,121,184,0.10) !important; }

/* Encart « pourquoi » : fond emerald → bleu encre */
body .detail-section.detail-why {
  background-color: rgba(31,86,137,0.16) !important;
  border-left-color: var(--gfm-blue) !important;
}

/* Puces oligo-éléments : contour vert → bleu encre */
body .oligo-chip, body .fiche-oligo-chip {
  border-color: rgba(62,121,184,0.32) !important;
}

/* Blocs « le saviez-vous / en pratique » : fond et liseré → bleu encre */
.block.saviez, .block.attention, .detail-why {
  border-left-color: var(--gfm-blue) !important;
}

/* Titres en dégradé-texte : couleur de chaque partie */
.page:not(.fam-minerales):not(.fam-vegetales):not(.fam-animales):not(.fam-specifiques) .section-title {
  background: linear-gradient(100deg, var(--gfm-blue) 0%, var(--gfm-red) 45%, var(--m-cream) 68%, var(--gfm-red) 88%, var(--gfm-blue) 100%) !important;
  background-size: 220% 100% !important;
  -webkit-background-clip: text !important;
          background-clip: text !important;
  color: transparent !important;
  -webkit-text-fill-color: transparent !important;
}
.page.fam-minerales .section-title  { background: linear-gradient(100deg, #D14B3C, #E8855C 45%, var(--m-cream) 70%, #D14B3C) !important; background-size:220% 100% !important; -webkit-background-clip:text !important; background-clip:text !important; color:transparent !important; -webkit-text-fill-color:transparent !important; }
.page.fam-vegetales .section-title  { background: linear-gradient(100deg, #C9A14A, #E3C677 45%, var(--m-cream) 70%, #C9A14A) !important; background-size:220% 100% !important; -webkit-background-clip:text !important; background-clip:text !important; color:transparent !important; -webkit-text-fill-color:transparent !important; }
.page.fam-animales .section-title   { background: linear-gradient(100deg, #B5455F, #D67288 45%, var(--m-cream) 70%, #B5455F) !important; background-size:220% 100% !important; -webkit-background-clip:text !important; background-clip:text !important; color:transparent !important; -webkit-text-fill-color:transparent !important; }
.page.fam-specifiques .section-title{ background: linear-gradient(100deg, #6E80CC, #9AA8E0 45%, var(--m-cream) 70%, #6E80CC) !important; background-size:220% 100% !important; -webkit-background-clip:text !important; background-clip:text !important; color:transparent !important; -webkit-text-fill-color:transparent !important; }

/* ---------- 4. NAVIGATION (barre du haut) ---------- */
/* Pastille mobile de chapitre actif → dégradé rouge → bleu encre */
.nav-chapters .nav-magic-pill,
.nav-chapters[data-active] .nav-magic-pill {
  background: linear-gradient(135deg, var(--gfm-red), var(--gfm-blue)) !important;
  box-shadow: 0 4px 14px rgba(225,37,27,0.42), 0 0 0 0.5px rgba(255,255,255,0.35) inset !important;
}
/* Indicateur mobile « magic-indicator » → couleur de chaque partie */
body.wow .magic-indicator,
body.wow .magic-indicator[data-fam="cover"]          { background: linear-gradient(135deg, var(--gfm-red), var(--gfm-blue)) !important; box-shadow: 0 4px 18px rgba(225,37,27,0.38), 0 1px 0 rgba(255,255,255,0.45) inset !important; }
body.wow .magic-indicator[data-fam="termes"]        { background: linear-gradient(135deg, #3E79B8, #1F5689) !important; box-shadow: 0 4px 18px rgba(62,121,184,0.40), 0 1px 0 rgba(255,255,255,0.45) inset !important; }
body.wow .magic-indicator[data-fam="minerales"]     { background: linear-gradient(135deg, #D14B3C, #B23A2C) !important; box-shadow: 0 4px 18px rgba(209,75,60,0.42), 0 1px 0 rgba(255,255,255,0.45) inset !important; }
body.wow .magic-indicator[data-fam="vegetales"]     { background: linear-gradient(135deg, #C9A14A, #B8902E) !important; box-shadow: 0 4px 18px rgba(201,161,74,0.42), 0 1px 0 rgba(255,255,255,0.45) inset !important; }
body.wow .magic-indicator[data-fam="animales"]      { background: linear-gradient(135deg, #B5455F, #8C2D46) !important; box-shadow: 0 4px 18px rgba(181,69,95,0.42), 0 1px 0 rgba(255,255,255,0.45) inset !important; }
body.wow .magic-indicator[data-fam="specifiques"]   { background: linear-gradient(135deg, #6E80CC, #5062B4) !important; box-shadow: 0 4px 18px rgba(110,128,204,0.42), 0 1px 0 rgba(255,255,255,0.45) inset !important; }
body.wow .magic-indicator[data-fam="certifications"]{ background: linear-gradient(135deg, #3E9A8F, #2E6FB0) !important; box-shadow: 0 4px 18px rgba(62,154,143,0.40), 0 1px 0 rgba(255,255,255,0.45) inset !important; }
body.wow .magic-indicator[data-fam="index"]         { background: linear-gradient(135deg, var(--gfm-blue), var(--gfm-red)) !important; box-shadow: 0 4px 18px rgba(31,86,137,0.40), 0 1px 0 rgba(255,255,255,0.45) inset !important; }
/* Onglet de chapitre actif */
body .nav-chapter.active {
  background: linear-gradient(135deg, var(--gfm-red), var(--gfm-blue)) !important;
  color: #fff !important;
}
/* Bouton Académie */
body.wow a.nav-chapter-academie,
body a.nav-chapter-academie {
  background: rgba(225,37,27,0.10) !important;
  color: var(--gfm-red) !important;
  -webkit-text-fill-color: var(--gfm-red) !important;
  border-color: rgba(225,37,27,0.45) !important;
}
body.wow a.nav-chapter-academie:hover,
body a.nav-chapter-academie:hover {
  background: linear-gradient(135deg, var(--gfm-red), var(--gfm-blue)) !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  border-color: var(--gfm-red) !important;
}
/* Filtres (barre matières) actifs */
.nav-btn.active {
  background: linear-gradient(120deg, var(--gfm-red), var(--gfm-blue)) !important;
  color: #fff !important;
  border-color: transparent !important;
}
