/* ==========================================================================
   DRAY & FILS — Conseils (articles) : mêmes coloris que le site
   ========================================================================== */

/* ---------- photo de couverture, logo posé dessus ---------- */
.cover { position: relative; overflow: hidden; margin: 0; aspect-ratio: 16 / 9; background: var(--bg-2); }
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.cover::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(8, 7, 6, 0) 48%, rgba(8, 7, 6, 0.7)); }
.cover__logo { position: absolute; left: clamp(14px, 2.4vw, 28px); bottom: clamp(12px, 2vw, 24px); z-index: 1; display: flex; align-items: center; gap: 12px; color: #f5ecda; }
.cover__logo svg { width: clamp(46px, 5vw, 72px); height: auto; aspect-ratio: 300 / 210; filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.55)); }
.cover__logo b { display: block; font: 400 clamp(13px, 1.3vw, 17px)/1.1 var(--f-display); letter-spacing: 0.2em; text-transform: uppercase; text-shadow: 0 1px 10px rgba(0, 0, 0, 0.6); }
.cover__logo small { display: block; margin-top: 4px; font-size: 10px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; opacity: 0.86; }
.cover-credit { margin-top: 10px; font-size: 12px; color: var(--text-3); }
.cover-credit a { color: var(--text-2); border-bottom: 1px solid var(--line-2); }

/* ---------- index ---------- */
.blog-hero { padding: calc(var(--header-h) + clamp(44px, 6vw, 88px)) 0 clamp(36px, 5vw, 64px); }
.blog-hero .title { max-width: 18ch; margin: 18px 0 22px; font-size: clamp(40px, 5.4vw, 78px); }
.blog-hero .lead { max-width: 64ch; }
.blog-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 30px; }
.blog-filters button { padding: 8px 16px; border: 0; border-radius: 99px; background: transparent; color: var(--text-2); font: 500 13px var(--f-sans); box-shadow: inset 0 0 0 1px var(--line-2); cursor: pointer; transition: color 0.3s, box-shadow 0.3s, background-color 0.3s; }
.blog-filters button:hover { color: var(--text); box-shadow: inset 0 0 0 1px var(--accent); }
.blog-filters button[aria-pressed="true"] { background: var(--text); color: var(--bg); box-shadow: none; }
.blog-filters + .blog-filters { margin-top: 10px; }
.posts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(22px, 2.6vw, 36px); }
.post-card { display: grid; align-content: start; gap: 14px; color: inherit; text-decoration: none; }
.post-card[hidden] { display: none; }
.post-card .cover { aspect-ratio: 4 / 3; }
.post-card .cover img { transition: transform 1.2s var(--ease); }
.post-card:hover .cover img { transform: scale(1.04); }
.post-card .cover__logo svg { width: 46px; }
.post-card .cover__logo b { font-size: 12px; }
.post-meta { font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.post-meta span { color: var(--text-3); }
/* h2 dans l'index, h3 dans « Dans le même esprit » en bas des articles (titres restés en gras sans empattement) */
.post-card h2, .post-card h3 { font: 400 clamp(21px, 1.8vw, 26px)/1.18 var(--f-display); transition: color 0.3s; }
.post-card:hover h2, .post-card:hover h3 { color: var(--accent); }
.post-card p { color: var(--text-2); font-size: 15px; }
.blog-empty { padding: 40px 0; color: var(--text-3); }

/* ---------- article ---------- */
.post-hero { padding: calc(var(--header-h) + clamp(40px, 5vw, 72px)) 0 clamp(28px, 4vw, 48px); }
.post-hero .title { max-width: 22ch; margin: 18px 0 22px; font-size: clamp(36px, 4.6vw, 66px); }
.post-hero .lead { max-width: 64ch; }
.post-info { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 22px; font-size: 13px; color: var(--text-3); }
.post-cover { margin-top: clamp(28px, 4vw, 48px); }
.post-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: clamp(40px, 6vw, 96px); align-items: start; }
.post-body { max-width: 70ch; }
.post-body h2 { margin: clamp(38px, 4vw, 56px) 0 16px; font: 400 clamp(26px, 2.6vw, 36px)/1.12 var(--f-display); }
.post-body h2:first-child { margin-top: 0; }
.post-body p { margin-top: 14px; color: var(--text-2); font-size: 17px; line-height: 1.75; }
.post-body ul { display: grid; gap: 10px; margin: 18px 0 4px; padding: 0; list-style: none; }
.post-body li { position: relative; padding-left: 28px; color: var(--text-2); font-size: 16.5px; line-height: 1.6; }
.post-body li::before { content: ""; position: absolute; left: 4px; top: 0.62em; width: 9px; height: 12px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; background: var(--water); transform: translateY(-50%); }
.post-faq { margin-top: clamp(44px, 5vw, 64px); }
.post-faq h2 { margin-bottom: 8px; }
.post-cta { margin-top: clamp(44px, 5vw, 64px); padding: clamp(26px, 3vw, 40px); border-left: 2px solid var(--water); background: var(--sea); }
.post-cta p { margin: 0 0 22px; color: var(--text); font: 400 clamp(20px, 1.9vw, 26px)/1.3 var(--f-display); }
.post-cta .ville-ctas { margin-top: 0; }
.post-side { position: sticky; top: calc(var(--header-h) + 24px); display: grid; gap: 28px; }
.post-side h3 { margin-bottom: 12px; font-size: 11px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-3); }
.post-side ul { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.post-side li a { display: block; padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--text-2); font-size: 14.5px; line-height: 1.4; transition: color 0.3s; }
.post-side li a:hover { color: var(--accent); }
.post-side li a small { display: block; margin-top: 3px; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); }
/* bandeau de fond alterné : sans marge haute, le libellé « — Conseils » collait au filet et touchait le titre */
.post-more { padding-top: clamp(56px, 7vw, 96px); }
.post-more .title { margin-top: 18px; }
.post-more .posts { margin-top: 28px; }

