/*
Theme Name:     Atelier 21 (North child)
Theme URI:      https://atelier21.org
Description:    Child theme d'Atelier 21 basé sur SiteOrigin North.
                Reprend l'identité visuelle Maskitto : vert #4a994a, logo compact,
                soulignement vert sur item actif, cards hover-reveal.
Author:         Atelier 21
Author URI:     https://atelier21.org
Template:       siteorigin-north
Version:        2.4.0
License:        GNU General Public License v2 or later
License URI:    https://www.gnu.org/licenses/gpl-2.0.html
Text Domain:    atelier21-north-child
*/

:root {
    --a21-green: #4a994a;
    --a21-green-hover: #008001;
    --a21-font: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ---------- TYPOGRAPHIE : Montserrat comme la prod ---------- */
body,
button,
input,
select,
textarea,
.entry-content,
.widget,
h1, h2, h3, h4, h5, h6 {
    font-family: var(--a21-font) !important;
}

body {
    font-size: 14px !important;
    line-height: 1.6;
}

/* ---------- TOPBAR : bandeau vert en haut avec contact + socials ---------- */
#topbar {
    background: var(--a21-green) !important;
    color: #fff !important;
    padding: 6px 0 !important;
    font-size: 13px;
    min-height: 34px;
}

#topbar a,
#topbar p,
#topbar .a21-topbar-info a {
    color: #fff !important;
    text-decoration: none;
}

#topbar a:hover {
    opacity: 0.85;
}

.a21-topbar-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1170px;
    margin: 0 auto;
    padding: 0 20px;
    gap: 20px;
    flex-wrap: wrap;
}

.a21-topbar-info .a21-contact span {
    margin-right: 18px;
    white-space: nowrap;
}

.a21-topbar-info .a21-contact svg,
.a21-topbar-info .a21-social svg {
    width: 14px;
    height: 14px;
    vertical-align: -2px;
    fill: currentColor;
    margin-right: 4px;
}

.a21-topbar-info .a21-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin-left: 6px;
}

.a21-topbar-info .a21-social svg {
    width: 16px;
    height: 16px;
    margin-right: 0;
}

/* ---------- LOGO : contraindre à 56px comme la prod ---------- */
.custom-logo,
.site-branding img,
.site-logo img,
.site-header img.custom-logo {
    max-height: 56px !important;
    width: auto !important;
    height: auto !important;
}

/* ---------- MENU : Montserrat, uppercase, poids 700 pour actif ---------- */
#site-navigation,
.main-navigation,
#site-navigation *,
.main-navigation *,
#site-navigation a,
.main-navigation a,
#primary-menu,
#primary-menu * {
    font-family: var(--a21-font) !important;
}

#site-navigation a,
.main-navigation a {
    text-transform: uppercase !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    letter-spacing: 0.02em;
}

#site-navigation .current-menu-item > a,
#site-navigation .current-menu-ancestor > a,
#site-navigation .current_page_item > a,
.main-navigation .current-menu-item > a,
.main-navigation .current_page_item > a {
    color: var(--a21-green) !important;
    border-bottom: 2px solid var(--a21-green) !important;
    padding-bottom: 4px;
    font-weight: 700 !important;
}

#site-navigation a:hover,
.main-navigation a:hover {
    color: var(--a21-green-hover) !important;
}

/* Menu principal (top-level uniquement) sur une seule ligne */
.main-navigation > div > ul#primary-menu,
.main-navigation > ul#primary-menu {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    white-space: nowrap;
}
/* Items top-level uniquement (pas les sub-menu) */
.main-navigation ul#primary-menu > li {
    display: inline-flex !important;
    align-items: center;
    float: none !important;
    position: relative;
}
.main-navigation ul#primary-menu > li > a {
    padding: 10px 12px !important;
    white-space: nowrap;
}
.main-navigation .pll-parent-menu-item > a {
    padding: 10px 8px !important;
}

/* Sous-menu langue : dropdown vertical propre */
.main-navigation ul#primary-menu > li .sub-menu {
    display: none !important;
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: auto !important;
    min-width: 160px;
    padding: 6px 0 !important;
    margin: 0 !important;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    z-index: 999;
    list-style: none;
}
.main-navigation ul#primary-menu > li:hover > .sub-menu,
.main-navigation ul#primary-menu > li:focus-within > .sub-menu {
    display: block !important;
}
.main-navigation .sub-menu li {
    display: block !important;
    float: none !important;
    width: 100%;
    margin: 0 !important;
}
.main-navigation .sub-menu li a {
    display: block !important;
    padding: 8px 16px !important;
    text-transform: uppercase;
    font-size: 12px !important;
    color: #374151 !important;
    text-align: left !important;
    border-bottom: none !important;
    white-space: nowrap;
    font-weight: 400 !important;
}
.main-navigation .sub-menu li a:hover {
    background: rgba(74, 153, 74, 0.08);
    color: var(--a21-green) !important;
}
/* Bordure verte active retirée dans les sub-menus */
.main-navigation .sub-menu .current-menu-item > a,
.main-navigation .sub-menu .current-lang > a {
    color: var(--a21-green) !important;
    border-bottom: none !important;
    font-weight: 600 !important;
}

