/* ============================================================
   REPARIO MARKETING PRO — /docs/ stylesheet
   ============================================================
   Scoped to pages whose slug starts with "docs". Loaded via
   conditional enqueue in functions.php (rmp_enqueue_assets).

   Uses design tokens from assets/tokens/tokens.css (--color-*).
   ============================================================ */

/* ── Shell ───────────────────────────────────────────────── */

.docs-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 48px;
    max-width: 1280px;
    margin: 0 auto;
    padding: 32px 24px 96px;
    font-family: var(--font-display);
    color: inherit;
}

@media (max-width: 1024px) {
    .docs-shell {
        grid-template-columns: 240px minmax(0, 1fr);
        gap: 32px;
    }
}

@media (max-width: 860px) {
    .docs-shell {
        grid-template-columns: minmax(0, 1fr);
        padding-top: 88px;
    }
}

/* ── Sidebar ─────────────────────────────────────────────── */

.docs-sidebar {
    position: sticky;
    top: 96px;
    align-self: start;
    max-height: calc(100vh - 112px);
    overflow-y: auto;
}

.docs-sidebar__inner {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 20px;
    background: color-mix(in srgb, var(--color-surface-1) 85%, transparent);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
}

.docs-sidebar__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    color: #f5f5f8;
}

.docs-sidebar__brand-icon {
    font-size: 22px;
    line-height: 1;
}

.docs-sidebar__brand-text strong {
    color: var(--color-primary);
    font-weight: 800;
}

.docs-sidebar__search-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.docs-sidebar__search-input {
    width: 100%;
    padding: 10px 12px;
    border-radius: var(--radius-base);
    border: 1px solid var(--color-border);
    background: var(--color-surface-3);
    color: #f5f5f8;
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.docs-sidebar__search-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgb(var(--color-primary-rgb) / 0.2);
}

.docs-sidebar__section + .docs-sidebar__section {
    margin-top: 14px;
}

.docs-sidebar__section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
    margin: 0 0 6px;
}

.docs-sidebar__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.docs-sidebar__link {
    display: block;
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease;
}

.docs-sidebar__link:hover {
    background: color-mix(in srgb, var(--color-primary) 10%, transparent);
    color: #f5f5f8;
}

.docs-sidebar__link.is-active {
    background: color-mix(in srgb, var(--color-primary) 18%, transparent);
    color: #fff;
    font-weight: 700;
}

.docs-sidebar__lang {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 14px;
    border-top: 1px solid var(--color-border);
}

.docs-sidebar__lang-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
}

.docs-sidebar__lang-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.docs-sidebar__lang-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    background: var(--color-surface-3);
    color: var(--color-text-muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.docs-sidebar__lang-btn.is-active {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

.docs-sidebar__lang-btn.is-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.docs-sidebar__cta {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 14px 16px;
    border-radius: var(--radius-base);
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
    color: #fff;
    text-decoration: none;
    text-align: center;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.docs-sidebar__cta:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow-primary);
}

.docs-sidebar__cta-title {
    font-weight: 800;
    font-size: 14px;
    letter-spacing: 0.01em;
}

.docs-sidebar__cta-sub {
    font-size: 12px;
    opacity: 0.85;
    margin-top: 2px;
}

/* ── Hamburger toggle (mobile only) ──────────────────────── */

.docs-sidebar-toggle {
    display: none;
    position: fixed;
    top: 82px;
    left: 12px;
    z-index: 80;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-base);
    border: 1px solid var(--color-border);
    background: var(--color-surface-1);
    color: #f5f5f8;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0,0,0,0.2);
}

@media (max-width: 860px) {
    .docs-sidebar-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .docs-sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        top: 72px;
        bottom: 0;
        width: min(320px, 85vw);
        max-height: none;
        z-index: 70;
        background: var(--color-bg-dark);
        transform: translateX(-105%);
        transition: transform 0.25s ease;
        padding: 16px;
        overflow-y: auto;
    }

    .docs-sidebar.is-open {
        transform: translateX(0);
    }
}

/* ── Content ─────────────────────────────────────────────── */

.docs-content {
    max-width: 780px;
    min-width: 0;
    color: #f5f5f8;
    line-height: 1.7;
}
/* Buggy rule removed 2026-04-21 : body.bg-background-light est toujours
   present (classe Tailwind tenace) et .dark est sur <html>, pas <body>.
   Light mode override est gere plus bas avec html:not(.dark). */

