/*
 * Thème potentiel-solaire.fr — chargé après site.css (config design.stylesheets).
 *
 * Scène : un propriétaire lit le soir chez lui, souvent après un démarchage dont il se méfie, et
 * veut vérifier des faits sur sa commune. D'où : fond clair neutre, une seule couleur de marque
 * (bleu pétrole profond, ni orange « solaire » ni codes de l'administration), chiffres très
 * lisibles, aucun effet décoratif. L'ambre du soleil reste réservé à la marque.
 */

@font-face {
    font-family: "IBM Plex Sans";
    src: url("/assets/fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "IBM Plex Sans";
    src: url("/assets/fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "IBM Plex Sans";
    src: url("/assets/fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "IBM Plex Sans";
    src: url("/assets/fonts/ibm-plex-sans-latin-700-normal.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --color-bg: oklch(0.985 0.003 220);
    --color-surface: oklch(1 0 0);
    --color-ink: oklch(0.23 0.025 235);
    --color-ink-soft: oklch(0.33 0.022 235);
    --color-ink-muted: oklch(0.46 0.02 235);
    --color-border: oklch(0.9 0.008 225);
    --color-border-strong: oklch(0.74 0.015 225);
    --color-primary: oklch(0.42 0.085 218);
    --color-primary-hover: oklch(0.34 0.075 218);
    --color-primary-ink: oklch(0.99 0 0);
    --color-primary-tint: oklch(0.955 0.018 218);
    --color-accent: oklch(0.42 0.085 218);
    --color-sun: oklch(0.79 0.15 75);
    --color-row: oklch(0.975 0.005 220);
    --font-body: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
    --font-heading: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
    --measure: 46rem;
    --radius: 10px;
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --z-header: 10;

    font-family: var(--font-body);
    font-size: 106.25%;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body {
    background: var(--color-bg);
    color: var(--color-ink);
}

a {
    color: var(--color-primary);
    text-underline-offset: 0.18em;
    text-decoration-thickness: 1px;
    transition: color 160ms var(--ease-out);
}

a:hover {
    color: var(--color-primary-hover);
    text-decoration-thickness: 2px;
}

:focus-visible {
    outline: 3px solid var(--color-primary);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ---- En-tête ---- */

.site-header {
    position: sticky;
    top: 0;
    z-index: var(--z-header);
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface);
}

.site-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: min(100% - 2rem, 72rem);
    margin: 0 auto;
    padding: 0.7rem 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--color-ink);
    font-weight: 600;
    font-size: 1.05rem;
    text-decoration: none;
}

.brand:hover {
    color: var(--color-ink);
    text-decoration: none;
}

.brand-mark {
    flex: none;
    color: var(--color-primary);
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    font-size: 0.95rem;
}

.site-nav a {
    color: var(--color-ink-soft);
    text-decoration: none;
}

.site-nav a:hover {
    color: var(--color-primary);
}

.site-nav .nav-cta {
    border-radius: 999px;
    background: var(--color-primary);
    padding: 0.45rem 1rem;
    color: var(--color-primary-ink);
    font-weight: 600;
    transition: background-color 160ms var(--ease-out);
}

.site-nav .nav-cta:hover {
    background: var(--color-primary-hover);
    color: var(--color-primary-ink);
}

@media (max-width: 34rem) {
    .site-nav a:not(.nav-cta) {
        display: none;
    }
}

/* ---- Mise en page ---- */

.page-shell,
.geo-page.local-page {
    display: block;
    width: min(100% - 2rem, 72rem);
    margin: 0 auto;
    padding: 2rem 0 4rem;
}

.content-main {
    display: block;
}

.content-main > * {
    max-width: var(--measure);
}

.content-main > .data-section,
.content-main > .listing,
.content-main > .lead-section,
.content-main > .hero {
    max-width: 60rem;
}

.breadcrumbs {
    margin-bottom: 1.5rem;
    color: var(--color-ink-muted);
    font-size: 0.875rem;
}

.breadcrumbs a {
    color: var(--color-ink-muted);
}

/* ---- Titres et texte ---- */

h1,
h2,
h3 {
    color: var(--color-ink);
    font-family: var(--font-heading);
    text-wrap: balance;
}

h1 {
    max-width: 24ch;
    margin: 0 0 1rem;
    font-size: clamp(2rem, 1.35rem + 2.6vw, 3.1rem);
    font-weight: 600;
    line-height: 1.12;
    letter-spacing: -0.015em;
}

h2 {
    margin: 0 0 0.75rem;
    font-size: clamp(1.3rem, 1.15rem + 0.6vw, 1.6rem);
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.005em;
}

p,
li {
    text-wrap: pretty;
}

.hero {
    max-width: none;
    margin-bottom: 2.5rem;
}

.lede {
    max-width: var(--measure);
    margin: 0;
    color: var(--color-ink-soft);
    font-size: 1.18rem;
    line-height: 1.55;
}

.update-note {
    margin: 0.25rem 0 2.25rem;
    color: var(--color-ink-muted);
    font-size: 0.875rem;
}

.content-section,
.data-section,
.listing,
.faq,
.sources {
    margin-top: 2.75rem;
}

.content-section p,
.data-section p {
    max-width: var(--measure);
    margin: 0 0 1rem;
}

.content-section ul,
.plain-list {
    margin: 0 0 1rem;
    padding-left: 1.2rem;
}

.content-section li,
.plain-list li {
    margin-bottom: 0.55rem;
}

.method-note,
.source-note {
    color: var(--color-ink-muted);
    font-size: 0.9rem;
}

/* ---- Recherche de commune (accueil) ---- */

.commune-search {
    max-width: 40rem;
    margin-top: 2rem;
}

.commune-search label {
    display: block;
    margin-bottom: 0.4rem;
}

.commune-search-row {
    display: flex;
    gap: 0.5rem;
}

.commune-search-row input {
    flex: 1;
    min-width: 0;
    font-size: 1.05rem;
    padding: 0.75rem 0.9rem;
}

.commune-search-row button {
    flex: none;
    width: auto;
    padding: 0 1.25rem;
}

.commune-search-help {
    margin: 0.5rem 0 0;
    color: var(--color-ink-muted);
    font-size: 0.875rem;
}

@media (max-width: 34rem) {
    .commune-search-row {
        flex-direction: column;
    }

    .commune-search-row button {
        width: 100%;
    }
}

/* ---- Photo d'illustration ---- */

.content-main > .page-photo {
    max-width: 60rem;
    margin: 0 0 2.5rem;
}

.page-photo img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 2;
    max-height: 30rem;
    border-radius: var(--radius);
    background: var(--color-row);
    object-fit: cover;
}

.page-photo figcaption {
    margin-top: 0.45rem;
    color: var(--color-ink-muted);
    font-size: 0.8rem;
}

/* ---- Fiche commune ---- */

.key-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 2rem 0 0;
    border-top: 1px solid var(--color-border-strong);
}

.key-facts > div {
    padding: 0.9rem 1rem 0.9rem 0;
    border-bottom: 1px solid var(--color-border);
}

.key-facts dt {
    color: var(--color-ink-muted);
    font-size: 0.85rem;
}

.key-facts dd {
    margin: 0.15rem 0 0;
    font-size: 1.2rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.key-facts dd a {
    color: var(--color-ink);
    text-decoration: none;
}

.key-facts dd a:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

@media (min-width: 52rem) {
    .key-facts {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* ---- Tableaux de données ---- */

.table-scroll {
    overflow-x: auto;
    margin: 0 0 1rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
    font-size: 0.97rem;
}

.data-table caption {
    padding-bottom: 0.6rem;
    color: var(--color-ink-muted);
    font-size: 0.875rem;
    text-align: left;
}

.data-table th,
.data-table td {
    padding: 0.65rem 0.9rem 0.65rem 0;
    border-bottom: 1px solid var(--color-border);
    text-align: left;
    vertical-align: top;
}

.data-table thead th {
    border-bottom: 2px solid var(--color-ink);
    color: var(--color-ink-soft);
    font-size: 0.85rem;
    font-weight: 600;
}

.data-table tbody th {
    font-weight: 600;
}

.data-table td {
    white-space: nowrap;
}

.data-table tbody tr:nth-child(even) {
    background: var(--color-row);
}

@media (max-width: 40rem) {
    .data-table td {
        white-space: normal;
    }
}

/* ---- Listes de liens (communes, guides, départements) ---- */

.listing h2 {
    margin-bottom: 1rem;
}

.local-links {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
    column-gap: 2rem;
    border-top: 1px solid var(--color-border);
}

.local-links a {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
    border: 0;
    border-bottom: 1px solid var(--color-border);
    border-radius: 0;
    background: none;
    padding: 0.7rem 1rem 0.7rem 0;
    color: var(--color-ink);
    font-size: 0.97rem;
    text-decoration: none;
}

.local-links a:hover {
    color: var(--color-primary);
}

.local-links a span {
    flex: none;
    color: var(--color-ink-muted);
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
}

/* ---- Chiffres clés animés (DataStory) ---- */

.content-main > .data-story {
    max-width: 60rem;
}

.data-story {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12.5rem, 1fr));
    gap: 1.5rem 2rem;
    margin: 0 0 2rem;
    padding: 1.75rem 0;
    border-top: 1px solid var(--color-border-strong);
    border-bottom: 1px solid var(--color-border);
}

.ds-item {
    display: flex;
    flex-direction: column;
}

.ds-visual {
    height: 6rem;
    margin-bottom: 0.9rem;
}

.ds-value {
    margin: 0;
    color: var(--color-ink);
    font-size: clamp(1.7rem, 1.4rem + 1vw, 2.15rem);
    font-weight: 600;
    line-height: 1.1;
}

.ds-label {
    margin: 0.35rem 0 0;
    color: var(--color-ink-soft);
    font-size: 0.9rem;
    line-height: 1.45;
}

/* Soleil : l'éclat (halo, rayons, lueur) suit --sun, de 0,15 à 1 selon l'ensoleillement. */
.ds-sun .ds-visual {
    width: 6rem;
    overflow: visible;
    filter: drop-shadow(0 0 calc(var(--sun) * 14px) oklch(0.85 0.14 80 / 0.9));
}

.ds-sun-halo {
    fill: var(--color-sun);
    opacity: calc(0.08 + var(--sun) * 0.27);
}

.ds-sun-rays {
    stroke: oklch(0.72 0.15 68);
    stroke-width: 4.5;
    stroke-linecap: round;
    opacity: calc(0.2 + var(--sun) * 0.8);
    transform-origin: 60px 60px;
}

.ds-sun-core {
    fill: var(--color-sun);
}

/* Batterie */
.ds-battery .ds-visual {
    position: relative;
    width: 3.4rem;
    border: 3px solid var(--color-ink-soft);
    border-radius: 9px;
    margin-top: 0.5rem;
    height: 5.5rem;
}

.ds-battery .ds-visual::before {
    content: "";
    position: absolute;
    top: -0.65rem;
    left: 50%;
    width: 1.3rem;
    height: 0.4rem;
    border-radius: 3px 3px 0 0;
    background: var(--color-ink-soft);
    transform: translateX(-50%);
}

.ds-battery-fill {
    position: absolute;
    right: 3px;
    bottom: 3px;
    left: 3px;
    height: calc(var(--fill) - 6px);
    min-height: 4px;
    border-radius: 4px;
    background: var(--color-primary);
}

/* Maisons */
.ds-house-row {
    display: grid;
    grid-template-columns: repeat(5, 1.6rem);
    align-content: center;
    gap: 0.45rem 0.5rem;
}

.ds-house {
    width: 1.6rem;
    height: 1.6rem;
    fill: var(--color-border);
}

.ds-house.is-lit {
    fill: var(--color-primary);
}

/* Évolution */
.ds-growth-bars {
    display: grid;
    align-content: center;
    gap: 0.6rem;
}

.ds-growth-row {
    display: grid;
    grid-template-columns: 2.6rem 1fr auto;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-ink-muted);
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
}

.ds-growth-bar {
    height: 16px;
    width: var(--w);
    border-radius: 0 4px 4px 0;
    background: var(--color-primary);
}

.ds-growth-bar.is-before {
    background: #7ab9cc;
}

/* États d'animation : « armé » (avant l'arrivée à l'écran) puis joué. Sans script, rien de tout
   ça ne s'applique et le rendu final reste affiché. */
.data-story.is-armed .ds-battery-fill {
    height: 4px;
}

.data-story.is-armed .ds-house.is-lit {
    fill: var(--color-border);
}

.data-story.is-armed .ds-growth-bar {
    width: 0;
}

.data-story.is-armed .ds-sun-rays {
    opacity: 0;
    transform: scale(0.6) rotate(-30deg);
}

.data-story.is-armed .ds-sun-halo {
    opacity: 0;
}

.data-story.is-in .ds-battery-fill {
    transition: height 1600ms var(--ease-out) 150ms;
}

.data-story.is-in .ds-house {
    transition: fill 320ms var(--ease-out);
}

.data-story.is-in .ds-house:nth-child(1) { transition-delay: 200ms; }
.data-story.is-in .ds-house:nth-child(2) { transition-delay: 300ms; }
.data-story.is-in .ds-house:nth-child(3) { transition-delay: 400ms; }
.data-story.is-in .ds-house:nth-child(4) { transition-delay: 500ms; }
.data-story.is-in .ds-house:nth-child(5) { transition-delay: 600ms; }
.data-story.is-in .ds-house:nth-child(6) { transition-delay: 700ms; }
.data-story.is-in .ds-house:nth-child(7) { transition-delay: 800ms; }
.data-story.is-in .ds-house:nth-child(8) { transition-delay: 900ms; }
.data-story.is-in .ds-house:nth-child(9) { transition-delay: 1000ms; }
.data-story.is-in .ds-house:nth-child(10) { transition-delay: 1100ms; }

.data-story.is-in .ds-growth-bar {
    transition: width 1100ms var(--ease-out) 250ms;
}

.data-story.is-in .ds-growth-bar:not(.is-before) {
    transition-delay: 650ms;
}

.data-story.is-in .ds-sun-rays {
    transition: opacity 1200ms var(--ease-out), transform 1600ms var(--ease-out);
}

.data-story.is-in .ds-sun-halo {
    transition: opacity 1400ms var(--ease-out) 200ms;
}

/* ---- « Les mêmes panneaux » : comparaison de trois communes (accueil) ---- */

.content-main > .sun-compare {
    max-width: 60rem;
}

.sun-compare {
    display: block;
    margin: 1rem 0 0;
    padding: 0;
    border: 0;
}

.sun-compare h2 {
    max-width: 30ch;
    font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem);
}

