/* ============================================================
   WOW — VERT ÉMERAUDE comme fil conducteur du document
   (PAS dans la barre de menu — uniquement dans le contenu)
   ============================================================ */

:root {
  --wem-emerald: #0E7C5A;
  --wem-emerald-deep: #063F2D;
  --wem-emerald-soft: #4DAA85;
  --wem-emerald-tint: #C4E4D4;
  --wem-emerald-bg:   #EDF6F0;
  --wem-lime:    #D4F15A;
}

/* ============================================================
   1. PAGES "NEUTRES" (cover, toc, foreword, termes, certifs, index)
   — emerald comme couleur famille
   ============================================================ */
.page:not(.fam-minerales):not(.fam-vegetales):not(.fam-animales):not(.fam-specifiques) {
  --fam-accent: var(--wem-emerald);
  --fam-deep:   var(--wem-emerald-deep);
  --fam-tint:   var(--wem-emerald-tint);
  --fam-bg:     var(--wem-emerald-bg);
  --wr-color:   var(--wem-emerald);
}

/* Fond léger teinté + bandeau haut emerald, comme les pages famille */
.page:not(.fam-minerales):not(.fam-vegetales):not(.fam-animales):not(.fam-specifiques):not(.chapter-opener) {
  position: relative;
  background:
    radial-gradient(circle at 95% 5%, color-mix(in srgb, var(--wem-emerald-tint) 50%, transparent), transparent 38%),
    radial-gradient(circle at 5% 95%, color-mix(in srgb, var(--wem-emerald-tint) 35%, transparent), transparent 42%),
    var(--paper);
}

/* Bandeau emerald en haut */
.page:not(.fam-minerales):not(.fam-vegetales):not(.fam-animales):not(.fam-specifiques):not(.chapter-opener)::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 6px;
  background: linear-gradient(90deg,
    var(--wem-emerald-deep),
    var(--wem-emerald),
    var(--wem-lime),
    var(--wem-emerald),
    var(--wem-emerald-deep));
  background-size: 200% 100%;
  animation: wem-shift 12s linear infinite;
  z-index: 5;
  pointer-events: none;
}
@keyframes wem-shift {
  to { background-position: 200% 50%; }
}

/* Liseré gauche fin */
.page:not(.fam-minerales):not(.fam-vegetales):not(.fam-animales):not(.fam-specifiques):not(.chapter-opener)::after {
  content: "";
  position: absolute;
  left: 0; top: 6px; bottom: 0;
  width: 3px;
  background: var(--wem-emerald);
  opacity: 0.5;
  z-index: 5;
  pointer-events: none;
}

/* ============================================================
   2. ACCENTS TRANSVERSAUX (toutes pages)
   — termes glossaire, italiques, citations, dropcaps...
   ============================================================ */

/* Termes définis (mots avec tooltip) */
.term {
  color: var(--wem-emerald-deep) !important;
  border-bottom: 1px dashed var(--wem-emerald) !important;
  text-decoration: none !important;
  font-weight: 500;
  transition: all 0.2s ease;
}
.term:hover {
  color: var(--wem-emerald) !important;
  border-bottom-style: solid !important;
  background: color-mix(in srgb, var(--wem-emerald-tint) 50%, transparent);
}

/* Italiques de display dans le texte */
.body em, .lead em, .body i, .lead i,
.foreword em, .toc em {
  color: var(--wem-emerald-deep);
  font-style: italic;
}

/* Liens & focus */
a:not(.nav-chapter):not(.nav-btn) {
  color: var(--wem-emerald);
  text-decoration-color: color-mix(in srgb, var(--wem-emerald) 50%, transparent);
  text-underline-offset: 3px;
}
a:not(.nav-chapter):not(.nav-btn):hover {
  color: var(--wem-emerald-deep);
  text-decoration-color: var(--wem-emerald);
}

/* ============================================================
   3. ORNEMENTS — fleurons, séparateurs, puces
   ============================================================ */

