/* ==========================================================================
   CSS de la page d'accueil (<main> uniquement — header/footer ont leurs
   propres fichiers). Sections dans l'ordre d'affichage : présentation,
   notre histoire, prestations, mosaïque des services, galerie (carrousel),
   chiffres clés, avis clients, zone d'intervention.
   ========================================================================== */

.site-content{
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Eyebrow générique : petit label majuscule au-dessus des titres de section */
.section-eyebrow{
    display: inline-block;
    font-family: var(--font-family-base);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-primary-dark);
}


/* ==========================================================================
   1. Présentation
   ========================================================================== */

.section-presentation{
    padding: var(--space-2xl) var(--space-lg);
    background-color: var(--color-background);
}

.presentation-inner{
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);

    max-width: 760px;
    margin: 0 auto;
    text-align: center;
}

.presentation-title{
    font-family: var(--font-family-heading);
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    font-weight: 800;
    line-height: 1.2;
    color: var(--color-text);
}

.presentation-text{
    font-family: var(--font-family-base);
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--color-text-soft);
}

.presentation-pillars{
    display: flex;
    flex-direction: row;
    gap: var(--space-md);
    margin-top: var(--space-sm);
}

.presentation-pillar{
    display: flex;
    align-items: center;
    gap: var(--space-xs);

    padding: var(--space-sm) var(--space-lg);
    border: 1px solid var(--color-border);
    border-radius: 999px;

    font-family: var(--font-family-base);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--color-text);

    cursor: default;
    transition: transform 0.3s ease, background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.presentation-pillar svg{
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    transition: transform 0.3s ease;
}

.presentation-pillar:hover{
    transform: scale(1.06);
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-text-inverse);
}

.presentation-pillar:hover svg{
    transform: rotate(-6deg) scale(1.1);
}


/* ==========================================================================
   2. Notre histoire
   ========================================================================== */

.section-histoire{
    padding: var(--space-2xl) var(--space-lg);
    background-color: var(--color-hero-background);
}

.histoire-inner{
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);

    max-width: 760px;
    margin: 0 auto;
    text-align: center;
}

.histoire-title{
    font-family: var(--font-family-heading);
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    font-weight: 800;
    line-height: 1.2;
    color: var(--color-text);
}

.histoire-text{
    font-family: var(--font-family-base);
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--color-text-soft);
}

.histoire-highlights{
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-md);
    margin-top: var(--space-sm);
}


/* ==========================================================================
   3. Prestations
   ========================================================================== */

.section-prestations{
    padding: var(--space-2xl) var(--space-lg);
    background-color: var(--color-surface-alt);
}

.prestations-header{
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2xs);

    max-width: 700px;
    margin: 0 auto var(--space-2xl) auto;
    text-align: center;
}

.prestations-title{
    font-family: var(--font-family-heading);
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    font-weight: 800;
    line-height: 1.2;
    color: var(--color-text);
}

.prestations-grid{
    display: flex;
    flex-direction: row;
    gap: var(--space-xl);

    max-width: 1100px;
    margin: 0 auto;
}

.prestation-card{
    display: flex;
    flex-direction: column;
    flex: 1 1 50%;
    gap: var(--space-lg);

    padding: var(--space-lg);
    border-radius: var(--radius-large);
    background-color: var(--color-surface);
    box-shadow: var(--shadow-soft);

    transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.prestation-card:hover{
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(31, 33, 27, 0.14);
}

.prestation-card-media{
    position: relative;
    /* espace pour laisser respirer la vignette qui déborde en bas */
    margin-bottom: var(--space-lg);
}

.prestation-card-media-main{
    display: block;
    width: 100%;
    height: 260px;
    object-fit: cover;
    border-radius: var(--radius-medium);
    transition: transform 0.4s ease;
}

.prestation-card:hover .prestation-card-media-main{
    transform: scale(1.03);
}

/* Deux vignettes côte à côte qui débordent en bas de la photo principale */
.prestation-card-accents{
    position: absolute;
    left: var(--space-lg);
    right: var(--space-lg);
    bottom: calc(-1 * var(--space-lg));

    display: flex;
    gap: var(--space-sm);
}
.special-card-custom-acceuil{
    flex: 1 1 50%;
}

.prestation-card-media-accent{
    flex: 1 1 50%;
    height: 110px;
    object-fit: cover;
    border-radius: var(--radius-medium);
    border: 4px solid var(--color-surface);
    box-shadow: var(--shadow-soft);

    transition: transform 0.4s ease;
}

.prestation-card:hover .prestation-card-media-accent:nth-child(1){
    transform: scale(1.08) rotate(-2deg);
}

.prestation-card:hover .prestation-card-media-accent:nth-child(2){
    transform: scale(1.08) rotate(2deg);
}

.prestation-card-title{
    font-family: var(--font-family-heading);
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--color-text);
}

