@font-face{font-family:'Caveat';font-style:normal;font-weight:400 700;font-display:swap;src:url('fonts/caveat-600.woff2') format('woff2');}
/* ============================================================
   LEXIQUE DE LA FERTILISATION — GERMIFLOR 1885–2026
   Design system : encyclopédie botanique moderne
   ============================================================ */

:root {
  /* Palette clair — papier ivoire, encre noire, sauge, sienna, or */
  --paper:        #f4eee1;
  --paper-2:      #ece3d0;
  --paper-edge:   #d9cdb3;
  --ink:          #1a1a15;
  --ink-2:        #2d2a22;
  --ink-soft:     #4a4538;
  --ink-muted:    #7a7362;
  --rule:         #2d2a22;
  --sage:         #3d5a3d;
  --sage-deep:    #25391f;
  --sage-pale:    #cfd4bc;
  --sienna:       #a85c2a;
  --sienna-deep:  #7a3e18;
  --ochre:        #c69449;
  --gold:         #b8944a;
  --wine:         #6e2530;
  --cream:        #fbf7ec;
  --shadow:       0 1px 0 rgba(0,0,0,0.03), 0 2px 8px rgba(45,42,34,0.06);

  /* Data colors (charts, NPK) */
  --c-N:  #3d5a3d;    /* Azote — vert sauge */
  --c-P:  #a85c2a;    /* Phosphore — sienna */
  --c-K:  #b8944a;    /* Potassium — or */
  --c-Mg: #6e2530;    /* Magnésium — wine */
  --c-Ca: #8a8570;    /* Calcium — pierre */
  --c-C:  #2d2a22;    /* Carbone — encre */
  --c-S:  #d4a24c;    /* Soufre — jaune doré */

  /* Typography */
  --font-display: 'Fraunces', 'Playfair Display', Georgia, serif;
  --font-body:    'Inter', 'Helvetica Neue', Arial, sans-serif;
  --font-mono:    'JetBrains Mono', 'IBM Plex Mono', ui-monospace, monospace;

  /* Page dims (A4 at ~3.2px/mm-ish, but we design @ 820×1160 ~ A4 proportions) */
  --page-w: 820px;
  --page-h: 1160px;
  --page-pad-x: 72px;
  --page-pad-y: 80px;

  /* Scale factor — populated by JS */
  --stage-scale: 1;
}

/* Dark mode — parchment night */
[data-theme="dark"] {
  --paper:        #17140e;
  --paper-2:      #1e1a12;
  --paper-edge:   #2a2418;
  --ink:          #f1e8d0;
  --ink-2:        #e7ddc2;
  --ink-soft:     #c9bea0;
  --ink-muted:    #8a8268;
  --rule:         #c9bea0;
  --sage:         #9fb389;
  --sage-deep:    #b8c8a2;
  --sage-pale:    #3a4a30;
  --sienna:       #e08a4e;
  --sienna-deep:  #c7743a;
  --ochre:        #e0b270;
  --gold:         #d9b775;
  --wine:         #c8646f;
  --cream:        #1e1a12;
  --shadow:       0 1px 0 rgba(255,255,255,0.02), 0 2px 10px rgba(0,0,0,0.5);
  --c-N:  #9fb389;
  --c-P:  #e08a4e;
  --c-K:  #e0b270;
  --c-Mg: #c8646f;
  --c-Ca: #c5bfa8;
  --c-C:  #f1e8d0;
  --c-S:  #e8c577;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: #1c1812;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
}

/* ============================================================
   STAGE — container holds the A4 book and scales to viewport
   ============================================================ */