@media (max-width: 979px) {
  .posts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .post-layout { grid-template-columns: minmax(0, 1fr); }
  .post-side { position: static; }
}
@media (max-width: 640px) {
  .posts { grid-template-columns: minmax(0, 1fr); }
  .post-body p { font-size: 16px; }
}

/* ==========================================================================
   Pages pivots (commune, métier), index en groupes, zone d'intervention (v4)
   ========================================================================== */

/* fil d'Ariane à quatre niveaux : le titre de l'article, long, tient sur une ligne et se termine par des points de suspension */
.post-hero .crumbs li[aria-current] { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumbs li { min-width: 0; }

/* ---------- navigation par métier et par commune ---------- */
.hub-nav { display: grid; gap: 20px; margin-top: 36px; }
.hub-nav > div { min-width: 0; }
.hub-nav h2 { margin-bottom: 10px; font-size: 11px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-3); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips a { padding: 7px 14px; border-radius: 99px; color: var(--text-2); font-size: 13px; line-height: 1.3; box-shadow: inset 0 0 0 1px var(--line-2); transition: color 0.3s, box-shadow 0.3s, background-color 0.3s; }
.chips a:hover { color: var(--text); box-shadow: inset 0 0 0 1px var(--accent); }
.chips a[aria-current] { background: var(--text); color: var(--bg); box-shadow: none; }
.chips .chips__zone { color: var(--accent); }

/* ---------- filtres de l'index (affichés seulement avec JavaScript) ---------- */
.blog-tools { display: none; }
.js .blog-tools { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px 18px; margin-top: 34px; padding-top: 26px; border-top: 1px solid var(--line); }
.blog-tools label { display: grid; gap: 7px; font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-3); }
.blog-tools select {
  width: 260px; max-width: 100%; padding: 11px 38px 11px 14px; border: 0; border-radius: 2px; appearance: none; -webkit-appearance: none;
  background: var(--bg-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23a79c88' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 14px center / 12px 8px;
  color: var(--text); font: 500 14px/1.3 var(--f-sans); letter-spacing: 0; text-transform: none; box-shadow: inset 0 0 0 1px var(--line-2); cursor: pointer;
}
.blog-tools select:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }
.blog-tools__reset { padding: 11px 16px; border-radius: 99px; color: var(--text-2); font-size: 13px; box-shadow: inset 0 0 0 1px var(--line-2); transition: color 0.3s, box-shadow 0.3s; }
.blog-tools__reset:hover { color: var(--text); box-shadow: inset 0 0 0 1px var(--accent); }
.blog-tools__nb { align-self: center; font-size: 14px; color: var(--text-2); }