.prestation-card-list{
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.prestation-card-list li{
    position: relative;
    padding-left: var(--space-md);

    font-family: var(--font-family-base);
    font-size: 0.95rem;
    line-height: 1.4;
    color: var(--color-text-soft);
}

.prestation-card-list li::before{
    content: "";
    position: absolute;
    left: 0;
    top: 0.55em;

    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--color-accent);
}

.prestation-card-cta{
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    align-self: flex-start;
    margin-top: auto;

    font-family: var(--font-family-base);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--color-primary-dark);
    text-decoration: none;
}

.prestation-card-cta svg{
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

.prestation-card-cta:hover{
    color: var(--color-accent-dark);
}

.prestation-card-cta:hover svg{
    transform: translateX(4px);
}


/* ==========================================================================
   4. Mosaïque des services (chaque tuile ancre vers sa carte prestation)
   ========================================================================== */

.section-mosaic{
    padding: var(--space-2xl) var(--space-lg);
    background-color: var(--color-surface-alt);
}

.mosaic-header{
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2xs);

    max-width: 700px;
    margin: 0 auto var(--space-2xl) auto;
    text-align: center;
}

.mosaic-title{
    font-family: var(--font-family-heading);
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    font-weight: 800;
    line-height: 1.2;
    color: var(--color-text);
}

.mosaic-grid{
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);

    max-width: 1100px;
    margin: 0 auto;
}

/* Tuile cliquable : image + libellé, scale au survol, petit "press" au clic pour le retour tactile */
.mosaic-tile{
    position: relative;
    display: block;

    height: 220px;
    border-radius: var(--radius-medium);
    overflow: hidden;
    text-decoration: none;

    box-shadow: var(--shadow-soft);
    transition: transform 0.2s ease;
}

.mosaic-tile img{
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.mosaic-tile::after{
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 40%, rgba(5, 5, 5, 0.75) 100%);
}

.mosaic-tile-label{
    position: absolute;
    left: var(--space-md);
    bottom: var(--space-sm);
    z-index: 1;

    font-family: var(--font-family-heading);
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--color-text-inverse);
}

.mosaic-tile:hover img{
    transform: scale(1.12);
}

.mosaic-tile:active{
    transform: scale(0.96);
}


/* ==========================================================================
   5. Galerie (carrousel réutilisable, voir partials/carousel.ejs)
   ========================================================================== */

.section-galerie{
    padding: var(--space-2xl) var(--space-lg);
    background-color: var(--color-background);
}

.galerie-header{
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2xs);

    max-width: 700px;
    margin: 0 auto var(--space-2xl) auto;
    text-align: center;
}

.galerie-title{
    font-family: var(--font-family-heading);
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    font-weight: 800;
    line-height: 1.2;
    color: var(--color-text);
}