.sc-intro {
    max-width: var(--measure);
    color: var(--color-ink-soft);
    font-size: 1.08rem;
}

.sc-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 2rem 0 1.5rem;
    border-top: 1px solid var(--color-border-strong);
    border-bottom: 1px solid var(--color-border);
}

.sc-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem 1rem 1.75rem;
    color: var(--color-ink);
    text-align: center;
    text-decoration: none;
    transition: background-color 200ms var(--ease-out);
}

.sc-item + .sc-item {
    border-left: 1px solid var(--color-border);
}

.sc-item:hover {
    background: oklch(0.975 0.02 80);
    color: var(--color-ink);
}

.sc-caption {
    color: var(--color-ink-muted);
    font-size: 0.85rem;
    font-weight: 600;
}

.sc-sun {
    width: calc(4.5rem + var(--sun) * 3rem);
    height: 7.5rem; /* hauteur fixe : les noms restent alignés quelle que soit la taille du soleil */
    margin: 0.5rem 0;
    overflow: visible;
    filter: drop-shadow(0 0 calc(var(--sun) * 18px) oklch(0.85 0.14 80 / 0.9));
}

.sc-place {
    font-weight: 600;
}

.sc-value {
    margin-top: 0.5rem;
    font-size: clamp(1.7rem, 1.3rem + 1.4vw, 2.4rem);
    font-weight: 600;
    line-height: 1.05;
}

