/* Energielabelkaart EPC theme + components.
   Loads AFTER style.css: this :root keeps the brand variables consistent (AA on white). */
:root {
    --primary: #2e7d2e;        /* energielabel green (AA on white) */
    --primary-dark: #246324;
    --primary-light: #3a9d3a;
    --accent: #2e7d2e;
    --accent-dark: #246324;
}

a { color: var(--primary-dark); }
a:hover { color: var(--primary); }

/* Logo badge (remplace l'image) */
.logo-badge {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: 8px;
    background: var(--primary); color: #fff; font-weight: 800; font-size: 0.85rem;
    letter-spacing: 0.5px;
}
.logo-text strong { color: var(--primary); }

/* ---------- Recherche d'adresse ---------- */
.address-search { position: relative; }
.ctrl-input {
    width: 100%; padding: 11px 14px; border: 2px solid #cfd8dc; border-radius: 8px;
    font-size: 1rem; color: #1a1a1a; background: #fff; box-sizing: border-box;
}
.ctrl-input:focus { outline: none; border-color: var(--primary); }
.ctrl-label { display: block; font-weight: 600; margin-bottom: 6px; color: #022733; }
.btn-block { width: 100%; justify-content: center; margin-top: 10px; }

/* Liste de suggestions — texte foncé explicite (évite blanc-sur-blanc) */
.suggest-list {
    list-style: none; margin: 4px 0 0; padding: 0; position: absolute; z-index: 1200;
    left: 0; right: 0; background: #fff; border: 1px solid #cfd8dc; border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12); max-height: 280px; overflow-y: auto; display: none;
}
.suggest-list.open { display: block; }
.suggest-item {
    padding: 10px 14px; cursor: pointer; color: #1a1a2e; background: #fff;
    border-bottom: 1px solid #f0f2f4; font-size: 0.95rem;
}
.suggest-item:last-child { border-bottom: none; }
.suggest-item:hover { background: #eaf6ef; color: #022733; }

.lookup-box {
    background: #f4f9f6; border: 1px solid #d7ebe0; border-radius: 12px;
    padding: 18px; margin: 18px 0 26px;
}
.lookup-box .btn { margin-top: 12px; }

/* ---------- Badges DPE ---------- */
.result-card {
    background: #fff; border: 1px solid #e3e8ec; border-radius: 14px; padding: 24px;
    box-shadow: 0 4px 16px rgba(0,0,0,.05); margin: 18px 0;
}
.result-addr { color: #4a5a64; margin-bottom: 16px; }
.result-addr strong { color: #022733; font-size: 1.1rem; }
.result-badges { display: flex; gap: 28px; flex-wrap: wrap; margin-bottom: 22px; }
.badge-col { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.badge-title { font-weight: 600; color: #4a5a64; font-size: .9rem; }
.dpe-badge {
    display: inline-flex; align-items: center; justify-content: center;
    width: 72px; height: 72px; border-radius: 12px; font-size: 2.4rem; font-weight: 800;
}
.badge-sub { font-size: .85rem; color: #4a5a64; }

/* Échelle A-G verticale */
.dpe-scale { display: flex; flex-direction: column; gap: 3px; max-width: 360px; margin: 18px 0; }
.dpe-step {
    display: flex; align-items: center; justify-content: space-between;
    padding: 6px 14px; border-radius: 4px; position: relative; font-weight: 700;
}
.dpe-step.is-active { box-shadow: 0 0 0 3px #022733; transform: scale(1.03); }
.dpe-letter { font-size: 1.1rem; }
.dpe-arrow { font-size: 1rem; }

.result-facts { list-style: none; padding: 0; margin: 18px 0; border-top: 1px solid #eef1f3; }
.result-facts li { display: flex; justify-content: space-between; padding: 10px 2px; border-bottom: 1px solid #eef1f3; }
.result-facts li span { color: #4a5a64; }
.result-facts li strong { color: #022733; }

/* ---------- Alertes & CTA ---------- */
.alert { padding: 14px 18px; border-radius: 10px; margin: 18px 0; line-height: 1.5; }
.alert-warn { background: #fff4e5; border: 1px solid #ffcc80; color: #7a4a00; }
.alert-info { background: #eaf2fb; border: 1px solid #b3d1f0; color: #1a3a5a; }
.alert a { color: inherit; text-decoration: underline; font-weight: 600; }

.cta-box {
    background: linear-gradient(135deg, #246324, #2e7d2e); color: #fff;
    border-radius: 14px; padding: 24px; margin: 24px 0;
}
.cta-box h3 { color: #fff; margin-bottom: 8px; }
.cta-box p { color: #e2f0e2; margin-bottom: 16px; }
.cta-box .btn-primary { background: #fff; color: #246324; }

/* ===== Energielabelkaart EPC components ===== */
.ctrl-hint { font-size: .82rem; color: var(--text-muted); margin-top: 8px; line-height: 1.45; }

.map-toggle { display: flex; gap: 8px; }
.toggle-btn {
    flex: 1; padding: 8px 10px; border: 1.5px solid var(--border); background: #fff;
    border-radius: 8px; cursor: pointer; font-size: .9rem; color: var(--text);
}
.toggle-btn.is-active { background: var(--primary); color: #fff; border-color: var(--primary); }

.epc-badge { display: inline-block; padding: 2px 8px; border-radius: 6px; font-weight: 700; }
.epc-badge-none { background: #e0e0e0; color: #555; }

.verdict-card {
    display: flex; gap: 20px; align-items: center; flex-wrap: wrap;
    background: var(--bg-soft); border: 1px solid var(--border); border-radius: 14px;
    padding: 22px; margin: 20px 0;
}
.verdict-badge {
    flex: 0 0 auto; min-width: 120px; text-align: center; border-radius: 12px; padding: 16px 18px;
}
.verdict-badge .vb-class { display: block; font-size: 1.9rem; font-weight: 800; line-height: 1; }
.verdict-badge .vb-sub { display: block; font-size: .8rem; margin-top: 6px; }
.verdict-text { flex: 1 1 260px; }
.verdict-text h2 { margin: 0 0 8px; }

.cta-checker {
    background: linear-gradient(135deg, #246324, #2e7d2e); color: #fff;
    border-radius: 14px; padding: 24px; margin: 24px 0;
}
.cta-checker h2 { color: #fff; margin: 0 0 10px; }
.cta-checker p { color: #e8f3e8; margin-bottom: 12px; }
.cta-checker a:not(.btn) { color: #fff; text-decoration: underline; }
.cta-checker .btn-primary { background: #fff; color: #246324; }
.btn-lg { padding: 12px 22px; font-size: 1.05rem; }

.rank-list { list-style: none; padding: 0; margin: 0; }
.rank-list li { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border-light); }
.rank-pct { padding: 2px 10px; border-radius: 6px; font-weight: 700; font-size: .85rem; }
.prov-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 640px) { .prov-cols { grid-template-columns: 1fr; } }

.search-suggest {
    position: absolute; z-index: 30; left: 0; right: 0; background: #fff;
    border: 1px solid var(--border); border-radius: 8px; margin-top: 4px; box-shadow: var(--shadow);
    overflow: hidden;
}
.search-suggest .sg-item {
    display: block; width: 100%; text-align: left; padding: 10px 12px; border: 0; background: #fff;
    cursor: pointer; color: #1a1a2e; font-size: .95rem;
}
.search-suggest .sg-item:hover { background: var(--bg-soft); }
.search-suggest .sg-label { color: var(--text-muted); font-size: .82rem; }
.address-search { position: relative; }
.subhero-search { max-width: 420px; margin-top: 14px; }

.bl-pct { display: inline-block; margin-top: 8px; padding: 3px 10px; border-radius: 6px; font-weight: 700; font-size: .8rem; }
.commune-tiles-wide { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.ct-meta { display: block; font-size: .78rem; color: var(--text-muted); }
.guide-links { display: flex; flex-wrap: wrap; gap: 10px; }
.guide-links a {
    padding: 8px 14px; background: var(--bg-soft); border: 1px solid var(--border);
    border-radius: 20px; font-size: .9rem;
}
.related-guides { margin: 26px 0; }
.cta-box .btn-primary:hover { background: #6bb89f; color: #022733; }
.cta-box .btn-outline { border-color: #81C7B2; color: #81C7B2; }
.cta-box .btn-outline:hover { background: #81C7B2; color: #022733; }

/* ---------- Barre de répartition A-G ---------- */
.mix-bar {
    display: flex; height: 38px; border-radius: 8px; overflow: hidden; margin: 12px 0;
    border: 1px solid #e3e8ec;
}
.mix-seg { display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; min-width: 2px; }
.mix-legend { display: flex; flex-wrap: wrap; gap: 12px; margin: 8px 0 4px; }
.mix-leg-item { font-size: .85rem; color: #4a5a64; display: inline-flex; align-items: center; gap: 5px; }
.mix-dot { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

/* ---------- Pastilles & tuiles ---------- */
.pct-pill, .ct-pct, .dep-pct, .rt-pct {
    display: inline-block; padding: 3px 10px; border-radius: 20px; font-weight: 700;
    font-size: .85rem; color: #1a1a1a; white-space: nowrap;
}
/* texte blanc sur fonds foncés (orange/rouge) géré inline via config text; ici fond clair => texte foncé par défaut */

.commune-tiles, .dep-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin: 14px 0; }
.commune-tile, .dep-card {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    background: #fff; border: 1px solid #e3e8ec; border-radius: 10px; padding: 12px 14px;
    color: #022733; font-weight: 600;
}
.commune-tile:hover, .dep-card:hover { border-color: var(--primary); color: var(--primary-dark); }
.ct-name, .dep-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.region-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin: 18px 0; }
.region-tile {
    display: flex; align-items: center; justify-content: space-between;
    background: #fff; border: 1px solid #e3e8ec; border-radius: 12px; padding: 16px 18px;
    color: #022733; font-weight: 600; font-size: 1.05rem;
}
.region-tile:hover { border-color: var(--primary); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 14px 0; }
.data-table { width: 100%; border-collapse: collapse; min-width: 480px; }
.data-table th, .data-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #eef1f3; }
.data-table th { background: #f4f9f6; color: #022733; font-weight: 700; font-size: .9rem; }
.data-table tr:hover td { background: #fafcfb; }
.data-table .muted, .muted { color: #6a7a84; font-size: .9rem; }

.search-form { display: flex; gap: 10px; margin: 18px 0; flex-wrap: wrap; }
.search-form input { flex: 1; min-width: 200px; padding: 11px 14px; border: 2px solid #cfd8dc; border-radius: 8px; color: #1a1a1a; background: #fff; }
.search-form input:focus { outline: none; border-color: var(--primary); }

/* ---------- Blocs & FAQ ---------- */
.data-block { margin: 28px 0; }
.data-block h2 { color: #022733; font-size: 1.35rem; margin-bottom: 10px; }
.content-body { margin: 20px auto; line-height: 1.7; color: #2a2a2a; }
.content-body h2 { color: #022733; font-size: 1.35rem; margin: 26px 0 10px; }
.content-body h3 { color: #033140; font-size: 1.12rem; margin: 20px 0 8px; }
.content-body p { margin: 0 0 14px; }
.content-body ul, .content-body ol { margin: 0 0 14px 22px; }
.content-body li { margin-bottom: 6px; }
.lead-intro { font-size: 1.1rem; color: #344; line-height: 1.6; margin: 14px 0 20px; }

.faq-block { margin: 28px 0; }
.faq-block h2 { color: #022733; }
.faq-item { border: 1px solid #e3e8ec; border-radius: 8px; padding: 4px 14px; margin-bottom: 8px; background: #fff; }
.faq-item summary { font-weight: 600; cursor: pointer; padding: 10px 0; color: #022733; }
.faq-item p { padding: 0 0 12px; color: #3a3a3a; margin: 0; }

.related-link { margin: 16px 0; padding: 12px 16px; background: #f4f9f6; border-radius: 8px; }
.disclaimer-note { font-size: .85rem; color: #6a7a84; margin-top: 24px; border-top: 1px solid #eef1f3; padding-top: 12px; }
.status-pill { display: inline-block; padding: 4px 12px; border-radius: 20px; font-weight: 600; font-size: .85rem; }

/* Légende carte (Leaflet) */
.map-legend { background: #fff; padding: 10px 12px; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,.15); font-size: .8rem; line-height: 1.6; color: #1a1a1a; }
.map-legend i { display: inline-block; width: 14px; height: 14px; border-radius: 3px; margin-right: 6px; vertical-align: -2px; }
.commune-popup a { color: var(--primary-dark); font-weight: 600; }

/* Légende sidebar */
.status-legend { display: flex; flex-direction: column; gap: 6px; }
.legend-row { display: flex; align-items: center; gap: 8px; font-size: .88rem; color: #2a2a2a; }
.legend-swatch { width: 18px; height: 18px; border-radius: 4px; flex-shrink: 0; border: 1px solid rgba(0,0,0,.1); }

.city-links { display: flex; flex-wrap: wrap; gap: 6px; }
.city-links a { background: #eaf6ef; color: #1f7a44; padding: 5px 11px; border-radius: 16px; font-size: .85rem; }
.city-links a:hover { background: var(--primary); color: #fff; }

/* Footer en 4 colonnes (grid, pas flex-wrap) */
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2rem; }
@media (max-width: 768px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .result-badges { gap: 18px; justify-content: center; }
    .dpe-badge { width: 60px; height: 60px; font-size: 2rem; }
}
@media (max-width: 480px) {
    .footer-grid { grid-template-columns: 1fr; }
}

/* Mobile overflow safety */
.content-body, .article-body, .subhero, .subhero h1, .page h1, .verdict-text, .lead-intro {
    overflow-wrap: break-word; word-wrap: break-word;
}
.content-body table, .article-body table { display: block; max-width: 100%; overflow-x: auto; }
.content-body img, .article-body img { max-width: 100%; height: auto; }
.subhero-chips { flex-wrap: wrap; }

/* ===== Pro-slag components ===== */
.gem-grid { display: grid; grid-template-columns: 1fr 320px; gap: 26px; align-items: start; }
@media (max-width: 860px) { .gem-grid { grid-template-columns: 1fr; } }
.gem-aside { position: sticky; top: 80px; display: flex; flex-direction: column; gap: 16px; }
.gem-mini-map { height: 240px; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); }
.gem-facts { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; }
.gem-facts h3 { margin: 0 0 10px; font-size: 1rem; }
.gem-facts ul { list-style: none; padding: 0; margin: 0; }
.gem-facts li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border-light); font-size: .92rem; }
.gem-facts li:last-child { border-bottom: 0; }
.gem-facts li span { color: var(--text-muted); }

.compare-row { margin: 12px 0 4px; display: flex; flex-direction: column; gap: 10px; }
.compare-line { display: grid; grid-template-columns: 110px 1fr 46px; align-items: center; gap: 10px; font-size: .92rem; }
.compare-line .cl-bar { background: #eee; border-radius: 6px; height: 14px; overflow: hidden; }
.compare-line .cl-bar span { display: block; height: 100%; border-radius: 6px; }
@media (max-width: 480px) { .compare-line { grid-template-columns: 90px 1fr 42px; } }

.epc-scale-strip { display: flex; gap: 3px; flex-wrap: nowrap; }
.epc-scale-item { flex: 1; min-width: 0; text-align: center; padding: 10px 2px; border-radius: 6px; }
.esi-letter { display: block; font-weight: 800; font-size: 1.05rem; }
.esi-range { display: block; font-size: .66rem; margin-top: 2px; opacity: .9; }
.epc-scale-cap { font-size: .85rem; color: var(--text-muted); margin-top: 10px; }
@media (max-width: 560px) { .esi-range { display: none; } .epc-scale-item { padding: 12px 2px; } }

.cta-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.cta-actions .cta-search { flex: 1 1 240px; max-width: 360px; }
.cta-actions .cta-search .ctrl-input { background: #fff; }
.cta-note { font-size: .88rem; margin-top: 12px; }

.article-wrap { max-width: 780px; margin: 0 auto; }
.toc { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px; margin: 0 0 22px; }
.toc-title { font-weight: 700; margin-bottom: 8px; }
.toc-list { margin: 0; padding-left: 18px; }
.toc-list li { margin: 4px 0; }
.toc-list a { color: var(--primary-dark); }
.article-body h2 { scroll-margin-top: 80px; border-left: 4px solid var(--primary); padding-left: 12px; margin-top: 28px; }
.lead-intro { font-size: 1.08rem; color: #333; line-height: 1.6; margin-bottom: 20px; }

/* ===== Home sections that lacked styling (section-head, howto, feature-cards) ===== */
.map-page-intro { padding: 8px 0 40px; }
.map-page-intro .lead { font-size: 1.1rem; color: #333; line-height: 1.6; max-width: 820px; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 34px 0 16px; flex-wrap: wrap; border-bottom: 2px solid var(--border-light); padding-bottom: 8px; }
.section-head h2 { margin: 0; font-size: 1.5rem; }
.section-head .see-all { font-weight: 600; white-space: nowrap; font-size: .92rem; }

.howto { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 22px 0 8px; }
@media (max-width: 720px) { .howto { grid-template-columns: 1fr; } }
.howto-step { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 14px; padding: 22px 20px 20px; position: relative; }
.howto-step .howto-num { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 800; font-size: 1.1rem; margin-bottom: 12px; }
.howto-step h3 { margin: 0 0 6px; font-size: 1.12rem; }
.howto-step p { margin: 0; color: var(--text-light); font-size: .95rem; line-height: 1.5; }

.feature-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; margin: 8px 0; }
.feature-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; color: var(--text); }
.feature-card:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(0,0,0,.10); color: var(--text); }
.feature-card .fc-thumb { display: block; height: 150px; background-size: cover; background-position: center; background-color: #eef3ee; }
.feature-card .fc-body { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px 18px; }
.feature-card .fc-title { font-weight: 700; font-size: 1.06rem; color: var(--primary-dark); }
.feature-card .fc-desc { font-size: .9rem; color: var(--text-light); line-height: 1.5; }

/* Blog cards on home/blog index */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; margin: 8px 0; }
.blog-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); color: var(--text); transition: transform .15s, box-shadow .15s; }
.blog-card:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(0,0,0,.10); color: var(--text); }
.blog-card .thumb { width: 100%; height: 165px; object-fit: cover; display: block; background: #eef3ee; }
.blog-card .body { padding: 14px 16px 18px; }
.blog-card .body h3 { margin: 0 0 6px; font-size: 1.05rem; line-height: 1.3; }
.blog-card .body p { margin: 0; color: var(--text-light); font-size: .9rem; line-height: 1.5; }

.region-cloud { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }

/* ===== Blog categories: filter pills + nav dropdown + card chip ===== */
.cat-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 24px; }
.cat-pill {
    display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 22px;
    background: #fff; border: 1.5px solid var(--border); color: var(--text); font-size: .92rem; font-weight: 600;
}
.cat-pill:hover { border-color: var(--primary); color: var(--primary-dark); }
.cat-pill.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }
.cat-pill .cat-count { font-size: .78rem; opacity: .8; font-weight: 700; }
.cat-pill.is-active .cat-count { opacity: .95; }

.card-cat { display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .03em; color: var(--primary-dark); margin-bottom: 4px; }
.post-cat { color: var(--primary-dark); font-weight: 700; }

.nav-dropdown { position: relative; display: inline-block; }
.nav-drop-toggle .caret { font-size: .7em; }
.nav-drop-menu {
    position: absolute; top: 100%; left: 0; min-width: 210px; background: #fff;
    border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 28px rgba(0,0,0,.12);
    padding: 8px; display: none; z-index: 1300; margin-top: 6px;
}
.nav-dropdown:hover .nav-drop-menu, .nav-dropdown:focus-within .nav-drop-menu { display: block; }
.nav-drop-menu a { display: flex; justify-content: space-between; gap: 10px; padding: 9px 12px;
    border-radius: 7px; color: var(--text); font-size: .95rem; }
.nav-drop-menu a:hover { background: var(--bg-soft); color: var(--primary-dark); }
.nav-drop-menu .dm-count { color: var(--text-muted); font-size: .8rem; }
@media (max-width: 860px) {
    .nav-drop-menu { position: static; display: block; box-shadow: none; border: 0; padding: 0 0 0 14px; min-width: 0; margin-top: 2px; }
    .nav-dropdown { display: block; }
}