.stage {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px 120px;
  background: radial-gradient(ellipse at 50% 0%, #2a2418 0%, #0f0c07 70%);
}

[data-theme="dark"] .stage {
  background: radial-gradient(ellipse at 50% 0%, #0d0a06 0%, #000 70%);
}

.book {
  width: var(--page-w);
  transform-origin: top center;
  transform: scale(var(--stage-scale));
  margin-bottom: calc(var(--page-h) * (1 - var(--stage-scale)) * -1);
}

/* ============================================================
   PAGE — individual A4-ish page
   ============================================================ */

.page {
  position: relative;
  width: var(--page-w);
  min-height: var(--page-h);
  padding: 112px var(--page-pad-x) 100px;
  background: var(--paper);
  color: var(--ink);
  box-shadow:
    0 1px 2px rgba(0,0,0,0.4),
    0 20px 40px rgba(0,0,0,0.5),
    0 40px 80px rgba(0,0,0,0.3);
  margin: 0 auto 32px;
  overflow: hidden;
  /* subtle paper texture */
  background-image:
    radial-gradient(circle at 20% 20%, rgba(0,0,0,0.015) 0%, transparent 50%),
    radial-gradient(circle at 80% 60%, rgba(0,0,0,0.02) 0%, transparent 50%),
    radial-gradient(circle at 50% 80%, rgba(0,0,0,0.01) 0%, transparent 50%);
}

[data-theme="dark"] .page {
  background-image:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,0.01) 0%, transparent 50%),
    radial-gradient(circle at 80% 60%, rgba(255,255,255,0.015) 0%, transparent 50%);
}

/* Page header / footer (running head) */
.page-header, .page-footer {
  position: absolute;
  left: var(--page-pad-x);
  right: var(--page-pad-x);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--font-body);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 500;
}

.page-header {
  top: 18px;
  padding-bottom: 10px;
  border-bottom: 0.5px solid var(--paper-edge);
}

.page-footer {
  bottom: 12px;
  padding-top: 12px;
  border-top: 0.5px solid var(--paper-edge);
}

.page-num {
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0;
  color: var(--ink-soft);
  font-style: italic;
  text-transform: none;
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */

.eyebrow {
  font-family: var(--font-body);
  font-size: 10px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--sienna);
  font-weight: 600;
  margin: 0 0 16px;
  display: inline-flex;
  align-items: center;
  gap: 22px;
}

.eyebrow::before {
  content: "";
  display: none;
  width: 24px;
  height: 1px;
  background: var(--sienna);
}

h1.display, .h-display {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 88px;
  line-height: 0.92;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin: 0;
  font-variation-settings: 'SOFT' 20, 'WONK' 1, 'opsz' 144;
}

h2.chapter-title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 64px;
  line-height: 0.95;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 0;
  font-variation-settings: 'SOFT' 30, 'opsz' 144;
}

h3.section-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 36px;
  line-height: 1.05;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0 0 18px;
  font-variation-settings: 'opsz' 48;
}

h4.entry-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 24px;
  line-height: 1.1;
  letter-spacing: -0.005em;
  color: var(--ink);
  margin: 0 0 8px;
  font-style: italic;
}

.lead {
  font-family: var(--font-display);
  font-weight: 300;
  font-style: italic;
  font-size: 22px;
  line-height: 1.4;
  color: var(--ink-soft);
  letter-spacing: -0.005em;
  text-wrap: pretty;
}

.body-text {
  font-size: 14.5px;
  line-height: 1.62;
  color: var(--ink-2);
  text-wrap: pretty;
  font-weight: 400;
}

.body-text p { margin: 0 0 12px; }
.body-text p:last-child { margin-bottom: 0; }

.body-text strong { color: var(--ink); font-weight: 600; }
.body-text em { color: var(--sienna-deep); font-style: italic; }

.small-caps {
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink-soft);
}

.mono {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: -0.01em;
}

.drop-cap::first-letter {
  font-family: var(--font-display);
  float: left;
  font-size: 76px;
  line-height: 0.82;
  padding: 6px 10px 0 0;
  font-weight: 400;
  color: var(--sienna);
  font-style: italic;
}

/* Decorative rules */
.rule {
  border: 0;
  border-top: 0.5px solid var(--ink);
  margin: 24px 0;
  width: 100%;
  opacity: 0.7;
}

.rule-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 32px 0;
  color: var(--sienna);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 14px;
}

.rule-ornament::before, .rule-ornament::after {
  content: "";
  flex: 1;
  height: 0.5px;
  background: var(--ink);
  opacity: 0.4;
}

/* Links */
a {
  color: inherit;
  text-decoration: none;
}

