/*
Theme Name: Prise de Courant
Theme URI: https://www.prise-de-courant.com
Author: Clément Quatravaux
Description: Thème maison en HTML, CSS et PHP pour prise-de-courant.com. Aucun constructeur, aucun framework, aucune police téléchargée.
Version: 1.0.0
Requires PHP: 8.0
License: Propriétaire
Text Domain: surmesure
*/

/* ── Palette ───────────────────────────────────────────────────────── */
:root {
  --encre: #14181f;
  --encre-doux: #5b6472;
  --accent: #2563eb;
  --accent-fonce: #1a4bc4;
  --fond: #ffffff;
  --fond-doux: #f5f7fa;
  --fond-carte: #ffffff;
  --bordure: #e2e7ef;
  --bordure-forte: #cdd5e2;

  --ok-fond: #ecfdf3;   --ok-trait: #a9e6c3;  --ok-encre: #05603a;
  --moyen-fond: #fff8ea; --moyen-trait: #f5d98a; --moyen-encre: #8a4b0a;
  --alerte-fond: #fef3f2; --alerte-trait: #f6c3bf; --alerte-encre: #8f1d15;

  --rayon: 14px;
  --rayon-petit: 9px;
  --largeur: 70rem;
  --largeur-texte: 44rem;
  --ombre: 0 1px 2px rgba(20, 24, 31, .05), 0 8px 24px -16px rgba(20, 24, 31, .3);
}

@media (prefers-color-scheme: dark) {
  :root {
    --encre: #e8ecf3;
    --encre-doux: #9aa5b6;
    --accent: #7aa2ff;
    --accent-fonce: #9dbaff;
    --fond: #0e1117;
    --fond-doux: #141922;
    --fond-carte: #171d27;
    --bordure: #262e3b;
    --bordure-forte: #36404f;

    --ok-fond: #0d2a1d;   --ok-trait: #1f5c3d;  --ok-encre: #7ee2ab;
    --moyen-fond: #2b2110; --moyen-trait: #6b5220; --moyen-encre: #f2c66b;
    --alerte-fond: #2c1512; --alerte-trait: #6d2b25; --alerte-encre: #f3a49c;

    --ombre: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -16px rgba(0, 0, 0, .8);
  }
}

/* ── Base ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--encre);
  background: var(--fond);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; }
img { height: auto; display: block; }

h1, h2, h3 { line-height: 1.18; letter-spacing: -0.02em; margin: 0 0 .55em; }
h1 { font-size: clamp(1.95rem, 4.4vw, 2.9rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.95rem); margin-top: 2.2em; }
h3 { font-size: 1.15rem; }
h2:first-child, h3:first-child { margin-top: 0; }

p { margin: 0 0 1.15em; }
strong { font-weight: 650; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-fonce); }

:focus-visible {
  outline: 2.5px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.evitement {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--encre); color: var(--fond); padding: .65rem 1.1rem;
}
.evitement:focus { left: 0; }

/* ── En-tête ───────────────────────────────────────────────────────── */
.entete {
  border-bottom: 1px solid var(--bordure);
  background: color-mix(in srgb, var(--fond) 88%, transparent);
  backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 20;
}

.entete-interieur {
  max-width: var(--largeur); margin: 0 auto;
  padding: .85rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; flex-wrap: wrap;
}

.marque {
  display: inline-flex; align-items: center; gap: .55rem;
  font-weight: 700; font-size: 1.08rem; letter-spacing: -0.02em;
  color: var(--encre); text-decoration: none;
}
.marque-signe { display: inline-flex; color: var(--accent); }

.bouton-menu {
  display: none; font: inherit; color: inherit;
  border: 1px solid var(--bordure-forte); background: var(--fond-carte);
  border-radius: var(--rayon-petit); padding: .45rem .9rem; cursor: pointer;
}

.liste-menu { list-style: none; margin: 0; padding: 0; display: flex; gap: 1.6rem; }
.liste-menu a { color: var(--encre); text-decoration: none; font-weight: 500; }
.liste-menu a:hover { color: var(--accent); }
.liste-menu .current-menu-item > a { color: var(--accent); }

@media (max-width: 46rem) {
  .bouton-menu { display: inline-block; }
  .navigation { display: none; width: 100%; }
  .navigation.ouvert { display: block; }
  .liste-menu { flex-direction: column; gap: .2rem; padding: .5rem 0; }
  .liste-menu a { display: block; padding: .5rem 0; }
}

/* ── Trames ────────────────────────────────────────────────────────── */
.section { max-width: var(--largeur); margin: 0 auto; padding: 3.5rem 1.25rem; }
.section-etroite { max-width: calc(var(--largeur-texte) + 2.5rem); }
.section-douce { background: var(--fond-doux); border-block: 1px solid var(--bordure); }
.texte-long { max-width: var(--largeur-texte); }