.carousel{
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    border-radius: var(--radius-large);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.carousel-track{
    position: relative;
    width: 100%;
    height: 460px;
}

/* Voile bas pour que les flèches/points restent lisibles quelle que soit la photo */
.carousel-track::after{
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 90px;
    background: linear-gradient(180deg, transparent 0%, rgba(5, 5, 5, 0.45) 100%);
    pointer-events: none;
}

.carousel-slide{
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s ease;
}

.carousel-slide.is-active{
    opacity: 1;
    visibility: visible;
}

.carousel-slide img{
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Légende + bouton "voir le service", optionnels et indépendants (cf. partials/carousel.ejs) */
.carousel-slide-caption{
    position: absolute;
    left: var(--space-lg);
    right: var(--space-lg);
    bottom: 44px;
    z-index: 1;

    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
}

.carousel-slide-text{
    display: inline-flex;
    align-items: center;
    gap: var(--space-2xs);

    font-family: var(--font-family-base);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text-inverse);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

/* Icône optionnelle (image.icon, cf. partials/carousel.ejs) : hérite de currentColor, donc du
   blanc de .carousel-slide-text par défaut. */
.carousel-slide-icon{
    display: inline-flex;
    flex-shrink: 0;
}

.carousel-slide-icon svg{
    width: 16px;
    height: 16px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6));
}

.carousel-slide-button{
    flex-shrink: 0;
    padding: var(--space-2xs) var(--space-sm);
    border-radius: var(--radius-small);

    background-color: var(--color-accent);
    color: var(--color-text);
    font-family: var(--font-family-base);
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;

    transition: background-color 0.3s ease, transform 0.3s ease;
}

.carousel-slide-button:hover{
    background-color: var(--color-accent-dark);
    transform: translateY(-2px);
}

.carousel-arrow{
    position: absolute;
    top: 50%;
    z-index: 1;
    transform: translateY(-50%);

    display: flex;
    align-items: center;
    justify-content: center;

    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    cursor: pointer;

    background-color: color-mix(in srgb, var(--color-surface) 85%, transparent);
    color: var(--color-text);
    box-shadow: var(--shadow-soft);

    transition: transform 0.3s ease, background-color 0.3s ease, color 0.3s ease;
}

.carousel-arrow svg{
    width: 20px;
    height: 20px;
}

.carousel-arrow:hover{
    transform: translateY(-50%) scale(1.1);
    background-color: var(--color-primary);
    color: var(--color-text-inverse);
}

.carousel-arrow--prev{
    left: var(--space-md);
}

.carousel-arrow--next{
    right: var(--space-md);
}

.carousel-dots{
    position: absolute;
    left: 50%;
    bottom: var(--space-md);
    z-index: 1;
    transform: translateX(-50%);

    display: flex;
    gap: var(--space-xs);
}

/* Zone cliquable 24px (accessibilité), point visuel 10px centré dessus */
.carousel-dot{
    position: relative;
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    background: none;
}

.carousel-dot::before{
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.55);

    transition: transform 0.3s ease, background-color 0.3s ease;
}

.carousel-dot.is-active::before{
    background-color: var(--color-accent);
    transform: translate(-50%, -50%) scale(1.25);
}


/* ==========================================================================
   6. Chiffres clés / confiance
   ========================================================================== */

.section-chiffres{
    padding: var(--space-2xl) var(--space-lg);
    background: linear-gradient(160deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: var(--color-text-inverse);
}

.chiffres-header{
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2xs);

    max-width: 700px;
    margin: 0 auto var(--space-2xl) auto;
    text-align: center;
}

.chiffres-header .section-eyebrow{
    color: var(--color-accent);
}

.chiffres-title{
    font-family: var(--font-family-heading);
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    font-weight: 800;
    line-height: 1.2;
}

.chiffres-grid{
    display: flex;
    flex-direction: row;
    justify-content: center;

    max-width: 1100px;
    margin: 0 auto;
}

.chiffre-tile{
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2xs);
    flex: 0 1 200px;

    padding: 0 var(--space-lg);
    text-align: center;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.chiffre-tile:first-child{
    border-left: none;
}

.chiffre-value{
    font-family: var(--font-family-heading);
    font-size: 2rem;
    font-weight: 800;
    color: var(--color-accent);
}

.chiffre-label{
    font-family: var(--font-family-base);
    font-size: 0.85rem;
    font-weight: 600;
    opacity: 0.9;
}

