/* Veille Maire-Info — pensé d'abord pour le smartphone, élargi ensuite pour le PC */
:root {
  --fond: #f6f4ef; --carte: #ffffff; --texte: #1c2330; --discret: #5b6472; --trait: #dfdbd1;
  --marine: #1f3a6e; --marine-clair: #e6ecf7; --accent: #b3261e; --or: #9a6b00; --or-fond: #fdf3d6;
  --rayon: 12px; --ombre: 0 1px 2px rgba(20, 30, 50, .08);
  --titres: Georgia, "Times New Roman", serif;
  --corps: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #12161d; --carte: #1b212b; --texte: #e8eaee; --discret: #a3acb9; --trait: #2f3744;
    --marine: #9db8ee; --marine-clair: #243049; --accent: #ff8a80; --or: #f0c661; --or-fond: #3a3115;
    --ombre: none;
  }
}
* { box-sizing: border-box; }
html { font-size: 17px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fond); color: var(--texte); font-family: var(--corps); line-height: 1.5;
       padding-bottom: calc(4.4rem + env(safe-area-inset-bottom)); }
a { color: var(--marine); }
h1, h2, h3 { font-family: var(--titres); line-height: 1.25; text-wrap: balance; }
h1 { font-size: 1.45rem; margin: 0 0 .6rem; }
.icone { width: 1.35rem; height: 1.35rem; flex: none; }
.evitement { position: absolute; left: -999px; }
.evitement:focus { left: .5rem; top: .5rem; background: var(--carte); padding: .5rem; z-index: 50; }
:focus-visible { outline: 3px solid var(--marine); outline-offset: 2px; border-radius: 4px; }

/* Bandeau et navigation */
.bandeau { background: var(--carte); border-bottom: 1px solid var(--trait); position: sticky; top: 0; z-index: 20; }
.bandeau-int { max-width: 62rem; margin: 0 auto; padding: .55rem 1rem; display: flex; align-items: center; gap: 1rem; }
.marque { display: flex; align-items: center; gap: .55rem; text-decoration: none; color: var(--texte); font-weight: 700; margin-right: auto; }
.marque small { font-weight: 400; color: var(--discret); margin-left: .2rem; }
.marque-pastille { background: #1f3a6e; color: #fff; font-family: var(--titres); border-radius: 8px; width: 2rem; height: 2rem; display: grid; place-items: center; font-size: .9rem; }
.sortie { font-size: .82rem; color: var(--discret); }
.menu { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; background: var(--carte);
        border-top: 1px solid var(--trait); padding-bottom: env(safe-area-inset-bottom); }
.menu a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .1rem; padding: .5rem .2rem .45rem;
          text-decoration: none; color: var(--discret); font-size: .72rem; min-height: 3.4rem; }
.menu a.actif { color: var(--marine); font-weight: 700; }

main { max-width: 62rem; margin: 0 auto; padding: 1rem; }
.pied { max-width: 62rem; margin: 1.5rem auto 0; padding: 0 1rem 1rem; color: var(--discret); font-size: .78rem; }

/* Formulaires */
input[type=text], input[type=search], input[type=password], select, textarea {
  font: inherit; color: var(--texte); background: var(--carte); border: 1px solid var(--trait); border-radius: 10px;
  padding: .7rem .85rem; width: 100%; min-height: 3rem; }
.bouton { font: inherit; font-weight: 600; border: 0; border-radius: 10px; background: #1f3a6e; color: #fff; padding: .7rem 1.1rem;
          min-height: 3rem; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: .45rem; justify-content: center; }
