/* ==========================================================================
   TEMPLATE SINGLE - Article de blog
   ========================================================================== */

/* Layout 2 colonnes */
.article-columns {
    display: flex;
    flex-wrap: nowrap;
    gap: var(--wp--preset--spacing--xl);
}

.article-main {
    flex: 1;
    min-width: 0;
    max-width: 880px;
    overflow: hidden;
}

.article-sidebar {
    flex: 0 0 300px;
    width: 300px;
    max-width: 300px;
}

/* Sidebar sticky */
.sidebar-sticky {
    position: sticky;
    top: 100px;
}

/* Force les patterns dans la sidebar à respecter la largeur */
.article-sidebar .wp-block-group.alignfull,
.article-sidebar .wp-block-group.alignwide {
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Stack les colonnes internes des patterns dans la sidebar */
.article-sidebar .wp-block-columns {
    flex-direction: column !important;
}

.article-sidebar .wp-block-column {
    flex-basis: 100% !important;
    width: 100% !important;
}

/* Ajustements typographiques pour la sidebar */
.article-sidebar h2 {
    font-size: var(--wp--preset--font-size--heading-4) !important;
}

.article-sidebar h3 {
    font-size: var(--wp--preset--font-size--body-large) !important;
}

.article-sidebar p {
    font-size: var(--wp--preset--font-size--small) !important;
}

/* Réduire le padding des patterns dans la sidebar */
.article-sidebar .wp-block-group[style*="padding"]:not(.widget-cta-recommend):not(.widget-cta-recommend__badge) {
    padding: var(--wp--preset--spacing--md) !important;
}

/* Responsive - Mobile */
@media (max-width: 900px) {
    .article-columns {
        flex-direction: column !important;
        gap: var(--wp--preset--spacing--lg);
    }

    .article-sidebar {
        display: none;
    }

    .article-main,
    .article-sidebar {
        flex: 1 1 100% !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .sidebar-sticky {
        position: static;
    }

    /* Restaurer les tailles sur mobile */
    .article-sidebar h2 {
        font-size: var(--wp--preset--font-size--heading-3) !important;
    }

    .article-sidebar p {
        font-size: var(--wp--preset--font-size--body) !important;
    }
}

/* Protéger la sidebar des styles globaux injectés par les blocs wp:html */
.article-sidebar table,
.article-sidebar th,
.article-sidebar td {
    all: revert;
}

/* Post terms (tags) styling */
.article-columns .wp-block-post-terms a {
    color: var(--wp--preset--color--secondary);
    text-decoration: none;
}

.article-columns .wp-block-post-terms a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   WIDGET CTA SIDEBAR
   ========================================================================== */

.widget-cta-recommend {
    width: 100%;
}

/* Badge styling */
.widget-cta-recommend__badge {
    gap: 6px !important;
    padding: 6px 12px !important;
    background: rgba(255, 255, 255, 0.15) !important;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 10px !important;
}

.widget-cta-recommend__badge p {
    font-size: 12px !important;
    font-weight: 600 !important;
    margin: 0 !important;
    line-height: 1 !important;
}

/* Override sidebar forced styles for this widget */
.article-sidebar .widget-cta-recommend {
    padding: var(--wp--preset--spacing--lg) !important;
}

.article-sidebar .widget-cta-recommend h3 {
    font-size: 18px !important;
}

.article-sidebar .widget-cta-recommend p {
    font-size: 14px !important;
}

/* Button hover effect */
.widget-cta-recommend .wp-block-button__link {
    transition: all 200ms ease;
}

.widget-cta-recommend .wp-block-button__link:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
}


/* ==========================================================================
   T3 — STICKY BAR MOBILE (articles uniquement)
   Barre fixe bottom:0, apparaît après 200px de scroll.
   ========================================================================== */

.sticky-bar-mobile {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: var(--wp--preset--color--white, #fff);
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(0);
    transition: transform 0.3s ease;
}

.sticky-bar-mobile[aria-hidden="true"] {
    transform: translateY(100%);
}

.sticky-bar-mobile__content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    max-height: 56px;
}

.sticky-bar-mobile__text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sticky-bar-mobile__title {
    font-size: var(--wp--preset--font-size--small, 0.9375rem);
    font-weight: 700;
    color: var(--wp--preset--color--text-dark, #1A1A1A);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sticky-bar-mobile__sub {
    font-size: 11px;
    color: var(--wp--preset--color--text-muted, #6B7280);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sticky-bar-mobile__btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 18px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #B0001D 0%, #DC2626 50%, #7C3AED 100%);
    border: none;
    border-radius: var(--wp--custom--border-radius--md, 8px);
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sticky-bar-mobile__btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(176, 0, 29, 0.3);
    color: #fff;
}

.sticky-bar-mobile__close {
    flex-shrink: 0;
    background: var(--wp--preset--color--muted, #F3F4F6);
    border: none;
    font-size: 20px;
    color: var(--wp--preset--color--text-muted, #6B7280);
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.sticky-bar-mobile__close:hover {
    opacity: 1;
}

/* Masquer sur desktop */
@media (min-width: 901px) {
    .sticky-bar-mobile {
        display: none;
    }
}

/* ==========================================================================
   T5 — CTA GUIDE GRATUIT INLINE (lien texte après 2e h2)
   ========================================================================== */

.cta-guide-inline {
    margin: var(--wp--preset--spacing--md) 0;
    padding: 14px 20px;
    background: var(--wp--preset--color--muted, #F3F4F6);
    border-left: 3px solid var(--wp--preset--color--secondary, #7C3AED);
    border-radius: 0;
    font-size: var(--wp--preset--font-size--body, 1rem);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.cta-guide-inline a {
    color: var(--wp--preset--color--text-dark, #1A1A1A);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.cta-guide-inline a:hover {
    color: var(--wp--preset--color--secondary, #7C3AED);
}

.cta-guide-inline a strong {
    font-weight: 700;
}

/* ==========================================================================
   T1 — CTA INLINE (callout éditorial après 3e et 6e h2)
   ========================================================================== */

.cta-inline {
    margin: var(--wp--preset--spacing--md) 0;
    padding: 14px 20px;
    background: var(--wp--preset--color--muted, #F3F4F6);
    border-left: 3px solid var(--wp--preset--color--secondary, #7C3AED);
    font-size: var(--wp--preset--font-size--body, 1rem);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.cta-inline--methodo {
    border-left-color: var(--wp--preset--color--primary, #B0001D);
}

.cta-inline__text {
    flex: 1;
    min-width: 0;
    color: var(--wp--preset--color--text-dark, #1A1A1A);
    font-weight: 500;
}

.cta-inline__icon {
    margin-right: 4px;
}

.cta-inline__btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    padding: 8px 18px;
    font-family: inherit;
    font-size: var(--wp--preset--font-size--small, 0.9375rem);
    font-weight: 600;
    color: var(--wp--preset--color--secondary, #7C3AED);
    background: transparent;
    border: 1px solid var(--wp--preset--color--secondary, #7C3AED);
    border-radius: var(--wp--custom--border-radius--md, 8px);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.cta-inline--methodo .cta-inline__btn {
    color: var(--wp--preset--color--primary, #B0001D);
    border-color: var(--wp--preset--color--primary, #B0001D);
}

.cta-inline__btn:hover {
    background: var(--wp--preset--color--secondary, #7C3AED);
    color: #fff;
}

.cta-inline--methodo .cta-inline__btn:hover {
    background: var(--wp--preset--color--primary, #B0001D);
    color: #fff;
}

/* Responsive mobile */
@media (max-width: 600px) {
    .cta-inline {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .cta-inline__btn {
        width: 100%;
        justify-content: center;
    }
}

/* ==========================================================================
   T2-B — SIDEBAR CTA FICHES v2
   ========================================================================== */

.widget-cta-fiches-v2 {
    background: #fff;
    border: 1px solid var(--wp--preset--color--border, #E5E7EB);
    border-radius: var(--wp--custom--border-radius--lg, 12px);
    padding: var(--wp--preset--spacing--md, 24px) var(--wp--preset--spacing--sm, 16px);
    text-align: center;
}

.widget-cta-fiches-v2__title {
    font-family: var(--wp--preset--font-family--heading, inherit);
    font-size: var(--wp--preset--font-size--medium, 1.125rem);
    font-weight: 700;
    color: var(--wp--preset--color--text-dark, #1A1A1A);
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.widget-cta-fiches-v2__desc {
    font-size: 14px;
    color: var(--wp--preset--color--text-muted, #9CA3AF);
    margin: 0 0 16px 0;
    line-height: 1.5;
}

.widget-cta-fiches-v2__btn {
    display: block;
    padding: 10px 20px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--wp--preset--color--secondary, #7C3AED);
    background: transparent;
    border: 1.5px solid var(--wp--preset--color--secondary, #7C3AED);
    border-radius: var(--wp--custom--border-radius--md, 8px);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.widget-cta-fiches-v2__btn:hover {
    background: var(--wp--preset--color--secondary, #7C3AED);
    color: #fff;
}

.widget-cta-fiches-v2__mention {
    font-size: var(--wp--preset--font-size--xs, 0.8125rem);
    color: var(--wp--preset--color--success, #10B981);
    margin: 12px 0 0 0;
    font-weight: 500;
}
