/* =============================================================================
   HISTORICA — THÈME GLOBAL (design system)
   Socle commun extrait des maquettes (Historica.html, Timeline.html, …).
   Contient : tokens, reset, texture parchemin, navigation, footer, menu mobile
   et composants partagés (boutons, ornement, reveal, section).
   Les CSS spécifiques à chaque page vivent dans leur propre feuille.
   ========================================================================== */

/* ─── TOKENS ─────────────────────────────────────────────────────────────── */
:root {
  --parchment:      #ede3cc;
  --parchment-dark: #ddd0b0;
  --parchment-deep: #c9b98a;
  --paper:          #f4ecd8;
  --empire:         #1a3a5c;
  --empire-dark:    #0f2440;
  --empire-mid:     #2a527a;
  --gold:           #b8943f;
  --gold-light:     #d4a84b;
  --gold-pale:      #e8c97a;
  --ink:            #1c1610;
  --ink-soft:       #3a3020;
  --ink-muted:      #6b5c40;
  --mauve:          #7a5c8a;

  --font-display:   'Cinzel', serif;        /* titres capitales, labels */
  --font-serif:     'Playfair Display', serif; /* titres éditoriaux */
  --font-body:      'EB Garamond', serif;   /* corps de texte */

  /* Couleurs de période (badges / accents timeline) */
  --c-antiquite:    #8b5e3c;
  --c-merovingiens: #5c6e2a;
  --c-carolingiens: #2a527a;
  --c-capetiens:    #7a3a5c;
  --c-valois:       #5c3a8b;
  --c-bourbons:     #1a3a5c;
  --c-revolution:   #8b1a1a;
  --c-empire:       #1a4a5c;
  --c-contemporain: #3a5c1a;
  --c-mythe:        #7a5c8a;
  --c-mythe-pale:   #b89aca;
}

/* ─── RESET ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background-color: var(--parchment);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ─── TEXTURE PARCHEMIN ──────────────────────────────────────────────────── */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}

/* ─── NAVIGATION ─────────────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 100;
  background-color: var(--empire-dark);
  border-bottom: 2px solid var(--gold);
}
.nav-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 40px; height: 72px;
}
.nav-logo { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.nav-logo-icon {
  width: 44px; height: 44px;
  background: var(--parchment);
  border: 1px solid rgba(184,148,63,0.5);
  border-radius: 6px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.nav-logo-icon img { width: 100%; height: 100%; object-fit: cover; }
.nav-logo-text {
  font-family: var(--font-display);
  font-size: 22px; letter-spacing: 0.15em;
  color: var(--parchment); font-weight: 600;
}
.nav-links { display: flex; gap: 0; list-style: none; }
.nav-links a {
  font-family: var(--font-display);
  font-size: 13px; letter-spacing: 0.12em;
  color: var(--parchment-deep); text-decoration: none;
  padding: 0 22px; height: 72px;
  display: flex; align-items: center;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: color 0.2s, border-color 0.2s;
}
.nav-links a:hover,
.nav-links a.active { color: var(--gold-light); border-bottom-color: var(--gold-light); }

/* ─── MENU MOBILE (hamburger) ────────────────────────────────────────────── */
.nav-burger {
  display: none; width: 42px; height: 42px;
  background: transparent; border: 1px solid rgba(184,148,63,0.4);
  color: var(--gold-light); cursor: pointer;
  flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; flex-shrink: 0; border-radius: 4px; transition: border-color .2s;
}
.nav-burger:hover { border-color: var(--gold-light); }
.nav-burger span { display: block; width: 20px; height: 2px; background: currentColor; transition: transform .25s, opacity .2s; }
.nav-burger.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
@media (max-width: 640px) {
  .nav-burger { display: flex; }
  .nav-links {
    position: fixed; left: 0; right: 0; top: 72px;
    max-height: calc(100vh - 72px); overflow-y: auto;
    flex-direction: column; gap: 0; padding: 8px 0;
    background: var(--empire-dark); border-top: 1px solid rgba(184,148,63,0.2);
    box-shadow: 0 20px 40px rgba(0,0,0,.35);
    transform: translateX(100%); transition: transform .3s ease; z-index: 200;
  }
  .nav-links.open { transform: none; }
  .nav-links li { width: 100%; }
  .nav-links a {
    height: auto; width: 100%; padding: 16px 28px;
    font-size: 15px; letter-spacing: .08em;
    border-bottom: 1px solid rgba(184,148,63,0.12);
    border-left: 3px solid transparent; margin: 0;
  }
  .nav-links a.active { border-left-color: var(--gold-light); border-bottom-color: rgba(184,148,63,0.12); }
}

