/* =====================================================================
   Blocs ajoutés pour le référencement
   - .secteurs-maillage : liens vers les pages villes (accueil, diagnostics)
   - .seo-ariane, .seo-actions, .seo-associees : pages diagnostics
   - accordéons : intertitre H2 autour du bouton, listes du contenu
   - .page-404 : page introuvable
   ===================================================================== */

/* Titre du bandeau devenu H1 sur certaines pages : même rendu que l'ancien div */
.home-slide h1.title {
    margin-top: 0;
}

/* ------------------------------------------------ icônes
   Remplacent Font Awesome 4 (une police de 78 Ko pour quelques chevrons) : mêmes classes
   « fa fa-... », dessinées en SVG et colorées par la couleur du texte. */

.fa {
    display: inline-block;
    width: 1em;
    height: 1em;
    vertical-align: -.125em;
    font-style: normal;
    background-color: currentColor;
    -webkit-mask: var(--fa-icone) center / contain no-repeat;
    mask: var(--fa-icone) center / contain no-repeat;
}

.fa-angle-right {
    --fa-icone: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 14'><path d='M1.6 1.6 6.4 7l-4.8 5.4' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/></svg>");
    width: .45em;
}

.fa-angle-left {
    --fa-icone: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 14'><path d='M6.4 1.6 1.6 7l4.8 5.4' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/></svg>");
    width: .45em;
}

.fa-arrow-right {
    --fa-icone: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M2 8h12M9 3l5 5-5 5' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>");
}

.fa-arrow-left {
    --fa-icone: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M14 8H2M7 3 2 8l5 5' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>");
}

.fa-times {
    --fa-icone: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M3 3l10 10M13 3 3 13' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/></svg>");
}

.fa-star {
    --fa-icone: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 2.5l2.9 6.1 6.6.8-4.9 4.6 1.3 6.6L12 17.3l-5.9 3.3 1.3-6.6-4.9-4.6 6.6-.8z'/></svg>");
}

.fa-calendar {
    --fa-icone: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'><rect x='3' y='5' width='18' height='16' rx='2'/><path d='M3 10h18M8 3v4M16 3v4'/></svg>");
}

.fa-clock-o {
    --fa-icone: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'><circle cx='12' cy='12' r='9'/><path d='M12 7v5l3 2'/></svg>");
}

.fa-spinner {
    --fa-icone: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round'><path d='M12 3a9 9 0 1 0 9 9'/></svg>");
}

.fa-pulse {
    animation: fa-tourne 1s linear infinite;
}

@keyframes fa-tourne {
    to {
        transform: rotate(360deg);
    }
}

/* chevrons des boutons : même encombrement que l'ancien glyphe */
.btn-1 .icon-btn .fa {
    width: 6px;
    height: 12px;
}

/* ------------------------------------------------ fonds décoratifs chargés à l'approche
   (classes posées par les scripts de head.tpl.php et bas.tpl.php ; sans JavaScript, rien ne change) */

html.js-fonds .service:not(.fond-visible) {
    background-image: none;
    background-color: #156a9a; /* contraste 5,9 avec le texte blanc */
}

html.js-fonds .site-footer:not(.fond-visible) {
    background-image: none;
    background-color: #113345;
}

/* ------------------------------------------------ fil d'Ariane */

.seo-ariane ol {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
    margin: 0 0 18px;
    padding: 0;
    list-style: none;
    font-size: 14px;
    color: #5b6472;
}

.seo-ariane li + li::before {
    content: '›';
    margin-right: 8px;
    color: #3399CC;
}

.seo-ariane a {
    color: #113345;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.seo-ariane a:hover {
    color: #006699;
}

/* ------------------------------------------------ appel à l'action des pages diagnostics */

.seo-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    margin-top: 22px;
}

.seo-actions .seo-btn {
    isolation: isolate;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 50px;
    padding: 0 24px;
    border-radius: 10px;
    font-size: 16px;
    color: #fff;
    box-shadow: 0 14px 28px -14px rgba(0, 102, 153, .75);
}