.sc-unit {
    color: var(--color-ink-muted);
    font-size: 0.85rem;
}

.sc-meter {
    position: relative;
    width: 100%;
    max-width: 12rem;
    height: 10px;
    margin: 1rem 0 0.5rem;
    border-radius: 999px;
    background: var(--color-primary-tint);
    overflow: hidden;
}

.sc-meter-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: var(--fill);
    border-radius: 999px;
    background: var(--color-primary);
}

.sc-share {
    max-width: 14rem;
    color: var(--color-ink-soft);
    font-size: 0.88rem;
    line-height: 1.4;
}

.sc-strip {
    margin: 0 0 1rem;
}

.sc-strip figcaption {
    margin-bottom: 0.4rem;
    color: var(--color-ink-soft);
    font-size: 0.9rem;
    font-weight: 600;
}

.sc-strip svg {
    display: block;
    width: 100%;
    height: auto;
}

.sc-strip-ticks line {
    stroke-width: 1;
    stroke-opacity: 0.55;
}

.sc-strip-markers circle {
    fill: var(--color-ink);
    stroke: var(--color-surface);
    stroke-width: 2;
}

.sc-strip-scale {
    display: flex;
    justify-content: space-between;
    color: var(--color-ink-muted);
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
}

.sc-cta {
    margin: 0.5rem 0 0.75rem;
    font-weight: 600;
}