/* ---------- cartes rangées par commune ---------- */
.blog-list { padding-top: clamp(56px, 7vw, 96px); }
.blog-group[hidden] { display: none; }
.blog-group + .blog-group { margin-top: clamp(64px, 8vw, 112px); }
.blog-group__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 22px; margin-bottom: 28px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.blog-group__head h2 { font: 400 clamp(26px, 2.6vw, 36px)/1.1 var(--f-display); }
.blog-group__head p { font-size: 13px; color: var(--text-3); }
.blog-group__head .text-link { margin-left: auto; font-size: 14px; }
.blog-group__head .text-link svg { width: 16px; height: 16px; }

/* ---------- pivots ---------- */
.pivot-hero .title { max-width: 20ch; }
.pivot-intro { display: grid; gap: 14px; max-width: 70ch; }
.pivot-intro p { color: var(--text-2); font-size: 17px; line-height: 1.7; }
.pivot-intro p:first-child { color: var(--text); font-size: 19px; }
.fiche { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin-top: 40px; background: var(--line); border: 1px solid var(--line); }
.fiche > div { min-width: 0; padding: 22px 24px 24px; background: var(--bg-2); }
.fiche dt { font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-3); }
.fiche dd { margin-top: 10px; font: 400 clamp(23px, 2.1vw, 29px)/1.15 var(--f-display); color: var(--text); }
.fiche dd small { display: block; margin-top: 8px; font: 400 13.5px/1.55 var(--f-sans); color: var(--text-2); }
.sources { margin-top: 16px; max-width: 90ch; font-size: 13px; line-height: 1.6; color: var(--text-3); }
.sources a { color: var(--text-2); border-bottom: 1px solid var(--line-2); overflow-wrap: anywhere; transition: color 0.3s; }
.sources a:hover { color: var(--accent); }
.pivot-side { position: static; }
.pivot-side ul { border-top: 1px solid var(--line); }
.ville-cta .hub-nav { max-width: 900px; margin: 56px auto 0; text-align: left; }

/* tableau de données d'un pivot métier (dureté de l'eau, résidences secondaires) */
.data { margin-top: 40px; max-width: 760px; }
.data figcaption { margin-bottom: 12px; font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-3); }
.data-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.data-table th, .data-table td { padding: 11px 12px 11px 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: baseline; }
.data-table th { font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-3); }
.data-table th:last-child, .data-table td:last-child { padding-right: 0; text-align: right; white-space: nowrap; color: var(--text); }
.data-table td.note { color: var(--text-3); font-size: 13.5px; }
.data-table a { color: var(--text); border-bottom: 1px solid var(--line-2); transition: color 0.3s; }
.data-table a:hover { color: var(--accent); }

