/* dechetterie-ouverte.fr — feuille de style unique, sans framework.
   Identité : encre vert-noir, papier chaud, jaune de signalétique, vert « ouvert » / brique « fermé ». */

@font-face {
  font-family: "Bricolage";
  src: url("/fonts/bricolage-grotesque-latin.woff2") format("woff2");
  font-weight: 600 800;
  font-display: swap;
}

:root {
  --ink: #17302b;
  --ink-2: #2c4a43;
  --paper: #fbfaf5;
  --card: #ffffff;
  --sign: #ffc629;
  --sign-soft: #fff4cc;
  --leaf: #17844a;
  --leaf-soft: #e3f4ea;
  --brick: #b9441c;
  --brick-soft: #fbe8e1;
  --amber: #9a6a00;
  --amber-soft: #fff1cf;
  --line: #e2ddcf;
  --muted: #56655f;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(23, 48, 43, .06), 0 6px 18px rgba(23, 48, 43, .06);
  --max: 1080px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Bricolage", var(--font);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 17px/1.6 var(--font);
  color: var(--ink);
  background: var(--paper);
}
img, svg { max-width: 100%; height: auto; }
a { color: var(--ink); text-decoration-color: var(--sign); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--ink); }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; letter-spacing: -.01em; }
h1 { font-size: clamp(1.75rem, 5vw, 2.6rem); font-weight: 800; margin: .3em 0 .4em; }
h2 { font-size: clamp(1.3rem, 3.5vw, 1.7rem); font-weight: 700; margin: 1.8em 0 .6em; }
h3 { font-size: 1.12rem; font-weight: 700; margin: 1.4em 0 .4em; }
p, ul, ol { margin: 0 0 1em; }
small, .petit { font-size: .88rem; }
.muted { color: var(--muted); }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--sign); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--sign); outline-offset: 2px; }

