/* ============================================================
   Style Clean Fantasy — Proxti
   STYLE GLOBAL — commun à toutes les pages (header, footer,
   variables, reset, + classes utilisées sur 3 pages ou plus)
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Toutes les couleurs (--bg, --bg2, --surface, --border, --magic-color,
   --magic-glow, --text, --muted, etc.) sont désormais définies dans
   colors.css, qui doit être chargé avant ce fichier. */
:root {
  --radius:      12px; /* Bords légèrement plus ronds */
  
  /* Polices */
  --font-text:   'Inter', system-ui, sans-serif;
  --font-title:  'Cinzel', serif; /* Police épique pour les titres */
  
  /* Animations */
  --trans:       all 0.3s ease;
}

body {
  font-family: var(--font-text);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 16px;
  overflow-x: hidden;
}

a { color: var(--magic-color); text-decoration: none; transition: var(--trans); }
a:hover { text-shadow: 0 0 8px var(--magic-glow); }

h1, h2, h3, .logo { font-family: var(--font-title); font-weight: 700; letter-spacing: 0.5px; }

/* ---- Header (Glassmorphism) ---- */
.site-header {
  background: var(--bg-alpha-70);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  transition: var(--trans);
}
.header-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 0 1.5rem;
  display: flex; align-items: center; justify-content: space-between; height: 70px;
  gap: 1rem; /* ← empêche le chevauchement */
}
.nav-logo { height: 40px; width: auto; flex-shrink: 0; /* ← logo jamais écrasé */ }

/* ---- Logo ---- */
.logo-container {
  display: flex; align-items: center;
  overflow: hidden; padding-right: 10px;
  flex-shrink: 0; /* ← ne rétrécit jamais */
  min-width: 40px; /* ← au minimum la taille du logo */
}
.logo-text {
  font-family: var(--font-title); font-size: 1.5rem; color: var(--text);
  width: 0; opacity: 0; white-space: nowrap;
  transition: width 0.5s ease, opacity 0.7s ease;
  margin-left: 10px;
}
.logo-container:hover .logo-text { width: 80px; opacity: 1; margin-left: 10px; }

/* ---- Nav ---- */
.main-nav {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap; /* ← passe à la ligne si vraiment trop étroit */
  justify-content: flex-end;
}
.main-nav a {
  color: var(--text); font-size: 0.95rem; font-family: var(--font-text);
  position: relative; padding: 5px 0;
  white-space: nowrap; /* ← les labels ne cassent pas en 2 lignes */
}
.main-nav a::after {
  content: ''; position: absolute; bottom: 0; left: 0; width: 0%; height: 2px;
  background: var(--magic-color); transition: var(--trans);
  box-shadow: 0 0 8px var(--magic-color);
}
.main-nav a:hover::after, .main-nav a.active::after { width: 100%; }

/* ---- Breakpoint burger (optionnel) ---- */
@media (max-width: 450px) {
  .main-nav { gap: 0.5rem; }
  .main-nav a { font-size: 0.75rem; }
}

.site-main {
  transition: opacity 0.3s ease;
  opacity: 1;
}

/* ---- Particules Magiques (effet sitewide, injecté par main.js) ---- */
.magic-particle {
    position: fixed;
    pointer-events: none;
    border-radius: 2px;
    background: var(--gold);
    box-shadow: 0 0 4px var(--gold), 0 0 8px var(--gold-glow);
    z-index: 9999;
    animation: fairyTrail 0.9s ease-out forwards;
}

@keyframes fairyTrail {
    0% {
        opacity: 1;
        transform: translate(0, 0) rotate(var(--rot)) scale(1);
    }
    60% {
        opacity: 0.6;
    }
    100% {
        opacity: 0;
        transform: translate(var(--dx), var(--dy)) rotate(calc(var(--rot) + 180deg)) scale(0.2);
    }
}

/* ---- Sections Globales (utilisé sur accueil, votes, carte) ---- */
.section-inner { max-width: 1200px; margin: 0 auto; padding: 4rem 1.5rem; }
.section-title { text-align: center; font-size: 2rem; margin-bottom: 3rem; color: var(--white); }

/* ---- Footer ---- */
.site-footer {
  background: var(--bg2); border-top: 1px solid var(--border);
  padding: 2rem; text-align: center; font-size: 0.9rem; color: var(--muted);
}
.footer-rune { font-size: 1.5rem; margin-bottom: 10px; opacity: 0.5; }
.footer-ip { color: var(--magic-color); }
.footer-links { margin-top: 1rem; }
.footer-links a { color: var(--muted); margin: 0 .5rem; }
.footer-links a:hover { color: var(--magic-color); }

/* ---- Utilitaires (utilisé sur accueil, actus, wiki, votes) ---- */
.empty { color: var(--muted); font-style: italic; text-align: center; }
code { font-family: monospace; }