/* ---------- Titre de page : masqué sur home, centré ailleurs ---------- */
body.home .entry-header,
body.page-id-9 .entry-header,
body.home .page-header {
    display: none !important;
}

.entry-header,
.entry-title,
.page-header,
.page-title {
    text-align: center !important;
}

/* Masque la sidebar principale (#secondary) — NE touche jamais le footer */
html body #secondary,
html body #secondary.widget-area {
    display: none !important;
}
/* Le footer garde ses widgets visibles — spécificité maximale, sans casser le clipping */
html body footer.site-footer,
html body footer.site-footer .container,
html body footer.site-footer .widgets,
html body footer.site-footer .widget-area,
html body footer.site-footer .widget,
html body footer.site-footer aside,
html body footer.site-footer .textwidget,
html body footer.site-footer .atelier21-attribution {
    display: block !important;
    visibility: visible !important;
    height: auto !important;
    opacity: 1 !important;
}

/* Neutralise la technique "equal-height columns" (padding-bottom: 9999px) qui polluait la page */
html body footer.site-footer .widget-wrapper,
html body footer.site-footer .widgets,
html body footer.site-footer .widget-area,
html body footer.site-footer > * {
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
    overflow: hidden;
}

/* Footer sur fond noir */
html body footer.site-footer {
    padding: 28px 20px !important;
    background: #111 !important;
    color: #fff !important;
    text-align: center;
    overflow: hidden !important;
}

html body footer.site-footer,
html body footer.site-footer * {
    color: #fff !important;
}

html body footer.site-footer .atelier21-attribution {
    color: #fff;
    opacity: 0.92;
}

html body footer.site-footer a {
    color: #fff !important;
    text-decoration: none;
    border-bottom: 1px dotted rgba(255,255,255,0.5);
}
html body footer.site-footer a:hover {
    color: var(--a21-green) !important;
    border-bottom-color: var(--a21-green);
}

/* Bloc Schneider Fondation : reste sombre mais fond légèrement plus clair pour lisibilité */
html body footer.site-footer .atelier21-attribution a[href*="se.com"] {
    background: #1a1a1a !important;
    border: 1px solid rgba(255,255,255,0.15);
}