.docs-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 13px;
    color: var(--color-text-muted);
    margin-bottom: 16px;
}

.docs-breadcrumb__link {
    color: var(--color-text-muted);
    text-decoration: none;
}

.docs-breadcrumb__link:hover {
    color: var(--color-primary);
}

.docs-breadcrumb__current {
    color: #f5f5f8;
    font-weight: 600;
}

.docs-breadcrumb__sep {
    color: var(--color-border);
}

.docs-content__header {
    margin-bottom: 24px;
}

.docs-content__roles {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}

.docs-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: 1px solid transparent;
}

.docs-badge--primary {
    background: rgb(var(--color-primary-rgb) / 0.15);
    color: var(--color-primary);
    border-color: rgb(var(--color-primary-rgb) / 0.3);
}

.docs-badge--info {
    background: rgb(var(--color-info-rgb) / 0.15);
    color: var(--color-info);
    border-color: rgb(var(--color-info-rgb) / 0.3);
}

.docs-badge--warning {
    background: rgb(var(--color-warning-rgb) / 0.15);
    color: var(--color-warning);
    border-color: rgb(var(--color-warning-rgb) / 0.3);
}

.docs-badge--success {
    background: rgb(var(--color-success-rgb) / 0.15);
    color: var(--color-success);
    border-color: rgb(var(--color-success-rgb) / 0.3);
}

.docs-content__h1 {
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin: 0 0 10px;
}

.docs-content__meta {
    font-size: 13px;
    color: var(--color-text-muted);
    margin: 0;
}

.docs-content__intro {
    font-size: 17px;
    color: var(--color-text-muted);
    margin-bottom: 32px;
}

.docs-content__intro p + p {
    margin-top: 12px;
}

.docs-content__section + .docs-content__section {
    margin-top: 36px;
}

.docs-content__h2 {
    font-size: clamp(22px, 2.2vw, 28px);
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 0 0 16px;
    padding-top: 8px;
    color: #f5f5f8;
}

/* Buggy rule removed 2026-04-21 : cf note plus haut. */

.docs-content__body p {
    margin: 0 0 14px;
}

.docs-content__body h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 24px 0 10px;
}

.docs-content__body ul,
.docs-content__body ol {
    margin: 0 0 16px;
    padding-left: 22px;
}

.docs-content__body li + li {
    margin-top: 6px;
}

.docs-content__body code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.92em;
    padding: 1px 6px;
    border-radius: 6px;
    background: var(--color-surface-3);
    border: 1px solid var(--color-border);
}

.docs-content__body a {
    color: var(--color-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.docs-content__body a:hover {
    color: var(--color-primary-hover);
}

/* ── Tip box ─────────────────────────────────────────────── */

.docs-tip {
    background: rgb(var(--color-success-rgb) / 0.1);
    border-left: 3px solid var(--color-success);
    border-radius: 0 var(--radius-base) var(--radius-base) 0;
    padding: 14px 16px;
    margin: 16px 0;
}

.docs-tip__title {
    display: block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-success);
    margin-bottom: 4px;
}

.docs-tip__text {
    margin: 0;
    font-size: 15px;
    color: inherit;
}

/* ── Steps list ──────────────────────────────────────────── */

.docs-steps {
    list-style: none;
    counter-reset: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.docs-steps__item {
    display: flex;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-base);
    background: color-mix(in srgb, var(--color-surface-1) 75%, transparent);
}

.docs-steps__badge {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--color-primary);
    color: #fff;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.docs-steps__content {
    min-width: 0;
}

.docs-steps__title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 6px;
}

.docs-steps__body {
    color: var(--color-text-muted);
    font-size: 15px;
}

.docs-steps__body p {
    margin: 0 0 6px;
}

/* ── Next page link ──────────────────────────────────────── */

.docs-content__next {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--color-border);
}

.docs-next-link {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 18px;
    border-radius: var(--radius-base);
    background: rgb(var(--color-primary-rgb) / 0.1);
    border: 1px solid rgb(var(--color-primary-rgb) / 0.3);
    color: inherit;
    text-decoration: none;
    transition: background 0.15s ease, transform 0.15s ease;
}

.docs-next-link:hover {
    background: rgb(var(--color-primary-rgb) / 0.2);
    transform: translateY(-1px);
}