/* ============================================================
   GRID HELPERS
   ============================================================ */

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.grid-asym { display: grid; grid-template-columns: 1fr 1.6fr; gap: 32px; }

/* ============================================================
   PICTOGRAMS / BADGES
   ============================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  font-family: var(--font-body);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  border: 0.5px solid currentColor;
  border-radius: 99px;
  line-height: 1;
  white-space: nowrap;
}

.badge-ab      { color: var(--sage-deep); background: var(--sage-pale); border-color: var(--sage); }
.badge-conv    { color: var(--sienna-deep); background: #f0e1cc; border-color: var(--sienna); }
.badge-vegan   { color: #2b5840; background: #d8ead8; border-color: #4a8060; }
.badge-soluble { color: #1e3a5f; background: #cdd9e5; border-color: #3c5a82; }

[data-theme="dark"] .badge-ab      { background: rgba(159,179,137,0.15); }
[data-theme="dark"] .badge-conv    { background: rgba(224,138,78,0.15); }
[data-theme="dark"] .badge-vegan   { background: rgba(74,128,96,0.18); color: #b5dfba; }
[data-theme="dark"] .badge-soluble { background: rgba(60,90,130,0.25); color: #b5cde5; }

/* ============================================================
   SCHÉMAS : image fixe réservée à l'impression (PDF).
   Masquée partout par défaut (écran) ; réaffichée uniquement
   sous body.print-mode (voir print.css). Évite que les images
   apparaissent dans la version interactive Lexique Wow.html.
   ============================================================ */
.schema-print-only { display: none; }

/* ============================================================
   SCHÉMAS ÉCRAN — infographies animées (toutes versions écran)
   Image fixe haut de gamme + mouvement subtil : travelling lent
   (Ken Burns), halo lime pulsé, balayage shimmer. La parallaxe
   3D au survol est ajoutée par schema-motion.js (Lexique Wow).
   En impression, .schema-screen-only est masqué (print.css).
   ============================================================ */
.schema-figure {
  margin: 6px 0 26px;
  perspective: 1100px;
}
.schema-frame {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  background: #0c1a16;
  border: 1px solid rgba(212, 241, 90, 0.22);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.40),
    0 22px 55px -20px rgba(0, 0, 0, 0.72),
    0 0 34px -14px rgba(212, 241, 90, 0.28);
  transform-style: preserve-3d;
  transition: transform 0.25s ease, border-color 0.4s ease;
  animation: schemaGlow 5.5s ease-in-out infinite;
  will-change: transform, box-shadow;
}
.schema-frame img {
  display: block;
  width: 100%;
  height: auto;
  transform-origin: 58% 46%;
  animation: schemaDrift 28s ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes schemaGlow {
  0%, 100% {
    box-shadow:
      0 0 0 1px rgba(0, 0, 0, 0.40),
      0 22px 55px -20px rgba(0, 0, 0, 0.72),
      0 0 30px -16px rgba(212, 241, 90, 0.22);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(0, 0, 0, 0.40),
      0 22px 55px -20px rgba(0, 0, 0, 0.72),
      0 0 58px -8px rgba(212, 241, 90, 0.52);
  }
}
@keyframes schemaDrift {
  0%   { transform: scale(1.0)   translate3d(0, 0, 0); }
  100% { transform: scale(1.045) translate3d(-1.1%, -0.8%, 0); }
}
.schema-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    115deg,
    transparent 40%,
    rgba(212, 241, 90, 0.10) 47%,
    rgba(255, 255, 255, 0.07) 50%,
    rgba(212, 241, 90, 0.10) 53%,
    transparent 60%
  );
  transform: translateX(-130%);
  animation: schemaSweep 8s ease-in-out infinite;
  pointer-events: none;
  mix-blend-mode: screen;
}
@keyframes schemaSweep {
  0%, 60%   { transform: translateX(-130%); }
  85%, 100% { transform: translateX(130%); }
}
.schema-frame:hover {
  border-color: rgba(212, 241, 90, 0.50);
  animation-play-state: paused;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.40),
    0 26px 60px -18px rgba(0, 0, 0, 0.78),
    0 0 64px -6px rgba(212, 241, 90, 0.55);
}
.schema-frame:hover img {
  animation-play-state: paused;
  transform: scale(1.055);
  transition: transform 0.6s ease;
}
.schema-caption {
  margin-top: 11px;
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  font-size: 10.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--sage, #8fa06a);
  display: flex;
  align-items: center;
  gap: 9px;
}
.schema-caption::before {
  content: "";
  flex: 0 0 auto;
  width: 20px;
  height: 1px;
  background: rgba(212, 241, 90, 0.6);
}
@media (prefers-reduced-motion: reduce) {
  .schema-frame,
  .schema-frame img,
  .schema-frame::after { animation: none !important; }
  .schema-frame { transform: none !important; }
}