.chiffres-source{
    margin-top: var(--space-xl);
    text-align: center;

    font-family: var(--font-family-base);
    font-size: 0.78rem;
    opacity: 0.65;
}


/* ==========================================================================
   7. Avis clients
   ========================================================================== */

.section-avis{
    padding: var(--space-2xl) var(--space-lg);
    background-color: var(--color-background);
}

.avis-header{
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2xs);

    max-width: 700px;
    margin: 0 auto var(--space-2xl) auto;
    text-align: center;
}

.avis-title{
    display: flex;
    align-items: baseline;
    gap: var(--space-xs);

    font-family: var(--font-family-heading);
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    font-weight: 800;
    color: var(--color-text);
}

.avis-score{
    color: var(--color-primary-dark);
}

.avis-grid{
    display: flex;
    flex-direction: row;
    gap: var(--space-lg);

    max-width: 1100px;
    margin: 0 auto;
}

.avis-card{
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: var(--space-md);
    flex: 1 1 33.33%;

    padding: var(--space-lg);
    border-radius: var(--radius-large);
    border: 1px solid var(--color-border);
    background-color: var(--color-surface);

    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.avis-card:hover{
    transform: translateY(-4px);
    border-color: var(--color-accent);
    box-shadow: var(--shadow-soft);
}

.avis-quote{
    font-family: var(--font-family-base);
    font-size: 0.98rem;
    line-height: 1.55;
    color: var(--color-text);
}

.avis-author{
    font-family: var(--font-family-base);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--color-text-muted);
}

/* Bloc CTA centré, réutilisé en fin de section (avis, zone d'intervention...) */
.section-cta-wrap{
    display: flex;
    justify-content: center;
    margin-top: var(--space-2xl);
}


/* ==========================================================================
   7bis. Questions fréquentes
   (dupliqué depuis service.css : .faq-item/.faq-question/.faq-answer sont
   utilisés sur les pages de service et sur l'accueil, chacune ne charge que
   son propre CSS — même remarque que .section-eyebrow plus haut)
   ========================================================================== */

.section-faq{
    padding: var(--space-2xl) var(--space-lg);
    background-color: var(--color-background);
}

.faq-inner{
    display: flex;
    flex-direction: column;
    gap: var(--space-md);

    max-width: 800px;
    margin: 0 auto;
}

.faq-title{
    font-family: var(--font-family-heading);
    font-size: clamp(1.4rem, 2.4vw, 1.8rem);
    font-weight: 800;
    color: var(--color-text);
    text-align: center;
    margin-bottom: var(--space-sm);
}

.faq-item{
    border: 1px solid var(--color-border);
    border-radius: var(--radius-medium);
    background-color: var(--color-surface);
    overflow: hidden;
}

.faq-question{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);

    padding: var(--space-md) var(--space-lg);
    cursor: pointer;
    list-style: none;

    font-family: var(--font-family-base);
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text);
}

.faq-question::-webkit-details-marker{
    display: none;
}

.faq-question::marker{
    content: "";
}

.faq-question svg{
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    color: var(--color-primary);
    transition: transform 0.3s ease;
}

.faq-item[open] .faq-question svg{
    transform: rotate(180deg);
}

.faq-answer{
    padding: 0 var(--space-lg) var(--space-md) var(--space-lg);

    font-family: var(--font-family-base);
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--color-text-soft);
}


/* ==========================================================================
   8. Zone d'intervention
   ========================================================================== */

.section-zone{
    padding: var(--space-2xl) var(--space-lg);
    background-color: var(--color-surface-alt);
}

.zone-inner{
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);

    max-width: 700px;
    margin: 0 auto;
    text-align: center;
}

/* Pin qui pulse : deux anneaux décalés dans le temps, imitent un radar/localisation */
.zone-pin{
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;

    width: 72px;
    height: 72px;
    margin-bottom: var(--space-xs);
    border-radius: 50%;

    background-color: var(--color-primary);
    color: var(--color-text-inverse);
}

