/* css/sidebar.css
 * Port FR du systeme sidebar de contadordeprazo.com.br (bumps 147 + 217 + 220 + 240).
 *
 * Layout cible (shifted-tool):
 *   <hero/>                           full-width, hors shift
 *   <div.cdp-tool-shift>              grid 2-col >= 1500px
 *     <main.cdp-tool-body>            contenu de l'outil (max 960px)
 *     <aside.cdp-tool-sidebar>        ad sticky 300x250 a droite
 *
 * Breakpoint : 1500px. Sous, sidebar stack en bas.
 */

/* === Layout shifted-tool : 2-col tool body + sidebar ad === */
.cdp-tool-shift {
    width: 100%;
    box-sizing: border-box;
    margin: 0 auto;
    padding: 0 16px;
    max-width: 1600px;
    /* Largeur par defaut du body (overridable per-tool). 960px centrado em 1600 = ~144px de margem cada lado. */
    --tool-body-max-width: 960px;
}

.cdp-tool-body {
    min-width: 0;
    max-width: var(--tool-body-max-width);
    width: 100%;
}

@media (min-width: 1500px) {
    .cdp-tool-shift {
        display: grid;
        grid-template-columns: minmax(0, var(--tool-body-max-width)) 320px;
        justify-content: center;
        gap: 32px;
        align-items: start;
    }
    .cdp-tool-sidebar {
        align-self: start;
    }
    /* Sticky toggle : applique seulement si .cdp-tool-sidebar--sticky present (port CDP). */
    .cdp-tool-sidebar--sticky {
        position: sticky;
        top: 116px;
    }
}

@media (max-width: 1499px) {
    .cdp-tool-sidebar {
        margin: 24px auto 0;
        max-width: 320px;
    }
}

/* Per-tool max-width overrides */
.cdp-tool-shift--qst    { --tool-body-max-width: 1160px; }
.cdp-tool-shift--article { --tool-body-max-width: 1000px; }

/* === Sidebar ad-only (cdp-tool-sidebar) === */
.cdp-tool-sidebar {
    overflow: visible !important;
    box-sizing: border-box;
}

/* === Ad wrap (commun aux 2 types de sidebar) === */
.cdp-ad-wrap {
    padding: 16px 0 24px;
    margin: 0;
    text-align: center;
    contain: none;
    overflow: visible;
    width: 100%;
    box-sizing: border-box;
}

.cdp-tool-sidebar .ad-slot--sidebar-vertical-fixed,
.cdp-tool-sidebar .ad-slot--sidebar-300x250 {
    margin: 0 auto;
    contain: none;
    overflow: visible;
}

/* === Label "Publicite" (RGPD / LCEN art. 20) === */
.cdp-ad-label {
    display: block;
    color: #94a3b8;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
    text-align: center;
    line-height: 1;
}

body.dark-mode .cdp-ad-label {
    color: #6b7280;
}

/* === Print : sidebar et label cachees === */
@media print {
    .cdp-tool-shift {
        display: block !important;
    }
    .cdp-tool-sidebar,
    .cdp-ad-label {
        display: none !important;
    }
}