.seo-actions .seo-btn:hover {
    color: #fff;
}

.seo-tel {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 50px;
    padding: 6px 18px;
    border: 1.5px solid #113345;
    border-radius: 10px;
    font-weight: 700;
    line-height: 1.25;
    color: #113345;
    transition: background-color .3s ease, color .3s ease;
}

.seo-tel strong {
    white-space: nowrap;
}

.seo-tel:hover,
.seo-tel:focus-visible {
    background: #113345;
    color: #fff;
}

/* ------------------------------------------------ accordéons */

/* intertitre H2 qui porte le bouton : il garde l'apparence du bouton d'origine */
.faq-item > .faq-titre {
    margin: 0;
    font: inherit;
    letter-spacing: inherit;
    color: inherit;
}

.faq-question:focus-visible {
    outline: 2px solid #3399CC;
    outline-offset: 4px;
    border-radius: 6px;
}

/* listes du contenu : petits cubes en puce, alignés sur le texte */
.content-img-text .bloc-text ul,
.content-img-text .description ul,
.faq .bloc-text ul {
    margin: 0 0 16px;
    padding: 0;
    list-style: none;
}

.content-img-text .bloc-text li,
.content-img-text .description li,
.faq .bloc-text li {
    position: relative;
    margin: 0 0 6px;
    padding-left: 24px;
}

.content-img-text .bloc-text li::before,
.content-img-text .description li::before,
.faq .bloc-text li::before {
    content: '';
    position: absolute;
    left: 4px;
    top: .62em;
    width: 7px;
    height: 7px;
    border-radius: 2px;
    background: #3399CC;
    transform: rotate(45deg);
}

/* ------------------------------------------------ prestations associées */

.seo-associees {
    margin-top: 36px;
    padding: 26px;
    border-radius: 20px;
    background: #3399CC14;
}

.content-img-text .seo-associees-titre {
    margin: 0 0 16px;
    font-family: 'Alfarn';
    font-size: clamp(18px, .6vw + 1rem, 22px);
    font-weight: 700;
    line-height: 1.25;
    color: #113345;
}