.bouton.second { background: transparent; color: var(--marine); border: 1px solid var(--trait); }
.bouton.petit { min-height: 2.5rem; padding: .4rem .8rem; font-size: .88rem; }
.barre-recherche { display: flex; gap: .5rem; margin-bottom: 1rem; }
.barre-recherche input { flex: 1; min-width: 0; }
@media (max-width: 480px) {   /* sur téléphone, le bouton se réduit à la loupe pour laisser la place à la question */
  .barre-recherche .bouton span { position: absolute; left: -999px; }
  .barre-recherche .bouton { padding: .7rem .9rem; }
}
label { display: block; font-weight: 600; margin: 1rem 0 .3rem; }
.aide { color: var(--discret); font-size: .85rem; font-weight: 400; }
.message { padding: .8rem 1rem; border-radius: 10px; margin: 0 0 1rem; background: var(--marine-clair); }
.message.erreur { background: #fde8e6; color: #8c1d18; }
.message.ok { background: #e3f4e8; color: #17572b; }

/* Filtres (défilement horizontal au doigt) */
.puces { display: flex; gap: .45rem; overflow-x: auto; padding: .1rem 0 .7rem; margin-bottom: .3rem; scrollbar-width: thin; }
.puce { flex: none; text-decoration: none; font-size: .85rem; padding: .4rem .8rem; border-radius: 999px; border: 1px solid var(--trait);
        background: var(--carte); color: var(--texte); white-space: nowrap; }
.puce.actif { background: #1f3a6e; border-color: #1f3a6e; color: #fff; }
.puces.plis { flex-wrap: wrap; overflow: visible; }
.puces.plis .puce { white-space: normal; flex: 0 1 auto; border-radius: 14px; }

/* Éditions et articles */
.edition { font-family: var(--corps); font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--discret);
           margin: 1.6rem 0 .6rem; padding-bottom: .35rem; border-bottom: 2px solid var(--marine); }
.grille { display: grid; gap: .8rem; }
.carte { background: var(--carte); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 1rem; box-shadow: var(--ombre);
         display: flex; flex-direction: column; gap: .45rem; }
.carte h3 { margin: 0; font-size: 1.12rem; }
.carte h3 a { color: var(--texte); text-decoration: none; }
.carte h3 a:hover { text-decoration: underline; }
.rubrique { color: var(--accent); font-size: .74rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; text-decoration: none; }
.chapo { margin: 0; color: var(--discret); font-size: .93rem; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.meta { color: var(--discret); font-size: .8rem; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: auto; padding-top: .3rem; }
.mot-amj { background: var(--or-fond); border-left: 4px solid var(--or); border-radius: 6px; padding: .55rem .75rem; font-size: .9rem; margin: 0; }
.mot-amj strong { color: var(--or); }
.etoile { color: var(--or); font-size: .8rem; font-weight: 700; }
.suite { display: flex; justify-content: center; margin: 1.5rem 0; }
.vide { text-align: center; color: var(--discret); padding: 2.5rem 1rem; }

/* Lecture d'un article */
.lecture { max-width: 42rem; margin: 0 auto; }
.lecture h1 { font-size: 1.6rem; }
.lecture .chapo-plein { font-size: 1.08rem; font-weight: 600; }
.lecture .texte p { margin: 0 0 1rem; }
.lecture .texte h2 { font-size: 1.15rem; margin: 1.6rem 0 .5rem; }
.encart { background: var(--marine-clair); border-radius: var(--rayon); padding: 1rem; margin: 1.3rem 0; }
.encart p { margin: 0 0 .7rem; }

/* Recherche */
.reponse { background: var(--carte); border: 1px solid var(--trait); border-left: 5px solid var(--marine); border-radius: var(--rayon);
           padding: 1rem 1.1rem; box-shadow: var(--ombre); }
.reponse > :first-child { margin-top: 0; } .reponse p, .reponse ul { margin: 0 0 .7rem; } .reponse ul { padding-left: 1.2rem; }
.reponse-entete { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--discret); margin-bottom: .5rem; }
.renvoi { display: inline-grid; place-items: center; min-width: 1.35rem; height: 1.35rem; padding: 0 .25rem; border-radius: 999px; background: var(--marine-clair);
          color: var(--marine); font-size: .72rem; font-weight: 700; text-decoration: none; vertical-align: .1em; margin-left: .1rem; }
.source { display: grid; grid-template-columns: 2rem 1fr; gap: .2rem .6rem; padding: .85rem 0; border-bottom: 1px solid var(--trait); scroll-margin-top: 5rem; }
.source:target { background: var(--or-fond); border-radius: 8px; }
.source-num { grid-row: span 3; display: grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 999px; background: #1f3a6e; color: #fff; font-weight: 700; font-size: .85rem; }
.source-num.muet { background: var(--trait); color: var(--discret); }
.alerte-chiffres { background: var(--or-fond); border-left: 4px solid var(--or); border-radius: 6px; padding: .55rem .75rem; font-size: .88rem; }
.source a.titre { font-family: var(--titres); font-weight: 700; color: var(--texte); text-decoration: none; }
.source .extrait { color: var(--discret); font-size: .88rem; margin: 0; }
.attente { display: none; position: fixed; inset: 0; z-index: 60; background: color-mix(in srgb, var(--fond) 88%, transparent); place-items: center; text-align: center; padding: 2rem; }
.attente.visible { display: grid; }
.roue { width: 2.6rem; height: 2.6rem; border: 4px solid var(--trait); border-top-color: var(--marine); border-radius: 50%; margin: 0 auto 1rem; animation: tourne 1s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .roue { animation-duration: 4s; } }

/* Connexion */
.porte { max-width: 26rem; margin: 2rem auto; background: var(--carte); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 1.4rem; box-shadow: var(--ombre); }
.porte .bouton { width: 100%; margin-top: 1.2rem; }

/* Gestion (administrateur) */
.chiffres { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; margin: 1rem 0; }
.chiffre { background: var(--carte); border: 1px solid var(--trait); border-radius: var(--rayon); padding: .8rem; }
.chiffre b { display: block; font-size: 1.4rem; font-family: var(--titres); }
.chiffre span { color: var(--discret); font-size: .8rem; }
.tri { background: var(--carte); border: 1px solid var(--trait); border-radius: var(--rayon); padding: .8rem; margin-bottom: .6rem; display: grid; gap: .5rem; }
.tri.conserve { border-left: 5px solid var(--or); } .tri.poubelle { opacity: .55; }
.tri a { color: var(--texte); font-weight: 600; text-decoration: none; }
.barre-fixe { position: sticky; top: 3.3rem; z-index: 10; background: var(--fond); padding: .5rem 0; }
details { background: var(--carte); border: 1px solid var(--trait); border-radius: var(--rayon); padding: .8rem 1rem; margin: 1rem 0; }
summary { font-weight: 700; cursor: pointer; }

/* PC et tablette */
@media (min-width: 760px) {
  body { padding-bottom: 0; }
  .menu { position: static; border: 0; background: none; padding: 0; gap: .3rem; }
  .menu a { flex: none; flex-direction: row; gap: .4rem; font-size: .9rem; min-height: 0; padding: .45rem .8rem; border-radius: 8px; }
  .menu a.actif { background: var(--marine-clair); }
  .grille { grid-template-columns: repeat(2, 1fr); }
  .grille .carte.vedette { grid-column: span 2; }
  .grille .carte.vedette h3 { font-size: 1.45rem; }
  .chiffres { grid-template-columns: repeat(4, 1fr); }
  .tri { grid-template-columns: 11rem 1fr; align-items: center; }
  .tri .note { grid-column: 2; }
  h1 { font-size: 1.7rem; }
}
@media (min-width: 1100px) { .grille { grid-template-columns: repeat(3, 1fr); } .grille .carte.vedette { grid-column: span 3; } }
@media print { .bandeau, .menu, .actions, .pied, .barre-recherche, .puces { display: none !important; } body { background: #fff; } }