/* ============================================================
   ENTRY CARDS (term / material cards)
   ============================================================ */

.entry {
  position: relative;
  padding: 24px 0;
  border-top: 0.5px solid var(--paper-edge);
}

.entry:first-child { border-top: 1px solid var(--ink); }

.entry-number {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--sienna);
  margin-bottom: 4px;
}

.entry-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border: 0.75px solid var(--ink);
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  margin-right: 14px;
  background: var(--cream);
  color: var(--ink);
}

/* ============================================================
   MATERIAL FICHE (the core card for matières premières)
   ============================================================ */

.fiche {
  background: var(--cream);
  border: 0.5px solid var(--paper-edge);
  padding: 20px 22px 22px;
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.fiche:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.fiche-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.fiche-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-style: italic;
  font-size: 19px;
  line-height: 1.15;
  color: var(--ink);
  margin: 0;
  letter-spacing: -0.005em;
}

.fiche-subtitle {
  font-family: var(--font-body);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-top: 3px;
  font-weight: 500;
}

.fiche-plate {
  aspect-ratio: 1.4 / 1;
  background: linear-gradient(135deg, var(--paper-2), var(--paper));
  border: 0.5px solid var(--paper-edge);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-muted);
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
}

.fiche-plate svg { width: 100%; height: 100%; display: block; }

.fiche-plate.has-photo {
  background: var(--paper-2);
  aspect-ratio: 1.4 / 1;
}
.fiche-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(0.92) contrast(1.02);
  transition: transform 0.6s ease;
}
.fiche:hover .fiche-photo { transform: scale(1.03); }
[data-theme="dark"] .fiche-photo { filter: saturate(0.85) contrast(0.95) brightness(0.9); }

.fiche-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border: 0.5px solid var(--paper-edge);
  margin-bottom: 12px;
}

.fiche-stat {
  padding: 8px 6px;
  text-align: center;
  border-right: 0.5px solid var(--paper-edge);
  background: var(--paper);
}
.fiche-stat:last-child { border-right: none; }

.fiche-stat-label {
  font-family: var(--font-body);
  font-size: 8.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 600;
}

.fiche-stat-value {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  margin-top: 2px;
  font-feature-settings: 'tnum';
}

.fiche-stat.N .fiche-stat-value { color: var(--c-N); }
.fiche-stat.P .fiche-stat-value { color: var(--c-P); }
.fiche-stat.K .fiche-stat-value { color: var(--c-K); }
.fiche-stat.MO .fiche-stat-value { color: var(--c-C); }

.fiche-secondary {
  margin-top: 8px;
  padding: 10px 10px 8px;
  background: var(--paper-2);
  border: 0.5px dashed var(--paper-edge);
}
.fiche-secondary-label {
  font-family: var(--font-body);
  font-size: 8.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sienna);
  margin-bottom: 6px;
  font-weight: 500;
}
.fiche-secondary-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  align-items: baseline;
}
.fiche-sec {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
}
.fiche-sec-k {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--ink-muted);
  letter-spacing: 0.04em;
}
.fiche-sec-v {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1;
}

.fiche-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 10px;
}

.fiche-body {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink-soft);
}

.fiche-body p { margin: 0 0 8px; }

.fiche-detail {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease, margin-top 0.3s ease;
}

