/*
 * Page d'une actualité, thèmes récents (News/Default/view.html.twig de chaque thème, encart
 * templates/News/Default/_actu_encart.html.twig).
 *
 * Deux mises en page :
 *  - en-tête aligné à gauche (Bocage, Foyer, Institutionnel, Verger, Terrain) : le texte suit le bord gauche du titre, en colonne de
 *    lecture (≈ 65 caractères), l'encart « rendez-vous, rubriques, partage, retour » se place à droite, sous la photo ;
 *  - colonne centrée (.wm-actu--centre : Chaleureux, Sobre) : en-tête et texte dans la même colonne, photo plus large,
 *    encart en bande sous le texte.
 * Couleurs, polices et angles viennent du thème par les variables --wa-* définies plus bas.
 *
 * La page des actualités (News/Default/fil.html.twig) charge aussi cette feuille pour ses rubriques en liens, ses pages et son message
 * « aucune actualité » (.wm-fil, en fin de fichier) : mêmes pastilles que les rubriques de l'encart.
 */

.wm-actu,
.wm-actu-suggestions,
.wm-fil {
    --wa-encre: #1d1d1b;
    --wa-doux: #55534d;
    --wa-accent: #7a4520;
    --wa-surface: #f7f5f1;
    --wa-filet: #ddd6c8;
    --wa-pastille: #fff;
    --wa-rayon: 12px;
    --wa-rayon-pastille: 999px;
    --wa-rayon-partage: 50%;
    --wa-rayon-bouton: 999px;
    --wa-bord-bouton: var(--wa-filet);
    --wa-bord-encart: transparent;
    --wa-police-ui: "Roboto", "Helvetica Neue", Arial, sans-serif;
    --wa-police-texte: "Roboto", "Helvetica Neue", Arial, sans-serif;
    --wa-police-titre: "Roboto Slab", Georgia, serif;
    --wa-gouttiere: clamp(16px, 4vw, 40px);
    --wa-colonne: 660px;
    --wa-taille: 18px;
}