.docs-next-link__label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-primary);
}

.docs-next-link__title {
    font-weight: 700;
    font-size: 16px;
}

/* ── Index cards (docs home) ─────────────────────────────── */

.docs-index-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin: 24px 0 40px;
}

.docs-index-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: color-mix(in srgb, var(--color-surface-1) 75%, transparent);
    color: inherit;
    text-decoration: none;
    transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.docs-index-card:hover {
    transform: translateY(-2px);
    border-color: rgb(var(--color-primary-rgb) / 0.5);
    background: color-mix(in srgb, var(--color-surface-1) 90%, transparent);
}

.docs-index-card__icon {
    font-size: 28px;
    line-height: 1;
}

.docs-index-card__title {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
}

.docs-index-card__desc {
    font-size: 14px;
    color: var(--color-text-muted);
    margin: 0;
}

.docs-index-section-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
    margin: 32px 0 12px;
}

/* ── FAQ list ────────────────────────────────────────────── */

.docs-faq {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

.docs-faq__item {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-base);
    background: color-mix(in srgb, var(--color-surface-1) 70%, transparent);
    padding: 14px 18px;
}

.docs-faq__question {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 6px;
}

.docs-faq__answer {
    color: var(--color-text-muted);
    font-size: 15px;
    margin: 0;
}

/* ── Screen reader helper ────────────────────────────────── */

.docs-shell .screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* ── Contrast fixes dark mode (2026-04-21) ────────────────
   Remplace --color-text-muted (#9d9db9) sur fond --color-bg-dark
   (#0f0f23) par des valeurs au contraste WCAG AA.
   !important utilise pour surpasser Tailwind preflight et
   dark:text-slate-100 utility du body. */

.docs-shell .docs-content              { color: #e2e2f0 !important; }
.docs-shell .docs-content__h1          { color: #ffffff !important; }
.docs-shell .docs-content__h2          { color: #f0f0ff !important; }
.docs-shell .docs-content__body h3,
.docs-shell .docs-steps__title,
.docs-shell .docs-index-card__title,
.docs-shell .docs-faq__question        { color: #f0f0ff !important; }
.docs-shell .docs-content__intro,
.docs-shell .docs-content__intro p,
.docs-shell .docs-content__body p,
.docs-shell .docs-faq__answer          { color: #e2e2f0 !important; }
.docs-shell .docs-content__meta,
.docs-shell .docs-breadcrumb,
.docs-shell .docs-breadcrumb__link,
.docs-shell .docs-index-section-title,
.docs-shell .docs-sidebar__section-title,
.docs-shell .docs-sidebar__lang-title  { color: #b8b8d0 !important; }
.docs-shell .docs-breadcrumb__link:hover { color: var(--color-primary) !important; }
.docs-shell .docs-breadcrumb__current  { color: #ffffff !important; }
.docs-shell .docs-steps__body,
.docs-shell .docs-index-card__desc     { color: #c8c8e0 !important; }
.docs-shell .docs-sidebar__link        { color: #b0b0cc !important; }
.docs-shell .docs-sidebar__link:hover,
.docs-shell .docs-sidebar__link.is-active { color: #ffffff !important; }
.docs-shell .docs-sidebar__lang-btn    { color: #b0b0cc !important; }

/* Light mode override (pour le theme switcher globalement en light) */
html:not(.dark) body .docs-shell .docs-content,
html:not(.dark) body .docs-shell .docs-content__h1,
html:not(.dark) body .docs-shell .docs-content__h2,
html:not(.dark) body .docs-shell .docs-content__body h3,
html:not(.dark) body .docs-shell .docs-steps__title,
html:not(.dark) body .docs-shell .docs-index-card__title,
html:not(.dark) body .docs-shell .docs-faq__question,
html:not(.dark) body .docs-shell .docs-content__intro,
html:not(.dark) body .docs-shell .docs-content__intro p,
html:not(.dark) body .docs-shell .docs-content__body p,
html:not(.dark) body .docs-shell .docs-faq__answer { color: #111827 !important; }
html:not(.dark) body .docs-shell .docs-content__meta,
html:not(.dark) body .docs-shell .docs-breadcrumb,
html:not(.dark) body .docs-shell .docs-breadcrumb__link,
html:not(.dark) body .docs-shell .docs-index-section-title { color: #6b7280 !important; }