.zone-pin svg{
    position: relative;
    z-index: 1;
    width: 30px;
    height: 30px;
}

.zone-pin::before,
.zone-pin::after{
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid var(--color-primary);
    animation: zone-pin-ping 2.4s ease-out infinite;
}

.zone-pin::after{
    animation-delay: 1.2s;
}

@keyframes zone-pin-ping{
    0%{
        transform: scale(1);
        opacity: 0.7;
    }
    100%{
        transform: scale(1.9);
        opacity: 0;
    }
}

.zone-title{
    font-family: var(--font-family-heading);
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    font-weight: 800;
    line-height: 1.2;
    color: var(--color-text);
}

.zone-text{
    font-family: var(--font-family-base);
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--color-text-soft);
}

.zone-badges{
    display: flex;
    flex-direction: row;
    gap: var(--space-sm);
    margin-top: var(--space-sm);
}

/* Répertoire SSR : l'index alphabétique reste entièrement consultable sans JavaScript.
   La recherche, lorsqu'elle est disponible, filtre simplement les éléments déjà rendus. */
.communes-directory{
    width: 100%;
    margin-top: var(--space-md);
    text-align: left;
}

.communes-directory-title{
    margin-bottom: var(--space-2xs);

    font-family: var(--font-family-heading);
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--color-text);
    text-align: center;
}

.communes-directory-intro,
.communes-directory-status{
    max-width: 620px;
    margin: 0 auto var(--space-md);

    font-family: var(--font-family-base);
    font-size: 0.95rem;
    color: var(--color-text-muted);
    text-align: center;
}

.communes-directory-search{
    display: none;
    max-width: 620px;
    margin: 0 auto var(--space-lg);
}

.communes-directory.is-enhanced .communes-directory-search{
    display: block;
}

.communes-search-label{
    display: block;
    margin-bottom: var(--space-xs);

    font-family: var(--font-family-base);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--color-text);
}

.communes-search-field{
    display: flex;
    align-items: center;
    gap: var(--space-xs);

    min-height: 52px;
    padding: 0 var(--space-sm);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-medium);
    background-color: var(--color-surface);
    box-shadow: var(--shadow-header);
    color: var(--color-primary-dark);

    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.communes-search-field:focus-within{
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(111, 119, 56, 0.2);
}

.communes-search-field svg{
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
}

.communes-search-input{
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;

    font-family: var(--font-family-base);
    font-size: 1rem;
    color: var(--color-text);
}

.communes-search-input::placeholder{
    color: var(--color-text-muted);
    opacity: 1;
}

.communes-search-clear{
    flex: 0 0 auto;
    min-height: 36px;
    padding: 0 var(--space-xs);
    border: 0;
    border-radius: var(--radius-small);
    background-color: transparent;
    cursor: pointer;

    font-family: var(--font-family-base);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-primary-dark);
}

.communes-search-clear:hover{
    background-color: var(--color-background-muted);
}

.communes-search-clear:focus-visible,
.communes-letter-summary:focus-visible{
    outline: 2px solid var(--color-primary-dark);
    outline-offset: 2px;
}

.communes-search-status{
    min-height: 1.5em;
    margin-top: var(--space-xs);

    font-family: var(--font-family-base);
    font-size: 0.9rem;
    color: var(--color-text-soft);
}

.communes-groups{
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(136px, 1fr));
    gap: var(--space-xs);
}