body.wm-theme-chaleureux .wm-actu,
body.wm-theme-chaleureux .wm-actu-suggestions,
body.wm-theme-chaleureux .wm-fil {
    --wa-encre: var(--warm-text, #20241a);
    --wa-doux: var(--warm-muted, #565a4c);
    --wa-accent: var(--theme-secondary-sur-clair, #9a3d1c);
    --wa-surface: #fff;
    --wa-filet: var(--warm-border, #e1c775);
    --wa-bord-encart: var(--warm-border, #e1c775);
    --wa-rayon: var(--warm-forme, 14px);
    --wa-police-titre: var(--warm-title, "Roboto Slab", Georgia, serif);
}

body.wm-theme-bocage .wm-actu,
body.wm-theme-bocage .wm-actu-suggestions,
body.wm-theme-bocage .wm-fil {
    --wa-encre: var(--bc-ink);
    --wa-doux: var(--bc-ink-2);
    --wa-accent: var(--theme-secondary-sur-clair, var(--mfr-prestige));
    --wa-surface: var(--mfr-respect-25);
    --wa-filet: var(--bc-line);
    --wa-rayon: var(--bc-r-s) 0;
    --wa-rayon-pastille: 12px 0;
    --wa-rayon-bouton: 12px 0;
}

body.wm-theme-foyer .wm-actu,
body.wm-theme-foyer .wm-actu-suggestions,
body.wm-theme-foyer .wm-fil {
    --wa-encre: var(--fy-encre);
    --wa-doux: var(--fy-encre-2);
    --wa-accent: var(--fy-ocre-fonce);
    --wa-surface: var(--fy-gris);
    --wa-filet: var(--fy-trait);
    --wa-rayon: var(--fy-r);
    --wa-rayon-pastille: var(--fy-r);
    --wa-rayon-partage: var(--fy-r);
    --wa-rayon-bouton: var(--fy-r);
    --wa-bord-bouton: var(--fy-encre);
}

body.wm-theme-institutionnel .wm-actu,
body.wm-theme-institutionnel .wm-actu-suggestions,
body.wm-theme-institutionnel .wm-fil {
    --wa-encre: var(--in-noir);
    --wa-doux: var(--in-gris);
    --wa-accent: var(--in-or-fonce);
    --wa-surface: var(--in-sable);
    --wa-filet: var(--in-trait);
    --wa-rayon: var(--in-r-l);
}

body.wm-theme-terrain .wm-actu,
body.wm-theme-terrain .wm-actu-suggestions,
body.wm-theme-terrain .wm-fil {
    --wa-encre: #000;
    --wa-doux: #4d4d4d;
    --wa-accent: var(--tr-vert, #45521f);
    --wa-surface: var(--tr-creme-50, #efebe6);
    --wa-filet: rgba(0, 0, 0, .18);
    --wa-rayon: 18px;
    --wa-bord-bouton: #000;
    --wa-police-titre: "Roboto Slab", Georgia, serif;
}

body.wm-theme-verger .wm-actu,
body.wm-theme-verger .wm-actu-suggestions,
body.wm-theme-verger .wm-fil {
    --wa-encre: var(--vg-ink);
    --wa-doux: var(--vg-ink-2);
    --wa-accent: var(--vg-terre);
    --wa-surface: var(--vg-creme);
    --wa-filet: var(--vg-line);
    --wa-rayon: 0;
    --wa-rayon-pastille: 0;
    --wa-rayon-partage: 0;
    --wa-rayon-bouton: 0;
    --wa-bord-bouton: #000;
    --wa-police-texte: var(--vg-f-text);
}

body.wm-theme-sobre .wm-actu,
body.wm-theme-sobre .wm-actu-suggestions,
body.wm-theme-sobre .wm-fil {
    --wa-encre: #1b1b1a;
    --wa-doux: #5b5a56;
    --wa-accent: var(--theme-primary-sur-clair, #6f5420);
    --wa-surface: #f5f4f1;
    --wa-filet: #e3e1dc;
    --wa-rayon: 10px;
}

/* ---------- Ligne « rubriques · date » au-dessus du titre ---------- */

.wm-actu .wm-actu-kicker {
    color: var(--wa-accent);
}

/* ---------- Corps : colonne de lecture et encart (en-tête aligné à gauche) ---------- */

.wm-actu .wm-actu-corps {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 48px;
    align-items: start;
}

@media (min-width: 992px) {
    .wm-actu .wm-actu-corps {
        grid-template-columns: minmax(0, var(--wa-colonne)) minmax(260px, 320px);
        justify-content: space-between;
        column-gap: clamp(48px, 6vw, 120px);
    }
}

/* ---------- Texte de l'actualité ---------- */

body .wm-actu .wm-actu-texte {
    max-width: var(--wa-colonne);
    margin: 0;
    color: var(--wa-encre);
    font-family: var(--wa-police-texte);
    font-size: var(--wa-taille);
    line-height: 1.7;
}

body .wm-actu .wm-actu-texte :is(p, li) {
    font-family: var(--wa-police-texte) !important;
    font-size: var(--wa-taille) !important;
    line-height: 1.7 !important;
    color: var(--wa-encre) !important;
}

body .wm-actu .wm-actu-texte p {
    text-wrap: pretty;
}

body .wm-actu .wm-actu-texte :is(h2, h3) {
    text-wrap: balance;
}

body .wm-actu .wm-actu-texte > :first-child,
body .wm-actu .wm-actu-texte > :first-child > :first-child {
    margin-top: 0 !important;
}

body .wm-actu .wm-actu-texte :is(ul, ol) {
    margin-bottom: 1.3em;
}

body .wm-actu .wm-actu-texte li + li {
    margin-top: .35em;
}

body .wm-actu .wm-actu-texte img {
    max-width: 100%;
    height: auto;
}

/* premier paragraphe .sg-intro de l'éditeur : le chapeau est déjà sous le titre, ce paragraphe reste au corps du texte */
body .wm-actu .wm-actu-texte .sg-intro {
    margin: 0 0 1.1em !important;
    font-family: var(--wa-police-texte) !important;
    font-size: var(--wa-taille) !important;
    font-weight: 400 !important;
    line-height: 1.7 !important;
    color: var(--wa-encre) !important;
}

/* mention de bas d'article (« actualité fictive… ») */
body .wm-actu .wm-actu-texte .sg-fictif {
    margin: 2.2em 0 0 !important;
    font-size: 15px !important;
    font-style: italic;
    color: var(--wa-doux) !important;
}

/* ---------- Encart : rendez-vous, rubriques, partage, retour ---------- */

.wm-actu .wm-actu-encart {
    display: flex;
    flex-direction: column;
    gap: 28px;
    padding: 28px;
    border: 1px solid var(--wa-bord-encart);
    border-radius: var(--wa-rayon);
    background: var(--wa-surface);
    color: var(--wa-encre);
    font-family: var(--wa-police-ui);
}

.wm-actu .wm-actu-encart-bloc {
    margin: 0;
}

.wm-actu .wm-actu-encart-titre {
    margin: 0 0 12px !important;
    font: 700 12px/1.3 var(--wa-police-ui) !important;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--wa-doux) !important;
}

.wm-actu .wm-actu-rdv-date {
    margin: 0 !important;
}

.wm-actu .wm-actu-rdv-date time {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 14px;
    align-items: center;
    line-height: 1.2;
}

.wm-actu .wm-actu-rdv-jour {
    grid-row: span 2;
    font: 900 54.4px/.9 var(--wa-police-ui);
    color: var(--wa-encre);
}

.wm-actu .wm-actu-rdv-mois {
    font: 700 16.8px/1.2 var(--wa-police-ui);
}

.wm-actu .wm-actu-rdv-semaine {
    color: var(--wa-doux);
    font-size: 15.2px;
}

.wm-actu .wm-actu-rubriques,
.wm-actu .wm-actu-partage {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.wm-actu .wm-actu-rubriques li,
.wm-actu .wm-actu-partage li {
    margin: 0;
    padding: 0;
}

.wm-actu .wm-actu-rubriques li::before,
.wm-actu .wm-actu-partage li::before {
    content: none !important;
}

.wm-actu .wm-actu-rubriques a {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 6px 16px;
    border: 1px solid var(--wa-bord-bouton);
    border-radius: var(--wa-rayon-pastille);
    background: var(--wa-pastille);
    color: var(--wa-encre) !important;
    font: 600 15px/1.2 var(--wa-police-ui);
    text-decoration: none !important;
    transition: border-color .15s ease, color .15s ease;
}

.wm-actu .wm-actu-partage a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--wa-bord-bouton);
    border-radius: var(--wa-rayon-partage);
    background: var(--wa-pastille);
    color: var(--wa-encre) !important;
    font-size: 18px;
    text-decoration: none !important;
    transition: border-color .15s ease, color .15s ease;
}

.wm-actu .wm-actu-rubriques a:hover,
.wm-actu .wm-actu-partage a:hover {
    border-color: var(--wa-accent);
    color: var(--wa-accent) !important;
}

.wm-actu .wm-actu-retour {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 0 20px 0 16px;
    border: 1px solid var(--wa-bord-bouton);
    border-radius: var(--wa-rayon-bouton);
    background: var(--wa-pastille);
    color: var(--wa-encre) !important;
    font: 700 15px/1.2 var(--wa-police-ui);
    text-decoration: none !important;
    white-space: nowrap;
    transition: border-color .15s ease, color .15s ease;
}

.wm-actu .wm-actu-retour svg {
    flex: none;
    width: 16px;
    height: 16px;
    transition: transform .15s ease;
}

.wm-actu .wm-actu-retour:hover {
    border-color: var(--wa-accent);
    color: var(--wa-accent) !important;
}

.wm-actu .wm-actu-retour:hover svg {
    transform: translateX(-3px);
}

.wm-actu .wm-actu-retour-bloc {
    padding-top: 20px;
    border-top: 1px solid var(--wa-filet);
}

.wm-actu :is(.wm-actu-rubriques, .wm-actu-partage, .wm-actu-retour-bloc) a:focus-visible {
    outline: 3px solid var(--wa-accent);
    outline-offset: 2px;
}

/* encart en bande sous le texte (colonne centrée) */
.wm-actu .wm-actu-encart--pied {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    column-gap: 48px;
    row-gap: 24px;
    margin-top: 48px;
}

.wm-actu .wm-actu-encart--pied .wm-actu-retour-bloc {
    flex: 1 0 100%;
}

@media (prefers-reduced-motion: reduce) {
    .wm-actu .wm-actu-retour,
    .wm-actu .wm-actu-retour svg,
    .wm-actu .wm-actu-rubriques a,
    .wm-actu .wm-actu-partage a,
    body.wm-theme-sobre .wm-actu-suggestions .news-card {
        transition: none;
    }
}

/* ---------- Colonne centrée (Chaleureux, Sobre) ---------- */

.wm-actu--centre {
    padding: clamp(28px, 4vw, 48px) 0 clamp(56px, 7vw, 96px);
}

.wm-actu--centre :is(.wm-actu-tete, .wm-actu-colonne) {
    box-sizing: content-box;
    max-width: var(--wa-colonne) !important;
    margin-inline: auto !important;
    padding-inline: var(--wa-gouttiere) !important;
}

.wm-actu--centre .wm-actu-colonne .wm-actu-texte {
    max-width: none;
}

.wm-actu--centre .wm-actu-photo {
    box-sizing: content-box;
    max-width: 1040px !important;
    margin: clamp(28px, 4vw, 44px) auto !important;
    padding-inline: var(--wa-gouttiere);
}

.wm-actu--centre .wm-actu-photo img {
    display: block;
    width: 100%;
    height: auto;
    max-height: min(720px, 75vh);
    object-fit: cover;
    border-radius: var(--wa-rayon);
}

.wm-actu-suggestions .wm-actu-large {
    box-sizing: content-box;
    max-width: 1040px;
    margin-inline: auto;
    padding-inline: var(--wa-gouttiere);
}

/* ---------- Sobre : en-tête, photo et suggestions (le thème n'a pas de styles d'article) ---------- */

body.wm-theme-sobre .wm-actu .news-crumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 20px;
    font-size: 15px;
    color: var(--wa-doux);
}

body.wm-theme-sobre .wm-actu .news-crumbs a {
    color: var(--wa-doux) !important;
    text-decoration: none;
}

body.wm-theme-sobre .wm-actu .news-crumbs a:hover {
    color: var(--wa-encre) !important;
    text-decoration: underline;
}

body.wm-theme-sobre .wm-actu .wm-actu-meta {
    margin: 0 0 14px !important;
    font: 700 13px/1.4 var(--wa-police-ui);
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--wa-doux) !important;
}

body.wm-theme-sobre .wm-actu .news-article-title {
    margin: 0 !important;
    font: 700 clamp(33.6px, 22.4px + 2.4vw, 52.8px)/1.1 var(--wa-police-titre) !important;
    letter-spacing: -.01em;
    color: var(--wa-encre) !important;
    text-wrap: balance;
}

body.wm-theme-sobre .wm-actu-texte :is(h2, h3) {
    margin: 1.8em 0 .55em !important;
    font-family: var(--wa-police-titre) !important;
    color: var(--wa-encre) !important;
}

body.wm-theme-sobre .wm-actu-texte h2 {
    font-size: 25.6px !important;
    line-height: 1.25 !important;
}

body.wm-theme-sobre .wm-actu-texte h3 {
    font-size: 20.8px !important;
    line-height: 1.3 !important;
}

body.wm-theme-sobre .wm-actu-texte a {
    color: var(--wa-encre) !important;
    text-decoration: underline;
    text-decoration-color: var(--wa-accent);
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

body.wm-theme-sobre .wm-actu-suggestions {
    padding: clamp(48px, 6vw, 88px) 0;
    background: var(--wa-surface);
}

body.wm-theme-sobre .wm-actu-suggestions .news-suggestions-title {
    margin: 0 0 28px !important;
    font: 700 clamp(25.6px, 20.8px + 1vw, 33.6px)/1.2 var(--wa-police-titre) !important;
    color: var(--wa-encre) !important;
}

body.wm-theme-sobre .wm-actu-suggestions .news-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

body.wm-theme-sobre .wm-actu-suggestions .news-card {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: var(--wa-rayon);
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
    transition: box-shadow .2s ease, transform .2s ease;
}

body.wm-theme-sobre .wm-actu-suggestions .news-card:hover {
    box-shadow: 0 14px 30px -18px rgba(0, 0, 0, .35);
    transform: translateY(-2px);
}

body.wm-theme-sobre .wm-actu-suggestions .news-card-media img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

body.wm-theme-sobre .wm-actu-suggestions .news-card-body {
    padding: 18px 20px 22px;
}

body.wm-theme-sobre .wm-actu-suggestions .news-card-date {
    margin: 0 0 8px !important;
    font: 700 12px/1.3 var(--wa-police-ui);
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--wa-doux) !important;
}

body.wm-theme-sobre .wm-actu-suggestions .news-card-title {
    margin: 0 0 8px !important;
    font: 700 18.4px/1.3 var(--wa-police-titre) !important;
}

body.wm-theme-sobre .wm-actu-suggestions .news-card-title a {
    color: var(--wa-encre) !important;
    text-decoration: none;
}

body.wm-theme-sobre .wm-actu-suggestions .news-card-title a::after {
    content: "";
    position: absolute;
    inset: 0;
}

body.wm-theme-sobre .wm-actu-suggestions .news-card-text {
    margin: 0 !important;
    font-size: 15.2px;
    line-height: 1.55;
    color: var(--wa-doux) !important;
}

@media (max-width: 991.98px) {
    body.wm-theme-sobre .wm-actu-suggestions .news-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .wm-actu,
    .wm-actu-suggestions {
        --wa-taille: 17px;
    }

    body .wm-actu .wm-actu-texte .sg-intro {
        font-size: 19px !important;
    }

    .wm-actu .wm-actu-encart {
        padding: 22px;
    }

    body.wm-theme-sobre .wm-actu-suggestions .news-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Foyer : la ligne « rubriques · date » est posée sur l'aplat ocre de l'en-tête, en noir comme la date */
body.wm-theme-foyer .fy-pagehead .wm-actu-kicker {
    color: inherit;
}

/* Foyer : le chapeau suit le bord gauche du titre ; sous 1100 px, la photo de l'actualité (masquée par le thème dans les
   en-têtes de page) passe sous l'aplat, car c'est un contenu de l'article et non un décor */
body.wm-theme-foyer .wm-actu .fy-pagehead-img .fy-intro {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

@media (max-width: 1099px) {
    body.wm-theme-foyer .wm-actu .fy-pagehead-media {
        display: block;
    }

    body.wm-theme-foyer .wm-actu .fy-pagehead-img .fy-pagehead-copy {
        border-bottom: 0;
    }

    body.wm-theme-foyer .wm-actu .fy-pagehead-media img {
        height: auto;
        aspect-ratio: 16 / 9;
    }
}

/* ---------- Relecture à froid : hiérarchie et finitions ---------- */

/* un seul chapeau, sous le titre, plus fort que le texte */
body .wm-actu--centre .news-article-intro {
    margin: 20px 0 0 !important;
    font: 400 clamp(19px, 17px + .5vw, 22px)/1.55 var(--wa-police-titre) !important;
    color: var(--wa-encre) !important;
    text-wrap: pretty;
}

body .wm-actu .fy-pagehead .fy-intro,
body .wm-actu .in-pagehead .in-intro {
    font-size: 20px !important;
    color: var(--wa-encre) !important;
}

.wm-actu h1 {
    text-wrap: balance;
}

/* ligne « rubriques · date » : un surtitre reste petit à toutes les largeurs */
body .wm-actu :is(.bc-pagehead, .fy-pagehead, .in-pagehead, .vg-pagehead) :is(.bc-news-date, .fy-news-date, .in-news-date, .vg-news-date),
body .wm-actu .tr-pagehead .tr-news-date {
    font-size: 12px !important;
    letter-spacing: .1em !important;
    line-height: 1.5 !important;
}

.wm-actu :is(.wm-actu-meta, .bc-news-date, .fy-news-date, .in-news-date, .vg-news-date, .tr-news-date) time {
    white-space: nowrap;
}

/* fil d'Ariane : le titre de l'actualité, répété juste dessous, n'est gardé que pour les lecteurs d'écran */
.wm-actu :is(.bc-crumbs, .fy-crumbs, .in-crumbs, .tr-crumbs) li[aria-current] {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* intertitres : un cran franc au-dessus du texte, accrochés au texte qui suit */
body:is(.wm-theme-chaleureux, .wm-theme-sobre, .wm-theme-foyer, .wm-theme-verger, .wm-theme-institutionnel, .wm-theme-terrain) .wm-actu .wm-actu-texte h2 {
    margin: 1.8em 0 .5em !important;
    font-size: clamp(23px, 19px + .8vw, 28px) !important;
    line-height: 1.25 !important;
}

body.wm-theme-foyer .wm-actu .wm-actu-texte h2 {
    letter-spacing: .06em !important;
}

body.wm-theme-bocage .wm-actu .wm-actu-texte h2 {
    margin: 1.8em 0 .5em !important;
}

/* Institutionnel : le filet or du bandeau suit le bord gauche du titre */
body.wm-theme-institutionnel .wm-actu .in-pagehead-img::after {
    left: calc(max(0px, (100% - var(--in-max) - 2 * var(--in-gutter)) / 2) + var(--in-gutter));
    margin-left: 0;
}

/* Terrain : la ligne « rubriques · date » est posée sur la parcelle bleue de l'en-tête, en noir ; intertitres en Roboto Slab */
body.wm-theme-terrain .tr-pagehead .wm-actu-kicker {
    color: inherit;
    font-weight: 600;
}

body.wm-theme-terrain .wm-actu .wm-actu-texte h2 {
    font-weight: 800 !important;
    letter-spacing: -.02em !important;
}

/* Verger : le texte des cartes « À lire aussi » ne touche plus les bords de la carte blanche */
body.wm-theme-verger .wm-actu .vg-news-body {
    padding: 20px 22px 24px;
}

body.wm-theme-sobre .wm-actu-suggestions .news-card-title {
    text-wrap: balance;
}

/* téléphone : « À lire aussi » en liste compacte (vignette carrée et titre), pour ne pas peser autant que l'article */
@media (max-width: 575.98px) {
    .wm-actu :is(.bc-news-card, .fy-news-card, .in-news-card, .vg-news-card, .tr-news-card),
    .wm-actu-suggestions .news-card {
        display: grid !important;
        grid-template-columns: 88px minmax(0, 1fr);
        column-gap: 16px;
        align-items: center;
    }

    .wm-actu :is(.bc-news-img, .fy-news-img, .in-news-img, .vg-news-img, .tr-news-img),
    .wm-actu-suggestions .news-card-media {
        grid-row: 1 / span 2;
        align-self: stretch;
        width: 88px;
        min-height: 88px;
        margin: 0 !important;
        overflow: hidden;
    }

    .wm-actu :is(.bc-news-img, .fy-news-img, .in-news-img, .vg-news-img, .tr-news-img) img,
    .wm-actu-suggestions .news-card-media img {
        width: 100% !important;
        height: 100% !important;
        min-height: 88px;
        aspect-ratio: auto !important;
        object-fit: cover;
    }

    .wm-actu :is(.bc-news-body, .fy-news-body, .in-news-body, .vg-news-body, .tr-news-body),
    .wm-actu-suggestions .news-card-body {
        padding: 12px 12px 12px 0 !important;
    }

    .wm-actu :is(.bc-news-body, .fy-news-body, .in-news-body, .vg-news-body) > p:not([class]),
    .wm-actu-suggestions .news-card-text {
        display: none;
    }

    .wm-actu :is(.bc-news-body, .fy-news-body, .in-news-body, .vg-news-body) h3,
    .wm-actu-suggestions .news-card-title {
        margin: 0 !important;
        font-size: 16px !important;
        line-height: 1.3 !important;
    }
}

/* ---------- Page des actualités : rubriques en liens (_fil_rubriques.html.twig) ---------- */

/* Pastille d'une rubrique : filet assez franc pour se lire comme un bouton (3:1 au moins sur le fond), pastille pleine pour
   la rubrique affichée. Chaleureux et Bocage la remplissent de la couleur principale du site, les autres de leur encre ;
   Foyer et Verger écrivent en petites capitales espacées, comme leurs dates et leurs boutons. */
.wm-fil {
    --wf-bord: color-mix(in srgb, var(--wa-encre) 55%, #fff);
    --wf-actif: var(--wa-encre);
    --wf-sur-actif: #fff;
    --wf-taille: 15px;
    --wf-graisse: 600;
    --wf-casse: none;
    --wf-espacement: 0;
}

body.wm-theme-chaleureux .wm-fil,
body.wm-theme-bocage .wm-fil {
    --wf-actif: var(--theme-primary-color, var(--wa-encre));
    --wf-sur-actif: var(--theme-primary-on, #fff);
}

body.wm-theme-foyer .wm-fil,
body.wm-theme-verger .wm-fil,
body.wm-theme-terrain .wm-fil {
    --wf-bord: var(--wa-bord-bouton);
}

body.wm-theme-foyer .wm-fil,
body.wm-theme-verger .wm-fil {
    --wf-taille: 12.5px;
    --wf-graisse: 700;
    --wf-casse: uppercase;
    --wf-espacement: .08em;
}

.wm-fil-rubriques {
    margin: 0 0 32px;
    /* la page rechargée revient à la rangée (#rubriques) sans la glisser sous un en-tête fixe */
    scroll-margin-top: 112px;
}

.wm-fil-rubriques ul {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* en-tête de page centré : la rangée est centrée tant qu'elle tient sur une ligne, puis s'aligne à gauche sur les cartes */
.wm-fil-rubriques.wm-fil--centre ul {
    width: fit-content;
    max-width: 100%;
    margin-inline: auto;
}

.wm-fil-rubriques li {
    flex: none;
    margin: 0;
    padding: 0;
}

.wm-fil-rubriques li::before {
    content: none !important;
}

.wm-fil-rubriques a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 6px 18px;
    border: 1px solid var(--wf-bord);
    border-radius: var(--wa-rayon-pastille);
    background: var(--wa-pastille);
    color: var(--wa-encre) !important;
    font-family: var(--wa-police-ui);
    font-size: var(--wf-taille);
    font-weight: var(--wf-graisse);
    line-height: 1.2;
    letter-spacing: var(--wf-espacement);
    text-decoration: none !important;
    text-transform: var(--wf-casse);
    white-space: nowrap;
    transition: border-color .15s ease, color .15s ease, background-color .15s ease;
}

.wm-fil-rubriques a:hover {
    border-color: var(--wa-accent);
    color: var(--wa-accent) !important;
}

.wm-fil-rubriques a[aria-current] {
    border-color: var(--wf-actif);
    background: var(--wf-actif);
    color: var(--wf-sur-actif) !important;
}

/* La pastille active garde son texte sous la souris, quel que soit le thème : une couleur de survol imposée à tous les
   liens par un thème la rendait noire sur noir (Verger, Foyer, Institutionnel, Terrain ; 2026-11-26). */
.wm-fil-rubriques a[aria-current]:not(#wf):hover {
    border-color: var(--wf-actif);
    color: var(--wf-sur-actif) !important;
}

.wm-fil-rubriques a:focus-visible,
.wm-fil-vide .wm-fil-vide-lien:focus-visible {
    outline: 3px solid var(--wa-accent);
    outline-offset: 2px;
}

/* téléphone : une seule rangée qui défile d'un bord de l'écran à l'autre (la pastille coupée par le bord dit qu'il en
   reste) ; les marges négatives et le retrait se compensent, la première pastille reste alignée sur les cartes */
@media (max-width: 767.98px) {
    .wm-fil-rubriques {
        margin-bottom: 24px;
    }

    .wm-fil-rubriques ul,
    .wm-fil-rubriques.wm-fil--centre ul {
        flex-wrap: nowrap;
        width: auto;
        max-width: none;
        margin: -3px calc(50% - 50vw);
        padding: 3px calc(50vw - 50%);
        overflow-x: auto;
        scroll-padding-inline: calc(50vw - 50%);
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .wm-fil-rubriques ul::-webkit-scrollbar {
        display: none;
    }
}

/* Chaleureux, Sobre : la rangée est une bande entre l'en-tête et les cartes */
.wm-fil-bande {
    padding: 40px 0 0;
}

.wm-fil-bande .wm-fil-rubriques {
    margin-bottom: 0;
}

body .wm-fil-bande + .news-liste,
.wm-fil-bande + .wm-fil-bande--vide {
    padding-top: 32px !important;
}

/* Thèmes à sections : la rangée ouvre la section sans flotter dans son grand blanc d'ouverture */
body:not(#wf) :is(.bc-section, .in-section, .vg-section, .tr-section):has(> div > .wm-fil-rubriques) {
    padding-top: clamp(40px, 5vw, 72px);
}

/* ---------- Page des actualités : pages suivantes (_fil_pages.html.twig) ---------- */

/* les pages suivantes s'ouvrent sur la liste (#liste-actualites) sans la glisser sous un en-tête fixe */
#liste-actualites {
    scroll-margin-top: 112px;
}

/* Deux boutons de la famille des rubriques autour du repère « Page 2 sur 5 » ; le filet les détache de la dernière rangée.
   Trois colonnes : le repère reste au centre et chaque bouton à sa place, même quand l'autre manque (première et dernière
   pages), pour qu'un bouton ne glisse pas sous le pointeur d'une page à l'autre. */
.wm-fil-pages {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px 24px;
    margin: 56px 0 0;
    padding: 32px 0 0;
    border-top: 1px solid var(--wa-filet);
}

.wm-fil-pages .wm-fil-page--avant {
    grid-column: 1;
    justify-self: end;
}

body .wm-fil-pages p.wm-fil-pages-etat {
    grid-column: 2;
}

.wm-fil-pages .wm-fil-page--apres {
    grid-column: 3;
    justify-self: start;
}

/* Sobre : le filet du pied de page suffit ; Chaleureux : un peu d'air avant le pied */
body.wm-theme-sobre .wm-fil-pages {
    padding-top: 0;
    border-top: 0;
}

body.wm-theme-chaleureux:not(#wf) .news-liste:has(.wm-fil-pages) {
    padding-bottom: 80px !important;
}

body .wm-fil-pages p.wm-fil-pages-etat {
    margin: 0;
    color: var(--wa-doux) !important;
    font-family: var(--wa-police-ui);
    font-size: 15px !important;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.wm-fil-pages .wm-fil-page {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 44px;
    padding: 6px 20px;
    border: 1px solid var(--wf-bord);
    border-radius: var(--wa-rayon-bouton);
    background: var(--wa-pastille);
    color: var(--wa-encre) !important;
    font-family: var(--wa-police-ui);
    font-size: var(--wf-taille);
    font-weight: var(--wf-graisse);
    line-height: 1.2;
    letter-spacing: var(--wf-espacement);
    text-decoration: none !important;
    text-transform: var(--wf-casse);
    white-space: nowrap;
    transition: border-color .15s ease, color .15s ease;
}

.wm-fil-pages .wm-fil-page svg {
    flex: none;
    transition: transform .15s ease;
}

.wm-fil-pages .wm-fil-page--avant svg {
    transform: scaleX(-1);
}

.wm-fil-pages .wm-fil-page:hover {
    border-color: var(--wa-accent);
    color: var(--wa-accent) !important;
}

.wm-fil-pages .wm-fil-page:hover svg {
    transform: translateX(3px);
}

.wm-fil-pages .wm-fil-page--avant:hover svg {
    transform: scaleX(-1) translateX(3px);
}

.wm-fil-pages .wm-fil-page:focus-visible {
    outline: 3px solid var(--wa-accent);
    outline-offset: 2px;
}

/* téléphone : le repère au-dessus, les boutons se partagent la largeur (l'un sous l'autre s'ils ne tiennent pas côte à côte) */
@media (max-width: 575.98px) {
    .wm-fil-pages {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 16px 10px;
        margin-top: 40px;
        padding-top: 24px;
    }

    body.wm-theme-sobre .wm-fil-pages {
        padding-top: 0;
    }

    body .wm-fil-pages p.wm-fil-pages-etat {
        order: -1;
        flex: 0 0 100%;
        text-align: center;
    }

    .wm-fil-pages .wm-fil-page {
        flex: 1 1 0;
        padding-inline: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .wm-fil-pages .wm-fil-page,
    .wm-fil-pages .wm-fil-page svg {
        transition: none;
    }
}

/* ---------- Page des actualités : rien à montrer (_fil_vide.html.twig) ---------- */

.wm-fil-vide {
    max-width: 560px;
    padding: 0 0 48px;
    color: var(--wa-doux);
    font-family: var(--wa-police-texte);
}

.wm-fil-vide.wm-fil--centre {
    margin: 0 auto;
    padding-bottom: 72px;
    text-align: center;
}

body .wm-fil-vide p {
    margin: 0 0 16px;
    color: var(--wa-doux);
    font-size: 17px !important;
    line-height: 1.6;
    text-wrap: balance;
}

body .wm-fil-vide p.wm-fil-vide-titre {
    margin: 0 0 8px;
    color: var(--wa-encre) !important;
    font-family: var(--wa-police-titre);
    font-size: 24px !important;
    font-weight: 700;
    line-height: 1.25;
}

body .wm-fil-vide p:last-child {
    margin: 24px 0 0;
}

/* bouton plein, pour ne pas le confondre avec une rubrique de la rangée */
.wm-fil-vide .wm-fil-vide-lien {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 6px 22px;
    border: 1px solid var(--wf-actif);
    border-radius: var(--wa-rayon-bouton);
    background: var(--wf-actif);
    color: var(--wf-sur-actif) !important;
    font-family: var(--wa-police-ui);
    font-size: var(--wf-taille);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: var(--wf-espacement);
    text-decoration: none !important;
    text-transform: var(--wf-casse);
    transition: border-color .15s ease, background-color .15s ease;
}

.wm-fil-vide .wm-fil-vide-lien:hover {
    border-color: var(--wa-accent);
    background: var(--wa-accent);
    color: #fff !important;
}

@media (prefers-reduced-motion: reduce) {
    .wm-fil-rubriques a,
    .wm-fil-vide .wm-fil-vide-lien {
        transition: none;
    }
}
