/* =========================================================================
   Charte graphique Jaikit (réplique de jaikit-mainvitrine/static/css/jaikit.css)
   - Tokens invariants (or, accent, signaux)
   - Thème sombre (défaut) + clair
   - Composants : navbar, hero, btn, badge, card, section
   - Mobile-first léger (max-width: 900px)
   ========================================================================= */

/* ---------- Fonts (Google Fonts CDN — fallback si fonts/ vides) ---------- */
@import url('https://fonts.googleapis.com/css2?family=Syne:wght@700&family=DM+Sans:wght@400;500&family=JetBrains+Mono&display=swap');

/* Si fonts locales fournies, charger en priorité (plus rapide + offline-ready). */
@font-face {
  font-family: 'Syne';
  src: local('Syne'), url('/static/fonts/Syne-Bold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'DM Sans';
  src: local('DM Sans'), url('/static/fonts/DM_Sans-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'DM Sans';
  src: local('DM Sans Medium'), url('/static/fonts/DM_Sans-Medium.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: local('JetBrains Mono'), url('/static/fonts/JetBrainsMono-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

/* ---------- Tokens invariants + thèmes ---------- */
:root {
  --or:        #d4a853;
  --or-clair:  #e8c278;
  --or-pale:   #f5e6c0;
  --accent:    #4a9eff;
  --rouge:     #e85d4a;
  --vert:      #52c07e;
  --orange:    #e8a040;

  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow:    0 4px 12px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.25);

  --t-fast: 0.15s ease;
  --t:      0.25s ease;
}

[data-theme="dark"] {
  --bg:        #0a0a0f;
  --bg-2:      #12121a;
  --bg-3:      #1c1c28;
  --text:      #f0ece4;
  --text-dim:  #c8c4bc;
  --text-muted:#6b6878;
  --border:    #334155;
}

[data-theme="light"] {
  --bg:        #ffffff;
  --bg-2:      #f8fafc;
  --bg-3:      #f1f5f9;
  --text:      #0f172a;
  --text-dim:  #1e293b;
  --text-muted:#64748b;
  --border:    #e2e8f0;
}

/* ---------- Reset minimal + typo de base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'DM Sans', -apple-system, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--t-fast);
}
a:hover { color: var(--or); }

h1, h2, h3, h4, h5 {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0 0 0.5rem;
  color: var(--text);
}

h1 { font-size: clamp(1.6rem, 2.8vw, 2.2rem); letter-spacing: 0.05em; }
h2 { font-size: clamp(1.2rem, 2vw, 1.6rem); }
h3 { font-size: 1.1rem; }

code, pre, kbd { font-family: 'JetBrains Mono', monospace; }

/* ---------- Containers & sections ---------- */
/* .container        → standard 1500px (home, gabarits index, etc.) */
/* .container--wide  → pleine largeur (catalogue, fiche, compare, admin — data-dense) */
/* .container--narrow → 1100px (motorisation, mon-trajet — éditorial mid) */
/* .container--read  → 820px (about, sources, guides — lecture longue) */
.container {
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.container--wide   { max-width: none; padding: 0 2rem; }
.container--narrow { max-width: 1100px; }
.container--read   { max-width: 820px; }
@media (max-width: 640px) {
  .container--wide { padding: 0 1rem; }
}

.section {
  padding: 2.5rem 0;
}
.section--alt { background: var(--bg-2); }

.section-title {
  display: inline-block;
}
.section-title span { color: var(--or); }

.section-sep {
  width: 50px;
  height: 3px;
  background: var(--or);
  margin: 0.4rem 0 1.2rem;
  border-radius: 2px;
}

/* ---------- Navbar ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
[data-theme="light"] .navbar {
  background: rgba(255, 255, 255, 0.85);
}

.navbar__inner {
  max-width: none;
  margin: 0 auto;
  padding: 0.9rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.navbar__brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  letter-spacing: 0.12em;
  font-size: 1.1rem;
  color: var(--text);
  text-transform: uppercase;
}
.navbar__brand:hover { color: var(--or); }

.navbar__brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--or), var(--or-clair));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #1a1a1a;
  font-weight: 800;
  font-size: 0.9rem;
}

.navbar__nav {
  display: flex;
  gap: 1.4rem;
  align-items: center;
}
.navbar__nav a {
  color: var(--text-dim);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color var(--t-fast);
}
.navbar__nav a:hover,
.navbar__nav a.active { color: var(--or); }

.navbar__actions { display: flex; gap: 0.5rem; align-items: center; }

.btn-theme {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--t-fast);
}
.btn-theme:hover { border-color: var(--or); color: var(--or); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 3rem 0 2rem;
  text-align: center;
  background: radial-gradient(ellipse at top, var(--bg-2) 0%, var(--bg) 70%);
}
.hero__content { max-width: 980px; margin: 0 auto; padding: 0 1.5rem; }
.hero__h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  margin-bottom: 0.8rem;
}
.hero__h1 span { color: var(--or); }
.hero__subtitle {
  font-size: 1.05rem;
  color: var(--text-dim);
  max-width: 720px;
  margin: 0 auto 1.5rem;
  line-height: 1.55;
}
.hero__cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  font-size: 1rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--t);
  text-decoration: none;
}
.btn-primary {
  background: var(--or);
  color: #1a1a1a;
  border-color: var(--or);
}
.btn-primary:hover {
  background: var(--or-clair);
  border-color: var(--or-clair);
  color: #1a1a1a;
}
.btn-secondary {
  background: transparent;
  color: var(--or);
  border-color: var(--or);
}
.btn-secondary:hover { background: var(--or); color: #1a1a1a; }
.btn-ghost {
  background: transparent;
  color: var(--text-dim);
}
.btn-ghost:hover { color: var(--or); }

/* ---------- Cards ---------- */
.card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: all var(--t);
}
.card:hover {
  border-color: var(--or);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

/* ---------- Badges ---------- */
.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  background: var(--bg-3);
  color: var(--text-dim);
  border: 1px solid var(--border);
}
.badge--live  { background: rgba(82, 192, 126, 0.15); color: var(--vert); border-color: var(--vert); }
.badge--beta  { background: rgba(212, 168, 83, 0.15); color: var(--or);   border-color: var(--or); }
.badge--soon  { background: var(--bg-3); color: var(--text-muted); }
.badge--alert { background: rgba(232, 93, 74, 0.15); color: var(--rouge); border-color: var(--rouge); }

/* Badges motorisations (couleurs domaine cars, pilotables via CSS variables injectées) */
.badge-mot {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-mot--bev  { background: rgba(82, 192, 126, 0.18); color: var(--vert);   border: 1px solid var(--vert); }
.badge-mot--hev,
.badge-mot--phev,
.badge-mot--mhev { background: rgba(232, 160, 64, 0.18); color: var(--orange); border: 1px solid var(--orange); }
.badge-mot--ice  { background: rgba(232, 93, 74, 0.18);  color: var(--rouge);  border: 1px solid var(--rouge); }

/* Badge canary (pending review) */
.badge-canary {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.7rem;
  background: rgba(74, 158, 255, 0.15);
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 500;
}

/* ---------- Footer ---------- */
.footer {
  margin-top: auto;
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.footer__links { display: flex; justify-content: center; gap: 1.5rem; margin-bottom: 0.5rem; flex-wrap: wrap; }
.footer__copy { margin: 0.5rem 0 0; font-size: 0.85rem; }

/* ---------- Utilities ---------- */
.text-muted  { color: var(--text-muted); }
.text-dim    { color: var(--text-dim); }
.text-or     { color: var(--or); }
.text-vert   { color: var(--vert); }
.text-rouge  { color: var(--rouge); }
.text-center { text-align: center; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 2rem; }

.flex   { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center  { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1  { gap: 0.5rem; }
.gap-2  { gap: 1rem; }

/* ---------- Tooltips inline (filtre Jinja `glossarize`) ---------- */
.g-term {
  text-decoration: underline dotted var(--text-muted);
  text-underline-offset: 2px;
  cursor: help;
  transition: color var(--t-fast);
}
.g-term:hover { color: var(--or); text-decoration-color: var(--or); }

/* ---------- Empty state ---------- */
.empty-state {
  text-align: center;
  padding: 4rem 1.5rem;
  color: var(--text-muted);
}
.empty-state__icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .navbar__inner { padding: 0.7rem 1rem; gap: 0.75rem; }
  .navbar__nav { gap: 0.9rem; font-size: 0.9rem; }
  .navbar__nav a { font-size: 0.85rem; }
  .hero { padding: 3rem 0 2rem; }
  .section { padding: 2.5rem 0; }
}

@media (max-width: 640px) {
  .navbar__nav { display: none; }
  body { font-size: 15px; }
  .hero__cta { flex-direction: column; align-items: stretch; }
  .btn { width: 100%; justify-content: center; }
}