.communes-letter{
    border: 1px solid var(--color-border);
    border-radius: var(--radius-medium);
    background-color: var(--color-surface);
    overflow: hidden;

    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

/* reset.css force `details { display: block }` en règle auteur, ce qui bat la règle navigateur
   `[hidden] { display: none }` (l'origine auteur prime sur l'origine navigateur, quelle que soit la
   spécificité) : sans ce correctif, filter() dans communes-directory.js calcule les bons résultats
   mais aucune commune/lettre n'est réellement masquée visuellement. */
.communes-letter[hidden],
.commune-chip[hidden]{
    display: none;
}

.communes-letter[open]{
    grid-column: 1 / -1;
    border-color: var(--color-primary-light);
    box-shadow: var(--shadow-soft);
}

.communes-letter-summary{
    display: flex;
    align-items: center;
    gap: var(--space-sm);

    min-height: 56px;
    padding: var(--space-xs) var(--space-sm);
    cursor: pointer;
    list-style: none;

    font-family: var(--font-family-base);
    font-weight: 700;
    color: var(--color-text);
}

.communes-letter-summary::-webkit-details-marker{
    display: none;
}

.communes-letter-summary::marker{
    content: "";
}

.communes-letter-key{
    display: flex;
    align-items: center;
    justify-content: center;

    width: 36px;
    height: 36px;
    border-radius: var(--radius-small);

    background-color: var(--color-primary);
    color: var(--color-text-inverse);
    font-family: var(--font-family-heading);
    font-size: 1.1rem;
    font-weight: 800;
}

.communes-letter-count{
    margin-left: auto;
    font-size: 1rem;
    font-weight: 800;
    color: var(--color-text);
}

.communes-letter-label{
    display: none;
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--color-text-muted);
}

.communes-letter-summary svg{
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    color: var(--color-primary);
    transition: transform 0.3s ease;
}

.communes-letter[open] .communes-letter-summary svg{
    transform: rotate(180deg);
}

.communes-letter[open] .communes-letter-key{
    background-color: var(--color-accent);
    color: var(--color-text);
}

.communes-letter[open] .communes-letter-label{
    display: inline;
}

.communes-cloud{
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);

    padding: var(--space-sm);
    border-top: 1px solid var(--color-border);
}

.commune-chip{
    flex: 0 0 auto;
}

.commune-chip-summary{
    display: inline-flex;
    align-items: center;
    min-height: 44px;

    padding: var(--space-sm) var(--space-lg);
    border: 1px solid var(--color-border);
    border-radius: 999px;
    cursor: pointer;
    list-style: none;

    font-family: var(--font-family-base);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--color-text);

    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.commune-chip-summary::-webkit-details-marker{
    display: none;
}

.commune-chip-summary::marker{
    content: "";
}

@media (hover: hover){
    .commune-chip:not([open]):hover .commune-chip-summary{
        background-color: var(--color-primary);
        border-color: var(--color-primary);
        color: var(--color-text-inverse);
    }
}

.commune-chip-summary:focus-visible{
    outline: 2px solid var(--color-primary-dark);
    outline-offset: 2px;
}

.commune-chip[open]{
    flex: 1 0 100%;

    padding: var(--space-sm);
    border: 1px solid var(--color-primary);
    border-radius: var(--radius-medium);
    background-color: var(--color-surface);
}

.commune-chip[open] .commune-chip-summary{
    border-color: var(--color-primary);
    background-color: var(--color-primary);
    color: var(--color-text-inverse);
}

.commune-chip-description{
    padding: var(--space-md) var(--space-sm) var(--space-xs) var(--space-sm);

    font-family: var(--font-family-base);
    color: var(--color-text-soft);
    line-height: 1.6;
}

.commune-chip-description h4{
    margin-bottom: var(--space-2xs);
    font-family: var(--font-family-heading);
    font-size: 1rem;
    color: var(--color-text);
}

.special-test{
    object-position: center 20%
}

/* ==========================================================================
   9. Responsive
   ========================================================================== */