.data-story.is-armed .sc-meter-fill {
    width: 0;
}

.data-story.is-armed .sc-sun {
    transform: scale(0.75);
    opacity: 0.4;
}

.data-story.is-armed .sc-strip-ticks {
    clip-path: inset(0 100% 0 0);
}

.data-story.is-armed .sc-strip-markers {
    opacity: 0;
}

.data-story.is-in .sc-sun {
    transition: transform 1200ms var(--ease-out), opacity 900ms var(--ease-out);
}

.data-story.is-in .sc-item:nth-child(2) .sc-sun { transition-delay: 150ms; }
.data-story.is-in .sc-item:nth-child(3) .sc-sun { transition-delay: 300ms; }

.data-story.is-in .sc-meter-fill {
    transition: width 1400ms var(--ease-out) 300ms;
}

.data-story.is-in .sc-strip-ticks {
    transition: clip-path 1600ms var(--ease-out) 400ms;
}

.data-story.is-in .sc-strip-markers {
    transition: opacity 500ms var(--ease-out) 1700ms;
}

@media (max-width: 40rem) {
    .sc-grid {
        grid-template-columns: 1fr;
    }

    .sc-item + .sc-item {
        border-left: 0;
        border-top: 1px solid var(--color-border);
    }
}

/* ---- Graphique d'ensoleillement (accueil) ---- */

