/* ------------------------------------------------------------------ */
/* Chapô (style de bloc core/paragraph « bbab-chapo »)                 */
/* ------------------------------------------------------------------ */

.is-style-bbab-chapo {
    font-size: 1.15em;
    line-height: 1.55;
    font-weight: 500;
    margin-block: 1.5em;
}

/* ------------------------------------------------------------------ */
/* Bloc dynamique « Article lié » (bbab/article-lie)                   */
/* ------------------------------------------------------------------ */

.bbab-article-lie {
    margin-block: 2em;
    padding: 1.25em;
    border: 1px solid color-mix(in srgb, currentColor 18%, transparent);
    border-radius: 12px;
}

.bbab-article-lie__inner {
    display: flex;
    gap: 1.25em;
    align-items: flex-start;
}

.bbab-article-lie__figure {
    flex: 0 0 9rem;
    margin: 0;
}

.bbab-article-lie__figure-link {
    display: block;
}

.bbab-article-lie__image {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 8px;
}

.bbab-article-lie__body {
    flex: 1 1 auto;
    min-width: 0;
}

.bbab-article-lie__kicker {
    margin: 0 0 .25em;
    font-size: .8em;
    letter-spacing: .06em;
    text-transform: uppercase;
    opacity: .7;
}

/* Titres en paragraphe : les sommaires automatiques ne les prennent pas pour des chapitres. */
.bbab-article-lie__title {
    margin: 0 0 .4em;
    font-size: 1.15em;
    font-weight: 700;
    line-height: 1.3;
}

.bbab-article-lie__link {
    text-decoration: none;
    color: inherit;
}

.bbab-article-lie__link:hover,
.bbab-article-lie__link:focus-visible {
    text-decoration: underline;
}

.bbab-article-lie__excerpt {
    margin: 0;
    font-size: .95em;
    line-height: 1.5;
}

@media (max-width: 600px) {
    .bbab-article-lie__inner {
        flex-direction: column;
    }

    .bbab-article-lie__figure {
        flex-basis: auto;
        width: 100%;
    }
}

/* ------------------------------------------------------------------ */
/* Bloc dynamique « Offre » (bbab/offre) — reprend le rendu historique */
/* ------------------------------------------------------------------ */

.bbab-offre {
    margin-block: 2em;
}

.bb-article-builder__offer-fallback {
    padding: 1.5em;
    border-radius: 12px;
    background-color: color-mix(in srgb, currentColor 6%, transparent);
}

.bb-article-builder__offer-logo-wrap {
    margin-bottom: 1em;
}

.bb-article-builder__offer-logo {
    display: block;
    max-width: 200px;
    height: auto;
}

.bb-article-builder__offer-advantage {
    margin: 0 0 .5em;
    font-weight: 600;
}

.bb-article-builder__offer-title {
    margin: 0 0 .5em;
    font-size: 1.5em;
    font-weight: 700;
    line-height: 1.25;
}

.bb-article-builder__offer-description {
    margin: 0 0 1em;
}

.bb-article-builder__offer-button {
    display: inline-block;
    padding: .6em 1.2em;
    border: 1px solid currentColor;
    border-radius: 999px;
    text-decoration: none;
    color: inherit;
}

.bb-article-builder__offer-button:hover,
.bb-article-builder__offer-button:focus-visible {
    text-decoration: underline;
}

/* Espace réservé dans l’éditeur avant sélection */
.bbab-block-placeholder {
    padding: 1em 1.25em;
    border: 1px dashed color-mix(in srgb, currentColor 35%, transparent);
    border-radius: 8px;
}

.bbab-block-placeholder p {
    margin: .25em 0 0;
    opacity: .75;
}

/* ------------------------------------------------------------------ */
/* Liens contextuels (maillage interne et sources externes)            */
/* ------------------------------------------------------------------ */

a.bbab-contextual-link,
a.bbab-contextual-link--internal,
a.bbab-contextual-link--external,
.custom-article-content .p_onecol_text_article a,
.custom-article-content .excerpt_article a {
    text-decoration: none;
    background-image: linear-gradient(to right, rgba(0, 0, 0, .22), rgba(0, 0, 0, .22)), linear-gradient(to right, currentColor, currentColor);
    background-repeat: no-repeat;
    background-position: 0 100%, 0 100%;
    background-size: 100% 1px, 0 2px;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
    transition: background-size 280ms ease, color 280ms ease;
}

.custom-article-content .p_onecol_text_article :is(ul, ol, blockquote) { margin-block: 1.25em; max-width: 100%; }
.custom-article-content .p_onecol_text_article :is(ul, ol) { padding-inline-start: 1.5em; }
.custom-article-content .p_onecol_text_article ol { list-style: decimal outside; }
.custom-article-content .p_onecol_text_article li + li { margin-block-start: .5em; }
.custom-article-content .p_onecol_text_article blockquote {
    margin-inline: 0;
    padding-inline-start: 1.25em;
    border-inline-start: 3px solid currentColor;
    overflow-wrap: anywhere;
}

a.bbab-contextual-link:hover,
a.bbab-contextual-link:focus-visible,
.custom-article-content .p_onecol_text_article a:hover,
.custom-article-content .p_onecol_text_article a:focus-visible,
.custom-article-content .excerpt_article a:hover,
.custom-article-content .excerpt_article a:focus-visible {
    background-size: 100% 1px, 100% 2px;
}

@supports (color: color-mix(in srgb, black 50%, transparent)) {
    a.bbab-contextual-link,
    .custom-article-content .p_onecol_text_article a,
    .custom-article-content .excerpt_article a {
        background-image: linear-gradient(to right, color-mix(in srgb, currentColor 25%, transparent), color-mix(in srgb, currentColor 25%, transparent)), linear-gradient(to right, currentColor, currentColor);
    }
}

@media (prefers-reduced-motion: reduce) {
    a.bbab-contextual-link,
    .custom-article-content .p_onecol_text_article a,
    .custom-article-content .excerpt_article a {
        transition: none;
    }
}

/* Galeries du plugin : légendes éditoriales sous l’image, jamais par-dessus (lisibles sur mobile). */
.wp-block-gallery.bbab-gallery.has-nested-images figure.wp-block-image {
    flex-direction: column;
    align-items: stretch;
}
.wp-block-gallery.bbab-gallery.has-nested-images figure.wp-block-image figcaption {
    position: static;
    max-height: none;
    overflow: visible;
    margin: .5em 0 0;
    padding: 0;
    background: none;
    color: inherit;
    font-size: .875em;
    line-height: 1.4;
    text-align: left;
    text-shadow: none;
}
.wp-block-gallery.bbab-gallery.has-nested-images figure.wp-block-image:has(figcaption)::before {
    content: none;
}