/* ─── BOUTON PRIMAIRE ────────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--font-display);
  font-size: 13px; letter-spacing: 0.15em; text-transform: uppercase;
  text-decoration: none;
  color: var(--empire-dark); background: var(--gold);
  padding: 16px 32px; border: 2px solid var(--gold);
  transition: background 0.2s, color 0.2s, gap 0.2s;
  white-space: nowrap; flex-shrink: 0; cursor: pointer;
}
.btn-primary:hover { background: transparent; color: var(--empire); gap: 18px; }
.btn-primary svg { flex-shrink: 0; }

/* ─── ORNEMENT ───────────────────────────────────────────────────────────── */
.ornament {
  display: flex; align-items: center; gap: 16px;
  margin: 0 auto 48px; max-width: 320px;
}
.ornament-line { flex: 1; height: 1px; background: linear-gradient(to right, transparent, var(--gold), transparent); }
.ornament-diamond { width: 8px; height: 8px; background: var(--gold); transform: rotate(45deg); flex-shrink: 0; }

/* ─── SECTION ────────────────────────────────────────────────────────────── */
.section { max-width: 1200px; margin: 0 auto; padding: 72px 40px; position: relative; z-index: 1; }
.section-header { text-align: center; margin-bottom: 56px; }
.section-eyebrow {
  font-family: var(--font-display);
  font-size: 11px; letter-spacing: 0.25em; color: var(--gold);
  text-transform: uppercase; margin-bottom: 12px; display: block;
}
.section-title {
  font-family: var(--font-serif);
  font-size: clamp(28px, 3vw, 44px); font-weight: 700;
  color: var(--empire); line-height: 1.2;
}
.section-title em { font-style: italic; color: var(--gold); }

/* ─── SCROLL REVEAL ──────────────────────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

/* ─── FOOTER ─────────────────────────────────────────────────────────────── */
footer.site-footer { background: var(--empire-dark); border-top: 2px solid var(--gold); position: relative; z-index: 1; }
.footer-inner {
  max-width: 1200px; margin: 0 auto; padding: 56px 40px 32px;
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 48px;
}
.footer-brand h4 { font-family: var(--font-display); font-size: 18px; letter-spacing: 0.18em; color: var(--parchment); margin-bottom: 12px; }
.footer-brand p { font-family: var(--font-body); font-size: 15px; color: rgba(184,158,112,0.7); font-style: italic; line-height: 1.6; }
.footer-col h5 {
  font-family: var(--font-display); font-size: 11px; letter-spacing: 0.2em;
  color: var(--gold); text-transform: uppercase; margin-bottom: 20px;
  padding-bottom: 10px; border-bottom: 1px solid rgba(184,148,63,0.2);
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer-col a { font-family: var(--font-body); font-size: 15px; color: rgba(184,158,112,0.7); text-decoration: none; transition: color 0.2s; }
.footer-col a:hover { color: var(--parchment); }
.footer-bottom {
  max-width: 1200px; margin: 0 auto; padding: 20px 40px;
  border-top: 1px solid rgba(184,148,63,0.15);
  display: flex; justify-content: space-between; align-items: center; gap: 20px;
}
.footer-bottom p { font-family: var(--font-display); font-size: 11px; letter-spacing: 0.12em; color: rgba(184,158,112,0.4); }

@media (max-width: 900px) {
  .nav-inner { padding: 0 20px; }
  .section { padding: 56px 20px; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .nav-links a { padding: 0 12px; font-size: 11px; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-col { display: none; }
  .footer-col:first-of-type { display: block; }
}