/* Contenu principal pleine largeur sur toutes les pages */
#primary,
.content-area,
.site-main,
article.page,
.entry-content {
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Container élargi (1270px comme prod) */
#content .container,
.site-content .container {
    max-width: 1270px !important;
    width: 100% !important;
}

/* Centre tout le contenu (headings inline-block + galleries) sur toutes les pages */
.entry-content,
.panel-grid-cell,
.so-panel {
    text-align: center;
}

/* Heading avec mark : centré, mark en inline-block */
.wp-block-heading {
    display: block;
    text-align: center;
}
.wp-block-heading mark {
    display: inline-block;
    padding: 6px 24px;
    color: #fff !important;
    background-color: var(--a21-green) !important;
    font-weight: 600;
}

/* Gallery centrée */
.wp-block-gallery {
    justify-content: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* (règle gallery centrée déplacée plus haut, pour toutes les pages) */

/* (règles HOMEPAGE déplacées plus haut, dans la section MENU) */

/* ---------- CARDS PORTFOLIO : overlay hover-reveal comme prod ---------- */
.projects-portfolio {
    --gap: 3px;
    max-width: 1234px;
    margin: 0 auto;
}

.projects-portfolio.wp-block-gallery {
    gap: var(--gap) !important;
}

.projects-portfolio figure.wp-block-image {
    width: calc(25% - (var(--gap) * 3)) !important;
    aspect-ratio: 1;
    position: relative;
    overflow: hidden;
    margin: 0 !important;
}

.projects-portfolio figure.wp-block-image a,
.projects-portfolio figure.wp-block-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    max-width: none !important;
    transition: transform 0.4s ease-in-out;
}

.projects-portfolio figure.wp-block-image:hover img {
    transform: scale(1.12);
}

/* Retire le flou par défaut appliqué par Gutenberg is-cropped sur ::before */
.projects-portfolio figure.wp-block-image::before,
.wp-block-gallery.is-cropped figure::before {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    content: none !important;
}

/* La figcaption Gutenberg est juste un conteneur ; le vrai overlay est .portfolio-details */
.projects-portfolio figcaption {
    position: absolute !important;
    inset: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    display: block !important;
    text-align: left !important;
    pointer-events: none;
    scrollbar-width: none !important;
    overflow: visible !important;
}

/* Overlay principal : caché par défaut, visible au hover — clic traverse vers le lien */
.projects-portfolio .portfolio-details,
.projects-portfolio .portfolio-details * {
    pointer-events: none !important; /* laisse le clic passer vers <a> sous-jacent */
}
.projects-portfolio .portfolio-details {
    position: absolute;
    inset: 0;
    background: rgba(50, 50, 50, 0.8);
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
    z-index: 10;
    text-align: center;
    cursor: pointer;
    color: #fff;
    padding: 15px;
}

.projects-portfolio figure.wp-block-image:hover .portfolio-details {
    opacity: 1;
}

.projects-portfolio .portfolio-details-align {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    padding: 0 15px;
    box-sizing: border-box;
}

.projects-portfolio .portfolio-title {
    font-family: var(--a21-font);
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 10px;
    line-height: 1.3;
}

.projects-portfolio .portfolio-info {
    font-size: 14px;
    font-style: italic;
    color: rgb(178, 184, 186);
    line-height: 1.4;
    margin: 0;
}

.projects-portfolio .portfolio-line {
    width: 30px;
    height: 1px;
    background: #fff;
    margin: 15px auto;
    border: none;
}

.projects-portfolio .portfolio-cat {
    font-size: 14px;
    font-weight: 400;
    color: #fff;
    margin-top: 8px;
}

@media only screen and (max-width: 990px) {
    .projects-portfolio figure.wp-block-image {
        width: calc(50% - var(--gap)) !important;
    }
}

@media only screen and (max-width: 770px) {
    .projects-portfolio figure.wp-block-image {
        width: 100% !important;
    }
}

/* ---------- TITRES DE SECTION : bandeau vert compact hugging le texte ---------- */
/* .projects-title est sur le <mark> intérieur du wp-block-heading */
mark.projects-title,
.wp-block-heading > mark {
    background: var(--a21-green) !important;
    color: #fff !important;
    padding: 6px 24px;
    display: inline-block;
    font-weight: 600;
    text-align: center;
    border-radius: 2px;
}

/* Le heading parent reste sans background, juste centré */
.wp-block-heading:has(> mark) {
    background: transparent !important;
    padding: 0 !important;
    text-align: center;
    margin: 30px 0 20px !important;
}

/* ---------- HEADER : masquer le tagline sous le logo ---------- */
.site-description,
.site-branding .site-description {
    display: none !important;
}

/* ---------- FOOTER : masquer TOUT le crédit (copyright + SiteOrigin) comme prod ---------- */
.site-info,
.site-footer .site-info {
    display: none !important;
}

/* ---------- Footer widget attribution ---------- */
.footer-widgets .atelier21-attribution {
    font-size: 0.9em;
    opacity: 0.85;
}

/* ================================================================
   PAGE CONTACT (id 17) — layout 2 colonnes : intro à gauche + encart vert à droite
   ================================================================ */

body.page-id-17 .entry-content {
    max-width: 1200px;
    margin: 20px auto 60px;
    padding: 0 20px;
    text-align: left !important;
}

body.page-id-17 .entry-title {
    text-align: center !important;
    font-size: 30px;
    letter-spacing: 0.03em;
    margin-bottom: 40px;
    position: relative;
    padding-bottom: 20px;
}
body.page-id-17 .entry-title::after {
    content: "";
    display: block;
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--a21-green);
    border-radius: 2px;
}

/* Grille 2 colonnes */
body.page-id-17 .a21-contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

/* Colonne gauche : intro */
body.page-id-17 .a21-contact-intro {
    padding: 20px 0;
    text-align: left !important;
}

body.page-id-17 .a21-contact-intro-title {
    font-size: 26px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 24px !important;
    line-height: 1.35;
    text-align: left !important;
}

body.page-id-17 .a21-tag {
    color: var(--a21-green);
    font-weight: 700;
    white-space: nowrap;
    border-bottom: 2px solid rgba(74, 153, 74, 0.25);
    padding-bottom: 1px;
}

body.page-id-17 .a21-contact-intro-lead {
    font-size: 16px;
    color: #4b5563;
    margin: 0 0 28px !important;
    text-align: left !important;
    line-height: 1.65;
}

body.page-id-17 .a21-contact-intro-lead em {
    color: var(--a21-green);
    font-style: italic;
    font-weight: 600;
}

body.page-id-17 .a21-contact-intro-cta {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    background: #fff;
    border-left: 3px solid var(--a21-green);
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    color: #374151;
    font-size: 14px;
    line-height: 1.55;
    text-align: left !important;
}

body.page-id-17 .a21-contact-intro-cta-arrow {
    color: var(--a21-green);
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    flex-shrink: 0;
}

body.page-id-17 .a21-contact-intro-cta a {
    color: var(--a21-green);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px dashed var(--a21-green);
}
body.page-id-17 .a21-contact-intro-cta a:hover {
    color: var(--a21-green-hover);
}