@media (max-width: 1024px){
    .section-presentation,
    .section-histoire,
    .section-prestations,
    .section-mosaic,
    .section-galerie,
    .section-chiffres,
    .section-avis,
    .section-faq,
    .section-zone{
        padding-left: var(--space-md);
        padding-right: var(--space-md);
    }

    .presentation-pillars,
    .histoire-highlights,
    .zone-badges{
        flex-wrap: wrap;
        justify-content: center;
    }

    .prestations-grid{
        gap: var(--space-lg);
    }

    .prestation-card-media-main{
        height: 220px;
    }

    .prestation-card-media-accent{
        height: 92px;
    }

    .mosaic-grid{
        grid-template-columns: repeat(2, 1fr);
        max-width: 760px;
    }

    .mosaic-tile{
        height: 200px;
    }

    .carousel-track{
        height: 380px;
    }

    .chiffres-grid{
        flex-wrap: wrap;
        gap: var(--space-lg) 0;
    }

    .chiffre-tile{
        flex-basis: 50%;
        box-sizing: border-box;
    }

    .chiffre-tile:nth-child(odd){
        border-left: none;
    }

    .avis-grid{
        flex-wrap: wrap;
    }

    .avis-card{
        flex-basis: calc(50% - var(--space-lg));
    }
}

@media (max-width: 640px){
    .section-presentation,
    .section-histoire,
    .section-prestations,
    .section-mosaic,
    .section-galerie,
    .section-chiffres,
    .section-avis,
    .section-faq,
    .section-zone{
        padding: var(--space-xl) var(--space-sm);
    }

    .presentation-header,
    .prestations-header,
    .mosaic-header,
    .galerie-header,
    .chiffres-header,
    .avis-header{
        margin-bottom: var(--space-xl);
    }

    .presentation-title,
    .histoire-title,
    .prestations-title,
    .mosaic-title,
    .galerie-title,
    .chiffres-title,
    .avis-title,
    .faq-title,
    .zone-title{
        font-size: 1.7rem;
    }

    .presentation-text,
    .histoire-text,
    .zone-text{
        font-size: 1rem;
    }

    .presentation-pillars,
    .histoire-highlights,
    .zone-badges{
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .presentation-pillar{
        justify-content: center;
        padding: var(--space-sm) var(--space-md);
        text-align: center;
    }

    .prestations-grid,
    .avis-grid{
        flex-direction: column;
        gap: var(--space-md);
    }

    .prestation-card,
    .avis-card{
        flex-basis: auto;
        padding: var(--space-md);
    }

    .prestation-card-media-main{
        height: 190px;
    }

    .prestation-card-accents{
        left: var(--space-md);
        right: var(--space-md);
        gap: var(--space-xs);
    }

    .prestation-card-media-accent{
        height: 76px;
        border-width: 3px;
    }

    .prestation-card-title{
        font-size: 1.25rem;
    }

    .mosaic-grid{
        grid-template-columns: 1fr;
        gap: var(--space-sm);
    }

    .mosaic-tile{
        height: 180px;
    }

    .carousel{
        border-radius: var(--radius-medium);
    }

    .carousel-track{
        height: 260px;
    }

    .carousel-track::after{
        height: 72px;
    }

    .carousel-arrow{
        width: 36px;
        height: 36px;
    }

    .carousel-arrow--prev{
        left: var(--space-xs);
    }

    .carousel-arrow--next{
        right: var(--space-xs);
    }

    .carousel-dots{
        bottom: var(--space-xs);
        gap: var(--space-2xs);
    }

    .chiffres-grid{
        flex-direction: column;
        gap: var(--space-lg);
    }

    .chiffre-tile{
        flex-basis: auto;
        padding: 0;
        border-left: none;
    }

    .avis-title{
        flex-direction: column;
        align-items: center;
        gap: 0;
    }

    .faq-question{
        align-items: flex-start;
        padding: var(--space-md);
        font-size: 0.95rem;
    }

    .faq-answer{
        padding: 0 var(--space-md) var(--space-md);
    }

    .section-cta-wrap{
        margin-top: var(--space-xl);
    }

    .communes-groups{
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .communes-letter[open]{
        grid-column: 1 / -1;
    }

    .communes-letter-summary{
        min-height: 52px;
    }

    .communes-letter-key{
        width: 34px;
        height: 34px;
    }

    .communes-cloud{
        padding: var(--space-xs);
    }

    .commune-chip-summary{
        padding-right: var(--space-md);
        padding-left: var(--space-md);
    }
}

.service-hero-media--x-70{ --img-x: 70%; }
.service-hero-media--y-30{ --img-y: 50%; }