/* ==========================================================================
   Annuaires WOUAIBE — feuille de style unique.
   Un code, cinq identités : la couleur d'accent est posée par le gabarit
   (style="--accent: …" sur <body>) selon le domaine.
   ========================================================================== */

:root {
  --ink: #14161a;
  --ink-soft: #3d444d;
  --muted: #6b7280;
  --bg: #fbfaf7;
  --surface: #ffffff;
  --line: #e7e3db;
  --line-strong: #d6d0c4;
  --accent: #1f2937;
  --max: 1080px;
  --r: 14px;
  --font: "Source Serif 4", "Libertinus Serif", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --ombre: 0 1px 2px rgba(20, 22, 26, .04), 0 8px 24px -12px rgba(20, 22, 26, .18);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
a:hover { border-bottom-color: currentColor; }
img { max-width: 100%; height: auto; }

/* ---------- En-tête ---------- */

.entete {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(251, 250, 247, .88);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.entete__in {
  max-width: var(--max);
  margin: 0 auto;
  padding: .7rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  justify-content: space-between;
}
.marque { display: flex; align-items: baseline; gap: .6rem; border: 0; min-width: 0; }
.marque img { display: block; height: 44px; width: auto; border-radius: 6px; }
.marque__nom {
  font-family: var(--font);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -.01em;
  white-space: nowrap;
}
.marque__baseline { font-size: .82rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.recherche { display: flex; gap: .4rem; flex: 0 1 420px; }
.recherche input {
  flex: 1 1 auto;
  min-width: 0;
  font: inherit;
  font-size: .95rem;
  padding: .55rem .8rem;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
}
.recherche input:focus { outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 1px; border-color: var(--accent); }
.recherche button {
  font: inherit;
  font-size: .9rem;
  font-weight: 600;
  padding: .55rem .9rem;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
}
.recherche button:hover { filter: brightness(1.08); }


/* ---------- Bandeau d'accueil ---------- */

.hero {
  position: relative;
  margin: 0 0 2.4rem;
  padding: 2.2rem 2rem 2rem;
  border-radius: 18px;
  border: 1px solid var(--line);
  background:
    radial-gradient(680px 220px at 100% 0%, color-mix(in srgb, var(--accent) 12%, transparent) 0%, transparent 70%),
    var(--surface);
  box-shadow: var(--ombre);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--accent);
}
.hero h1 { margin: 0 0 .7rem; max-width: 24ch; }
.hero__lede { margin: 0; font-size: 1.05rem; color: var(--muted); max-width: 62ch; }
.bloc-note { margin-top: 2.6rem; padding-top: 1.6rem; border-top: 1px solid var(--line); }

.marque__pt {
  width: 11px; height: 11px; border-radius: 3px;
  background: var(--accent); display: inline-block; flex: 0 0 auto;
  transform: translateY(-1px);
}
.marque { align-items: center; }

/* ---------- Contenu ---------- */

.contenu {
  flex: 1 0 auto;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}
.contenu > article { animation: monte .4s ease-out both; }

h1, h2, h3 { font-family: var(--font); font-weight: 700; line-height: 1.22; color: var(--ink); letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 3.2vw, 2.6rem); margin: .2rem 0 1rem; }
h2 { font-size: clamp(1.4rem, 2.2vw, 1.75rem); margin: 2.2rem 0 .8rem; }
h3 { font-size: clamp(1.12rem, 1.4vw, 1.28rem); margin: 1.4rem 0 .4rem; }
h2::after {
  content: "";
  display: block;
  width: 44px;
  height: 3px;
  margin-top: .5rem;
  border-radius: 2px;
  background: var(--accent);
  opacity: .85;
}
p { margin: 0 0 1rem; }

/* Accueil : première section mise en avant */
.contenu--accueil > article > h1 { max-width: 22ch; }

/* ---------- Listes et cartes ---------- */

.list { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.list li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: .85rem 1rem;
  box-shadow: var(--ombre);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  font-size: .96rem;
}
.list li:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.list li a, .list li .dist { overflow-wrap: anywhere; }
.list li a { border: 0; font-weight: 600; color: var(--ink); }
.list li a:hover { color: var(--accent); }

.deps { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .45rem; }
.deps li { margin: 0; }
.deps a {
  display: inline-block;
  padding: .35rem .7rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: .88rem;
  border-bottom-width: 1px;
  transition: all .15s ease;
}
.deps a:hover { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, #fff); }

article section > ul:not(.list):not(.deps):not(.coord__actions) { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
article section > ul:not(.list):not(.deps):not(.coord__actions) li {
  padding: .7rem .9rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid color-mix(in srgb, var(--accent) 55%, #fff);
  border-radius: 10px;
  font-size: .96rem;
}

/* ---------- Fil d'Ariane, fiches ---------- */

.breadcrumb { font-size: .88rem; color: var(--muted); margin: 0 0 1.2rem; }
.breadcrumb a { color: var(--muted); border-bottom-color: transparent; }
.breadcrumb a:hover { color: var(--accent); }

.fiche address { font-style: normal; margin-bottom: 1rem; color: var(--ink-soft); }
.dist, .muted { color: var(--muted); }
.dist { font-size: .88em; }
.error { color: #8b1a1a; }

/* ---------- Fiche d'annuaire ---------- */

.grille-fiche { display: grid; gap: 2rem; grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); align-items: start; }
.coord {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 1.3rem 1.4rem;
  box-shadow: var(--ombre);
}
.coord dl { margin: 0; }
.coord dt { font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: .9rem 0 .15rem; }
.coord dt:first-child { margin-top: 0; }
.coord dd { margin: 0; font-size: .98rem; line-height: 1.5; color: var(--ink); overflow-wrap: anywhere; }
.coord dd a { border-bottom-color: color-mix(in srgb, var(--accent) 25%, transparent); }
.coord__actions { list-style: none; margin: 1.3rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .45rem; }
.coord__actions li { margin: 0; }
.coord__actions .btn { padding: .45rem .7rem; font-size: .85rem; }
.btn {
  display: inline-block;
  padding: .55rem .9rem;
  border-radius: 10px;
  border: 1px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, #fff);
  color: var(--accent);
  font-size: .9rem;
  font-weight: 600;
}
.btn:hover { background: var(--accent); color: #fff; }
.fiche__texte h2 { margin-top: 0; }

@media (max-width: 860px) {
  .grille-fiche { grid-template-columns: 1fr; gap: 1.4rem; }
}

/* ---------- Carte de localisation ---------- */

.carte {
  margin: 2rem 0 0;
  height: 340px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: #e9e5dc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Ccircle cx='12' cy='12' r='1.2' fill='%23b9b2a4'/%3E%3C/svg%3E") repeat;
  box-shadow: var(--ombre);
  z-index: 0;
}
.carte--prete { background: #e9e5dc; }
.carte .leaflet-control-attribution { font-size: .68rem; }
.carte--ville { margin: 0 0 1.8rem; height: 300px; }
@media (max-width: 860px) { .carte { height: 260px; margin-top: 1.4rem; } .carte--ville { margin-top: 0; } }

/* ---------- Pages éditoriales (articles) ---------- */

.post { max-width: 760px; margin: 0 auto; }
.post h1 { font-size: clamp(1.75rem, 2.8vw, 2.3rem); }
.editorial, .description { max-width: 70ch; }
.post .editorial { max-width: none; }
.editorial { font-size: 1.06rem; line-height: 1.72; color: var(--ink-soft); }
.editorial h2 { margin: 2.4rem 0 .7rem; color: var(--ink); }
.editorial h3 { margin: 1.6rem 0 .4rem; color: var(--ink); font-family: var(--font); }
.editorial p { margin: 0 0 1.1rem; }
.editorial ul, .editorial ol { margin: 0 0 1.3rem; padding-left: 1.35rem; }
.editorial li { margin: .35rem 0; }
.editorial strong { color: var(--ink); }
.editorial em { color: var(--muted); }
.editorial figure.illus { margin: 0 0 1.8rem; }
.editorial figure.illus img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--r);
  background: #e9e5dc;
  box-shadow: var(--ombre);
}
.editorial figure.illus figcaption { font-size: .88rem; color: var(--muted); margin-top: .5rem; }

/* Mention d'état sur une fiche d'entreprise */
.etat-entreprise {
  border-left: 4px solid #b45309;
  background: #fff8ec;
  color: #6b4a12;
  padding: .8rem 1rem;
  margin: 0 0 1.4rem;
  border-radius: 0 10px 10px 0;
  font-size: .95rem;
  line-height: 1.55;
}
.etat-entreprise strong { color: #8a3c00; }


/* ---------- Formulaire d'avis ---------- */

.avis { max-width: 640px; margin: 2.6rem 0 0; }
.avis__aide { color: var(--muted); font-size: .95rem; margin: 0 0 1rem; }
.avis__message { border-radius: 10px; padding: .8rem 1rem; font-size: .95rem; margin: 0 0 1.2rem; }
.avis__message--ok { background: #eef7ee; border-left: 4px solid #2f7d43; color: #1f5330; }
.avis__message--ko { background: #fdf1ef; border-left: 4px solid #b3392a; color: #7a241a; }

.form-avis { display: grid; gap: 1rem; }
.champ { margin: 0; display: grid; gap: .35rem; }
.champ label { font-size: .85rem; font-weight: 600; color: var(--ink-soft); }
.champ__aide { font-weight: 400; color: var(--muted); }
.champ input, .champ textarea {
  font: inherit;
  font-size: .97rem;
  padding: .6rem .75rem;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  width: 100%;
}
.champ textarea { resize: vertical; min-height: 120px; }
.champ input:focus, .champ textarea:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent);
  outline-offset: 1px;
  border-color: var(--accent);
}
.champ--leurre { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.champ__envoi { margin: .2rem 0 0; }
.btn--plein { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn--plein:hover { filter: brightness(1.08); color: #fff; }

/* ---------- Pied de page ---------- */

.pied {
  background: var(--ink);
  color: #cfd3d9;
  margin-top: auto;
}
.pied a { color: #eef1f4; border-bottom-color: rgba(238, 241, 244, .3); }
.pied a:hover { border-bottom-color: #fff; }
.pied__in {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem 1.25rem;
  display: grid;
  gap: 1.6rem;
  grid-template-columns: 1.1fr 1.4fr 1fr;
  align-items: start;
  font-size: .9rem;
}
.pied__bloc p { margin: 0 0 .35rem; }
.pied__marque { font-weight: 600; color: #fff; letter-spacing: .01em; }
.pied__titre { font-size: .78rem; text-transform: uppercase; letter-spacing: .09em; color: #8f98a3; margin-bottom: .6rem !important; }
.pied__abc { display: flex; flex-wrap: wrap; gap: .3rem .1rem; }
.pied__abc a {
  display: inline-block;
  min-width: 1.5rem;
  text-align: center;
  padding: .15rem 0;
  border: 0;
  color: #cfd3d9;
  font-size: .84rem;
}
.pied__abc a:hover { color: #fff; }
.pied__bloc--droit { text-align: right; color: #8f98a3; }

/* ---------- Utilitaires ---------- */

.sr, .visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; white-space: nowrap;
}

/* Anciennes classes, conservées pour les gabarits non repris */
.site-header, .main, .site-footer { max-width: var(--max); margin: 0 auto; padding: 1rem 1.25rem; }
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.brand img { max-width: 100%; height: auto; display: block; }
.brand-text { font-family: var(--font); font-size: 1.75rem; font-weight: 700; color: var(--ink); }
.admin .site-header nav { display: flex; gap: 1rem; }

/* ---------- Animations ---------- */

@keyframes monte {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Mobile ---------- */

@media (max-width: 860px) {
  .entete__in { flex-wrap: wrap; gap: .6rem; }
  .recherche { flex: 1 1 100%; order: 2; }
  .marque img { height: 34px; }
  .marque__nom { font-size: 1.2rem; }
  .marque__baseline { display: none; }
  .pied__in { grid-template-columns: 1fr; gap: 1.4rem; }
  .pied__bloc--droit { text-align: left; }
  .contenu { padding: 1.4rem 1rem 2.4rem; }
  .list { grid-template-columns: 1fr; }
  .list li:hover { transform: none; }
}
@media (max-width: 520px) {
  .recherche button { padding: .55rem .7rem; font-size: .84rem; }
  h1 { font-size: 1.7rem; }
  h2 { font-size: 1.32rem; }
}