/* Colonne droite : encart vert compact */
body.page-id-17 .a21-contact-panel {
    background: var(--a21-green);
    background-image: linear-gradient(135deg, #4a994a 0%, #2f7a2f 100%);
    color: #fff;
    padding: 28px 28px;
    border-radius: 16px;
    box-shadow: 0 12px 30px rgba(74,153,74,0.25);
    position: relative;
}

body.page-id-17 .a21-contact-panel .panel-layout,
body.page-id-17 .a21-contact-panel .panel-grid,
body.page-id-17 .a21-contact-panel .panel-grid-cell,
body.page-id-17 .a21-contact-panel .so-panel {
    background: transparent !important;
    color: #fff !important;
    margin: 0 !important;
    padding: 0 !important;
}

body.page-id-17 .a21-contact-panel .textwidget {
    color: #fff !important;
    font-size: 15px;
    line-height: 1.7;
    text-align: left !important;
}

body.page-id-17 .a21-contact-panel .textwidget:first-of-type {
    margin-bottom: 0 !important;
    font-size: 16px;
}

/* Header du panel : adresse à gauche + logo à droite pour équilibre visuel */
body.page-id-17 .a21-contact-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px !important;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(255,255,255,0.25);
}

body.page-id-17 .a21-contact-panel-header .textwidget {
    flex: 1 1 auto;
    margin: 0 !important;
    padding: 0 !important;
}

body.page-id-17 .a21-contact-panel-logo {
    flex: 0 0 auto;
    background: #fff;
    padding: 14px 16px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
}

body.page-id-17 .a21-contact-panel-logo img {
    display: block;
    max-width: 140px;
    max-height: 60px;
    width: auto;
    height: auto;
    box-shadow: none;
    border-radius: 0;
    margin: 0;
}

/* Responsive : logo passe sous l'adresse */
@media (max-width: 500px) {
    body.page-id-17 .a21-contact-panel-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

body.page-id-17 .a21-contact-panel a {
    color: #fff !important;
    text-decoration: underline;
    text-underline-offset: 3px;
    font-weight: 600;
}
body.page-id-17 .a21-contact-panel a:hover {
    text-decoration: none;
    opacity: 0.9;
}

/* Formulaire compact */
body.page-id-17 .a21-contact-panel .wpcf7 form {
    margin: 0;
}
body.page-id-17 .a21-contact-panel .wpcf7 p {
    color: #fff !important;
    font-size: 13px;
    margin: 8px 0 !important;
    text-align: left !important;
    line-height: 1.3;
}

body.page-id-17 .a21-contact-panel .wpcf7 label {
    color: #fff !important;
    font-weight: 500;
    display: block;
    margin-bottom: 2px;
    font-size: 12px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    opacity: 0.9;
}

body.page-id-17 .a21-contact-panel .wpcf7 input[type="text"],
body.page-id-17 .a21-contact-panel .wpcf7 input[type="email"],
body.page-id-17 .a21-contact-panel .wpcf7 input[type="tel"],
body.page-id-17 .a21-contact-panel .wpcf7 textarea {
    width: 100%;
    padding: 7px 12px;
    background: rgba(255,255,255,0.95);
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: 5px;
    color: #111827;
    font-size: 13px;
    font-family: var(--a21-font);
    box-sizing: border-box;
    height: 34px;
    margin-top: 2px;
}
body.page-id-17 .a21-contact-panel .wpcf7 input:focus,
body.page-id-17 .a21-contact-panel .wpcf7 textarea:focus {
    outline: none;
    background: #fff;
    border-color: #fff;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.3);
}

body.page-id-17 .a21-contact-panel .wpcf7 textarea {
    min-height: 80px;
    height: auto;
    resize: vertical;
    padding: 8px 12px;
}

body.page-id-17 .a21-contact-panel .wpcf7 input[type="submit"],
body.page-id-17 .a21-contact-panel .wpcf7 button[type="submit"] {
    background: #fff !important;
    color: var(--a21-green) !important;
    border: 2px solid #fff !important;
    padding: 9px 26px !important;
    border-radius: 20px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, transform 0.15s;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    width: auto !important;
    height: auto !important;
    margin-top: 12px;
}
body.page-id-17 .a21-contact-panel .wpcf7 input[type="submit"]:hover {
    background: transparent !important;
    color: #fff !important;
    transform: translateY(-1px);
}

/* Responsive : 1 colonne sous 900px */
@media (max-width: 900px) {
    body.page-id-17 .a21-contact-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    body.page-id-17 .a21-contact-panel {
        padding: 28px 20px;
    }
}

/* ================================================================
   PAGE PARTENAIRES (/references/) — style prod
   ================================================================ */

/* Titre "Partenaires" — plus de présence + underline vert */
body.page-id-15 .entry-title {
    position: relative;
    padding-bottom: 20px;
    margin-bottom: 40px;
    font-size: 30px;
    letter-spacing: 0.03em;
    color: #111827;
}
body.page-id-15 .entry-title::after {
    content: "";
    display: block;
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--a21-green);
    border-radius: 2px;
}