.heros {
  max-width: calc(var(--largeur-texte) + 6rem);
  margin: 0 auto; padding: 4.5rem 1.25rem 2.5rem; text-align: center;
}
.heros-resume {
  font-size: 1.15rem; color: var(--encre-doux);
  max-width: 38rem; margin-inline: auto;
}

.titre-liste { margin-top: 0; }

/* Sur un téléphone, les respirations pensées pour un grand écran mangent un
   demi-écran à chaque section : on les resserre. */
@media (max-width: 40rem) {
  .section { padding: 2.5rem 1.15rem; }
  .heros { padding: 2.75rem 1.15rem 1.5rem; }
  .recherche { margin-top: 1.5rem; }
  h2 { margin-top: 1.8em; }
}

/* ── Fil d'Ariane ──────────────────────────────────────────────────── */
.fil-ariane {
  font-size: .875rem; color: var(--encre-doux);
  margin-bottom: 1.6rem; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
}
.fil-ariane a { color: var(--encre-doux); text-decoration: none; }
.fil-ariane a:hover { color: var(--accent); text-decoration: underline; }
.fil-separateur { opacity: .45; }

/* ── Recherche ─────────────────────────────────────────────────────── */
.recherche { margin: 2rem auto 0; max-width: 30rem; }
.recherche-label {
  display: block; font-size: .9rem; font-weight: 600;
  color: var(--encre-doux); margin-bottom: .5rem; text-align: left;
}
.recherche-champ {
  width: 100%; font: inherit; font-size: 1.08rem; color: var(--encre);
  background: var(--fond-carte);
  border: 1.5px solid var(--bordure-forte); border-radius: var(--rayon);
  padding: .85rem 1.05rem; box-shadow: var(--ombre);
  transition: border-color .15s ease;
}
.recherche-champ::placeholder { color: var(--encre-doux); opacity: .75; }
.recherche-champ:focus { border-color: var(--accent); }
.recherche-etat {
  min-height: 1.4em; margin: .55rem 0 0;
  font-size: .875rem; color: var(--encre-doux); text-align: left;
}

.aucun-resultat {
  padding: 2rem; text-align: center; color: var(--encre-doux);
  border: 1px dashed var(--bordure-forte); border-radius: var(--rayon);
}

/* ── Fiche pays ────────────────────────────────────────────────────── */
.pays-entete {
  display: flex; align-items: center; gap: 1.4rem;
  flex-wrap: wrap; margin-bottom: 1.8rem;
}
.pays-drapeau {
  width: 92px; height: 69px; object-fit: cover; flex: none;
  border-radius: var(--rayon-petit);
  border: 1px solid var(--bordure);
  box-shadow: var(--ombre);
}
.pays-entete h1 { margin-bottom: .3em; }
.pays-resume { color: var(--encre-doux); margin: 0; }

.verdict {
  border: 1.5px solid; border-radius: var(--rayon);
  padding: 1.25rem 1.4rem; margin: 0 0 1.8rem;
}
.verdict-titre { font-weight: 680; font-size: 1.12rem; margin: 0 0 .35em; }
.verdict-texte { margin: 0; }
.verdict-aucun { background: var(--ok-fond); border-color: var(--ok-trait); color: var(--ok-encre); }
.verdict-partiel { background: var(--moyen-fond); border-color: var(--moyen-trait); color: var(--moyen-encre); }
.verdict-obligatoire { background: var(--alerte-fond); border-color: var(--alerte-trait); color: var(--alerte-encre); }

.chiffres {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 1px; margin: 0 0 1.6rem;
  background: var(--bordure); border: 1px solid var(--bordure);
  border-radius: var(--rayon); overflow: hidden;
}
.chiffre { background: var(--fond-carte); padding: 1.05rem 1.15rem; }
.chiffre dt {
  font-size: .8rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--encre-doux); margin-bottom: .3rem;
}
.chiffre dd { margin: 0; font-size: 1.32rem; font-weight: 660; letter-spacing: -0.02em; }

.mention {
  font-size: .95rem; color: var(--encre-doux);
  border-left: 3px solid var(--bordure-forte); padding-left: 1rem; margin: 0;
}

.note {
  border-left: 3px solid var(--bordure-forte);
  padding: .1rem 0 .1rem 1rem; margin-bottom: 1.15em;
}
.note-attention { border-left-color: var(--moyen-trait); }
.note-calme { border-left-color: var(--ok-trait); }

/* ── Cartes de prises ──────────────────────────────────────────────── */
.schema-prise { width: 56px; height: 56px; flex: none; color: var(--encre); }
.schema-prise-grand { width: 76px; height: 76px; }