.fiche.expanded .fiche-detail {
  max-height: 800px;
  margin-top: 8px;
}

.fiche-expand-hint {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 22px; height: 22px;
  border: 0.5px solid var(--ink);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--ink);
  transition: transform 0.3s ease, background 0.3s ease;
  background: var(--paper);
}

.fiche.expanded .fiche-expand-hint {
  transform: rotate(45deg);
  background: var(--ink);
  color: var(--paper);
}

/* ============================================================
   TOOLTIPS — terms agronomiques
   ============================================================ */

.term {
  border-bottom: 0.5px dotted var(--sienna);
  color: var(--sienna-deep);
  cursor: help;
  position: relative;
  font-weight: 500;
}

.tooltip {
  position: fixed;
  z-index: 1000;
  background: var(--ink);
  color: var(--paper);
  padding: 12px 16px;
  max-width: 260px;
  font-family: var(--font-body);
  font-size: 12px;
  line-height: 1.5;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.tooltip.visible { opacity: 1; }
.tooltip-term {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 14px;
  margin-bottom: 4px;
  color: var(--ochre);
}

/* ============================================================
   TABLES
   ============================================================ */

table.data {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-body);
  font-size: 12px;
}

table.data th {
  font-family: var(--font-body);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink);
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--ink);
}

table.data td {
  padding: 9px 8px;
  border-bottom: 0.5px solid var(--paper-edge);
  color: var(--ink-2);
  font-feature-settings: 'tnum';
}

table.data tr:hover td {
  background: var(--paper-2);
}

table.data td.num {
  font-family: var(--font-mono);
  text-align: right;
  font-size: 11px;
}

/* ============================================================
   BLOCKS (le saviez-vous, note, attention, reglementation)
   ============================================================ */

.block {
  padding: 18px 22px;
  margin: 16px 0;
  background: var(--paper-2);
  border-left: 2px solid var(--sienna);
  position: relative;
}

.block-label {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 13px;
  color: var(--sienna);
  margin-bottom: 6px;
  font-weight: 500;
}

.block-body {
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-2);
}

.block.saviez    { border-color: var(--sage); }
.block.saviez .block-label { color: var(--sage); }

.block.regl { border-color: var(--ink); background: var(--cream); }
.block.regl .block-label { color: var(--ink); }

.block.attention { border-color: var(--wine); }
.block.attention .block-label { color: var(--wine); }

/* ============================================================
   PRINT
   ============================================================ */

@media print {
  @page { size: A4; margin: 0; }
  body { background: white; }
  .stage { padding: 0; background: white; min-height: 0; }
  .book { transform: none; margin: 0; }
  .page {
    box-shadow: none;
    margin: 0;
    page-break-after: always;
    page-break-inside: avoid;
  }
  .nav-bar, .tooltip, .tweaks-panel, .print-hide { display: none !important; }
}

/* Pied de page uniforme (comme les fiches) */
.page-footer {
  font-family: var(--font-mono) !important;
  font-size: 8.5px !important;
  position: absolute !important;
  left: var(--page-pad-x) !important;
  right: var(--page-pad-x) !important;
  bottom: 28px !important;
  display: flex !important;
  flex-direction: row !important;
  justify-content: space-between !important;
  align-items: baseline !important;
  gap: 16px;
}
.page-footer > span { position: static !important; }
.page-footer .page-num { position: static !important; flex: 0 0 auto; white-space: nowrap; }

/* Dernière page (Contact) : pas de pied de page ni de haut de page */
.page-last .page-footer { display: none !important; }
.page-last .page-header { display: none !important; }

/* Bloc année de la page Contact : statique en impression (évite le chevauchement A4) */
body.print-mode .contact-year {
  position: static !important;
  transform: none !important;
  margin: 40px auto 0 !important;
}

/* ============================================================
   NAVIGATION BAR (top, print-hidden)
   ============================================================ */