/* Section titles : bandeau pill vert compact — centré via wrapper text-align */
body.page-id-15 .entry-content > p:not(:has(img)) {
    text-align: center !important;
    margin: 50px 0 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: none;
}
body.page-id-15 .entry-content > p:not(:has(img))::before {
    content: attr(data-noop);
}
/* On stylise via un span virtuel : le texte du <p> devient un pill grâce à display:inline-block + bg */
body.page-id-15 .entry-content > p:not(:has(img)) {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--a21-green) !important;
}
body.page-id-15 .entry-content > p:not(:has(img))::first-line {
    /* Rien : first-line ne supporte pas background sur inline. On fait autrement. */
}
/* Fallback : le <p> lui-même en pill centré, sans transform */
body.page-id-15 .entry-content > p:not(:has(img)) {
    display: table;
    margin: 50px auto 0 !important;
    padding: 6px 18px !important;
    background: rgba(74, 153, 74, 0.08) !important;
    border-radius: 20px;
}

body.page-id-15 .entry-content > hr {
    display: none;
}

/* Gallery : container = card doux gris clair avec padding + shadow */
body.page-id-15 .gallery {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 24px 32px;
    max-width: 1150px;
    margin: 20px auto 40px !important;
    padding: 32px 24px;
    background: #f9fafb;
    border-radius: 12px;
    border: 1px solid #f3f4f6;
    box-sizing: border-box;
}

body.page-id-15 .gallery::before,
body.page-id-15 .gallery::after,
body.page-id-15 .gallery br {
    display: none !important;
}

body.page-id-15 .gallery-item {
    width: auto !important;
    max-width: 200px;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.page-id-15 .gallery-item .gallery-icon,
body.page-id-15 .gallery-item dt {
    margin: 0 !important;
    padding: 0 !important;
}

body.page-id-15 .gallery-item img {
    max-height: 90px;
    max-width: 180px;
    width: auto !important;
    height: auto !important;
    object-fit: contain;
    border: none !important;
    padding: 0 !important;
    filter: grayscale(60%);
    opacity: 0.85;
    transition: filter 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
}

body.page-id-15 .gallery-item:hover img {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.05);
}

/* Masque les captions/légendes de gallery */
body.page-id-15 .gallery-caption,
body.page-id-15 .wp-caption-text {
    display: none !important;
}

/* Titre "Partenaires" — laissé visible mais compact */
body.page-id-15 .entry-title {
    font-size: 24px;
    font-weight: 500;
    margin: 20px 0 30px;
}

/* Responsive : logos plus compacts sur mobile */
@media (max-width: 720px) {
    body.page-id-15 .gallery {
        gap: 16px 20px;
    }
    body.page-id-15 .gallery-item img {
        max-height: 60px;
        max-width: 140px;
    }
}

/* ================================================================
   PAGE PRESSE (/presse-2/, page-id-2102) — style prod
   ================================================================ */

/* Titre PRESSE avec petite barre verte en dessous */
body.page-id-2102 .entry-title {
    position: relative;
    padding-bottom: 18px;
    margin-bottom: 30px;
}
body.page-id-2102 .entry-title::after {
    content: "";
    display: block;
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background: var(--a21-green);
    border-radius: 2px;
}

/* ---------------- Container général ---------------- */
body.page-id-2102 .entry-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px 40px;
    text-align: left !important;
}

body.page-id-2102 .entry-content p strong {
    color: #111827;
    font-weight: 700;
}

body.page-id-2102 .entry-content a {
    color: var(--a21-green);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}
body.page-id-2102 .entry-content a:hover {
    color: var(--a21-green-hover);
}

