/* Portance : barre du site, accueil, éléments communs aux rubriques Comprendre / Piloter */
.sitebar { display: flex; align-items: center; gap: 4px 18px; padding: 8px 16px; background: #0a0c13; border-bottom: 2px solid var(--line); flex-wrap: wrap; position: sticky; top: 0; z-index: 30; }
.sitebar .logo { font-family: var(--px); font-size: 15px; color: var(--accent2); text-decoration: none; letter-spacing: 1px; text-shadow: 2px 2px 0 #0f3a4a; margin-right: 10px; }
.sitebar .logo span { color: var(--accent); text-shadow: 2px 2px 0 #4a3a10; }
.navlink { color: var(--muted); text-decoration: none; font-size: 21px; padding: 2px 4px; border-bottom: 3px solid transparent; }
.navlink:hover { color: var(--text); }
.navlink.on { color: var(--accent); border-bottom-color: var(--accent); }
.sectitle { font-family: var(--px); font-size: 11px; color: var(--red); letter-spacing: 1px; text-shadow: 2px 2px 0 #4a1010; }
.loading { padding: 40px; text-align: center; color: var(--muted); }

a.btn, .btn { display: inline-block; text-decoration: none; color: var(--text); background: var(--panel2); border: 2px solid var(--line); border-bottom-width: 4px; padding: 5px 12px; font-size: 19px; }
a.btn:hover { border-color: var(--accent); }
a.btn.big { background: #3a2f10; border-color: var(--accent); color: var(--accent); }

/* accueil */
.hero { position: relative; max-width: 1180px; margin: 12px auto 0; border: 2px solid var(--line); overflow: hidden; aspect-ratio: 2 / 1; max-height: 72vh; min-height: 300px; }
.hero-cv { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; object-fit: cover; object-position: 50% 75%; }
.hero-txt { position: absolute; left: 0; top: 0; right: 0; padding: 18px 22px 40px; background: linear-gradient(rgba(8, 10, 18, .85) 55%, transparent); }
.hero h1 { font-family: var(--px); font-size: clamp(15px, 2.4vw, 24px); line-height: 1.4; margin: 0 0 8px; color: #fff; text-shadow: 3px 3px 0 #000; font-weight: normal; }
.hero p { margin: 0 0 12px; max-width: 760px; font-size: 21px; color: #dfe3f2; }
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; }
.hsec { max-width: 1180px; margin: 28px auto 0; padding: 0 16px; }
.hsec h2 { font-family: var(--px); font-size: 15px; font-weight: normal; margin: 0 0 6px; letter-spacing: 1px; }
.hsec h2 a { color: var(--accent); text-decoration: none; }
.hsec .lead { margin: 0 0 12px; color: var(--muted); font-size: 20px; }
.hgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.hcard { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 10px 12px 12px; background: var(--panel); border: 2px solid var(--line); border-bottom-width: 4px; color: var(--text); text-decoration: none; }
a.hcard:hover { border-color: var(--accent); }
.hcard .num { font-size: 15px; color: var(--accent2); text-transform: uppercase; letter-spacing: 1px; }
.hcard b { font-size: 22px; font-weight: normal; color: #fff; }
.hcard span:last-of-type { color: var(--muted); font-size: 18px; }
.hcard .lvl { position: absolute; top: 9px; right: 10px; color: var(--accent); font-size: 13px; letter-spacing: 2px; }
.hcard.soon { opacity: .5; border-style: dashed; }
.hcard em { font-style: normal; font-size: 15px; color: var(--accent); text-transform: uppercase; }
.crashlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 4px 16px; }
.crashlist a { color: var(--text); text-decoration: none; padding: 3px 0; border-bottom: 1px dashed var(--line); }
.crashlist a:hover { color: var(--accent); }
.crashlist .yr { color: var(--accent2); display: inline-block; width: 3.2em; }
.sitefoot { max-width: 1180px; margin: 34px auto 20px; padding: 12px 16px 0; border-top: 2px solid var(--line); color: var(--muted); font-size: 17px; }

@media (max-width: 640px) {
  .hero { aspect-ratio: auto; min-height: 0; display: flex; flex-direction: column-reverse; }
  .hero-cv { position: static; aspect-ratio: 16 / 9; height: auto; }
  .hero-txt { position: static; background: none; padding: 14px 14px 16px; }
  .hero p { font-size: 19px; }
  .sitebar { gap: 2px 12px; }
  .navlink { font-size: 19px; }
}

/* rubrique Accidents sous la barre du site (collante) */
#view-crash .side { top: 58px; max-height: calc(100vh - 72px); }

/* accueil : présentation du site, rubriques, pied de page */
.hero h1 { font-size: clamp(26px, 5vw, 46px); color: var(--accent2); text-shadow: 4px 4px 0 #0f3a4a; letter-spacing: 3px; margin: 0 0 10px; }
.hero h1 span { color: var(--accent); text-shadow: 4px 4px 0 #4a3a10; }
.hero-tag { font-size: 24px !important; }
.about-site .about-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 32px; }
.about-site p { margin: 0; font-size: 21px; line-height: 1.3; }
.rubgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.rub { display: flex; flex-direction: column; background: var(--panel); border: 2px solid var(--line); border-bottom-width: 4px; color: var(--text); text-decoration: none; }
.rub:hover { border-color: var(--accent); }
.rub img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; image-rendering: pixelated; border-bottom: 2px solid var(--line); }
.rub-body { display: flex; flex-direction: column; gap: 6px; padding: 10px 14px 14px; }
.rub-body b { font-family: var(--px); font-weight: normal; font-size: 14px; color: var(--accent); }
.rub-body span { font-size: 20px; line-height: 1.25; }
.rub-body em { font-style: normal; color: var(--muted); font-size: 17px; }
.sitefoot { max-width: none; margin: 44px 0 0; padding: 0; border-top: 2px solid var(--line); background: #0a0c13; }
.foot-cols { max-width: 1180px; margin: 0 auto; padding: 22px 16px 10px; display: grid; grid-template-columns: 1.2fr 1fr 1.2fr 1.6fr; gap: 20px 28px; }
.foot-cols > div { display: flex; flex-direction: column; gap: 5px; }
.foot-cols b { font-weight: normal; color: var(--text); font-size: 19px; }
.foot-cols a { color: var(--muted); text-decoration: none; font-size: 18px; }
.foot-cols a:hover { color: var(--accent); }
.foot-cols p { margin: 0; color: var(--muted); font-size: 17px; }
.foot-logo { font-family: var(--px); font-size: 13px !important; color: var(--accent2) !important; letter-spacing: 1px; }
.foot-logo span { color: var(--accent); }
.foot-bottom { max-width: 1180px; margin: 0 auto; padding: 10px 16px 18px; color: var(--muted); font-size: 16px; border-top: 1px solid var(--line); }
@media (max-width: 900px) {
  .about-site .about-cols, .rubgrid { grid-template-columns: 1fr; }
  .foot-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) { .foot-cols { grid-template-columns: 1fr; } }
@media (max-width: 420px) {
  .sitebar { padding: 8px 12px; gap: 2px 10px; }
  .sitebar .logo { font-size: 12px; margin-right: 2px; }
  .navlink { font-size: 18px; padding: 2px 2px; }
}

/* menu : les liens défilent horizontalement sur petit écran plutôt que de passer à la ligne */
.navlinks { display: flex; gap: 4px 18px; align-items: center; min-width: 0; }
@media (max-width: 640px) {
  .sitebar { flex-wrap: nowrap; }
  .navlinks { flex: 1; overflow-x: auto; scrollbar-width: none; gap: 14px; -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); padding-right: 24px; }
  .navlinks::-webkit-scrollbar { display: none; }
  .navlink { white-space: nowrap; }
}

/* fonctions IA masquées (voir SHOW_AI dans main.js) */
body.no-ai .ai-only { display: none !important; }
.rub-lex { margin: 14px 0 0; color: var(--muted); font-size: 19px; }
.rub-lex a { color: var(--accent2); }
@media (min-width: 900px) { .navlex { margin-left: auto; } .navlinks { flex: 1; } }
.rub-lex { margin: 14px 0 0; color: var(--muted); font-size: 19px; }
.rub-lex a { color: var(--accent2); }
@media (min-width: 900px) { .navlex { margin-left: auto; } .navlinks { flex: 1; } }
