/* ================================================================
   STYLES DES BLOCS GUTENBERG — Frontend Bio et Local
   Miroir de editor-style.css pour le rendu public des pages.
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Boogaloo&display=swap');

/* ── Variables ───────────────────────────────────────────────── */
:root {
    --rose:  #D2097A;
    --vert:  #009C50;
    --jaune: #FFDB16;
}

/* ── Mise en page du contenu de la page ─────────────────────── */
.site-main .entry-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px 16px;
}

@media (min-width: 992px) {
    .site-main .entry-content {
        padding: 12px 16px 24px;
    }

    /* ── Override du sélecteur WordPress qui centre le contenu dans les sections ── */
    /* WordPress génère : .is-layout-constrained > :where(:not(.alignleft)...) { max-width: 645px; margin: auto !important } */
    /* On surcharge pour nos sections spécifiques avec une spécificité plus haute */
    .wp-block-group.is-style-section-verte.is-layout-constrained > :where(:not(.alignleft):not(.alignright):not(.alignfull):not(.wp-block-file)),
    .wp-block-group.is-style-section-verte .is-layout-constrained > :where(:not(.alignleft):not(.alignright):not(.alignfull):not(.wp-block-file)),
    .wp-block-group.is-style-section-rose.is-layout-constrained > :where(:not(.alignleft):not(.alignright):not(.alignfull):not(.wp-block-file)),
    .wp-block-group.is-style-section-rose .is-layout-constrained > :where(:not(.alignleft):not(.alignright):not(.alignfull):not(.wp-block-file)),
    .wp-block-group.is-style-section-blanche.is-layout-constrained > :where(:not(.alignleft):not(.alignright):not(.alignfull):not(.wp-block-file)),
    .wp-block-group.is-style-section-blanche .is-layout-constrained > :where(:not(.alignleft):not(.alignright):not(.alignfull):not(.wp-block-file)) {
        max-width: 100%;
        margin-left: 100px !important;
        margin-right: 100px !important;
    }

    /* Boutons de téléchargement : alignés à gauche avec le même retrait */
    .wp-block-group.is-style-section-verte.is-layout-constrained > .wp-block-file,
    .wp-block-group.is-style-section-verte .is-layout-constrained > .wp-block-file,
    .wp-block-group.is-style-section-rose.is-layout-constrained > .wp-block-file,
    .wp-block-group.is-style-section-rose .is-layout-constrained > .wp-block-file,
    .wp-block-group.is-style-section-blanche.is-layout-constrained > .wp-block-file,
    .wp-block-group.is-style-section-blanche .is-layout-constrained > .wp-block-file {
        margin-left: 100px !important;
        margin-right: auto !important;
    }
}