body.page-id-2102 .entry-content hr {
    border: none;
    height: 1px;
    background: linear-gradient(to right, transparent, #e5e7eb, transparent);
    margin: 40px auto;
    max-width: 400px;
}

/* ================================================================
   SECTION 1 : REVUES DE PRESSE — grid de cards INDÉPENDANTES
   ================================================================ */
/* Wrapper virtuel : les 7 premiers <p> deviennent des cards distinctes,
   affichées en grille responsive. On utilise flex-wrap via display: flex sur le container.
   Comme on ne peut pas wrapper le HTML sans le modifier, on donne à chaque <p>
   les propriétés d'une card autonome et on compte sur le layout container. */

/* ---- Carrousel wrapper (créé par carousel.js) — centré sur la page ---- */
.a21-carousel {
    position: relative;
    max-width: 1150px;
    margin: 30px auto 60px !important;
    padding: 0 60px;
    display: block;
    width: 100%;
    box-sizing: border-box;
}

.a21-carousel-track {
    display: flex;
    justify-content: center;
    gap: 20px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding: 20px;
    padding: 6px 4px 20px;
    scrollbar-width: thin;
    scrollbar-color: var(--a21-green) transparent;
}
.a21-carousel-track::-webkit-scrollbar {
    height: 6px;
}
.a21-carousel-track::-webkit-scrollbar-thumb {
    background: rgba(74, 153, 74, 0.4);
    border-radius: 3px;
}
.a21-carousel-track::-webkit-scrollbar-thumb:hover {
    background: var(--a21-green);
}

/* Items du carrousel — cards fixes 300px, contenu centré (block, pas flex) */
.a21-carousel .a21-carousel-item {
    display: block !important;
    flex: 0 0 300px;
    width: 300px;
    margin: 0 !important;
    padding: 60px 20px 28px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    text-align: center !important;
    line-height: 1.4;
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s;
    position: relative;
    box-sizing: border-box;
    min-height: 150px;
    scroll-snap-align: start;
    float: none !important;
}

/* Boutons prev/next */
.a21-carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #e5e7eb;
    color: var(--a21-green);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: background 0.2s, color 0.2s, opacity 0.2s;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.a21-carousel-prev { left: 0; }
.a21-carousel-next { right: 0; }

.a21-carousel-btn:hover {
    background: var(--a21-green);
    color: #fff;
    border-color: var(--a21-green);
}

.a21-carousel-btn.is-disabled {
    opacity: 0.3;
    pointer-events: none;
}

/* Icône newspaper en cercle vert doux, centré en haut de la card */
.a21-carousel .a21-carousel-item::before {
    content: "\f1ea"; /* fa-newspaper-o */
    font-family: FontAwesome;
    position: absolute;
    left: 50%;
    top: 16px;
    transform: translateX(-50%);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(74, 153, 74, 0.12);
    border-radius: 50%;
    font-size: 16px;
    color: var(--a21-green);
    transition: background 0.25s;
}

.a21-carousel .a21-carousel-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(74,153,74,0.15);
    border-color: var(--a21-green);
}
.a21-carousel .a21-carousel-item:hover::before {
    background: rgba(74, 153, 74, 0.22);
}

/* Bouton "Consulter" : outlined vert, texte noir, TOUJOURS sur ligne suivante */
.a21-carousel .a21-carousel-item a {
    display: block !important;
    width: fit-content;
    margin: 14px auto 0 !important;
    background: #fff;
    color: #111827 !important;
    padding: 8px 20px;
    border: 2px solid var(--a21-green);
    border-radius: 24px;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.2s, color 0.2s, transform 0.15s;
    cursor: pointer;
    text-decoration: none !important;
    pointer-events: auto !important;
    position: relative;
    z-index: 20;
    text-align: center;
}
.a21-carousel .a21-carousel-item a:hover {
    background: var(--a21-green);
    color: #fff !important;
    transform: translateY(-1px);
}

body.page-id-2102 .entry-content > hr:first-of-type {
    margin-top: 20px !important;
}

/* ================================================================
   SECTION 2 : ARTICLES — FRISE CHRONOLOGIQUE VERTICALE
   ================================================================ */
/* Container virtuel après le <hr> — on positionne un pseudo-element sur .entry-content
   pour dessiner la ligne verticale centrale, puis on style chaque <p> comme un item timeline. */

body.page-id-2102 .entry-content {
    position: relative;
}

/* La ligne verticale est dessinée par un ::before sur le premier item timeline
   pour ne s'étendre que sur la zone timeline exacte */
body.page-id-2102.a21-has-timeline .entry-content > .a21-timeline-item:first-of-type {
    margin-top: 30px !important;
}

body.page-id-2102 .a21-timeline-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 0;
    border-left: 2px dashed var(--a21-green);
    transform: translateX(-1px);
    z-index: 0;
    pointer-events: none;
}

/* ---- Chaque item timeline (classé via JS) ---- */
body.page-id-2102 .entry-content > .a21-timeline-item {
    position: relative;
    display: block !important;
    width: calc(50% - 40px);
    padding: 18px 22px;
    margin: 20px 0 !important;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    text-align: left !important;
    line-height: 1.55;
    font-size: 14px;
    color: #374151;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s;
    float: none;
    clear: both;
    z-index: 1;
}

/* Alternance gauche / droite via classes JS */
body.page-id-2102 .entry-content > .a21-timeline-item.a21-timeline-left {
    margin-left: 0 !important;
    margin-right: auto !important;
}
body.page-id-2102 .entry-content > .a21-timeline-item.a21-timeline-right {
    margin-left: auto !important;
    margin-right: 0 !important;
}

/* Point / cercle sur la ligne pour chaque item */
body.page-id-2102 .entry-content > .a21-timeline-item::after {
    content: "";
    position: absolute;
    top: 24px;
    width: 14px;
    height: 14px;
    background: var(--a21-green);
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 2px var(--a21-green);
    z-index: 2;
}
body.page-id-2102 .entry-content > .a21-timeline-item.a21-timeline-left::after {
    right: -47px;
}
body.page-id-2102 .entry-content > .a21-timeline-item.a21-timeline-right::after {
    left: -47px;
}

