/* Mairie de Rivèrenert — feuille de style commune
   Aucune police ni ressource externe : pas de requête vers des tiers (RGPD). */

:root {
  --nuit: #12203F;
  --bleu: #22399A;
  --rouge: #BE2A30;
  --pierre: #5A6272;
  --or: #CDBB8A;
  --fond: #F6F7F9;
  --blanc: #FFFFFF;
  --trait: #DDE1E8;
  --texte: #1B2333;
  --serif: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 1rem; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--texte);
  background: var(--fond);
}

a { color: var(--bleu); text-underline-offset: 3px; }
a:hover { color: var(--nuit); }
:focus-visible { outline: 3px solid var(--bleu); outline-offset: 3px; border-radius: 2px; }

.skip {
  position: absolute; left: 1rem; top: -4rem;
  background: var(--nuit); color: var(--blanc);
  padding: .6rem 1rem; z-index: 20; text-decoration: none;
}
.skip:focus { top: 1rem; }

/* Filet tricolore */
.tricolore {
  height: 6px;
  background: linear-gradient(90deg, var(--bleu) 0 33.33%, var(--blanc) 33.33% 66.66%, var(--rouge) 66.66% 100%);
  border-bottom: 1px solid var(--trait);
}

/* En-tête */
.entete { background: var(--blanc); border-bottom: 1px solid var(--trait); }
.entete__interieur {
  max-width: 68rem; margin: 0 auto; padding: 1rem 1.5rem;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 2rem;
}
.marque { text-decoration: none; color: var(--nuit); display: block; }
.marque__nom { font-family: var(--serif); font-size: 1.35rem; font-weight: 700; line-height: 1.2; display: block; }
.marque__lieu { font-size: .9rem; color: var(--pierre); display: block; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem 1.5rem; }
.nav a { color: var(--nuit); text-decoration: none; padding: .35rem 0; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: var(--rouge); }

/* Bandeau d'accueil */
.accueil {
  color: var(--blanc);
  background:
    radial-gradient(circle at 78% 50%, rgba(255,255,255,.07) 0 12rem, transparent 12.1rem),
    radial-gradient(circle at 78% 50%, transparent 0 17rem, rgba(255,255,255,.05) 17.05rem 17.15rem, transparent 17.2rem),
    radial-gradient(circle at 78% 50%, transparent 0 24rem, rgba(255,255,255,.04) 24.05rem 24.15rem, transparent 24.2rem),
    linear-gradient(135deg, #0E1932 0%, var(--nuit) 45%, #1B3163 100%);
}
.accueil__interieur {
  max-width: 68rem; margin: 0 auto; padding: 4rem 1.5rem;
  display: grid; grid-template-columns: 1.25fr 1fr; align-items: center; gap: 2rem;
}
.accueil h1 {
  font-family: var(--serif); font-weight: 700;
  font-size: clamp(2.2rem, 5vw, 3.4rem); line-height: 1.1;
  margin: 0 0 1.25rem; letter-spacing: -.01em;
}
.devise { font-family: var(--serif); font-style: italic; color: var(--or); margin: 0 0 2rem; font-size: 1.15rem; }
.avis {
  display: inline-block; max-width: 34rem;
  border-left: 4px solid var(--rouge);
  background: rgba(255,255,255,.08);
  padding: 1rem 1.25rem; margin: 0;
}
.avis strong { display: block; font-family: var(--serif); font-size: 1.2rem; margin-bottom: .25rem; }
.embleme { justify-self: center; width: min(100%, 24rem); height: auto; }

/* Contenu */
main { display: block; }
.contenu { max-width: 68rem; margin: 0 auto; padding: 3.5rem 1.5rem 4rem; }
.contenu h2 { font-family: var(--serif); font-size: 1.7rem; line-height: 1.2; color: var(--nuit); margin: 0 0 1.25rem; }
.contenu h3 { font-family: var(--serif); font-size: 1.25rem; color: var(--nuit); margin: 2rem 0 .5rem; }

.grille { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; }
.bloc { background: var(--blanc); border: 1px solid var(--trait); border-top: 4px solid var(--bleu); padding: 1.75rem; }
.bloc h2 { margin-bottom: 1rem; }

table.horaires { width: 100%; border-collapse: collapse; }
.horaires caption { text-align: left; }
.horaires th, .horaires td { padding: .6rem .25rem; border-bottom: 1px solid var(--trait); text-align: left; font-weight: 400; }
.horaires th { font-weight: 600; width: 45%; }
.horaires tr:last-child th, .horaires tr:last-child td { border-bottom: 0; }
.horaires .ferme td { color: var(--pierre); }

.coordonnees { margin: 0; }
.coordonnees dt { font-weight: 600; color: var(--nuit); margin-top: 1.1rem; }
.coordonnees dt:first-child { margin-top: 0; }
.coordonnees dd { margin: .15rem 0 0; }
.coordonnees a { word-break: break-word; }

/* Pages de texte */
.texte { max-width: 46rem; }
.texte p, .texte li { max-width: 68ch; }
.texte ul { padding-left: 1.25rem; }
.texte .maj { color: var(--pierre); font-size: .95rem; margin-top: 0; }
.encart {
  background: var(--blanc); border: 1px solid var(--trait); border-left: 4px solid var(--rouge);
  padding: 1rem 1.25rem; margin: 1.5rem 0;
}
.encart p { margin: 0; }
.retour { display: inline-block; margin-bottom: 1.5rem; }

table.donnees { width: 100%; border-collapse: collapse; background: var(--blanc); margin: 1rem 0; font-size: .97rem; }
.donnees th, .donnees td { border: 1px solid var(--trait); padding: .6rem .75rem; text-align: left; vertical-align: top; }
.donnees thead th { background: var(--nuit); color: var(--blanc); font-weight: 600; }
.tableau-defilant { overflow-x: auto; }

/* Boutons */
.btn {
  font: inherit; font-weight: 600; cursor: pointer;
  padding: .7rem 1.4rem; border-radius: 4px;
  border: 2px solid var(--nuit); background: var(--nuit); color: var(--blanc);
}
.btn:hover { background: var(--bleu); border-color: var(--bleu); }
.btn--clair { background: var(--blanc); color: var(--nuit); }
.btn--clair:hover { background: var(--fond); color: var(--nuit); border-color: var(--nuit); }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1rem 0; }
.etat-choix { font-weight: 600; margin: .75rem 0 0; }

/* Bandeau cookies */
.cookies {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: var(--blanc); border-top: 4px solid var(--nuit);
  box-shadow: 0 -8px 24px rgba(18,32,63,.15);
}
.cookies[hidden] { display: none; }
.cookies__interieur {
  max-width: 68rem; margin: 0 auto; padding: 1.25rem 1.5rem;
  display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center; justify-content: space-between;
}
.cookies p { margin: 0; flex: 1 1 26rem; font-size: .98rem; }
.cookies .actions { margin: 0; }

/* Pied de page */
.pied { background: var(--nuit); color: #D6DBE7; }
.pied__interieur {
  max-width: 68rem; margin: 0 auto; padding: 2rem 1.5rem;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2rem; font-size: .95rem;
}
.pied a { color: #fff; }
.pied ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem 1.5rem; }
.pied p { margin: 0; }

@media (max-width: 52rem) {
  .accueil__interieur { grid-template-columns: 1fr; padding: 2.5rem 1.5rem; }
  .embleme { order: -1; width: 12rem; }
  .grille { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Utilitaires */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.texte h1 { font-family: var(--serif); font-size: 2.2rem; line-height: 1.15; color: var(--nuit); margin: 0 0 .5rem; }