.liste-prises { display: grid; gap: 1rem; }
.carte-prise {
  display: flex; gap: 1.15rem; align-items: flex-start;
  background: var(--fond-carte); border: 1px solid var(--bordure);
  border-radius: var(--rayon); padding: 1.2rem 1.3rem;
}
.carte-prise h3 { margin-bottom: .3em; }
.carte-prise h3 a { text-decoration: none; }
.carte-prise h3 a:hover { text-decoration: underline; }
.carte-prise p { margin: 0; color: var(--encre-doux); font-size: .97rem; }

.type-entete { display: flex; align-items: center; gap: 1.3rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.type-entete h1 { margin-bottom: .25em; }

.grille-types {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
  gap: 1rem; margin-top: 2rem;
}
.carte-type {
  display: flex; flex-direction: column; align-items: flex-start; gap: .3rem;
  background: var(--fond-carte); border: 1px solid var(--bordure);
  border-radius: var(--rayon); padding: 1.2rem;
  text-decoration: none; color: var(--encre);
  transition: border-color .15s ease, transform .15s ease;
}
.carte-type:hover {
  border-color: var(--accent); color: var(--encre); transform: translateY(-2px);
}
.carte-type .schema-prise { margin-bottom: .5rem; }
.carte-type-nom { font-weight: 660; }
.carte-type-court { font-size: .9rem; color: var(--encre-doux); line-height: 1.45; }
.carte-type-compte { font-size: .82rem; color: var(--accent); margin-top: .35rem; }

/* ── Grille de pays ────────────────────────────────────────────────── */
.grille-pays {
  list-style: none; margin: 1.5rem 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .6rem;
}
.grille-pays-large { grid-template-columns: repeat(auto-fill, minmax(16.5rem, 1fr)); }

.grille-pays a {
  display: flex; align-items: center; gap: .7rem;
  padding: .65rem .85rem;
  background: var(--fond-carte); border: 1px solid var(--bordure);
  border-radius: var(--rayon-petit);
  text-decoration: none; color: var(--encre);
  transition: border-color .15s ease, background-color .15s ease;
}
.grille-pays a:hover { border-color: var(--accent); background: var(--fond-doux); color: var(--encre); }
.grille-pays img {
  width: 26px; height: 20px; flex: none; object-fit: cover;
  border-radius: 3px; border: 1px solid var(--bordure);
}
.pays-nom { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.etiquette {
  font-size: .78rem; font-weight: 620; letter-spacing: .06em;
  color: var(--encre-doux); background: var(--fond-doux);
  border: 1px solid var(--bordure); border-radius: 5px;
  padding: .1rem .4rem; flex: none;
}

.pastille {
  width: .58rem; height: .58rem; border-radius: 50%; flex: none;
  display: inline-block; border: 1px solid rgba(0, 0, 0, .12);
}
.pastille-aucun { background: #16a34a; }
.pastille-partiel { background: #e0a325; }
.pastille-obligatoire { background: #dc4c41; }

.legende {
  list-style: none; margin: 1.6rem 0 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 1.2rem;
  font-size: .875rem; color: var(--encre-doux);
}
.legende li { display: flex; align-items: center; gap: .45rem; }

.groupe-continent + .groupe-continent { margin-top: 2.5rem; }
.lien-retour { font-weight: 600; }

/* ── Contenu libre et pages simples ────────────────────────────────── */
.contenu-article, .contenu-libre { max-width: var(--largeur-texte); }
.contenu-article img, .contenu-libre img { border-radius: var(--rayon); }

.article-entete { margin-bottom: 1.8rem; }
.meta { color: var(--encre-doux); font-size: .9rem; }

.liste-articles { display: grid; gap: 1rem; margin-top: 2rem; }
.apercu {
  border: 1px solid var(--bordure); border-radius: var(--rayon);
  padding: 1.4rem; background: var(--fond-carte);
}
.apercu h2 { font-size: 1.25rem; margin: 0 0 .3em; }
.apercu h2 a { color: var(--encre); text-decoration: none; }
.apercu h2 a:hover { color: var(--accent); }

.bouton {
  display: inline-block; background: var(--accent); color: #fff;
  font-weight: 620; text-decoration: none;
  padding: .75rem 1.5rem; border-radius: var(--rayon-petit);
}
.bouton:hover { background: var(--accent-fonce); color: #fff; }

/* ── Pied de page ──────────────────────────────────────────────────── */
.pied { border-top: 1px solid var(--bordure); background: var(--fond-doux); margin-top: 4rem; }
.pied-interieur {
  max-width: var(--largeur); margin: 0 auto; padding: 2.2rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; flex-wrap: wrap;
  color: var(--encre-doux); font-size: .93rem;
}
.pied-marque { margin: 0; }
.liste-pied { list-style: none; margin: 0; padding: 0; display: flex; gap: 1.3rem; }
.liste-pied a { color: var(--encre-doux); text-decoration: none; }
.liste-pied a:hover { color: var(--accent); }
