/* =============================================================================
   O2O Cleaning – Enhanced Single Post (Elementor-compatible, fixed overlay)
   ============================================================================= */

/* ---------- Reading Progress Bar ---------- */
#o2o-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    z-index: 2147483647;  /* max int — always on top of Elementor/sticky headers */
    pointer-events: none;
    background: rgba(37, 99, 235, 0.08);
}

#o2o-progress-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #2563eb 0%, #7c3aed 60%, #ec4899 100%);
    box-shadow: 0 0 8px rgba(37, 99, 235, 0.45);
    transition: width 80ms linear;
}

/* Hide Rank Math's inline TOC on desktop where our floating TOC is visible */
@media (min-width: 1461px) {
    .wp-block-rank-math-toc-block {
        display: none !important;
    }
}

/* ---------- Floating TOC (left side) ---------- */
#o2o-toc-float {
    position: fixed;
    left: -9999px;               /* off-screen until JS positions it */
    top: 110px;
    width: 240px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    scrollbar-width: thin;
    z-index: 990;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 18px 14px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    opacity: 0;
    transition: opacity 0.25s ease, top 0.15s linear;
    pointer-events: none;
}

/* Only when JS (a) found ≥1 heading AND (b) space is available */
#o2o-toc-float.o2o-toc-ready.o2o-toc-visible {
    opacity: 1;
    pointer-events: auto;
}

/* Dev fallback: if JS hasn't run but class exists, allow at safe offset */
#o2o-toc-float.o2o-toc-ready:not(.o2o-toc-visible) {
    left: -9999px;
}

.o2o-toc-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.8px;
    color: #9ca3af;
    text-transform: uppercase;
    margin: 0 0 12px;
}

#o2o-toc-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 18px;
}

#o2o-toc-nav a {
    display: block;
    font-size: 12.5px;
    line-height: 1.45;
    color: #4b5563;
    text-decoration: none;
    padding: 5px 9px;
    border-left: 3px solid transparent;
    border-radius: 0 4px 4px 0;
    transition: color 0.15s, background 0.15s, border-color 0.15s;
}

#o2o-toc-nav a:hover {
    color: #2563eb;
    background: #eff6ff;
    border-left-color: #93c5fd;
}

#o2o-toc-nav a.o2o-toc-active {
    color: #1d4ed8;
    font-weight: 600;
    background: #eff6ff;
    border-left-color: #2563eb;
}

#o2o-toc-nav a.o2o-h3 {
    padding-left: 20px;
    font-size: 11.5px;
}

/* Sidebar CTA inside TOC panel */
.o2o-toc-cta {
    border-top: 1px solid #e5e7eb;
    padding-top: 16px;
}

.o2o-toc-cta-title {
    font-size: 13px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 7px;
}

.o2o-toc-cta-body {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.5;
    margin: 0 0 14px;
}

.o2o-toc-cta-btn {
    display: block;
    text-align: center;
    background: #111827;
    color: #fff !important;
    text-decoration: none !important;
    padding: 9px 14px;
    border-radius: 7px;
    font-size: 12.5px;
    font-weight: 600;
    transition: background 0.2s;
}

.o2o-toc-cta-btn:hover {
    background: #2563eb;
}

/* Hard cut-off: never show floating TOC on narrow viewports */
@media (max-width: 1200px) {
    #o2o-toc-float {
        display: none !important;
    }
}

/* Floating Social Share removed 2026-04-17 — redundant with inline FB/Tw/Li/Rd
   bar at the top of every post, was overlapping Elementor right-sidebar CTAs. */

/* ---------- TL;DR Summary Block ---------- */
.o2o-tldr-block {
    background: #eff6ff;
    border-left: 4px solid #2563eb;
    border-radius: 0 8px 8px 0;
    padding: 14px 18px;
    margin: 24px 0 28px;
    font-size: 15px;
    line-height: 1.7;
    color: #1e3a5f;
}

.o2o-tldr-block strong {
    color: #1d4ed8;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    display: block;
    margin-bottom: 5px;
}

/* ---------- Callout Boxes (shortcodes) ---------- */
.o2o-callout {
    border-radius: 8px;
    padding: 18px 22px;
    margin: 28px 0;
    border-left: 4px solid;
}

.o2o-callout-header {
    display: flex;
    align-items: center;
    gap: 7px;
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 8px;
}

.o2o-callout-body {
    font-size: 15px;
    line-height: 1.7;
    margin: 0;
}

/* Pro Tip / Author's Note — teal */
.o2o-callout-tip {
    background: #ecfdf5;
    border-left-color: #10b981;
}
.o2o-callout-tip .o2o-callout-header { color: #059669; }
.o2o-callout-tip .o2o-callout-body   { color: #065f46; }

/* Warning — amber */
.o2o-callout-warning {
    background: #fffbeb;
    border-left-color: #f59e0b;
}
.o2o-callout-warning .o2o-callout-header { color: #d97706; }
.o2o-callout-warning .o2o-callout-body   { color: #78350f; }

/* Info — blue */
.o2o-callout-info {
    background: #eff6ff;
    border-left-color: #2563eb;
}
.o2o-callout-info .o2o-callout-header { color: #2563eb; }
.o2o-callout-info .o2o-callout-body   { color: #1e40af; }

/* ---------- CTA Banner (shortcode) ---------- */
.o2o-cta-banner {
    background: #0f172a;
    color: #fff;
    text-align: center;
    padding: 52px 36px;
    border-radius: 14px;
    margin: 40px 0;
}

.o2o-cta-banner h2 {
    color: #fff !important;
    font-size: 1.9rem;
    font-weight: 800;
    line-height: 1.25;
    margin: 0 0 12px !important;
}

.o2o-cta-subtitle {
    color: #94a3b8;
    font-size: 16px;
    margin: 0 0 28px;
}

.o2o-cta-link {
    display: inline-block;
    border: 2px solid #fff;
    color: #fff !important;
    background: transparent;
    padding: 13px 32px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 15px;
    text-decoration: none !important;
    transition: background 0.2s, color 0.2s;
}

.o2o-cta-link:hover {
    background: #fff;
    color: #0f172a !important;
}
