/* =============================================================================
   HISTORICA — TIMELINE (port fidèle de la maquette Timeline.html)
   Tokens/reset/nav dupliqués volontairement (mêmes valeurs que le thème).
   ========================================================================== */
    /* ─── TOKENS ─────────────────────────────────────────────── */
    :root {
      --parchment:      #ede3cc;
      --parchment-dark: #ddd0b0;
      --parchment-deep: #c9b98a;
      --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;
      --font-serif:     'Playfair Display', serif;
      --font-body:      'EB Garamond', serif;

      /* Mythologique */
      --c-mythe:        #7a5c8a;
      --c-mythe-pale:   #b89aca;

      /* Période colors */
      --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;
    }

    *, *::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 */
    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: 1280px; 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: 46px; height: 46px;
      background: var(--parchment);
      border-radius: 6px;
      border: 1px solid rgba(184,148,63,0.5);
      display: flex; align-items: center; justify-content: center;
      overflow: hidden; 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);
    }

    /* ─── PAGE HEADER ────────────────────────────────────────── */
    .page-header {
      background: var(--empire-dark);
      position: relative; overflow: hidden;
      padding: 64px 40px 56px;
      border-bottom: 2px solid var(--gold);
    }
    .page-header::before {
      content: 'HISTOIRE';
      position: absolute; right: -20px; top: 50%; transform: translateY(-50%);
      font-family: var(--font-display);
      font-size: 160px; font-weight: 700;
      color: rgba(184,148,63,0.05);
      letter-spacing: 0.1em;
      pointer-events: none; user-select: none; white-space: nowrap;
    }
    .page-header-inner {
      max-width: 1280px; margin: 0 auto;
      position: relative; z-index: 1;
    }
    .page-header-eyebrow {
      font-family: var(--font-display); font-size: 11px;
      letter-spacing: 0.28em; color: var(--gold);
      text-transform: uppercase; margin-bottom: 12px; display: block;
    }
    .page-header-title {
      font-family: var(--font-serif);
      font-size: clamp(36px, 4vw, 64px);
      font-weight: 700; color: var(--parchment);
      line-height: 1.1; margin-bottom: 14px;
    }
    .page-header-title em { font-style: italic; color: var(--gold-light); }
    .page-header-sub {
      font-family: var(--font-body); font-size: 18px;
      font-style: italic; color: rgba(184,158,112,0.75);
    }

    /* ─── FILTRES ─────────────────────────────────────────────── */
    .filters-bar {
      background: var(--empire);
      border-bottom: 1px solid rgba(184,148,63,0.2);
      position: sticky; top: 72px; z-index: 90;
    }

    /* Ligne 1 : périodes scrollables */
    .filters-row1 {
      max-width: 1280px; margin: 0 auto;
      padding: 0 40px;
      display: flex; align-items: stretch;
      border-bottom: 1px solid rgba(184,148,63,0.1);
      position: relative;
    }
    .filters-scroll {
      flex: 1; min-width: 0;
      display: flex; align-items: center;
      overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
      scroll-behavior: smooth;
      -webkit-overflow-scrolling: touch;
    }
    .filters-scroll::-webkit-scrollbar { display: none; }
    /* Fondu dynamique selon la position de défilement */
    .filters-scroll.fade-right { mask-image: linear-gradient(to right, black 86%, transparent 100%); -webkit-mask-image: linear-gradient(to right, black 86%, transparent 100%); }
    .filters-scroll.fade-left  { mask-image: linear-gradient(to left, black 86%, transparent 100%); -webkit-mask-image: linear-gradient(to left, black 86%, transparent 100%); }
    .filters-scroll.fade-both  { mask-image: linear-gradient(to right, transparent 0%, black 9%, black 91%, transparent 100%); -webkit-mask-image: linear-gradient(to right, transparent 0%, black 9%, black 91%, transparent 100%); }
    /* Flèches de défilement */
    .fscroll-btn {
      flex-shrink: 0; width: 36px; height: 48px;
      background: var(--empire); border: none; cursor: pointer;
      color: var(--gold-light); font-size: 20px; line-height: 1;
      display: none; align-items: center; justify-content: center;
      transition: color 0.15s, background 0.15s; z-index: 2;
    }
    .fscroll-btn:hover { color: var(--gold-pale); background: var(--empire-mid); }
    .fscroll-btn.show { display: flex; }

    /* Ligne 2 : toggle mythologique — toujours visible */
    .filters-row2 {
      max-width: 1280px; margin: 0 auto;
      padding: 4px 40px;
      display: flex; align-items: center;
    }

    .filter-label {
      font-family: var(--font-display); font-size: 10px;
      letter-spacing: 0.2em; color: rgba(184,148,63,0.5);
      text-transform: uppercase; padding: 0 16px 0 0;
      white-space: nowrap; flex-shrink: 0;
      border-right: 1px solid rgba(184,148,63,0.15);
      margin-right: 4px; height: 48px;
      display: flex; align-items: center;
    }
    .filter-btn {
      font-family: var(--font-display); font-size: 11px;
      letter-spacing: 0.12em; text-transform: uppercase;
      color: rgba(237,227,204,0.55);
      background: none; border: none; cursor: pointer;
      padding: 0 14px; height: 48px;
      display: flex; align-items: center; gap: 6px;
      white-space: nowrap; flex-shrink: 0;
      border-bottom: 2px solid transparent;
      margin-bottom: -1px;
      transition: color 0.2s, border-color 0.2s;
    }
    .filter-btn .filter-dot {
      width: 7px; height: 7px; border-radius: 50%;
      background: currentColor; opacity: 0.6; flex-shrink: 0;
    }
    .filter-btn:hover { color: var(--parchment); }
    .filter-btn.active { color: var(--gold-light); border-bottom-color: var(--gold-light); }
    .filter-btn.active .filter-dot { opacity: 1; }

    @media (max-width: 600px) {
      .filters-row1 { padding: 0 16px; }
      .filters-row2 { padding: 4px 16px; flex-wrap: wrap; gap: 2px 16px; }
      .filter-label { display: none; }
      .filter-btn { padding: 0 10px; font-size: 10px; letter-spacing: 0.08em; }
      .legende-btn { margin-left: 0; }
      /* Sur petit écran : icônes seules, pas de texte, pour tenir sur une ligne */
      .filter-toggle-mythe span { display: none; }
      .legende-btn-txt { display: none; }
      .fold-btn .fold-lbl { display: none; }
      .fold-btn.folded .fold-lbl-folded { display: none; }
      .fold-btn { margin-right: 0; }
      .filters-row2 { justify-content: space-between; }
      /* En-tête de période : empiler pour ne pas compresser les dates */
      .periode-section-header { flex-wrap: wrap; gap: 6px 12px; margin-bottom: 28px; }
      .periode-badge { flex: 1 1 100%; font-size: 9px; padding: 5px 12px; }
      .periode-line { display: none; }
      .periode-section-dates { white-space: nowrap; font-size: 10px; }
      .periode-toggle { margin-left: auto; }
    }

    /* ─── LAYOUT PRINCIPAL ───────────────────────────────────── */
    .main {
      max-width: 1280px; margin: 0 auto;
      padding: 0 40px 80px;
      position: relative; z-index: 1;
    }

    /* ─── LÉGENDE DES RÉGIMES (V2) ───────────────────────────── */
    .regime-legende {
      display: flex; align-items: center; gap: 24px;
      flex-wrap: wrap;
      margin-top: 40px;
      padding: 16px 24px;
      background: rgba(255,255,255,0.35);
      border: 1px solid rgba(201,185,138,0.4);
    }
    .regime-legende-label {
      font-family: var(--font-display); font-size: 10px;
      letter-spacing: 0.2em; text-transform: uppercase;
      color: var(--ink-muted);
      padding-right: 20px;
      border-right: 1px solid rgba(201,185,138,0.5);
    }
    .regime-legende-items {
      display: flex; align-items: center; gap: 28px; flex-wrap: wrap;
    }
    .regime-legende-item {
      display: flex; align-items: center; gap: 10px;
      font-family: var(--font-body); font-size: 15px;
      color: var(--ink-soft);
    }
    .regime-legende-icon {
      width: 30px; height: 30px; flex-shrink: 0;
      border-radius: 3px;
      display: flex; align-items: center; justify-content: center;
      overflow: hidden;
    }
    .regime-legende-icon.gold { background: var(--gold); }
    .regime-legende-icon.light {
      background: var(--parchment);
      border: 1px solid rgba(26,58,92,0.25);
    }
    .regime-legende-icon img {
      width: 19px; height: 19px; object-fit: contain;
      filter: brightness(0) invert(1); opacity: 0.95;
    }
    .regime-legende-icon.light img { filter: none; width: 22px; height: 22px; }
    .regime-legende-icon.multi { width: auto; min-width: 30px; padding: 0 6px; }
    .regime-legende-icon.multi img { width: 13px; height: 13px; margin: 0 -1px; }

    /* Bouton + modal légende des sceaux */
    .legende-btn {
      display: inline-flex; align-items: center; gap: 8px;
      font-family: var(--font-display); font-size: 10px; letter-spacing: 0.14em;
      text-transform: uppercase; color: rgba(184,158,112,0.7);
      background: none; border: none; cursor: pointer; padding: 10px 0;
      transition: color 0.2s;
    }
    .legende-btn:hover { color: var(--gold-light); }
    .legende-btn-ic {
      width: 16px; height: 16px; border: 1px solid currentColor; border-radius: 50%;
      display: inline-flex; align-items: center; justify-content: center;
      font-size: 10px; font-style: italic; font-family: var(--font-serif);
    }

    /* Bouton « vue synthétique » (replier tous les événements) */
    .fold-btn {
      display: inline-flex; align-items: center; gap: 8px;
      font-family: var(--font-display); font-size: 10px; letter-spacing: 0.14em;
      text-transform: uppercase; color: rgba(184,158,112,0.7);
      background: none; border: none; cursor: pointer; padding: 10px 0;
      margin-right: 20px; transition: color 0.2s;
    }
    .fold-btn:hover { color: var(--gold-light); }
    .fold-btn-ic {
      width: 16px; height: 16px; flex-shrink: 0;
      display: inline-flex; align-items: center; justify-content: center;
      transition: transform 0.3s ease;
    }
    .fold-btn.folded .fold-btn-ic { transform: rotate(180deg); }
    .fold-btn .fold-lbl-open  { display: inline; }
    .fold-btn .fold-lbl-folded { display: none; }
    .fold-btn.folded .fold-lbl-open  { display: none; }
    .fold-btn.folded .fold-lbl-folded { display: inline; }
    /* ─── FOOTER ──────────────────────────────────── */
    footer {
      background: var(--empire-dark);
      border-top: 2px solid var(--gold);
      position: relative; z-index: 1; margin-top: 40px;
    }
    .footer-inner {
      max-width: 1280px; 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: 1280px; 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) { .footer-inner { grid-template-columns: 1fr 1fr; } }
    @media (max-width: 560px) {
      .footer-inner { grid-template-columns: 1fr; padding: 40px 20px 24px; gap: 32px; }
      .footer-bottom { padding: 20px; flex-direction: column; gap: 8px; text-align: center; }
    }

    .legende-modal {
      position: fixed; inset: 0; z-index: 300;
      background: rgba(15,36,64,0.55); backdrop-filter: blur(2px);
      display: none; align-items: center; justify-content: center; padding: 24px;
    }
    .legende-modal.open { display: flex; }
    .legende-card {
      width: 480px; max-width: 100%;
      background: var(--parchment); border: 1px solid var(--parchment-deep);
      border-top: 3px solid var(--gold); box-shadow: 0 30px 70px rgba(0,0,0,0.4);
      animation: legIn 0.25s ease;
    }
    @keyframes legIn { from { opacity:0; transform: translateY(-14px); } to { opacity:1; transform:none; } }
    .legende-card-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--parchment-deep); }
    .legende-card-title { font-family: var(--font-serif); font-size: 22px; font-weight: 700; color: var(--empire); }
    .legende-close { width: 32px; height: 32px; border: 1px solid var(--parchment-deep); background: none; cursor: pointer; color: var(--ink-muted); font-size: 15px; transition: all 0.15s; }
    .legende-close:hover { border-color: var(--gold); color: var(--gold); }
    .legende-intro { font-family: var(--font-body); font-style: italic; color: var(--ink-muted); font-size: 15px; padding: 18px 24px 2px; line-height: 1.5; }
    .legende-rows { padding: 8px 24px 24px; display: flex; flex-direction: column; }
    .legende-row { display: flex; align-items: center; gap: 16px; padding: 13px 0; border-bottom: 1px solid rgba(201,185,138,0.3); }
    .legende-row:last-child { border-bottom: none; }
    .legende-row > div { display: flex; flex-direction: column; gap: 3px; }
    .legende-row strong { font-family: var(--font-serif); font-size: 17px; color: var(--empire); font-weight: 700; }
    .legende-row span { font-family: var(--font-body); font-size: 14px; color: var(--ink-muted); font-style: italic; line-height: 1.4; }

    /* ─── PÉRIODE SECTION ────────────────────────────────────── */
    .periode-section {
      margin-top: 64px;
    }
    .periode-section.hidden { display: none; }

    .periode-section-header {
      display: flex; align-items: center; gap: 20px;
      margin-bottom: 40px; cursor: pointer;
      user-select: none;
    }
    .periode-section-header:hover .periode-toggle { opacity: 1; }
    .periode-badge {
      font-family: var(--font-display); font-size: 10px;
      letter-spacing: 0.22em; text-transform: uppercase;
      padding: 6px 16px;
      border: 1px solid currentColor;
      flex-shrink: 0;
    }
    .periode-section-title {
      font-family: var(--font-serif);
      font-size: clamp(24px, 2.5vw, 36px);
      font-weight: 700; color: var(--empire);
      flex: 1;
    }
    .periode-section-dates {
      font-family: var(--font-display); font-size: 11px;
      letter-spacing: 0.15em; color: var(--ink-muted);
      text-transform: uppercase;
    }
    .periode-toggle {
      width: 28px; height: 28px;
      border: 1px solid var(--parchment-deep);
      border-radius: 50%;
      display: flex; align-items: center; justify-content: center;
      color: var(--ink-muted);
      transition: opacity 0.2s, transform 0.3s;
      flex-shrink: 0; opacity: 0.5;
    }
    .periode-section.collapsed .periode-toggle { transform: rotate(-90deg); }
    .periode-line {
      flex: 1; height: 1px;
      background: linear-gradient(to right, currentColor, transparent);
      opacity: 0.25;
    }

    /* ─── TIMELINE TRACK ─────────────────────────────────────── */
    .timeline-track {
      position: relative;
      padding-left: 72px;
      overflow: hidden;
      transition: max-height 0.5s ease, opacity 0.4s ease;
    }
    .periode-section.collapsed .timeline-track {
      max-height: 0 !important;
      opacity: 0;
      pointer-events: none;
    }

    /* Ligne verticale */
    .timeline-track::before {
      content: '';
      position: absolute; left: 28px; top: 0; bottom: 0;
      width: 2px;
      background: linear-gradient(
        to bottom,
        transparent 0%,
        var(--parchment-deep) 8%,
        var(--parchment-deep) 92%,
        transparent 100%
      );
    }

    /* ─── RÈGNE ───────────────────────────────────────────────── */
    .regne {
      position: relative;
      margin-bottom: 2px;
    }

    /* Médaillon-sceau du règne — posé sur la ligne du temps (Option B) */
    .regne-medallion {
      position: absolute;
      left: -65px; top: 13px;
      width: 42px; height: 42px;
      border-radius: 50%;
      background: var(--empire);
      display: flex; align-items: center; justify-content: center;
      overflow: hidden;
      z-index: 3;
      border: 2px solid var(--gold);
      box-shadow: 0 0 0 3px var(--parchment), 0 2px 7px rgba(15,36,64,0.25);
      transition: transform 0.2s, box-shadow 0.2s;
    }
    .regne:hover .regne-medallion {
      transform: scale(1.07);
      box-shadow: 0 0 0 3px var(--parchment), 0 0 0 4px rgba(184,148,63,0.5), 0 4px 11px rgba(15,36,64,0.3);
    }
    .regne-medallion img {
      width: 26px; height: 26px; object-fit: contain;
      filter: brightness(0) invert(1); opacity: 0.92;
    }
    /* Connecteur médaillon → en-tête */
    .regne-medallion::after {
      content: '';
      position: absolute;
      left: 100%; top: 50%; transform: translateY(-50%);
      width: 23px; height: 1px;
      background: var(--parchment-deep);
    }
    /* Couronnes multiples (royaume partagé) */
    .regne-medallion.multi img { width: 15px; height: 15px; margin: 0 -3px; }
    /* Marianne (république) — image bleue sur fond clair */
    .regne-medallion.regime-republique { background: var(--parchment); border-color: var(--empire); }
    .regne-medallion.regime-republique img { filter: none; width: 30px; height: 30px; opacity: 1; }
    /* Régimes dorés (empire, monarchie) */
    .regne-medallion.gold-bg { background: var(--gold); }
    .regne-medallion.gold-bg img { opacity: 1; }

    .regne-header {
      display: flex; align-items: center; gap: 16px;
      padding: 16px 20px;
      background: rgba(255,255,255,0.35);
      border: 1px solid rgba(201,185,138,0.4);
      cursor: pointer;
      transition: background 0.2s, border-color 0.2s;
      position: relative;
    }
    .regne-header:hover {
      background: rgba(255,255,255,0.6);
      border-color: var(--gold);
    }
    /* (Ancien carré d'icône de règne retiré — remplacé par le médaillon sur la ligne, Option B) */
    .regne-info { flex: 1; min-width: 0; }
    .regne-name {
      font-family: var(--font-serif); font-size: 20px;
      font-weight: 700; color: var(--empire);
      white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .regne-dates {
      font-family: var(--font-display); font-size: 12px;
      letter-spacing: 0.12em; color: var(--gold); font-weight: 600;
      text-transform: uppercase;
    }
    .regne-toggle {
      width: 24px; height: 24px; flex-shrink: 0;
      display: flex; align-items: center; justify-content: center;
      color: var(--ink-muted);
      transition: transform 0.3s;
    }
    .regne.collapsed .regne-toggle { transform: rotate(-90deg); }

    /* ─── ÉVÉNEMENTS ─────────────────────────────────────────── */
    .evenements {
      padding: 0 0 0 32px;
      transition: max-height 0.4s ease, opacity 0.35s ease;
      overflow: hidden;
    }
    .regne.collapsed .evenements {
      max-height: 0 !important; opacity: 0; pointer-events: none;
    }

    .evenement {
      position: relative;
      display: grid;
      grid-template-columns: 80px 1fr;
      gap: 0 20px;
      padding: 14px 0;
      border-bottom: 1px solid rgba(201,185,138,0.25);
      transition: background 0.2s;
    }
    .evenement:last-child { border-bottom: none; }
    .evenement:hover { background: rgba(255,255,255,0.25); }

    /* Losange sur la ligne */
        /* Losange retiré : redondant avec l'icône de type désormais affichée sur chaque événement,
       et se faisait rogner par l'overflow:hidden de .evenements selon les écrans. */
    .evenement::before { content: none; }
    .evenement:hover::before { content: none; }

    .evenement-annee {
      font-family: var(--font-display); font-size: 14px;
      font-weight: 600; color: var(--gold);
      letter-spacing: 0.05em;
      padding-top: 2px;
      text-align: right;
    }

    /* Icône de type d'événement */
    .evenement-type-icon {
      display: inline-flex; align-items: center; justify-content: center;
      width: 28px; height: 28px; flex-shrink: 0;
      border-radius: 3px;
      background: var(--empire);
      overflow: hidden;
    }
    .evenement-type-icon img {
      width: 19px; height: 19px;
      object-fit: contain;
      filter: brightness(0) invert(1);
      opacity: 0.9;
    }
    /* Icônes or (monarchie, traite, suicide, empire, chute_regne) */
    .evenement-type-icon.gold-icon {
      background: var(--gold);
    }
    .evenement-type-icon.gold-icon img {
      filter: brightness(0) invert(1);
      opacity: 1;
    }
    .evenement-body { display: flex; flex-direction: column; gap: 4px; }
    .evenement-titre {
      font-family: var(--font-serif); font-size: 17px;
      font-weight: 600; color: var(--ink-soft);
      line-height: 1.3;
    }
    .evenement-desc {
      font-family: var(--font-body); font-size: 15px;
      font-style: italic; color: var(--ink-muted);
      line-height: 1.5;
    }
    .evenement-tags {
      display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px;
    }
    .evenement-tag {
      font-family: var(--font-display); font-size: 9px;
      letter-spacing: 0.18em; text-transform: uppercase;
      padding: 3px 8px;
      border: 1px solid rgba(184,148,63,0.3);
      color: var(--ink-muted);
    }

    /* ─── MYTHOLOGIQUE ──────────────────────────────────────── */
    .evenement.mythologique {
      background: rgba(122, 92, 138, 0.06);
      border-left: 3px solid rgba(122,92,138,0.4);
      padding-left: 12px;
    }
    .evenement.mythologique .evenement-annee { color: var(--c-mythe); }
        .evenement.mythologique::before { content: none; }
    .mythe-badge {
      display: inline-flex; align-items: center; gap: 5px;
      font-family: var(--font-display); font-size: 9px;
      letter-spacing: 0.18em; text-transform: uppercase;
      color: var(--c-mythe-pale);
      background: rgba(122,92,138,0.15);
      border: 1px solid rgba(122,92,138,0.35);
      padding: 2px 8px;
      flex-shrink: 0;
    }
    .mythe-badge svg { opacity: 0.8; }

    /* Masquer les mythologiques si toggle off */
    body.hide-mythe .evenement.mythologique { display: none !important; }
    /* Masquer les règnes / périodes entièrement légendaires (aucun événement réel) */
    body.hide-mythe .regne.all-myth,
    body.hide-mythe .periode-section.all-myth { display: none !important; }

    /* ─── LIEN WIKIPEDIA ─────────────────────────────────────── */
    .wiki-link {
      display: inline-flex; align-items: center; gap: 5px;
      font-family: var(--font-display); font-size: 10px;
      letter-spacing: 0.12em; text-transform: uppercase;
      color: var(--gold); text-decoration: none;
      border-bottom: 1px solid rgba(184,148,63,0.3);
      padding-bottom: 1px;
      transition: color 0.2s, border-color 0.2s;
      margin-top: 6px; align-self: flex-start;
    }
    .wiki-link:hover { color: var(--gold-pale); border-color: var(--gold-pale); }
    .wiki-link svg { flex-shrink: 0; opacity: 0.7; }

    .filter-toggle-mythe {
      display: flex; align-items: center; gap: 12px;
      font-family: var(--font-display); font-size: 10px;
      letter-spacing: 0.14em; text-transform: uppercase;
      background: none; border: none; cursor: pointer;
      padding: 10px 0;
      white-space: nowrap; flex-shrink: 0;
      transition: color 0.2s;
      color: rgba(237, 227, 204, 0.35);
    }
    .filter-toggle-mythe .mythe-state {
      font-family: var(--font-display); font-size: 9px;
      letter-spacing: 0.2em;
      padding: 3px 8px;
      border: 1px solid currentColor;
      opacity: 0.7;
    }
    .filter-toggle-mythe .mythe-state-on { display: none; }
    .filter-toggle-mythe .mythe-state-off { display: inline-block; }

    /* Switch visuel — type interrupteur */
    .mythe-toggle-icon {
      width: 38px; height: 22px; flex-shrink: 0;
      border-radius: 999px;
      background: rgba(237, 227, 204, 0.10);
      border: 1px solid rgba(237, 227, 204, 0.25);
      position: relative;
      transition: background 0.25s, border-color 0.25s;
    }
    .mythe-toggle-icon::after {
      content: '';
      position: absolute;
      top: 2px; left: 2px;
      width: 16px; height: 16px;
      border-radius: 50%;
      background: rgba(237, 227, 204, 0.55);
      transition: transform 0.25s, background 0.25s;
      box-shadow: 0 1px 2px rgba(0,0,0,0.25);
    }

    /* État ACTIF — mythes visibles */
    .filter-toggle-mythe.active { color: var(--c-mythe-pale); }
    .filter-toggle-mythe.active .mythe-state-on { display: inline-block; }
    .filter-toggle-mythe.active .mythe-state-off { display: none; }
    .filter-toggle-mythe.active .mythe-state {
      background: rgba(122,92,138,0.25);
      opacity: 1;
    }
    .filter-toggle-mythe.active .mythe-toggle-icon {
      background: var(--c-mythe);
      border-color: var(--c-mythe-pale);
    }
    .filter-toggle-mythe.active .mythe-toggle-icon::after {
      transform: translateX(16px);
      background: var(--parchment);
    }

    .filter-toggle-mythe:hover { color: var(--parchment); }
    .filter-toggle-mythe.active:hover { color: var(--c-mythe-pale); }

    /* ─── EMPTY STATE ────────────────────────────────────────── */
    .empty-state {
      text-align: center; padding: 80px 20px;
      display: none;
    }
    .empty-state.visible { display: block; }
    .empty-state p {
      font-family: var(--font-serif); font-size: 22px;
      font-style: italic; color: var(--ink-muted);
    }

    /* ─── SEARCH (tiroir escamotable) ────────────────────────── */
    .search-toggle-btn {
      display: inline-flex; align-items: center; justify-content: center;
      width: 30px; height: 30px; flex-shrink: 0;
      background: none; border: 1px solid rgba(184,148,63,0.35); border-radius: 50%;
      color: rgba(184,158,112,0.75); cursor: pointer; transition: opacity 0.24s ease, color 0.2s, border-color 0.2s, background 0.2s;
      margin-left: auto; margin-right: 12px;
      opacity: 0; pointer-events: none;
    }
    .search-toggle-btn.show { opacity: 1; pointer-events: auto; }
    .search-toggle-btn:hover { color: var(--gold-light); border-color: var(--gold-light); }
    .search-toggle-btn.active { color: var(--gold-light); background: rgba(184,148,63,0.14); border-color: var(--gold-light); }

    .search-wrap {
      background: var(--parchment-dark);
      border-bottom: 1px solid transparent;
      max-height: 0; overflow: hidden; opacity: 0;
      transition: max-height 0.32s ease, opacity 0.24s ease, border-color 0.24s ease;
    }
    .search-wrap.open {
      max-height: 90px; opacity: 1;
      border-bottom-color: var(--parchment-deep);
    }
    .search-inner {
      max-width: 1280px; margin: 0 auto;
      padding: 12px 40px;
      display: flex; align-items: center; gap: 16px;
    }
    .search-input-wrap {
      flex: 1; position: relative;
    }
    .search-input {
      width: 100%;
      font-family: var(--font-body); font-size: 16px;
      font-style: italic; color: var(--ink);
      background: rgba(255,255,255,0.5);
      border: 1px solid rgba(201,185,138,0.5);
      padding: 10px 16px 10px 40px;
      outline: none;
      transition: border-color 0.2s, background 0.2s;
    }
    .search-input:focus {
      border-color: var(--gold);
      background: rgba(255,255,255,0.8);
    }
    .search-icon {
      position: absolute; left: 12px; top: 50%;
      transform: translateY(-50%);
      color: var(--ink-muted); pointer-events: none;
    }
    .search-count {
      font-family: var(--font-display); font-size: 11px;
      letter-spacing: 0.12em; color: var(--ink-muted);
      text-transform: uppercase; white-space: nowrap;
    }

    /* ─── SCROLL REVEAL ──────────────────────────────────────── */
    .reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.6s, transform 0.6s; }
    .reveal.visible { opacity: 1; transform: none; }

    /* ─── RESPONSIVE ─────────────────────────────────────────── */
    @media (max-width: 768px) {
      .nav-inner { padding: 0 20px; }
      .page-header { padding: 48px 20px 40px; }
      .main { padding: 0 16px 60px; }
      .search-inner { padding: 12px 20px; }
      .timeline-track { padding-left: 48px; }
      .timeline-track::before { left: 16px; }
      .regne-medallion { left: -48px; top: 13px; width: 32px; height: 32px; }
      .regne-medallion img { width: 20px; height: 20px; }
      .evenements { padding-left: 24px; }
      .nav-links a { padding: 0 12px; font-size: 11px; }
    }
    @media (max-width: 560px) {
      /* Année au-dessus du texte, contenu pleine largeur */
      .evenement { grid-template-columns: 1fr; gap: 4px 0; }
      .evenement-annee { text-align: left; padding-top: 0; }
      .timeline-track { padding-left: 40px; }
      .timeline-track::before { left: 16px; }
      .regne-medallion { left: -40px; }
      .evenements { padding-left: 24px; }
      .regne-header { padding: 14px 14px; gap: 12px; }
    }