/* Les blocs alignfull sortent du conteneur pour occuper toute la largeur */
.site-main .entry-content > .alignfull {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

/* ── Bouton Rose ─────────────────────────────────────────────── */
.wp-block-button.is-style-rose .wp-block-button__link {
    background-color: #D2097A;
    color: #fff;
    border-radius: 10px;
    border: none;
    padding: 12px 28px;
    font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-weight: 700;
    text-decoration: none;
}
.wp-block-button.is-style-rose .wp-block-button__link:hover {
    opacity: 0.85;
    color: #fff;
}

/* ── Bouton Vert ─────────────────────────────────────────────── */
.wp-block-button.is-style-vert .wp-block-button__link {
    background-color: #009C50;
    color: #fff;
    border-radius: 10px;
    border: none;
    padding: 12px 28px;
    font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-weight: 700;
    text-decoration: none;
}
.wp-block-button.is-style-vert .wp-block-button__link:hover {
    opacity: 0.85;
    color: #fff;
}

/* ── Section fond vert ───────────────────────────────────────── */
.wp-block-group.is-style-section-verte {
    background-color: #009C50;
    color: #fff;
    padding: 40px 24px;
}
.wp-block-group.is-style-section-verte h1,
.wp-block-group.is-style-section-verte h2,
.wp-block-group.is-style-section-verte h3,
.wp-block-group.is-style-section-verte h4,
.wp-block-group.is-style-section-verte p,
.wp-block-group.is-style-section-verte li {
    color: #fff;
}

/* ── Section fond rose ───────────────────────────────────────── */
.wp-block-group.is-style-section-rose {
    background-color: #D2097A;
    color: #fff;
    padding: 40px 24px;
}
.wp-block-group.is-style-section-rose h1,
.wp-block-group.is-style-section-rose h2,
.wp-block-group.is-style-section-rose h3,
.wp-block-group.is-style-section-rose h4,
.wp-block-group.is-style-section-rose p,
.wp-block-group.is-style-section-rose li {
    color: #fff;
}

/* ── Section fond blanc ──────────────────────────────────────── */
.wp-block-group.is-style-section-blanche {
    background-color: #ffffff;
    color: #000000;
    padding: 40px 24px;
}
.wp-block-group.is-style-section-blanche h1,
.wp-block-group.is-style-section-blanche h2,
.wp-block-group.is-style-section-blanche h4 {
    font-family: 'Boogaloo', 'Arial Rounded MT Bold', sans-serif;
    color: #009C50;
    font-weight: 400;
}
.wp-block-group.is-style-section-blanche h3 {
    font-family: 'Boogaloo', 'Arial Rounded MT Bold', sans-serif;
    color: #000 !important;
    font-weight: 400;
}

/* ── Titre Bio et Local ──────────────────────────────────────── */
.wp-block-heading.is-style-titre-bio {
    font-family: 'Boogaloo', 'Arial Rounded MT Bold', sans-serif;
    color: #D2097A;
    text-transform: uppercase;
    font-weight: 400;
    font-size: 32px;
    line-height: 1.1;
    margin-bottom: 24px;
}
@media (min-width: 768px) {
    .wp-block-heading.is-style-titre-bio { font-size: 42px; }
}

/* ── Séparateur vert ─────────────────────────────────────────── */
.wp-block-separator.is-style-vert {
    border-color: #009C50;
    border-top-width: 3px;
}

/* ── Accordion FAQ Bio et Local (core/accordion WP 6.9) ─────── */

/* Un seul cadre rose arrondi autour de tout l'accordéon, items collés */
.entry-content .wp-block-accordion {
    --wp--style--block-gap: 0px;
    border: 2px solid #D2097A;
    border-radius: 12px;
    overflow: hidden;
}

/* Séparateur entre items (ligne rose, sauf après le dernier) */
.entry-content .wp-block-accordion-item:not(:last-child) {
    border-bottom: 2px solid #D2097A;
}

/* Texte noir (override h3 vert de section-blanche) */
.entry-content .wp-block-accordion-heading,
.entry-content .wp-block-accordion-heading__toggle,
.entry-content .wp-block-accordion-heading__toggle-title {
    color: #000 !important;
    font-family: system-ui, -apple-system, 'Segoe UI', sans-serif !important;
    font-weight: 700 !important;
    font-size: 15px !important;
}

/* Bouton toggle */
.entry-content .wp-block-accordion-heading__toggle {
    width: 100%;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    margin: 0;
    line-height: 1.4;
}

/* Ligne de séparation titre / contenu quand item ouvert */
.entry-content .wp-block-accordion-item.is-open .wp-block-accordion-heading__toggle {
    border-bottom: 2px solid #D2097A;
}

.entry-content .wp-block-accordion-heading__toggle-title {
    flex: 1;
}

/* Masquer le + natif de WP */
.entry-content .wp-block-accordion-heading__toggle-icon {
    display: none;
}

/* Chevron ^ rose */
.entry-content .wp-block-accordion-heading__toggle::after {
    content: '';
    display: inline-block;
    flex-shrink: 0;
    width: 10px;
    height: 10px;
    border-right: 2.5px solid #D2097A;
    border-top: 2.5px solid #D2097A;
    transform: rotate(-45deg) translateY(3px);
    transition: transform .25s ease;
}

.entry-content .wp-block-accordion-item.is-open .wp-block-accordion-heading__toggle::after {
    transform: rotate(135deg) translateY(0);
}

/* Panneau de contenu */
.entry-content .wp-block-accordion-panel {
    padding: 12px 20px 16px;
}

/* ── Dans une section verte ─────────────────────────────────── */
.wp-block-group.is-style-section-verte .wp-block-accordion {
    border-color: rgba(255, 255, 255, 0.6);
}
.wp-block-group.is-style-section-verte .wp-block-accordion-item:not(:last-child) {
    border-bottom-color: rgba(255, 255, 255, 0.6);
}
.wp-block-group.is-style-section-verte .wp-block-accordion-heading,
.wp-block-group.is-style-section-verte .wp-block-accordion-heading__toggle,
.wp-block-group.is-style-section-verte .wp-block-accordion-heading__toggle-title {
    color: #fff !important;
}
.wp-block-group.is-style-section-verte .wp-block-accordion-item.is-open .wp-block-accordion-heading__toggle {
    border-bottom-color: rgba(255, 255, 255, 0.6);
}
.wp-block-group.is-style-section-verte .wp-block-accordion-heading__toggle::after {
    border-right-color: #fff;
    border-top-color: #fff;
}
.wp-block-group.is-style-section-verte .wp-block-accordion-panel {
    color: #fff;
}

/* ── Fichier PDF Bio et Local (core/file) ────────────────────── */

/* Variante blanc (fond blanc, bordure + texte + icônes verts) */
.wp-block-file.is-style-ressource-pdf-blanc {
    background-color: #fff;
    border: 2px solid #009C50;
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    text-decoration: none;
}
.wp-block-file.is-style-ressource-pdf-blanc .wp-block-file__content-wrapper {
    flex: 1;
    min-width: 0;
}
.wp-block-file.is-style-ressource-pdf-blanc a:not(.wp-block-file__button) {
    color: #009C50;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
    padding-left: 34px;
}
.wp-block-file.is-style-ressource-pdf-blanc a:not(.wp-block-file__button)::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 26px;
    height: 26px;
    background-image: url('../images/icons/pdf-green.svg');
    background-repeat: no-repeat;
    background-size: contain;
}
.wp-block-file.is-style-ressource-pdf-blanc .wp-block-file__button {
    background: transparent;
    border: none;
    padding: 0;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    font-size: 0;
    color: transparent;
    background-image: url('../images/icons/down-arrow-grren.svg');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 22px 22px;
    cursor: pointer;
}
.wp-block-file.is-style-ressource-pdf-blanc .wp-block-file__button:hover {
    opacity: 0.8;
}