.seo-pastilles {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.content-img-text .seo-pastilles li {
    margin: 0;
    padding: 0;
}

.content-img-text .seo-pastilles li::before {
    display: none;
}

.seo-pastilles a {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 8px 16px;
    border: 1px solid rgba(17, 51, 69, .14);
    border-radius: 999px;
    background: #fff;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    color: #113345;
    transition: border-color .3s ease, color .3s ease;
}

.seo-pastilles a:hover,
.seo-pastilles a:focus-visible {
    border-color: #3399CC;
    color: #006699;
}

@media (max-width: 767.98px) {
    .seo-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .seo-actions .seo-btn,
    .seo-tel {
        width: 100%;
        justify-content: center;
    }

    .seo-associees {
        padding: 20px;
    }
}

/* ------------------------------------------------ secteurs */

.secteurs-maillage {
    padding: clamp(40px, 3vw + 1.5rem, 88px) 0;
}

.secteurs-maillage-in {
    padding: clamp(24px, 3vw + .5rem, 56px);
    border-radius: 24px;
    background: #3399CC14;
}

.secteurs-maillage .section-title .description {
    margin-top: -6px;
    color: var(--c-muted, #5b6472);
}

/* 1re bande : diagnostic immobilier sur toute la largeur ; 2e bande : DPE (3/4) et drone (1/4) */
.secteurs-maillage-groupes {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 32px 40px;
    margin-top: 32px;
}

.secteurs-maillage-groupe:nth-child(1) {
    grid-column: 1 / -1;
}

.secteurs-maillage-groupe:nth-child(2) {
    grid-column: span 3;
}

.secteurs-maillage-groupe summary {
    display: block;
    list-style: none;
    cursor: default;
    pointer-events: none;
}

.secteurs-maillage-groupe summary::-webkit-details-marker {
    display: none;
}

.secteurs-maillage-groupe h3 {
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3399CC55;
    font-family: var(--font);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0;
    color: #113345;
}

.secteurs-maillage-groupe ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.secteurs-maillage-groupe:nth-child(1) ul {
    column-count: 3;
    column-gap: 32px;
}

/* nom de commune jamais coupé à son trait d'union sur grand écran */
@media (min-width: 992px) {
    .secteurs-maillage-groupe a span {
        white-space: nowrap;
    }
}

.secteurs-maillage-groupe:nth-child(2) ul {
    column-count: 3;
    column-gap: 32px;
}

.secteurs-maillage-groupe li {
    break-inside: avoid;
    margin: 0 0 8px;
}

.secteurs-maillage-groupe a {
    position: relative;
    display: inline-block;
    padding-left: 18px;
    font-size: 15px;
    line-height: 1.4;
    color: #113345;
    transition: color .3s ease;
}

/* petit cube en puce, rappel du logo */
.secteurs-maillage-groupe a::before {
    content: '';
    position: absolute;
    left: 2px;
    top: .5em;
    width: 7px;
    height: 7px;
    border-radius: 2px;
    background: #3399CC;
    transform: rotate(45deg);
    transition: background-color .3s ease;
}

.secteurs-maillage-groupe a:hover,
.secteurs-maillage-groupe a:focus-visible {
    color: #006699;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.secteurs-maillage-groupe a:hover::before {
    background: #113345;
}

.secteurs-maillage-lien {
    margin-top: 28px;
    text-align: center;
}

.secteurs-maillage-lien a {
    font-weight: 700;
    color: #006699;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.secteurs-maillage-lien a:hover {
    color: #113345;
}

@media (max-width: 1199.98px) {
    .secteurs-maillage-groupe:nth-child(1) ul,
    .secteurs-maillage-groupe:nth-child(2) ul {
        column-count: 2;
    }
}

@media (max-width: 991.98px) {
    .secteurs-maillage-groupes {
        grid-template-columns: minmax(0, 1fr);
    }

    .secteurs-maillage-groupe:nth-child(n) {
        grid-column: auto;
    }

    .secteurs-maillage-groupe:nth-child(1) ul,
    .secteurs-maillage-groupe:nth-child(2) ul {
        column-count: 2;
    }
}

/* Mobile : chaque groupe se replie (ouvert sans JavaScript) */
@media (max-width: 767.98px) {
    .secteurs-maillage-groupes {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
        margin-top: 24px;
    }

    .secteurs-maillage-groupe {
        border-radius: 14px;
        background: #fff;
    }

    .secteurs-maillage-groupe summary {
        position: relative;
        padding: 14px 44px 14px 18px;
        cursor: pointer;
        pointer-events: auto;
    }

    .secteurs-maillage-groupe summary::after {
        content: '';
        position: absolute;
        right: 20px;
        top: 50%;
        width: 9px;
        height: 9px;
        border-right: 2px solid #113345;
        border-bottom: 2px solid #113345;
        transform: translateY(-70%) rotate(45deg);
        transition: transform .3s ease;
    }

    .secteurs-maillage-groupe[open] summary::after {
        transform: translateY(-30%) rotate(-135deg);
    }

    .secteurs-maillage-groupe h3 {
        margin: 0;
        padding: 0;
        border: 0;
        font-size: 16px;
    }

    .secteurs-maillage-groupe ul,
    .secteurs-maillage-groupe:nth-child(1) ul,
    .secteurs-maillage-groupe:nth-child(2) ul {
        column-count: 1;
        padding: 0 18px 14px;
    }
}

/* ------------------------------------------------ 404 */

.page-404 {
    padding: clamp(40px, 3vw + 1.5rem, 88px) 0 clamp(24px, 2vw + 1rem, 56px);
}

.page-404 .list-btn {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    margin-top: 28px;
}

@media (prefers-reduced-motion: reduce) {
    .secteurs-maillage *,
    .secteurs-maillage *::before,
    .secteurs-maillage *::after {
        transition: none !important;
    }
}