/* Petit connecteur horizontal vers la ligne centrale */
body.page-id-2102 .entry-content > .a21-timeline-item::before {
    content: "";
    position: absolute;
    top: 28px;
    width: 12px;
    height: 2px;
    background: var(--a21-green);
    z-index: 1;
}
body.page-id-2102 .entry-content > .a21-timeline-item.a21-timeline-left::before {
    right: -12px;
}
body.page-id-2102 .entry-content > .a21-timeline-item.a21-timeline-right::before {
    left: -12px;
}

body.page-id-2102 .entry-content > .a21-timeline-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(74,153,74,0.12);
    border-color: var(--a21-green);
}

/* Badge année : premier <strong> = pill vert */
body.page-id-2102 .entry-content > .a21-timeline-item > strong:first-child {
    display: inline-block;
    padding: 3px 10px;
    background: var(--a21-green);
    color: #fff !important;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-right: 8px;
    margin-bottom: 6px;
    vertical-align: middle;
}

/* Ligne pointillée verticale : dessinée derrière tous les items timeline via un
   pseudo-element sur entry-content. On la démarre juste sous le carousel/hr pour éviter
   d'être masquée par le fond blanc de la partie supérieure. */
body.page-id-2102.a21-has-timeline .entry-content {
    position: relative;
}
body.page-id-2102.a21-has-timeline .entry-content::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 500px;
    bottom: 40px;
    width: 2px;
    background-image: linear-gradient(to bottom, var(--a21-green) 60%, transparent 40%);
    background-size: 2px 10px;
    background-repeat: repeat-y;
    transform: translateX(-1px);
    z-index: 1;
    pointer-events: none;
}

/* Les items de la timeline restent au-dessus de la ligne */
body.page-id-2102 .entry-content > .a21-timeline-item {
    z-index: 2;
}
body.page-id-2102 .entry-content > .a21-timeline-item::after {
    z-index: 4 !important;
}
body.page-id-2102 .entry-content > .a21-timeline-item::before {
    z-index: 3 !important;
}

/* Images / vidéos dans la timeline : centrées, ombre douce, marge propre */
body.page-id-2102 .entry-content img,
body.page-id-2102 .entry-content video,
body.page-id-2102 .entry-content iframe {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 20px auto;
    box-shadow: 0 6px 20px rgba(0,0,0,0.10);
    border-radius: 6px;
    clear: both;
}

/* IFRAME direct-enfant (ex: vidéo ENGIE smartphone) : format vertical 9:16 centré */
body.page-id-2102 .entry-content > iframe {
    display: block !important;
    width: 100% !important;
    max-width: 360px !important;
    aspect-ratio: 9 / 16;
    height: auto !important;
    min-height: auto !important;
    margin: 30px auto !important;
    clear: both;
    position: relative;
    z-index: 3;
    background: #000;
    border-radius: 12px;
}

/* IFRAME direct : neutralise le style overlay des timeline items adjacents */
body.page-id-2102 .entry-content > .wp-block-spacer {
    clear: both !important;
    width: 100% !important;
    display: block !important;
}

/* Paragraphe contenant image/vidéo — centré, occupe toute la largeur */
body.page-id-2102 .entry-content > p:has(img),
body.page-id-2102 .entry-content > p:has(video),
body.page-id-2102 .entry-content > p:has(iframe) {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 20px auto !important;
    width: 100% !important;
    max-width: 100%;
    float: none !important;
    clear: both !important;
    text-align: center !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    position: relative;
    z-index: 1;
}
body.page-id-2102 .entry-content > p:has(img) img {
    max-width: 45%;
    margin: 0;
}
body.page-id-2102 .entry-content > p:has(video) video,
body.page-id-2102 .entry-content > p:has(iframe) iframe {
    max-width: 640px;
    width: 100%;
    margin: 0 auto;
}

/* Titre PRESSE (rappel) */
body.page-id-2102 .entry-title {
    position: relative;
    padding-bottom: 20px;
    margin-bottom: 40px;
    font-size: 30px;
    letter-spacing: 0.05em;
    color: #111827;
}
body.page-id-2102 .entry-title::after {
    content: "";
    display: block;
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--a21-green);
    border-radius: 2px;
}