/* En-tête */
.site-header { background: var(--ink); color: #fff; }
.site-header .wrap { display: flex; align-items: center; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-family: var(--display); font-weight: 800; font-size: 1.12rem; letter-spacing: -.01em; }
.logo svg { width: 34px; height: 34px; flex: none; }
.logo .tld { color: var(--sign); font-weight: 600; }
.nav { display: flex; gap: 4px 18px; margin-left: auto; flex-wrap: wrap; font-size: .95rem; }
.nav a { color: #e9f1ee; text-decoration: none; padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: var(--sign); color: #fff; }
@media (max-width: 640px) {
  .nav { width: 100%; margin: 0 0 8px; overflow-x: auto; flex-wrap: nowrap; gap: 16px; }
}

/* Fil d'Ariane */
.ariane { font-size: .88rem; color: var(--muted); margin: 14px 0 0; }
.ariane ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.ariane li + li::before { content: "›"; margin: 0 6px 0 2px; color: #a3aea9; }
.ariane a { color: var(--muted); }

/* Bandeau d'accueil */
.hero { background: var(--ink); color: #fff; padding: 28px 0 40px; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; inset: auto 0 0 0; height: 10px; background: repeating-linear-gradient(-45deg, var(--sign) 0 18px, var(--ink) 18px 36px); }
.hero h1 { color: #fff; max-width: 16em; }
.hero p.lead { font-size: 1.1rem; color: #d6e3df; max-width: 36em; }
.hero .chercheurs { display: grid; gap: 14px; grid-template-columns: 1fr; margin-top: 18px; }
@media (min-width: 860px) { .hero .chercheurs { grid-template-columns: 1fr 1fr; } }
.chercheur { background: #fff; color: var(--ink); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.chercheur label { display: block; font-family: var(--display); font-weight: 700; font-size: 1.05rem; margin-bottom: 8px; }

/* Formulaires */
input[type=text], input[type=search], input[type=email], textarea, select {
  width: 100%; font: inherit; color: inherit; padding: 11px 13px; border: 2px solid var(--line); border-radius: 10px; background: #fff;
}
input:focus, textarea:focus, select:focus { border-color: var(--ink); outline: none; }
textarea { min-height: 120px; resize: vertical; }
.ligne { display: flex; gap: 8px; }
.ligne input { flex: 1; min-width: 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 600 1rem var(--font); padding: 11px 16px; border-radius: 10px; border: 2px solid var(--ink); background: var(--ink); color: #fff; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--ink-2); }
.btn-jaune { background: var(--sign); border-color: var(--sign); color: var(--ink); }
.btn-jaune:hover { background: #ffd457; }
.btn-clair { background: #fff; color: var(--ink); }
.btn-clair:hover { background: var(--sign-soft); }
.btn svg { width: 18px; height: 18px; }
.champ { margin-bottom: 16px; }
.champ label { display: block; font-weight: 600; margin-bottom: 4px; }
.aide { font-size: .88rem; color: var(--muted); margin-top: 4px; }
.pot-de-miel { position: absolute; left: -5000px; }

/* Suggestions (autocomplétion) */
.suggestions { list-style: none; margin: 6px 0 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.suggestions:empty { display: none; }
.suggestions li a, .suggestions li button { display: block; width: 100%; text-align: left; padding: 10px 12px; text-decoration: none; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; }
.suggestions li + li { border-top: 1px solid var(--line); }
.suggestions li a:hover, .suggestions li a:focus, .suggestions li button:hover { background: var(--sign-soft); }
.suggestions .sous { display: block; font-size: .85rem; color: var(--muted); }
.reponse-immediate { margin-top: 10px; padding: 12px 14px; border-radius: 10px; background: var(--sign-soft); border-left: 5px solid var(--sign); }
.reponse-immediate:empty { display: none; }
.reponse-immediate strong { display: block; }

/* Cartes et grilles */
.grille { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.carte { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.carte h3 { margin-top: 0; }
a.carte { display: block; text-decoration: none; transition: transform .12s ease, border-color .12s ease; }
a.carte:hover { transform: translateY(-2px); border-color: var(--ink); }
.tuile { display: flex; align-items: center; gap: 12px; }
.tuile .pict { flex: none; width: 44px; height: 44px; border-radius: 12px; background: var(--sign-soft); display: grid; place-items: center; font-size: 1.4rem; }
.tuile strong { display: block; font-family: var(--display); font-size: 1.05rem; }
.tuile span { font-size: .9rem; color: var(--muted); }
section.bloc { margin: 36px 0; }

/* Statut d'ouverture */
.statut { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; border-radius: 999px; padding: 5px 12px 5px 10px; font-size: .95rem; }
.statut::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: currentColor; }
.statut-ouvert { background: var(--leaf-soft); color: var(--leaf); }
.statut-ouvert::before { box-shadow: 0 0 0 4px rgba(23, 132, 74, .18); }
.statut-ferme_bientot, .statut-incertain { background: var(--amber-soft); color: var(--amber); }
.statut-ferme { background: var(--brick-soft); color: var(--brick); }
.statut-inconnu { background: #eef0ee; color: var(--muted); }
.statut-detail { color: var(--muted); font-size: .95rem; }
.statut-grand { font-size: 1.1rem; padding: 8px 16px 8px 14px; }

/* Fiche déchetterie */
.fiche-tete { display: grid; gap: 18px; grid-template-columns: 1fr; margin-top: 10px; }
@media (min-width: 900px) { .fiche-tete { grid-template-columns: 1.4fr 1fr; } }
.etat { border-radius: var(--radius); padding: 18px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.coord { list-style: none; padding: 0; margin: 0; }
.coord li { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.coord li:last-child { border-bottom: 0; }
.coord .ico { flex: none; width: 22px; text-align: center; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.horaires { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.horaires th, .horaires td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.horaires tr:last-child th, .horaires tr:last-child td { border-bottom: 0; }
.horaires th { width: 34%; font-weight: 600; }
.horaires tr.aujourdhui { background: var(--sign-soft); }
.horaires td.ferme { color: var(--muted); }
.periode { margin: 18px 0 8px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.periode h3 { margin: 0; }
.pastille { font-size: .78rem; font-weight: 700; background: var(--ink); color: #fff; border-radius: 999px; padding: 2px 9px; }
.dechets-groupes { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.dechets-groupes ul { padding-left: 18px; margin: 0; }
.dechets-groupes h3 { margin: 0 0 6px; font-size: 1rem; }
.source { font-size: .85rem; color: var(--muted); }
.encadre { border-radius: var(--radius); padding: 14px 16px; margin: 18px 0; background: var(--sign-soft); border-left: 6px solid var(--sign); }
.encadre p:last-child, .encadre ul:last-child { margin-bottom: 0; }
.encadre.alerte { background: var(--brick-soft); border-left-color: var(--brick); }
.encadre.info { background: #eef4f2; border-left-color: var(--ink-2); }
.carte-osm { height: 320px; border-radius: var(--radius); border: 1px solid var(--line); background: #e8ece8 center/cover; display: grid; place-items: center; text-align: center; }
.liste-proches { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.liste-proches li { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; justify-content: space-between; }
.liste-proches .nom { font-weight: 700; }
.liste-proches .dist { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .92rem; }
.liste-proches .ad { width: 100%; font-size: .9rem; color: var(--muted); }

/* Contenus éditoriaux */
.article { max-width: 760px; }
.article h2 { scroll-margin-top: 16px; }
.en-bref { background: #fff; border: 2px solid var(--ink); border-radius: var(--radius); padding: 14px 18px; margin: 18px 0 24px; }
.en-bref h2 { margin: 0 0 6px; font-size: 1.05rem; text-transform: uppercase; letter-spacing: .06em; }
.en-bref ul { margin: 0; padding-left: 20px; }
.options { list-style: none; counter-reset: opt; padding: 0; }
.options > li { counter-increment: opt; position: relative; padding: 12px 14px 12px 54px; background: #fff; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; }
.options > li::before { content: counter(opt); position: absolute; left: 14px; top: 12px; width: 28px; height: 28px; border-radius: 50%; background: var(--sign); font-weight: 800; display: grid; place-items: center; font-family: var(--display); }
.options strong { display: block; }
.meta { font-size: .88rem; color: var(--muted); }
.sources-liste { font-size: .92rem; }
details.faq { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin-bottom: 10px; }
details.faq summary { font-weight: 700; cursor: pointer; }
details.faq[open] summary { margin-bottom: 8px; }
.toc { font-size: .95rem; }
.colonnes { columns: 2 220px; column-gap: 24px; }
.colonnes li { break-inside: avoid; }

/* Emplacements publicitaires et partenaires (discrets, réservés, jamais trompeurs) */
.pub { margin: 28px auto; min-height: 0; text-align: center; }
.pub:empty { display: none; }
.partenaire { border: 1px dashed var(--line); border-radius: var(--radius); padding: 14px 16px; margin: 24px 0; background: #fff; }
.partenaire .etiquette { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

/* Pied de page */
.site-footer { margin-top: 56px; background: #eae6da; padding: 32px 0 24px; font-size: .92rem; }
.site-footer .cols { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.site-footer h2 { font-size: 1rem; margin: 0 0 8px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: 4px 0; }
.site-footer .bas { margin-top: 22px; color: var(--muted); }
.lien-bouton { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; text-decoration-color: var(--sign); cursor: pointer; }

/* Tableaux simples */
table.simple { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.simple th, table.simple td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }

/* Modération */
.moderation .carte { margin-bottom: 14px; }
.moderation pre { white-space: pre-wrap; background: #f4f2ea; padding: 8px; border-radius: 8px; }

@media print {
  .site-header .nav, .site-footer, .pub, .partenaire, .actions, .chercheur { display: none !important; }
  body { background: #fff; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Garde-fous mobile : aucun élément de grille ne doit élargir la page */
body { overflow-wrap: break-word; }
.fiche-tete > *, .grille > *, .chercheurs > *, .dechets-groupes > *, .cols > * { min-width: 0; }
.coord li span:last-child { min-width: 0; }
@media (max-width: 640px) {
  table.simple { display: block; overflow-x: auto; }
}
