/* =============================================================
   Portail de l'Assemblée nationale du Bénin — proposition
   Système : portail de service public. Plat, carré, sans ombre.
   ============================================================= */

/* ---------- Police servie depuis le domaine ----------
   Public Sans : grotesque conçue pour les sites de service public (US Web Design System),
   variable, deux fichiers pour tous les graissages. */
@font-face {
  font-family: "Public Sans"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/public-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Public Sans"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/public-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308,
    U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113,
    U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- Jetons ---------- */
:root {
  --vert: #0b6b3a;
  --vert-900: #053b20;
  --vert-pale: #e8f1eb;
  --jaune: #fcd116;
  --jaune-pale: #fdf5d5;
  --rouge: #c9102b;
  --rouge-pale: #fbeaec;

  --texte: #161616;
  --texte-2: #42524b;
  --texte-3: #666f6a;
  --fond: #ffffff;
  --fond-2: #f5f6f5;
  --fond-3: #ececec;
  --bord: #d8d8d8;
  --bord-fort: #9a9a9a;

  --focus: #0a58ca;
  --focus-halo: #fcd116;

  --l: 1248px;              /* largeur de page */
  --g: clamp(1rem, 4vw, 2rem);
  --p1: .25rem; --p2: .5rem; --p3: .75rem; --p4: 1rem; --p6: 1.5rem; --p8: 2rem; --p12: 3rem;
}

/* ---------- Socle ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--fond); color: var(--texte);
  font-family: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1rem; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
/* un display: grid ou flex d'auteur l'emporte sur l'attribut hidden du navigateur :
   sans cette règle, une fiche filtrée reste à l'écran. */
[hidden] { display: none !important; }
h1, h2, h3, h4 { margin: 0 0 var(--p4); line-height: 1.2; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(1.75rem, 3.6vw, 2.5rem); }
h2 { font-size: clamp(1.35rem, 2.4vw, 1.75rem); }
h3 { font-size: 1.1875rem; }
p { margin: 0 0 var(--p4); }
ul, ol { margin: 0; padding: 0; list-style: none; }
table { border-collapse: collapse; width: 100%; }

/* surfaces que le navigateur dessine et que personne ne thème */
::selection { background: var(--jaune); color: var(--texte); }
html { scrollbar-color: var(--bord-fort) var(--fond-2); }
:focus-visible {
  outline: 2px solid var(--focus); outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--focus-halo);
}
.num { font-variant-numeric: tabular-nums; }