.nav-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: rgba(20,17,11,0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border-bottom: 0.5px solid rgba(241,232,208,0.15);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
.nav-brand:hover img { opacity: 0.82; }
.acad-short { display: none; }
/* Lecteur en ligne : pas de numéro de page (navigation par onglets, non séquentielle).
   Conservé dans le PDF (body.print-mode). */
body:not(.print-mode) .page-footer .page-num { display: none; }
body:not(.print-mode) .page .page-num { display: none; }
/* Index cliquable (écran) */
.idx-entry { transition: color .15s ease; border-radius: 4px; }
.idx-entry:hover .idx-term { color: var(--sienna); text-decoration: underline; text-underline-offset: 2px; }

.nav-brand-mark {
  width: 24px; height: 24px;
  border: 0.75px solid currentColor;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 12px;
  font-style: italic;
  letter-spacing: 0;
  font-weight: 400;
}

.nav-chapters {
  display: flex;
  gap: 28px;
  align-items: center;
}

.nav-chapter {
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s;
  font-size: 10.5px;
  letter-spacing: 0.2em;
  background: none;
  border: none;
  color: inherit;
  font-family: inherit;
  text-transform: inherit;
  padding: 0;
}
.nav-chapter:hover { opacity: 1; }
.nav-chapter.active { opacity: 1; color: var(--ochre); }

/* Onglet Académie : ressort en lime dans la rangée des chapitres */
.nav-chapter-academie {
  opacity: 1;
  text-decoration: none;
  color: #D4F15A;
  background: transparent;
  cursor: pointer;
  font: inherit;
  border: 1px solid rgba(212,241,90,0.4);
  border-radius: 999px;
  padding: 5px 12px;
  margin-left: 4px;
  white-space: nowrap;
  transition: background 0.2s, border-color 0.2s;
}
.nav-chapter-academie.active { background: rgba(212,241,90,0.18); border-color: #D4F15A; }
.nav-chapter-academie:hover { background: rgba(212,241,90,0.12); border-color: #D4F15A; opacity: 1; }

.nav-tools {
  display: flex;
  gap: 14px;
  align-items: center;
}

.nav-btn {
  background: transparent;
  border: 0.5px solid rgba(241,232,208,0.3);
  color: inherit;
  font: inherit;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 7px 14px;
  cursor: pointer;
  transition: all 0.2s;
}
.nav-btn:hover { background: rgba(241,232,208,0.1); border-color: var(--ochre); color: var(--ochre); }
.nav-btn.active { background: var(--ochre); color: var(--ink); border-color: var(--ochre); }

/* Lien vers l'Académie (entrée vers le mini-site quizz) */
.nav-academie {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  color: #D4F15A;
  border: 1px solid rgba(212,241,90,0.4);
  border-radius: 999px;
  padding: 7px 15px;
  white-space: nowrap;
  transition: all 0.2s;
}
.nav-academie:hover { background: rgba(212,241,90,0.12); border-color: #D4F15A; }

/* ============================================================
   NPK BARS
   ============================================================ */

.npk-bars {
  display: grid;
  grid-template-columns: 40px 1fr 44px;
  gap: 8px;
  align-items: center;
  font-family: var(--font-body);
  font-size: 11px;
  margin: 3px 0;
}

.npk-bar-track {
  height: 6px;
  background: var(--paper-edge);
  position: relative;
  overflow: hidden;
}

.npk-bar-fill {
  height: 100%;
  transition: width 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes ncyc-pulse {
  0%, 100% { transform: scale(1); opacity: 0.24; }
  50%      { transform: scale(1.12); opacity: 0.12; }
}

.npk-bar-value {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-align: right;
  color: var(--ink-soft);
}

.npk-bar-label {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 13px;
  color: var(--ink);
}

/* ============================================================
   COMPARATOR
   ============================================================ */

.compare-tray {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  width: min(720px, calc(100% - 40px));
  background: var(--ink);
  color: var(--paper);
  padding: 20px 24px;
  z-index: 90;
  transition: transform 0.4s cubic-bezier(0.2,0.8,0.2,1);
  box-shadow: 0 -10px 40px rgba(0,0,0,0.5);
}
.compare-tray.visible { transform: translateX(-50%) translateY(0); }

.compare-tray h4 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 15px;
  color: var(--ochre);
  font-weight: 400;
}

/* Utility */
.ital { font-style: italic; }
.sc   { font-variant: small-caps; letter-spacing: 0.1em; }
.nowrap { white-space: nowrap; }
.muted { color: var(--ink-muted); }
.center { text-align: center; }

/* =========================================================
   DETAIL MODAL
   ========================================================= */
.detail-modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(24, 22, 20, 0.68);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 500;
  display: flex; align-items: center; justify-content: center;
  padding: 40px 20px;
  animation: modalFadeIn 0.3s ease;
}
@keyframes modalFadeIn { from { opacity: 0; } to { opacity: 1; } }

.detail-modal {
  position: relative;
  background: var(--paper);
  color: var(--ink);
  width: min(1080px, 100%);
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  border: 0.5px solid var(--ink);
  box-shadow: 0 40px 80px rgba(0,0,0,0.5),
              0 0 0 1px rgba(0,0,0,0.02);
  animation: modalSlide 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  font-family: var(--font-body);
}
@keyframes modalSlide {
  from { opacity: 0; transform: translateY(30px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}

.detail-close {
  position: absolute; top: 18px; right: 18px;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--paper);
  border: 0.5px solid var(--ink);
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: all 0.2s;
  z-index: 10;
}
.detail-close:hover { background: var(--ink); color: var(--paper); transform: rotate(90deg); }

.detail-header {
  padding: 40px 56px 28px;
  border-bottom: 0.5px solid var(--paper-edge);
  background: linear-gradient(180deg, var(--paper-2) 0%, var(--paper) 100%);
}
.detail-kicker {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px;
  font-family: var(--font-sans);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--sienna);
}
.detail-kicker .eyebrow { padding: 0 !important; }
.detail-dot { color: var(--paper-edge); }
.detail-famille { color: var(--ink-muted); font-weight: 500; }

.detail-title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 52px;
  line-height: 1;
  margin: 0 0 10px;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.detail-subtitle {
  font-family: var(--font-display);
  font-size: 17px;
  color: var(--ink-2);
  margin: 0 0 16px;
  font-style: italic;
  font-weight: 300;
}
.detail-badges { display: flex; gap: 8px; flex-wrap: wrap; }

.detail-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 40px;
  padding: 32px 56px 48px;
}
@media (max-width: 820px) {
  .detail-header { padding: 32px 28px 22px; }
  .detail-title { font-size: 36px; }
  .detail-grid { grid-template-columns: 1fr; padding: 24px 28px 40px; gap: 28px; }
}

/* LEFT column */
.detail-left { position: sticky; top: 0; align-self: start; }
@media (max-width: 820px) { .detail-left { position: static; } }

.detail-photo-frame {
  margin: 0 0 24px;
  padding: 14px;
  background: var(--paper-2);
  border: 0.5px solid var(--paper-edge);
  box-shadow:
    inset 0 0 0 1px var(--paper),
    0 8px 20px rgba(0,0,0,0.08);
  position: relative;
}
.detail-photo-frame::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 0.5px solid var(--paper-edge);
  pointer-events: none;
}
.detail-photo-frame img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  filter: saturate(1.05) contrast(1.03);
}
[data-theme="dark"] .detail-photo-frame img { filter: saturate(0.88) contrast(0.95) brightness(0.9); }
.detail-photo-frame.no-photo img { display: none; }
.detail-photo-cap {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 11px;
  color: var(--ink-muted);
  text-align: center;
  margin-top: 10px;
  letter-spacing: 0.02em;
}