/* Variante verte (fond vert, icônes blancs) */
.wp-block-file.is-style-ressource-pdf {
    background-color: #009C50;
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    text-decoration: none;
}
.wp-block-file.is-style-ressource-pdf .wp-block-file__content-wrapper {
    flex: 1;
    min-width: 0;
}
.wp-block-file.is-style-ressource-pdf a:not(.wp-block-file__button) {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
    padding-left: 34px;
}
.wp-block-file.is-style-ressource-pdf a:not(.wp-block-file__button)::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 26px;
    height: 26px;
    background-image: url('../images/icons/pdf-white.svg');
    background-repeat: no-repeat;
    background-size: contain;
}
.wp-block-file.is-style-ressource-pdf .wp-block-file__button {
    background: transparent;
    border: none;
    padding: 0;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    font-size: 0;
    color: transparent;
    background-image: url('../images/icons/down-arrow-white.svg');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 22px 22px;
    cursor: pointer;
}
.wp-block-file.is-style-ressource-pdf .wp-block-file__button:hover {
    opacity: 0.8;
}

/* ── Tailles h2 / h3 responsives (override les styles inline des patterns) ── */
.entry-content h2,
.wp-block-group h2 {
    font-size: 28px !important;
}
.entry-content h3,
.wp-block-group h3 {
    font-size: 22px !important;
}
@media (min-width: 768px) {
    .entry-content h2,
    .wp-block-group h2 {
        font-size: 32px !important;
    }
    .entry-content h3,
    .wp-block-group h3 {
        font-size: 28px !important;
    }
}

/* ── Classes couleur générées par theme.json ─────────────────── */
.has-rose-color        { color: #D2097A !important; }
.has-vert-color        { color: #009C50 !important; }
.has-jaune-color       { color: #FFDB16 !important; }
.has-blanc-color       { color: #ffffff !important; }
.has-noir-color        { color: #000000 !important; }

.has-rose-background-color        { background-color: #D2097A !important; }
.has-vert-background-color        { background-color: #009C50 !important; }
.has-jaune-background-color       { background-color: #FFDB16 !important; }
.has-blanc-background-color       { background-color: #ffffff !important; }
.has-noir-background-color        { background-color: #000000 !important; }
.has-gris-clair-background-color  { background-color: #f5f5f5 !important; }

/* ── Police Boogaloo ─────────────────────────────────────────── */
.has-boogaloo-font-family {
    font-family: 'Boogaloo', 'Arial Rounded MT Bold', sans-serif;
}
