/* =========================================================
   ValeurÉcole — système de design
   Identité "académique sérieuse" : bleu marine profond, or/ambre en
   accent, fond ivoire. Distinct de PrixDuMètre (vert sapin/terre cuite)
   et de l'identité mobile "aurora indigo/cyan" de la famille dlastes.
   ========================================================= */

:root {
  --marine: #16233f;
  --marine-clair: #223458;
  --or: #c9962f;
  --or-clair: #e0b34f;
  --ivoire: #f8f5ee;
  --ivoire-fonce: #ece5d3;
  --encre: #1c1b18;
  --gris-texte: #4a4741;
  --gris-bordure: #dcd4bf;
  --blanc: #ffffff;
  --positif: #2f6b4f;
  --negatif: #a13d2a;

  --font-display: "Newsreader", Georgia, serif;
  --font-texte: "Work Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --rayon: 10px;
  --ombre: 0 2px 8px rgba(22, 35, 63, 0.09);
  --ombre-forte: 0 12px 32px rgba(22, 35, 63, 0.18);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-texte);
  background: var(--ivoire);
  color: var(--encre);
  line-height: 1.55;
  font-size: 16px;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.18;
  color: var(--marine);
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2rem, 5vw, 3.3rem); font-weight: 500; }
h2 { font-size: clamp(1.4rem, 3vw, 2.1rem); }
h3 { font-size: 1.25rem; }

a { color: var(--or); text-decoration: none; }
a:hover { text-decoration: underline; }
p { color: var(--gris-texte); }

.conteneur { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* --- En-tête --- */
.entete { background: var(--marine); color: var(--ivoire); padding: 18px 0; }
.entete .conteneur { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.logo { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; color: var(--ivoire); display: flex; align-items: baseline; gap: 4px; }
.logo span { color: var(--or-clair); }
.nav-principale { display: flex; gap: 22px; flex-wrap: wrap; }
.nav-principale a { color: var(--ivoire); opacity: 0.85; font-size: 0.95rem; }
.nav-principale a:hover { opacity: 1; text-decoration: none; border-bottom: 2px solid var(--or-clair); }

/* --- Hero / recherche --- */
.hero { background: linear-gradient(180deg, var(--marine) 0%, var(--marine-clair) 100%); color: var(--ivoire); padding: 72px 0 96px; text-align: center; }
.hero h1 { color: var(--ivoire); }
.hero .sous-titre { color: #d8dfec; font-size: 1.15rem; max-width: 640px; margin: 0 auto 36px; }

.recherche-box { max-width: 560px; margin: 0 auto; background: var(--ivoire); border-radius: var(--rayon); padding: 8px; box-shadow: var(--ombre-forte); display: flex; gap: 8px; }
.recherche-box input { flex: 1; border: none; background: transparent; font-family: var(--font-texte); font-size: 1.05rem; padding: 14px 16px; color: var(--encre); outline: none; }
.recherche-box button { background: var(--or); color: var(--marine); border: none; border-radius: 8px; padding: 0 26px; font-size: 1rem; font-weight: 700; cursor: pointer; transition: background 0.15s ease; }
.recherche-box button:hover { background: var(--or-clair); }

#suggestions { max-width: 560px; margin: 6px auto 0; background: var(--ivoire); border-radius: var(--rayon); box-shadow: var(--ombre-forte); text-align: left; overflow: hidden; position: relative; z-index: 5; }
#suggestions button { display: block; width: 100%; text-align: left; background: none; border: none; padding: 12px 18px; font-family: var(--font-texte); font-size: 0.96rem; color: var(--encre); cursor: pointer; border-bottom: 1px solid var(--ivoire-fonce); }
#suggestions button:hover { background: var(--ivoire-fonce); }
#suggestions button .meta { color: var(--gris-texte); font-size: 0.83rem; }

/* --- Sections --- */
.section { padding: 56px 0; }
.section--alt { background: var(--ivoire-fonce); }

.grille-cartes { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; margin-top: 32px; }
.carte { background: var(--blanc); border: 1px solid var(--gris-bordure); border-radius: var(--rayon); padding: 24px; box-shadow: var(--ombre); }
.carte h3 { margin-top: 0; }

.stat-grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 24px; margin: 32px 0; }
.stat { background: var(--blanc); border-radius: var(--rayon); border: 1px solid var(--gris-bordure); padding: 22px; text-align: center; }
.stat .valeur { font-family: var(--font-display); font-size: 2.1rem; color: var(--marine); display: block; }
.stat .valeur.positif { color: var(--positif); }
.stat .valeur.negatif { color: var(--negatif); }
.stat .libelle { color: var(--gris-texte); font-size: 0.9rem; }

table.tableau-resultats { width: 100%; border-collapse: collapse; background: var(--blanc); border-radius: var(--rayon); overflow: hidden; box-shadow: var(--ombre); }
table.tableau-resultats th, table.tableau-resultats td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--ivoire-fonce); font-size: 0.92rem; }
table.tableau-resultats th { background: var(--marine); color: var(--ivoire); font-family: var(--font-texte); font-weight: 600; }
table.tableau-resultats tr:last-child td { border-bottom: none; }
table.tableau-resultats tr:hover td { background: var(--ivoire-fonce); }

.source-donnees { margin-top: 14px; font-size: 0.85rem; color: var(--gris-texte); border-left: 3px solid var(--or); padding-left: 12px; }

.pied { background: var(--marine); color: #cdd6e6; padding: 40px 0; margin-top: 40px; font-size: 0.9rem; }
.pied a { color: var(--or-clair); }
.pied .colonnes { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 24px; margin-bottom: 24px; }
.pied h4 { color: var(--ivoire); font-family: var(--font-texte); font-size: 0.95rem; }
.pied ul { list-style: none; padding: 0; margin: 0; }
.pied li { margin-bottom: 6px; }
.mention-bas { border-top: 1px solid rgba(255,255,255,0.15); padding-top: 16px; opacity: 0.75; font-size: 0.8rem; }

.badge { display: inline-block; background: var(--ivoire-fonce); color: var(--marine); border-radius: 20px; padding: 4px 12px; font-size: 0.8rem; font-weight: 600; margin-right: 6px; }
.chargement { text-align: center; padding: 40px; color: var(--gris-texte); }
.erreur { text-align: center; padding: 40px; color: var(--negatif); }
.fil-ariane { font-size: 0.85rem; color: var(--gris-texte); margin-bottom: 18px; }
.fil-ariane a { color: var(--marine); }

.liste-departements { list-style: none; padding: 0; margin: 32px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.liste-departements li a { display: block; background: var(--blanc); border: 1px solid var(--gris-bordure); border-radius: 8px; padding: 12px 16px; color: var(--encre); }
.liste-departements li a:hover { border-color: var(--or); text-decoration: none; }
.liste-departements .meta { color: var(--gris-texte); font-size: 0.85rem; }

@media (max-width: 640px) {
  .entete .conteneur { flex-direction: column; align-items: flex-start; gap: 12px; }
  .recherche-box { flex-direction: column; }
  .recherche-box button { padding: 12px; }
}