/* Puces de listes */
.body ul, .lead ul, ul.bullets {
  list-style: none;
  padding-left: 0;
}
.body ul li, .lead ul li, ul.bullets li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 6px;
}
.body ul li::before, .lead ul li::before, ul.bullets li::before {
  content: "❋";
  position: absolute;
  left: 0; top: 0;
  color: var(--wem-emerald);
  font-size: 0.85em;
  line-height: 1.6;
}

/* Séparateurs <hr> */
hr {
  border: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--wem-emerald), transparent);
  margin: 24px 0;
  position: relative;
}
hr::after {
  content: "❋";
  position: absolute;
  top: -10px; left: 50%;
  transform: translateX(-50%);
  background: var(--paper, #FBF8F2);
  color: var(--wem-emerald);
  padding: 0 8px;
  font-size: 14px;
}

/* ============================================================
   4. CHIFFRES & STATS — accent emerald
   ============================================================ */
.kpi-value, .stat-value, .number-large,
.cover-year, .cover-stat {
  color: var(--wem-emerald-deep);
}

/* Numéros romains de chapitre */
.chapter-roman, .chapter-num {
  background: linear-gradient(135deg, var(--wem-emerald), var(--wem-emerald-deep));
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

/* ============================================================
   5. ENCADRÉS NEUTRES (sans famille) — emerald
   ============================================================ */
.page:not(.fam-minerales):not(.fam-vegetales):not(.fam-animales):not(.fam-specifiques) .block.saviez {
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--wem-emerald) 14%, white),
    color-mix(in srgb, var(--wem-emerald-tint) 60%, white)) !important;
  border-left: 4px solid var(--wem-emerald) !important;
}

/* ============================================================
   6. SEARCH / INPUT focus — souligné emerald
   ============================================================ */
input[type="text"]:focus,
input[type="search"]:focus,
.search-input:focus {
  outline: none;
  border-bottom-color: var(--wem-emerald) !important;
  box-shadow: 0 1px 0 var(--wem-emerald);
}

/* ============================================================
   7. SCROLLBAR — touche emerald subtile
   ============================================================ */
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--wem-emerald), #E07856) !important;
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--wem-emerald-deep), #C4451C) !important;
}

/* ============================================================
   8. COVER PAGE — accents emerald si présente
   ============================================================ */
.page.chapter-cover h1 em,
.page.chapter-cover .cover-title em,
.page:first-child h1 em {
  color: var(--wem-emerald) !important;
  font-style: italic;
}

/* ============================================================
   9. HEADER & FOOTER de page — couleur année / pagination
   ============================================================ */
.page:not(.fam-minerales):not(.fam-vegetales):not(.fam-animales):not(.fam-specifiques) .page-num {
  background: linear-gradient(135deg, var(--wem-emerald), var(--wem-emerald-deep)) !important;
  -webkit-background-clip: text !important;
          background-clip: text !important;
  color: transparent !important;
  -webkit-text-fill-color: transparent !important;
  font-weight: 800;
}
.page:not(.fam-minerales):not(.fam-vegetales):not(.fam-animales):not(.fam-specifiques) .page-header > span:first-child {
  color: var(--wem-emerald-deep) !important;
  font-weight: 700;
}
.page:not(.fam-minerales):not(.fam-vegetales):not(.fam-animales):not(.fam-specifiques) .page-header,
.page:not(.fam-minerales):not(.fam-vegetales):not(.fam-animales):not(.fam-specifiques) .page-footer {
  border-color: color-mix(in srgb, var(--wem-emerald) 30%, transparent) !important;
}

/* ============================================================
   10. EYEBROW — emerald sur pages neutres
   ============================================================ */
.page:not(.fam-minerales):not(.fam-vegetales):not(.fam-animales):not(.fam-specifiques) .eyebrow {
  color: var(--wem-emerald) !important;
  font-weight: 700;
}
.page:not(.fam-minerales):not(.fam-vegetales):not(.fam-animales):not(.fam-specifiques) .eyebrow::before {
  background: var(--wem-emerald) !important;
}