.detail-soil { margin-top: 20px; }
.detail-soil .soil-radar { display: block; margin: 0 auto; }
.detail-soil-ideal {
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink-2);
  margin: 12px 0 0;
  padding: 10px 12px;
  background: var(--paper-2);
  border-left: 2px solid var(--sage);
}
.detail-soil-ideal strong {
  font-family: var(--font-sans);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--sage);
  display: block;
  margin-bottom: 4px;
  font-weight: 700;
}

/* RIGHT column */
.detail-section {
  margin-bottom: 26px;
}
.detail-section-title {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--sienna);
  margin: 0 0 10px;
  padding-bottom: 6px;
  border-bottom: 0.5px solid var(--paper-edge);
}
.detail-section p {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink-2);
  margin: 0 0 10px;
  text-wrap: pretty;
}
.detail-section p strong {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  margin-right: 6px;
}

/* NPK big display */
.detail-npk {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 30px;
  padding: 18px;
  background: var(--paper-2);
  border: 0.5px solid var(--paper-edge);
}
.detail-npk-cell {
  position: relative;
  text-align: center;
  padding: 10px 4px;
  border-right: 0.5px solid var(--paper-edge);
}
.detail-npk-cell:last-child { border-right: none; }
.detail-npk-label {
  font-family: var(--font-sans);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 8px;
  font-weight: 600;
}
.detail-npk-value {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 400;
  line-height: 1;
  font-feature-settings: "lnum";
}
.detail-npk-unit {
  display: inline;
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--ink-muted);
  margin-left: 2px;
}
.detail-npk-sym {
  position: absolute;
  top: 6px; right: 8px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 10px;
  color: var(--c);
  opacity: 0.5;
}