a { color: var(--vert); text-decoration: underline; text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
a:visited { color: #5a3a86; }

.page { width: 100%; max-width: var(--l); margin-inline: auto; padding-inline: var(--g); }
.evitement {
  position: absolute; left: -9999px; top: 0; z-index: 50;
  background: var(--texte); color: #fff; padding: .7rem 1rem; text-decoration: none;
}
.evitement:focus { left: .5rem; top: .5rem; }
.invisible { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Bandeau de maquette ---------- */
.bandeau-maquette {
  background: var(--texte); color: #fff; font-size: .8125rem; padding: .5rem 0;
}
.bandeau-maquette .page { display: flex; gap: .75rem; align-items: baseline; flex-wrap: wrap; }
.bandeau-maquette b { color: var(--jaune); }
.bandeau-maquette a { color: #fff; }

/* ---------- En-tête ---------- */
.entete { border-bottom: 1px solid var(--bord); }
.entete-haut { display: flex; gap: var(--p8); align-items: center; padding-top: var(--p4); padding-bottom: var(--p4); }
.bloc-marque { display: flex; gap: var(--p4); align-items: center; text-decoration: none; color: inherit; }
.bloc-marque:hover { text-decoration: none; }
.bloc-etat { font-size: .6875rem; font-weight: 700; line-height: 1.15; letter-spacing: .02em; text-transform: uppercase; }
.bloc-etat .filets { display: flex; height: 5px; width: 72px; margin-top: 5px; }
.bloc-etat .filets i { flex: 1; }
.bloc-etat .filets i:nth-child(1) { background: var(--vert); }
.bloc-etat .filets i:nth-child(2) { background: var(--jaune); }
.bloc-etat .filets i:nth-child(3) { background: var(--rouge); }
.marque-sep { width: 1px; align-self: stretch; background: var(--bord); }
.marque-nom { display: flex; gap: .7rem; align-items: center; }
.marque-nom img { width: 40px; }
.marque-nom b { font-size: 1.0625rem; font-weight: 700; display: block; line-height: 1.2; }
.marque-nom span { font-size: .8125rem; color: var(--texte-3); }

.entete-outils { margin-left: auto; display: flex; gap: var(--p6); align-items: center; }
.liens-outils { display: flex; gap: var(--p4); font-size: .875rem; }
.liens-outils a { color: var(--texte); text-decoration: none; }
.liens-outils a:hover { text-decoration: underline; }

/* menu principal */
.menu { border-top: 1px solid var(--bord); background: var(--fond); }
.menu ul { display: flex; flex-wrap: wrap; }
.menu a {
  display: block; padding: .8rem var(--p4); color: var(--texte); text-decoration: none;
  font-weight: 500; font-size: .9375rem; border-bottom: 3px solid transparent;
}
.menu a:hover { background: var(--fond-2); }
.menu a[aria-current="page"] { border-bottom-color: var(--vert); font-weight: 700; }
.menu li:first-child a { padding-left: 0; }

.bouton-menu { display: none; }

/* ---------- Recherche principale ---------- */
.recherche { background: var(--vert-pale); border-bottom: 1px solid var(--bord); padding-top: var(--p8); padding-bottom: var(--p8); }
.recherche h1 { margin-bottom: .35rem; }
.recherche p.intro { color: var(--texte-2); margin-bottom: var(--p6); max-width: 60ch; }
.barre { display: flex; max-width: 760px; }
.barre input {
  flex: 1; min-width: 0; font: inherit; padding: .8rem .9rem;
  border: 1px solid var(--bord-fort); border-right: 0; background: #fff; color: var(--texte);
}
.barre input::placeholder { color: var(--texte-3); }
.barre button { border: 0; }
.suggestions { margin-top: var(--p3); font-size: .875rem; color: var(--texte-2); }
.suggestions a { margin-right: var(--p3); }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem; justify-content: center;
  font: inherit; font-weight: 600; font-size: .9375rem; line-height: 1.2;
  padding: .75rem 1.1rem; border: 1px solid var(--vert); background: var(--vert); color: #fff;
  cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--vert-900); border-color: var(--vert-900); color: #fff; text-decoration: none; }
.btn-second { background: #fff; color: var(--vert); }
.btn-second:hover { background: var(--vert-pale); color: var(--vert-900); }
.btn-tertiaire { background: transparent; border-color: transparent; color: var(--vert); text-decoration: underline; }
.btn-tertiaire:hover { background: var(--fond-2); color: var(--vert-900); }
.btn-bloc { width: 100%; }

/* ---------- Fil d'Ariane ---------- */
.ariane { padding-top: var(--p4); padding-bottom: var(--p4); font-size: .875rem; color: var(--texte-2); }
.ariane ol { display: flex; flex-wrap: wrap; gap: .4rem; }
.ariane li::after { content: "›"; margin-left: .4rem; color: var(--texte-3); }
.ariane li:last-child::after { content: ""; }
.ariane [aria-current] { color: var(--texte-2); }

/* ---------- Blocs de contenu ---------- */
.section { padding-top: var(--p12); padding-bottom: var(--p12); border-top: 1px solid var(--bord); }
.section:first-of-type { border-top: 0; }
.section-grise { background: var(--fond-2); }
.titre-section { display: flex; align-items: baseline; justify-content: space-between; gap: var(--p4); flex-wrap: wrap; margin-bottom: var(--p6); }
.titre-section h2 { margin: 0; }
.titre-section a { font-size: .9375rem; font-weight: 600; }

/* tuiles de démarche */
.tuiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--bord); border: 1px solid var(--bord); }
.tuile {
  background: #fff; padding: var(--p6); display: flex; flex-direction: column; gap: .4rem;
  text-decoration: none; color: var(--texte);
}
.tuile:hover { background: var(--vert-pale); text-decoration: none; }
.tuile b { font-size: 1.0625rem; font-weight: 700; }
.tuile span { font-size: .9375rem; color: var(--texte-2); }
.tuile .fleche { margin-top: auto; padding-top: var(--p4); color: var(--vert); font-weight: 600; font-size: .9375rem; }

/* liste de liens serrée */
.liste-liens li { border-top: 1px solid var(--bord); }
.liste-liens li:last-child { border-bottom: 1px solid var(--bord); }
.liste-liens a { display: flex; gap: var(--p4); padding: .85rem 0; text-decoration: none; color: var(--texte); align-items: baseline; }
.liste-liens a:hover { background: var(--fond-2); text-decoration: underline; }
.liste-liens .date { flex: 0 0 8.5rem; font-size: .875rem; color: var(--texte-3); }
.liste-liens .quoi { font-weight: 500; }
.liste-liens .meta { margin-left: auto; font-size: .8125rem; color: var(--texte-3); }

/* tableau */
.tableau { border: 1px solid var(--bord); }
.tableau caption { text-align: left; font-size: .875rem; color: var(--texte-2); padding: .6rem .8rem; border-bottom: 1px solid var(--bord); background: var(--fond-2); }
.tableau th, .tableau td { text-align: left; padding: .7rem .8rem; border-bottom: 1px solid var(--bord); font-size: .9375rem; vertical-align: top; }
.tableau thead th { background: var(--fond-2); font-weight: 700; font-size: .8125rem; text-transform: uppercase; letter-spacing: .04em; }
.tableau tbody tr:last-child td { border-bottom: 0; }
.tableau tbody tr:hover { background: var(--fond-2); }

/* étiquettes d'état */
.etat { display: inline-block; font-size: .75rem; font-weight: 700; padding: .15rem .45rem; border: 1px solid; white-space: nowrap; }
.etat-cours { color: #7a5c00; border-color: #e0c56a; background: var(--jaune-pale); }
.etat-fait { color: var(--vert-900); border-color: #9dc4ae; background: var(--vert-pale); }
.etat-attente { color: var(--texte-2); border-color: var(--bord); background: var(--fond-2); }
.etat-direct { color: #fff; border-color: var(--rouge); background: var(--rouge); }

/* actualité avec photo */
.actus { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--p6); }
.actu { border: 1px solid var(--bord); background: #fff; display: flex; flex-direction: column; }
.actu img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.actu .corps { padding: var(--p4); display: flex; flex-direction: column; gap: .4rem; flex: 1; }
.actu .date { font-size: .8125rem; color: var(--texte-3); }
.actu h3 { margin: 0; font-size: 1.0625rem; }
.actu h3 a { color: var(--texte); text-decoration: none; }
.actu h3 a:hover { text-decoration: underline; }
.actu p { margin: 0; font-size: .9375rem; color: var(--texte-2); }
figure { margin: 0; }
figcaption { font-size: .8125rem; color: var(--texte-3); padding-top: .4rem; border-top: 1px solid var(--bord); margin-top: .5rem; }

/* encart */
.encart { border: 1px solid var(--bord); border-left: 4px solid var(--vert); padding: var(--p6); background: #fff; }
.encart.alerte { border-left-color: var(--rouge); background: var(--rouge-pale); }
.encart.info { border-left-color: var(--jaune); background: var(--jaune-pale); }
.encart h3 { margin-bottom: .4rem; }
.encart p:last-child { margin-bottom: 0; }

/* deux colonnes */
.deux-col { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: var(--p12); align-items: start; }
.trois-col { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--p8); }

/* ---------- Formulaires ---------- */
fieldset { border: 0; padding: 0; margin: 0 0 var(--p8); }
legend { font-size: 1.125rem; font-weight: 700; padding: 0; margin-bottom: .3rem; }
.aide-legende { color: var(--texte-2); font-size: .9375rem; margin-bottom: var(--p6); }
.champ { margin-bottom: var(--p6); max-width: 42rem; }
.champ label { display: block; font-weight: 600; font-size: .9375rem; margin-bottom: .2rem; }
.champ .aide { display: block; font-size: .875rem; color: var(--texte-2); margin-bottom: .4rem; }
.champ input[type="text"], .champ input[type="email"], .champ input[type="tel"],
.champ input[type="search"], .champ select, .champ textarea {
  width: 100%; font: inherit; padding: .65rem .7rem; color: var(--texte);
  border: 1px solid var(--bord-fort); background: var(--fond-2); border-bottom: 2px solid var(--texte-2);
}
.champ textarea { min-height: 8rem; resize: vertical; }
.champ select { background-image: none; }
.obligatoire { color: var(--rouge); }
.compteur { font-size: .8125rem; color: var(--texte-3); }
.erreur { border-color: var(--rouge) !important; }
.msg-erreur { color: var(--rouge); font-size: .875rem; font-weight: 600; margin-top: .3rem; display: flex; gap: .35rem; }
.case { display: flex; gap: .6rem; align-items: flex-start; margin-bottom: var(--p3); }
.case input { margin-top: .3rem; width: 1.1rem; height: 1.1rem; accent-color: var(--vert); }
.case label { font-weight: 400; font-size: .9375rem; }
.actions-form { display: flex; gap: var(--p4); flex-wrap: wrap; padding-top: var(--p4); border-top: 1px solid var(--bord); }

/* étapes de démarche */
.etapes { display: flex; border: 1px solid var(--bord); margin-bottom: var(--p8); }
.etapes li { flex: 1; padding: .7rem 1rem; font-size: .875rem; border-right: 1px solid var(--bord); color: var(--texte-3); }
.etapes li:last-child { border-right: 0; }
.etapes li[aria-current] { background: var(--vert); color: #fff; font-weight: 700; }
.etapes li b { display: block; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; }

/* parcours vertical d'un texte */
.parcours li { display: grid; grid-template-columns: 11rem 1fr; gap: var(--p6); padding: var(--p4) 0; border-top: 1px solid var(--bord); }
.parcours li:last-child { border-bottom: 1px solid var(--bord); }
.parcours .quand { font-size: .875rem; color: var(--texte-3); }
.parcours b { display: block; }
.parcours p { margin: .2rem 0 0; font-size: .9375rem; color: var(--texte-2); }

/* accordéon */
.accordeon { border: 1px solid var(--bord); }
.accordeon details { border-bottom: 1px solid var(--bord); }
.accordeon details:last-child { border-bottom: 0; }
.accordeon summary { padding: .9rem 1rem; font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.accordeon summary::-webkit-details-marker { display: none; }
.accordeon summary::after { content: "+"; font-weight: 700; color: var(--vert); }
.accordeon details[open] summary::after { content: "–"; }
.accordeon summary:hover { background: var(--fond-2); }
.accordeon .contenu { padding: 0 1rem 1rem; font-size: .9375rem; color: var(--texte-2); }

/* annuaire */
.resultats { border-top: 1px solid var(--bord); }
.resultat { display: grid; grid-template-columns: 1fr auto; gap: var(--p4); padding: var(--p4) 0; border-bottom: 1px solid var(--bord); align-items: center; }
.resultat b { font-size: 1.0625rem; }
.resultat .fonction { font-size: .9375rem; color: var(--texte-2); }
.resultat .etiquettes { display: flex; gap: .4rem; margin-top: .4rem; flex-wrap: wrap; }
.filtres-ligne { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: var(--p4); align-items: end; padding: var(--p6); background: var(--fond-2); border: 1px solid var(--bord); margin-bottom: var(--p6); }
.filtres-ligne .champ { margin: 0; max-width: none; }
.nb-resultats { font-weight: 600; padding-top: var(--p4); padding-bottom: var(--p4); }

/* ---------- Pied ---------- */
.pied { border-top: 2px solid var(--vert); margin-top: var(--p12); padding-top: var(--p8); padding-bottom: var(--p8); }
.pied-haut { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: var(--p12); padding-bottom: var(--p8); border-bottom: 1px solid var(--bord); }
.pied-desc { font-size: .9375rem; color: var(--texte-2); max-width: 44ch; }
.pied-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--p8); }
.pied h2 { font-size: 1.0625rem; margin-bottom: .6rem; }
.pied li { padding: .22rem 0; font-size: .9375rem; }
.pied a { color: var(--texte); text-decoration: none; }
.pied a:hover { text-decoration: underline; }
.pied-bas { padding-top: var(--p6); display: flex; gap: var(--p6); flex-wrap: wrap; font-size: .8125rem; color: var(--texte-2); }
.pied-bas ul { display: flex; gap: var(--p4); flex-wrap: wrap; }

/* ---------- Adaptatif ---------- */
@media (max-width: 1000px) {
  .tuiles, .actus, .trois-col, .pied-cols { grid-template-columns: repeat(2, 1fr); }
  .deux-col, .pied-haut { grid-template-columns: 1fr; gap: var(--p8); }
  .filtres-ligne { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .entete-outils { display: none; }
  .bouton-menu {
    display: inline-flex; align-items: center; gap: .4rem; margin-left: auto;
    font: inherit; font-weight: 600; font-size: .875rem; padding: .5rem .7rem;
    background: #fff; border: 1px solid var(--bord-fort); color: var(--texte); cursor: pointer;
  }
  .menu { display: none; }
  .menu.ouvert { display: block; }
  .menu ul { flex-direction: column; }
  .menu a { padding: .85rem 0; border-bottom: 1px solid var(--bord); }
  .menu a[aria-current="page"] { border-bottom-color: var(--bord); box-shadow: inset 3px 0 0 var(--vert); padding-left: .6rem; }
  .tuiles, .actus, .trois-col, .pied-cols { grid-template-columns: 1fr; }
  .etapes { flex-direction: column; }
  .etapes li { border-right: 0; border-bottom: 1px solid var(--bord); }
  .parcours li, .liste-liens a { grid-template-columns: 1fr; display: block; }
  .liste-liens .date { display: block; margin-bottom: .1rem; }
  .liste-liens .meta { margin: .2rem 0 0; display: block; }
  .resultat { grid-template-columns: 1fr; }
  .filtres-ligne { grid-template-columns: 1fr; }
  .barre { flex-direction: column; }
  .barre input { border-right: 1px solid var(--bord-fort); border-bottom: 0; }
}
@media (max-width: 480px) {
  .marque-nom > span > span { display: none; }          /* l'adresse passe au pied de page */
  .marque-nom b { font-size: .9375rem; }
  .bloc-etat { font-size: .625rem; }
  .entete-haut { gap: .75rem; }
}
@media print {
  .entete, .menu, .bandeau-maquette, .recherche form, .bouton-menu { display: none; }
  body { font-size: 11pt; }
  a::after { content: " (" attr(href) ")"; font-size: 9pt; color: #555; }
}
