/*
 * Articles (actualités) — gabarit template-parts/single.php.
 *
 * Chargé seulement sur les articles (inc/articles.php). Reprend la charte
 * des pages Elementor : titre Instrument Serif vert centré, séparateur jaune
 * avec le lapin, texte Montserrat, boutons sarcelle aux coins arrondis.
 * Couleurs : variables globales d'Elementor, avec la valeur en secours.
 *
 * Liens : la règle du kit `.elementor-kit-52 a` (sarcelle, soulignée) a le
 * même poids qu'une classe + `a` et se charge après ce fichier. Tous les
 * sélecteurs de liens commencent donc par `.wr-article` ; ceux du corps
 * excluent les boutons (`:not(.wp-block-button__link)`) pour ne pas les
 * repeindre en vert souligné.
 */

.wr-article {
    --wr-vert: var(--e-global-color-primary, #286C63);
    --wr-sarcelle: var(--e-global-color-secondary, #49A7A4);
    --wr-texte: var(--e-global-color-text, #1A1A1A);
    --wr-jaune: #FFE942;
    --wr-menthe: #B6E4DD;
    --wr-glace: #B5ECF4;
    --wr-ardoise: #636C6D;
    --wr-perle: #DBDBDB;
    --wr-colonne: 720px;

    padding: 48px 20px 64px;
    color: var(--wr-texte);
}

/* ---------- En-tête ---------- */

.wr-article__entete {
    max-width: 900px;
    margin: 0 auto 32px;
    text-align: center;
}

.wr-article__ariane {
    margin-bottom: 24px;
    font-size: 0.8125rem;
    color: var(--wr-ardoise);
}

.wr-article .wr-article__ariane a {
    color: inherit;
    text-decoration: none;
}

.wr-article .wr-article__ariane a:hover,
.wr-article .wr-article__ariane a:focus-visible {
    color: var(--wr-vert);
    text-decoration: underline;
}

.wr-article__ariane span {
    margin: 0 6px;
}

/* Le kit Elementor donne aux h1 une hauteur de ligne de près de 200 px. */
.wr-article .wr-article__titre {
    margin: 0;
    font-family: var(--e-global-typography-primary-font-family, "Instrument Serif"), serif;
    font-size: clamp(2.125rem, 5vw, 3.375rem);
    font-weight: 400;
    line-height: 1.15;
    color: var(--wr-vert);
}

.wr-article__separateur {
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: 640px;
    margin: 24px auto 16px;
}

.wr-article__separateur span {
    flex: 1;
    height: 2px;
    background: var(--wr-jaune);
}

.wr-article__separateur img {
    display: block;
    width: 28px;
    height: 28px;
}

.wr-article__meta {
    margin: 0;
    font-size: 0.875rem;
    color: var(--wr-ardoise);
}

.wr-article .wr-article__meta a {
    color: var(--wr-vert);
}

/* ---------- Image à la une ---------- */

.wr-article__image {
    max-width: 960px;
    margin: 0 auto 40px;
}

.wr-article__image img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 2 / 1;
    object-fit: cover;
    border-radius: 16px;
}

/* ---------- Corps : colonne de lecture ---------- */

.wr-article__corps {
    max-width: var(--wr-colonne);
    margin: 0 auto;
    font-size: 1.0625rem;
    line-height: 1.7;
}

.wr-article--elementor .wr-article__corps {
    max-width: none;
}

.wr-article__corps > *:first-child {
    margin-top: 0;
}

.wr-article__corps p,
.wr-article__corps ul,
.wr-article__corps ol {
    margin: 0 0 1.25em;
}

.wr-article__corps h2,
.wr-article__corps h3,
.wr-article__corps h4 {
    margin: 1.75em 0 0.6em;
    font-family: var(--e-global-typography-primary-font-family, "Instrument Serif"), serif;
    font-weight: 400;
    line-height: 1.2;
    color: var(--wr-vert);
}

.wr-article__corps h2 { font-size: 2rem; }
.wr-article__corps h3 { font-size: 1.625rem; }
.wr-article__corps h4 { font-size: 1.3125rem; }

.wr-article .wr-article__corps a:not(.wp-block-button__link) {
    color: var(--wr-vert);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.wr-article .wr-article__corps a:not(.wp-block-button__link):hover,
.wr-article .wr-article__corps a:not(.wp-block-button__link):focus-visible {
    color: var(--wr-sarcelle);
}

.wr-article__corps img {
    border-radius: 12px;
}

.wr-article__corps figure {
    margin: 2em 0;
}

.wr-article__corps figcaption {
    margin-top: 8px;
    font-size: 0.875rem;
    color: var(--wr-ardoise);
    text-align: center;
}

.wr-article__corps blockquote {
    margin: 2em 0;
    padding: 4px 0 4px 20px;
    border-left: 4px solid var(--wr-jaune);
    font-style: italic;
}

.wr-article__corps hr {
    margin: 2.5em auto;
    border: 0;
    border-top: 2px solid var(--wr-jaune);
    max-width: 240px;
}

/* ---------- Boutons (bloc Bouton et bouton du gabarit) ---------- */

.wr-article .wp-block-button__link,
.wr-article .wr-bouton {
    display: inline-block;
    padding: 12px 26px;
    border: 2px solid var(--wr-sarcelle);
    border-radius: 40px;
    background-color: var(--wr-sarcelle);
    color: #FFFFFF;
    font-family: var(--e-global-typography-accent-font-family, "Montserrat"), sans-serif;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.wr-article .wp-block-button__link:hover,
.wr-article .wp-block-button__link:focus-visible,
.wr-article .wr-bouton:hover,
.wr-article .wr-bouton:focus-visible {
    border-color: var(--wr-vert);
    background-color: var(--wr-vert);
    color: #FFFFFF;
}

.wr-article .is-style-outline .wp-block-button__link {
    background-color: transparent;
    color: var(--wr-vert);
}

.wr-article .is-style-outline .wp-block-button__link:hover,
.wr-article .is-style-outline .wp-block-button__link:focus-visible {
    border-color: var(--wr-vert);
    background-color: var(--wr-vert);
    color: #FFFFFF;
}

.wr-article .wp-block-buttons {
    gap: 12px;
    margin: 1.5em 0;
}

/* ---------- Compositions (motifs de l'éditeur) ---------- */

.wr-article .wr-encadre-vert,
.wr-article .wr-encadre-info,
.wr-article .wr-encadre-soutien {
    margin: 2em 0;
    padding: 24px 28px;
    border-radius: 12px;
}

.wr-article .wr-encadre-vert {
    background: var(--wr-vert);
    color: #FFFFFF;
}

.wr-article .wr-encadre-vert h2,
.wr-article .wr-encadre-vert h3,
.wr-article .wr-encadre-vert h4,
.wr-article .wr-article__corps .wr-encadre-vert a:not(.wp-block-button__link) {
    color: #FFFFFF;
}

.wr-article .wr-encadre-info {
    border-left: 4px solid var(--wr-sarcelle);
    background: #E3F3F9;
}

.wr-article .wr-encadre-soutien {
    background: var(--wr-menthe);
}

.wr-article .wr-encadre-vert > :first-child,
.wr-article .wr-encadre-info > :first-child,
.wr-article .wr-encadre-soutien > :first-child {
    margin-top: 0;
}

.wr-article .wr-encadre-vert > :last-child,
.wr-article .wr-encadre-info > :last-child,
.wr-article .wr-encadre-soutien > :last-child {
    margin-bottom: 0;
}

.wr-article .wr-encadre-vert .wp-block-button__link {
    border-color: #FFFFFF;
    background-color: #FFFFFF;
    color: var(--wr-vert);
}

/* ---------- Encadré newsletter (bas d'article) ---------- */

.wr-article__newsletter {
    max-width: var(--wr-colonne);
    margin: 48px auto 0;
    padding: 28px 32px 24px;
    border-radius: 12px;
    background: var(--wr-vert);
    color: #FFFFFF;
}

.wr-article__newsletter h2 {
    margin: 0 0 8px;
    font-family: var(--e-global-typography-primary-font-family, "Instrument Serif"), serif;
    font-size: 1.75rem;
    font-weight: 400;
    line-height: 1.2;
    color: #FFFFFF;
}

.wr-article__newsletter p {
    margin: 0 0 16px;
    font-size: 0.9375rem;
    line-height: 1.6;
}

/* ---------- Pied : article précédent / suivant ---------- */

.wr-article__pied {
    max-width: var(--wr-colonne);
    margin: 48px auto 0;
    padding-top: 32px;
    border-top: 1px solid var(--wr-perle);
}

.wr-article__navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.wr-article__suivant {
    text-align: right;
}

.wr-article .wr-article__navigation a {
    display: block;
    color: var(--wr-texte);
    text-decoration: none;
}

.wr-article__navigation span {
    display: block;
    margin-bottom: 4px;
    font-size: 0.8125rem;
    color: var(--wr-ardoise);
}

.wr-article__navigation strong {
    font-family: var(--e-global-typography-primary-font-family, "Instrument Serif"), serif;
    font-size: 1.25rem;
    font-weight: 400;
    line-height: 1.25;
    color: var(--wr-vert);
}

.wr-article .wr-article__navigation a:hover strong,
.wr-article .wr-article__navigation a:focus-visible strong {
    text-decoration: underline;
}

.wr-article__retour {
    margin: 32px 0 0;
    text-align: center;
}

/* ---------- Petits écrans ---------- */

@media (max-width: 767px) {
    .wr-article {
        padding: 32px 16px 48px;
    }

    .wr-article__image img {
        aspect-ratio: 16 / 9;
        border-radius: 12px;
    }

    .wr-article__newsletter {
        padding: 24px 20px 20px;
    }

    .wr-article__navigation {
        grid-template-columns: 1fr;
    }

    .wr-article__suivant {
        text-align: left;
    }
}