.sun-chart {
    --sun-bar: oklch(0.66 0.15 62); /* 3,2:1 sur blanc : seuil des éléments graphiques */
    --label-col: minmax(9rem, 15rem);
    max-width: 52rem;
}

.sun-chart h3 {
    margin: 1.5rem 0 0.4rem;
    color: var(--color-ink-soft);
    font-size: 0.95rem;
    font-weight: 600;
}

.bar-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.bar-list a {
    display: grid;
    grid-template-columns: var(--label-col) 1fr 3.2rem;
    align-items: center;
    gap: 0.75rem;
    padding: 0.2rem 0;
    color: var(--color-ink);
    text-decoration: none;
}

.bar-label {
    overflow: hidden;
    font-size: 0.93rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bar-track {
    position: relative;
    height: 18px;
    background:
        linear-gradient(to right, var(--color-border) 1px, transparent 1px) 0 0 / 25% 100%;
}

.bar {
    display: block;
    height: 100%;
    border-radius: 0 4px 4px 0;
    background: var(--sun-bar);
    transition: filter 160ms var(--ease-out);
}

.bar-value {
    color: var(--color-ink-soft);
    font-size: 0.88rem;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.bar-list a:hover .bar,
.bar-list a:focus-visible .bar {
    filter: brightness(0.88);
}

.bar-list a:hover .bar-label {
    color: var(--color-primary);
    text-decoration: underline;
}

.bar-axis {
    display: grid;
    grid-template-columns: var(--label-col) 1fr 3.2rem;
    gap: 0.75rem;
    margin-top: 0.35rem;
    color: var(--color-ink-muted);
    font-size: 0.78rem;
}

.bar-axis-ticks {
    position: relative;
    height: 1.1rem;
    border-top: 1px solid var(--color-border-strong);
}

.bar-axis-ticks span {
    position: absolute;
    top: 0.2rem;
    transform: translateX(-50%);
    font-variant-numeric: tabular-nums;
}

.bar-axis-ticks span:first-child {
    transform: none;
}

.bar-axis-ticks span:last-child {
    transform: translateX(-100%);
}

.sun-chart h2 {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.sun-chart h2::before {
    content: "";
    flex: none;
    width: 1.1em;
    height: 1.1em;
    border-radius: 50%;
    background: var(--color-sun);
    box-shadow: 0 0 0 0.22em oklch(0.93 0.06 80);
}

.bar-axis-unit {
    padding-top: 0.2rem;
    padding-left: 0.5rem;
    text-align: right;
    white-space: nowrap;
}

@media (max-width: 34rem) {
    .sun-chart {
        --label-col: minmax(6.5rem, 9rem);
    }

    .bar-axis-ticks span:nth-child(even) {
        display: none;
    }
}

/* ---- Guides (accueil) ---- */

.guide-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
    gap: 1.5rem 1.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.guide-list a {
    display: block;
    color: var(--color-ink);
    text-decoration: none;
}

.guide-list img,
.guide-placeholder {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 2;
    border-radius: var(--radius);
    object-fit: cover;
    transition: opacity 160ms var(--ease-out);
}

.guide-placeholder {
    background:
        radial-gradient(circle at 50% 46%, var(--color-sun) 0 14%, transparent 14.5%),
        var(--color-primary-tint);
}

.guide-title {
    display: block;
    margin-top: 0.6rem;
    font-weight: 600;
    line-height: 1.35;
}

.guide-list a:hover .guide-title {
    color: var(--color-primary);
    text-decoration: underline;
}

.guide-list a:hover img {
    opacity: 0.9;
}

/* ---- Carte des départements (accueil) ---- */

.departments > p {
    max-width: var(--measure);
    color: var(--color-ink-soft);
}

.map-figure {
    margin: 1rem 0 0;
}

.map-frame {
    position: relative;
    max-width: 38rem;
}

.dept-map {
    display: block;
    width: 100%;
    height: auto;
}

.dept path {
    stroke: var(--color-surface);
    stroke-width: 0.8;
    stroke-linejoin: round;
}

.dept-empty path,
.swatch.dept-empty {
    fill: oklch(0.93 0.005 225);
    background: oklch(0.93 0.005 225);
}

.dept-1 path, .swatch.dept-1 { fill: #7ab9cc; background: #7ab9cc; }
.dept-2 path, .swatch.dept-2 { fill: #4899af; background: #4899af; }
.dept-3 path, .swatch.dept-3 { fill: #15788e; background: #15788e; }
.dept-4 path, .swatch.dept-4 { fill: #005569; background: #005569; }

a.dept path {
    cursor: pointer;
    transition: filter 140ms var(--ease-out);
}

a.dept:hover path,
a.dept:focus path {
    filter: brightness(1.18);
    stroke: var(--color-ink);
    stroke-width: 1.4;
}

a.dept:focus {
    outline: none;
}

.map-tooltip {
    position: absolute;
    z-index: 2;
    transform: translate(-50%, calc(-100% - 6px));
    border-radius: 6px;
    background: var(--color-ink);
    padding: 0.3rem 0.6rem;
    color: var(--color-primary-ink);
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    pointer-events: none;
}

.map-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.1rem;
    margin: 0.9rem 0 0;
    padding: 0;
    color: var(--color-ink-soft);
    font-size: 0.85rem;
    list-style: none;
}

.map-legend li {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.swatch {
    display: inline-block;
    width: 0.9rem;
    height: 0.9rem;
    border-radius: 3px;
}

.map-figure figcaption {
    margin-top: 0.5rem;
    color: var(--color-ink-muted);
    font-size: 0.78rem;
}

.region-list {
    margin-top: 1.75rem;
    border-top: 1px solid var(--color-border);
}

.region-list summary {
    padding: 0.9rem 0;
    color: var(--color-primary);
    font-weight: 600;
    cursor: pointer;
}

.region-list h3 {
    margin: 1.25rem 0 0.4rem;
    font-size: 1rem;
    font-weight: 600;
}

/* ---- Mise en relation ---- */

/* ---- Calculateur (app/View/SolarCalculator.php) ---- */

.calc-intro {
    max-width: var(--measure);
    color: var(--color-ink-soft);
}

.calc-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 1.5rem 2rem;
    align-items: start;
    margin-top: 1.25rem;
}

.calc-form {
    display: grid;
    gap: 1.5rem;
}

.calc-group {
    display: grid;
    gap: 1rem;
    margin: 0;
    padding: 1.1rem 1.2rem 1.25rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
    min-width: 0;
}

.calc-group > legend {
    padding: 0 0.4rem;
    margin-left: -0.4rem;
    color: var(--color-ink);
    font-size: 1.05rem;
    font-weight: 600;
}

.calc-label {
    display: block;
    margin-bottom: 0.45rem;
    color: var(--color-ink-soft);
    font-size: 0.93rem;
    font-weight: 600;
}

.calc-input {
    margin-top: 0.75rem;
}

.calc-input label {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--color-ink-soft);
    font-size: 0.93rem;
    font-weight: 600;
}

.calc-suffix {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-ink-soft);
}

.calc-suffix input {
    width: 8.5rem;
    min-height: 2.75rem;
    padding: 0.45rem 0.7rem;
    border: 1px solid var(--color-border-strong);
    border-radius: 8px;
    background: var(--color-surface);
    color: var(--color-ink);
    font: inherit;
    font-variant-numeric: tabular-nums;
}

.calc-suffix input:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 1px;
}

.calc-field {
    margin: 0;
    padding: 0;
    border: 0;
    min-width: 0;
}

.calc-field legend,
.calc-field > label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--color-ink);
    font-weight: 600;
}

.calc-field.is-disabled {
    opacity: 0.45;
}

.calc-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.calc-option {
    position: relative;
    display: inline-flex;
}

.calc-option input {
    position: absolute;
    opacity: 0;
    inset: 0;
    margin: 0;
    cursor: pointer;
}

.calc-option span {
    display: inline-flex;
    align-items: center;
    min-height: 2.5rem;
    padding: 0.4rem 0.9rem;
    border: 1px solid var(--color-border-strong);
    border-radius: 999px;
    background: var(--color-surface);
    color: var(--color-ink-soft);
    font-size: 0.93rem;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.calc-option input:checked + span {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: var(--color-primary-ink);
}

.calc-option input:focus-visible + span {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.calc-field input[type="range"] {
    width: 100%;
    accent-color: var(--color-primary);
}

.calc-field output {
    color: var(--color-primary);
}

.calc-help {
    margin: 0.4rem 0 0;
    color: var(--color-ink-muted);
    font-size: 0.88rem;
}

.calc-result {
    position: sticky;
    top: 5rem;
    padding: clamp(1.1rem, 2.5vw, 1.6rem);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
}

.calc-headline {
    margin: 0;
}

.calc-big {
    color: var(--color-ink);
    font-size: clamp(2.2rem, 1.6rem + 2vw, 3rem);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    line-height: 1.05;
}

.calc-unit {
    color: var(--color-ink-soft);
    font-weight: 600;
}

.calc-range {
    margin: 0.4rem 0 1rem;
    color: var(--color-ink-soft);
    font-size: 0.93rem;
}

.calc-money {
    margin: 0;
    border-top: 1px solid var(--color-border);
}

.calc-money > div {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.25rem 1rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--color-border);
}

.calc-money dt {
    color: var(--color-ink-soft);
    font-size: 0.93rem;
}

.calc-money dd {
    margin: 0;
    color: var(--color-ink);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.calc-money .calc-total dt {
    color: var(--color-ink);
    font-weight: 600;
}

.calc-money .calc-total dd {
    color: var(--color-primary);
    font-size: 1.15rem;
}

.calc-kicker {
    margin: 0 0 0.25rem;
    color: var(--color-primary);
    font-size: 0.93rem;
    font-weight: 600;
}

.calc-verdict,
.calc-why,
.calc-note {
    margin: 0.9rem 0 0;
    color: var(--color-ink-soft);
    font-size: 0.93rem;
}

.calc-note {
    padding-top: 0.8rem;
    border-top: 1px solid var(--color-border);
}

.calc-headline + .calc-money {
    margin-top: 1rem;
}

.calc-table {
    width: 100%;
    margin-top: 1.1rem;
    border-collapse: collapse;
    font-size: 0.9rem;
    font-variant-numeric: tabular-nums;
}

.calc-table caption {
    margin-bottom: 0.4rem;
    color: var(--color-ink);
    font-weight: 600;
    text-align: left;
}

.calc-table th,
.calc-table td {
    padding: 0.5rem 0.4rem;
    border-bottom: 1px solid var(--color-border);
    text-align: left;
}

.calc-table thead th {
    color: var(--color-ink-muted);
    font-size: 0.82rem;
    font-weight: 600;
}

.calc-table tr.is-recommended {
    background: var(--color-primary-tint);
}

.calc-badge {
    display: inline-block;
    margin-left: 0.3rem;
    padding: 0.05rem 0.45rem;
    border-radius: 999px;
    background: var(--color-primary);
    color: var(--color-primary-ink);
    font-size: 0.72rem;
    font-weight: 600;
    vertical-align: 0.1em;
}

.calc-warning {
    margin: 0.8rem 0 0;
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    background: oklch(0.95 0.04 80);
    color: oklch(0.36 0.07 65);
    font-size: 0.88rem;
}

.calc-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 2.9rem;
    margin-top: 1.1rem;
    padding: 0.6rem 1rem;
    border-radius: 999px;
    background: var(--color-primary);
    color: var(--color-primary-ink);
    font-weight: 600;
    text-align: center;
    text-decoration: none;
}

.calc-cta:hover {
    background: var(--color-primary-hover);
}

@media (max-width: 52rem) {
    /* minmax(0, …) : une colonne 1fr ne descend pas sous la largeur de la rangée d'orientations,
     * d'où 7 px de débordement à 390 px de large. */
    .calc-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .calc-result {
        position: static;
    }
}

.lead-section {
    margin-top: 3.5rem;
    border-radius: var(--radius);
    background: var(--color-primary-tint);
    padding: clamp(1.25rem, 3vw, 2.25rem);
}

.lead-section > h2 {
    margin-top: 0;
}

.lead-section > p {
    max-width: var(--measure);
    color: var(--color-ink-soft);
}

.quote-form {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
    box-shadow: none;
    padding: clamp(1rem, 3vw, 1.75rem);
}

.form-grid {
    gap: 1rem 1.25rem;
}

label {
    color: var(--color-ink);
    font-size: 0.93rem;
    font-weight: 600;
}

input,
select,
textarea {
    min-height: 3rem;
    border: 1px solid var(--color-border-strong);
    border-radius: 8px;
    background: var(--color-surface);
    color: var(--color-ink);
    transition: border-color 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-tint);
}

.consent {
    color: var(--color-ink-soft);
    font-size: 0.9rem;
    line-height: 1.5;
    font-weight: 400;
}

.consent input {
    width: 1.15rem;
    min-height: 0;
    height: 1.15rem;
    vertical-align: -0.2em;
    accent-color: var(--color-primary);
}

button {
    min-height: 3.1rem;
    border-radius: 8px;
    background: var(--color-primary);
    color: var(--color-primary-ink);
    font-weight: 600;
    font-size: 1rem;
    transition: background-color 160ms var(--ease-out);
}

button:hover {
    background: var(--color-primary-hover);
}

.form-errors {
    border: 1px solid oklch(0.62 0.17 25);
    border-radius: 8px;
    background: oklch(0.97 0.02 25);
}

.delivery-notice {
    margin-top: 1.25rem;
    border: 1px solid var(--color-primary);
    border-radius: var(--radius);
    background: var(--color-surface);
    padding: 1rem 1.25rem;
}

/* ---- Questions fréquentes ---- */

.faq details {
    border-bottom: 1px solid var(--color-border);
}

.faq details:first-of-type {
    border-top: 1px solid var(--color-border);
}

.faq summary {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}

.faq summary::-webkit-details-marker {
    display: none;
}

.faq summary::after {
    content: "+";
    flex: none;
    color: var(--color-primary);
    font-size: 1.3rem;
    line-height: 1;
    transition: transform 200ms var(--ease-out);
}

.faq details[open] summary::after {
    transform: rotate(45deg);
}

.faq details > p,
.faq details > div {
    margin: 0 0 1.1rem;
    color: var(--color-ink-soft);
}

.faq details[open] > p,
.faq details[open] > div {
    animation: faq-reveal 260ms var(--ease-out);
}

@keyframes faq-reveal {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
}

/* ---- Sources ---- */

.sources ul {
    padding-left: 1.2rem;
    color: var(--color-ink-muted);
    font-size: 0.9rem;
}

/* ---- Pied de page ---- */

.site-footer {
    margin-top: 4rem;
    background: var(--color-ink);
    padding: 3.5rem max(1rem, calc((100% - 72rem) / 2)) 1.75rem;
    color: oklch(0.82 0.012 235);
    font-size: 0.92rem;
    line-height: 1.55;
}

.footer-inner {
    display: grid;
    grid-template-columns: minmax(16rem, 1.05fr) minmax(0, 2.2fr) minmax(10rem, 0.85fr) minmax(11rem, 0.95fr);
    gap: 2.5rem 3rem;
}

.site-footer .brand,
.site-footer .brand-mark {
    color: oklch(0.98 0.004 235);
}

.site-footer li {
    text-wrap: wrap;
}

.site-footer .link-button {
    min-height: 0;
    padding: 0;
    border: 0;
    background: none;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
    vertical-align: baseline;
}

.footer-brand p {
    margin: 0.9rem 0 1.25rem;
    max-width: 30ch;
}

.footer-cta {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    padding: 0.55rem 1.1rem;
    border-radius: 999px;
    background: var(--color-sun);
    color: var(--color-ink);
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.footer-cta:hover {
    background: oklch(0.84 0.13 78);
}

.footer-col h2 {
    margin: 0 0 0.9rem;
    color: oklch(0.98 0.004 235);
    font-size: 0.98rem;
    font-weight: 600;
    letter-spacing: 0;
}

.footer-col ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.footer-col li + li {
    margin-top: 0.5rem;
}

.footer-guides ul {
    columns: 2;
    column-gap: 2rem;
}

.footer-guides li {
    break-inside: avoid;
}

.footer-guides li + li {
    margin-top: 0;
}

.footer-guides li {
    padding-bottom: 0.5rem;
}

.site-footer .footer-col a,
.site-footer .link-button {
    color: oklch(0.86 0.012 235);
    text-decoration: none;
    text-align: left;
}

.site-footer .footer-col a:hover,
.site-footer .link-button:hover {
    color: oklch(0.98 0.004 235);
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.5rem 2rem;
    margin-top: 3rem;
    padding-top: 1.25rem;
    border-top: 1px solid oklch(0.38 0.02 235);
    color: oklch(0.74 0.014 235);
    font-size: 0.84rem;
}

.footer-bottom p {
    margin: 0;
    max-width: 62ch;
}

@media (max-width: 64rem) {
    .footer-inner {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .footer-brand,
    .footer-guides {
        grid-column: 1 / -1;
    }
}

@media (max-width: 34rem) {
    .footer-inner {
        grid-template-columns: 1fr;
    }

    .footer-guides ul {
        columns: 1;
    }
}

/* ---- Formulaire Leadrs (iframe) ----
 * Le formulaire n'envoie pas sa hauteur à la page : hauteur fixe. Leadrs choisit la version du
 * formulaire selon le produit détecté pour la page ; la version longue (lieu de résidence,
 * propriétaire) mesurée le 6 octobre 2026 fait 848 px à 950 px de large et 948 px à 520 px.
 * Mieux vaut un peu d'espace vide sous la version courte qu'un ascenseur dans la longue. */
.lead-iframe {
    display: block;
    width: 100%;
    height: 900px;
    border: 0;
}

@media (max-width: 52rem) {
    .lead-iframe {
        height: 980px;
    }
}

@media (max-width: 30rem) {
    .lead-iframe {
        height: 1120px;
    }
}

/* ---- Images éditeur (pages légales) ---- */

.content-section img {
    max-width: 100%;
    height: auto;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 1ms !important;
        transition-duration: 1ms !important;
    }
}