/* ---------- zone d'intervention ---------- */
.zone-hero__grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(36px, 5vw, 80px); align-items: start; }
.zone-hero .title { max-width: 16ch; }
.zone-texte { margin-top: 18px; max-width: 62ch; color: var(--text-2); font-size: 15.5px; }
.zone-pages { display: flex; flex-wrap: wrap; gap: 14px 28px; margin-top: 30px; }
.zone-figure { position: sticky; top: calc(var(--header-h) + 24px); margin: 0; }
.zone-figure figcaption { margin-top: 10px; font-size: 13px; color: var(--text-3); }
.zone-carte { width: 100%; height: auto; overflow: hidden; }
.zc-points circle { fill: var(--text-3); opacity: 0.55; }
.zc-pivots circle { fill: var(--accent); }
.zc-cercles circle { fill: none; stroke: var(--line-2); stroke-width: 0.25; stroke-dasharray: 1 1.2; }
.zc-cercles text { fill: var(--text-3); font: 500 2.3px var(--f-sans); }
.zc-noms text { fill: var(--text-2); font: 500 2.6px var(--f-sans); paint-order: stroke; stroke: var(--bg); stroke-width: 0.6px; }
.zc-atelier circle:first-child { fill: none; stroke: var(--water); stroke-width: 0.5; }
.zc-atelier circle:last-child { fill: var(--water); }
.zc-atelier text { fill: var(--text); font: 600 2.8px var(--f-sans); paint-order: stroke; stroke: var(--bg); stroke-width: 0.6px; }
.zone-search { display: grid; grid-template-columns: minmax(0, 420px) auto; align-items: center; gap: 8px 18px; margin-bottom: 26px; }
.zone-search label { grid-column: 1 / -1; font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-3); }
.zone-search input { width: 100%; padding: 13px 16px; border: 0; border-radius: 2px; background: var(--bg); color: var(--text); font: 500 16px var(--f-sans); box-shadow: inset 0 0 0 1px var(--line-2); }
.zone-search input:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }
.zone-search p { font-size: 14px; color: var(--text-2); }
.zone-search { display: none; }
.js .zone-search { display: grid; }
.zone-sauts { margin-bottom: clamp(40px, 5vw, 64px); }
.zone-epci[hidden] { display: none; }
.zone-epci + .zone-epci { margin-top: clamp(40px, 5vw, 64px); }
.zone-epci__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 20px; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line-2); }
.zone-epci__head h2 { font: 400 clamp(22px, 2.2vw, 30px)/1.15 var(--f-display); }
.zone-epci__head p { font-size: 13px; color: var(--text-3); }
.zone-list { columns: 4 220px; column-gap: 36px; }
.zone-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); break-inside: avoid; font-size: 15px; line-height: 1.35; }
.zone-list li[hidden] { display: none; }
.zone-list li > span { min-width: 0; overflow-wrap: anywhere; }
.zone-list small { flex: none; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.zone-list a { color: var(--accent); border-bottom: 1px solid currentColor; transition: color 0.3s; }
.zone-list a:hover { color: var(--text); }
.zone-source { margin-top: 48px; font-size: 13px; color: var(--text-3); }

@media (max-width: 979px) {
  .fiche { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .zone-hero__grid { grid-template-columns: minmax(0, 1fr); }
  .zone-figure { position: static; max-width: 640px; }
}
@media (max-width: 640px) {
  /* cartes compactes : vignette carrée à gauche, titre à droite, sans le résumé */
  .posts--liste { gap: 14px; }
  .posts--liste .post-card { grid-template-columns: 104px minmax(0, 1fr); align-items: start; gap: 4px 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
  .posts--liste .post-card .cover { grid-row: 1 / span 3; aspect-ratio: 1; }
  .posts--liste .post-card .cover::after, .posts--liste .post-card .cover__logo { display: none; }
  .posts--liste .post-card h2, .posts--liste .post-card h3 { font-size: 18px; line-height: 1.22; }
  .posts--liste .post-card > p:last-child { display: none; }
  .posts--liste .post-meta { font-size: 10px; letter-spacing: 0.12em; }
  .blog-group__head .text-link { margin-left: 0; }
  .js .blog-tools { gap: 12px; }
  .blog-tools label, .blog-tools select { width: 100%; }
  .zone-search { grid-template-columns: minmax(0, 1fr); }
  .zone-list { columns: 1; }
  .data-table td.note, .data-table th.note { display: none; }
  .fiche { grid-template-columns: minmax(0, 1fr); }
  .fiche > div { padding: 18px 18px 20px; }
  /* rangées de pastilles : défilement horizontal plutôt qu'un mur de liens avant les filtres */
  .hub-nav .chips, .zone-sauts { flex-wrap: nowrap; overflow-x: auto; margin-inline: calc(-1 * var(--gutter)); padding: 2px var(--gutter) 8px; scrollbar-width: none; }
  .hub-nav .chips::-webkit-scrollbar, .zone-sauts::-webkit-scrollbar { display: none; }
  .hub-nav .chips a, .zone-sauts a { flex: none; }
}