/* Oligo chips */
.oligo-chips {
  display: flex; flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.oligo-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 5px 10px;
  border: 0.5px solid currentColor;
  background: var(--paper);
  border-radius: 2px;
  font-size: 11px;
  font-family: var(--font-sans);
  transition: background 0.2s;
}
.oligo-chip:hover { background: var(--paper-2); }
.oligo-chip-k {
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-weight: 600;
}
.oligo-chip-v {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--ink);
}

/* Contextual sections */
.detail-why        { background: rgba(61, 90, 61, 0.04);       padding: 18px 20px; border-left: 2px solid var(--sage); }
.detail-history    { background: rgba(198, 148, 73, 0.05);     padding: 18px 20px; border-left: 2px solid var(--ochre); }
.detail-history p  { font-family: var(--font-display); font-style: italic; font-size: 14.5px; }
.detail-advice     { background: rgba(168, 92, 42, 0.05);      padding: 18px 20px; border-left: 2px solid var(--sienna); }
.detail-warning    { background: rgba(168, 92, 42, 0.08);      padding: 14px 18px; border-left: 2px solid var(--sienna); font-size: 12.5px; }
.detail-warning p  { font-size: 12.5px; color: var(--ink-2); }

.detail-meta {
  margin-top: 10px;
  padding-top: 18px;
  border-top: 0.5px solid var(--paper-edge);
}
.detail-meta-row {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-2);
  margin-bottom: 4px;
}
.detail-meta-row .small-caps {
  color: var(--ink-muted);
  font-size: 9px;
  margin-right: 4px;
}

/* =========================================================
   FICHE — lore badge + soil-affinity icon
   ========================================================= */
.fiche.has-lore { cursor: pointer; }
.fiche.has-lore:hover .fiche-expand-hint {
  background: var(--sienna);
  color: var(--paper);
  border-color: var(--sienna);
  transform: rotate(45deg);
}

.badge-lore {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
  font-weight: 600;
}

.fiche-soil-badge {
  position: absolute;
  bottom: 10px; right: 10px;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--paper);
  color: var(--sage);
  border: 0.5px solid var(--sage);
  display: flex; align-items: center; justify-content: center;
  opacity: 0.85;
  transition: all 0.2s;
}
.fiche-plate { position: relative; }
.fiche:hover .fiche-soil-badge { opacity: 1; background: var(--sage); color: var(--paper); }

/* Soil radar styling (in fiche context) */
.soil-radar text { font-family: var(--font-sans); }

/* Dark theme for modal */
[data-theme="dark"] .detail-modal {
  background: var(--paper);
}
[data-theme="dark"] .detail-why       { background: rgba(140, 180, 140, 0.06); }
[data-theme="dark"] .detail-history   { background: rgba(230, 180, 100, 0.06); }
[data-theme="dark"] .detail-advice    { background: rgba(200, 120, 70, 0.07); }
[data-theme="dark"] .detail-warning   { background: rgba(200, 120, 70, 0.1); }

/* Print: hide modal */
@media print {
  .detail-modal-backdrop { display: none !important; }
}