/* Responsive : mobile — timeline en pleine largeur, ligne à gauche */
@media (max-width: 720px) {
    body.page-id-2102 .entry-content {
        padding: 0 16px 20px;
    }
    /* Carousel : cards plus étroites en mobile */
    .a21-carousel {
        padding: 0 24px;
    }
    .a21-carousel .a21-carousel-item {
        flex: 0 0 240px;
        width: 240px;
        min-height: 130px;
    }

    /* Timeline mobile : ligne pointillée à gauche, items à droite */
    body.page-id-2102.a21-has-timeline .entry-content::after {
        left: 20px;
        transform: none;
    }
    body.page-id-2102 .entry-content > .a21-timeline-item,
    body.page-id-2102 .entry-content > .a21-timeline-item.a21-timeline-left,
    body.page-id-2102 .entry-content > .a21-timeline-item.a21-timeline-right {
        width: calc(100% - 45px);
        margin-left: 45px !important;
        margin-right: 0 !important;
        padding: 14px 16px;
        font-size: 14px;
    }
    body.page-id-2102 .entry-content > .a21-timeline-item::after,
    body.page-id-2102 .entry-content > .a21-timeline-item.a21-timeline-left::after,
    body.page-id-2102 .entry-content > .a21-timeline-item.a21-timeline-right::after {
        left: -32px;
        right: auto;
    }
    body.page-id-2102 .entry-content > .a21-timeline-item::before,
    body.page-id-2102 .entry-content > .a21-timeline-item.a21-timeline-left::before,
    body.page-id-2102 .entry-content > .a21-timeline-item.a21-timeline-right::before {
        left: -12px;
        right: auto;
    }

    body.page-id-2102 .entry-content > p:has(img) img {
        max-width: 100%;
    }
}

/* ---------- SERVICE ITEMS (colonnes Présentation avec icônes) — comme prod Maskitto ---------- */
.service-item {
    text-align: center;
    margin-bottom: 15px;
    animation: fadeInDown 1s both;
}

.service-column-left {
    display: block;
    position: relative;
    width: 100%;
    margin: 0 auto;
}

.service-icon {
    display: inline-block;
    padding: 15px 20px;
    color: #4a994a;
    font-size: 28px;
    line-height: 1;
    position: relative;
    z-index: 2;
    background: #fff;
}

.service-icon i {
    font-size: 28px;
    color: #4a994a;
    display: inline-block;
    transition: transform 0.4s ease-in-out, color 0.3s;
}

.service-item:hover .service-icon i {
    transform: scale(1.15) rotate(-6deg);
    color: #008001;
}

/* Barres décoratives : retirées (design cards à la place) */
.service-line,
.service-line-bottom {
    display: none !important;
}

/* ---------- 3 CARDS Présentation (Activités / Actions / Programmes) ---------- */
.actions-container {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 24px;
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.actions-container .actions-col {
    flex: 1 1 300px;
    min-width: 260px;
    max-width: 360px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 32px 24px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
    transition: transform 0.25s ease-out, box-shadow 0.25s ease-out, border-color 0.25s;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
}

.actions-container .actions-col:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(74, 153, 74, 0.15);
    border-color: var(--a21-green);
}

/* Icône : cercle vert doux en fond, icône verte au centre */
.actions-container .actions-col .service-item {
    animation: none !important;
    margin: 0 0 20px !important;
    padding: 0;
}

.actions-container .actions-col .service-column-left {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(74, 153, 74, 0.12);
    transition: background 0.25s;
    margin: 0 auto;
}

.actions-container .actions-col:hover .service-column-left {
    background: rgba(74, 153, 74, 0.22);
}

.actions-container .actions-col .service-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: transparent;
}

.actions-container .actions-col .service-icon i {
    font-size: 30px;
    color: var(--a21-green);
    transition: transform 0.4s ease-in-out;
}

.actions-container .actions-col:hover .service-icon i {
    transform: scale(1.15) rotate(-6deg);
}

/* Titre et description */
.actions-container .actions-col h5,
.actions-container .actions-col h4,
.actions-container .actions-col .wp-block-heading {
    font-size: 18px !important;
    font-weight: 700 !important;
    color: #1f2937 !important;
    margin: 0 0 12px !important;
    text-align: center !important;
    background: transparent !important;
    padding: 0 !important;
    display: block !important;
}

.actions-container .actions-col p {
    font-size: 14px;
    line-height: 1.55;
    color: #4b5563;
    text-align: center !important;
    margin: 0 !important;
}

/* Responsive : 1 colonne pleine largeur sous 720px */
@media (max-width: 720px) {
    .actions-container {
        gap: 16px;
        margin: 24px auto;
    }
    .actions-container .actions-col {
        flex: 1 1 100%;
        max-width: 480px;
        padding: 24px 20px;
    }
}

.service-column-right {
    display: none; /* prod l'utilise pour layouts en ligne, on garde vertical par défaut */
}

/* animate.css fadeInDown minimal (auto-hébergé pour éviter dépendance externe) */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translate3d(0, -20px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

/* ---------- Text-align : les paragraphes contenu doivent être justify (pas center) ---------- */
.entry-content p:not(.has-text-align-center):not(.has-text-align-left):not(.has-text-align-right) {
    text-align: justify;
    text-align-last: center;
}

/* Preserve center pour les paragraphes qui l'ont explicitement */
.entry-content p.has-text-align-center {
    text-align: center !important;
}
