/* ═══════════════════════════════════════════════════════════════
   PREMIUM EFFECTS — Trading Post ("The Casino Has an API")
   Scoped to: .post-article[data-post-slug="trading"]
   ═══════════════════════════════════════════════════════════════ */

/* --- Tokens --- */
.post-article[data-post-slug="trading"] {
    --tp-accent: var(--color-accent);
    --tp-accent-dim: var(--accent-dim);
    --tp-surface: var(--color-surface);
    --tp-border: var(--border-subtle);
    --tp-text: var(--text-primary);
    --tp-text-sec: var(--text-secondary);
    --tp-text-muted: var(--color-text-muted, #6b6b6b);
    --tp-heading: var(--text-heading, var(--tp-text));
    --tp-venue-line: var(--color-accent);
    --tp-toc-num: var(--color-accent);
    --tp-receipt-accent: var(--color-accent);
    --tp-divider: var(--border-subtle);
}

[data-theme='dark'] .post-article[data-post-slug="trading"] {
    --tp-text-muted: #7c879b;
    --tp-venue-line: #e57373;
    --tp-toc-num: #e57373;
    --tp-receipt-accent: #e57373;
}


/* ═══════════════════════════════════════
   0. PROGRESS BAR
   ═══════════════════════════════════════ */
.trading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: var(--color-accent);
    z-index: 9999;
    transition: width 80ms linear;
    pointer-events: none;
}

[data-theme='dark'] .trading-progress {
    background: #e57373;
    box-shadow: 0 0 12px rgba(229, 115, 115, 0.35);
}


/* ═══════════════════════════════════════
   1. POST SHELL
   ═══════════════════════════════════════ */
.post-article[data-post-slug="trading"] .post-shell {
    max-width: 780px;
}


/* ═══════════════════════════════════════
   2. POST HEADER — cinematic, spacious
   ═══════════════════════════════════════ */
.post-article[data-post-slug="trading"] .post-header {
    padding-bottom: var(--space-9);
    margin-bottom: var(--space-9);
    border-bottom: 1px solid var(--tp-border);
}

.post-article[data-post-slug="trading"] .post-date time {
    font-size: 0.72rem;
    letter-spacing: 0.18em;
}

.post-article[data-post-slug="trading"] .post-title {
    font-size: clamp(2.6rem, 5.5vw, 3.8rem);
    letter-spacing: -0.025em;
    line-height: 1.05;
    margin-bottom: var(--space-5);
}

.post-article[data-post-slug="trading"] .post-description {
    font-size: 1.12rem;
    line-height: 1.7;
    max-width: 52ch;
    color: var(--tp-text-sec);
    margin-top: var(--space-2);
}

/* Hide the empty tags list */
.post-article[data-post-slug="trading"] .post-tags:empty,
.post-article[data-post-slug="trading"] .post-tags:not(:has(li)) {
    display: none;
}


/* ═══════════════════════════════════════
   3. BODY TEXT — editorial rhythm
   ═══════════════════════════════════════ */
.post-article[data-post-slug="trading"] .post-content {
    gap: 0;
}

.post-article[data-post-slug="trading"] .post-content > p,
.post-article[data-post-slug="trading"] .post-content > li {
    font-size: clamp(1.06rem, 0.96rem + 0.35vw, 1.15rem);
    line-height: 1.85;
    max-width: 65ch;
    color: var(--tp-text-sec);
    text-wrap: pretty;
    margin-bottom: 1.35rem;
}

/* Short punchy lines get tighter spacing above — visual rhythm */
.post-article[data-post-slug="trading"] .post-content > p + p {
    margin-top: 0;
}


/* ═══════════════════════════════════════
   4. DISCLAIMER — quiet, no icon
   ═══════════════════════════════════════ */
.post-article[data-post-slug="trading"] .post-content .disclaimer {
    position: relative;
    background: transparent;
    border: none;
    border-left: 2px solid var(--tp-border);
    border-radius: 0;
    padding: 0.6rem 0 0.6rem 1.4rem;
    margin: 0 0 2.5rem;
    box-shadow: none;
}

.post-article[data-post-slug="trading"] .post-content .disclaimer::before {
    display: none;
}

.post-article[data-post-slug="trading"] .post-content .disclaimer p,
.post-article[data-post-slug="trading"] .post-content .disclaimer strong {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    letter-spacing: 0.02em;
    line-height: 1.65;
    color: var(--tp-text-muted);
    margin-bottom: 0;
}

.post-article[data-post-slug="trading"] .post-content .disclaimer strong {
    color: var(--tp-text-sec);
    display: inline;
    margin-bottom: 0;
}

.post-article[data-post-slug="trading"] .post-content .disclaimer p + p {
    margin-top: 0.25rem;
}


/* ═══════════════════════════════════════
   5. TABLE OF CONTENTS
   ═══════════════════════════════════════ */
.post-article[data-post-slug="trading"] .post-content > h2#content {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--tp-text-muted);
    border-top: none;
    padding-top: 0;
    margin-top: 3rem;
    margin-bottom: 0.8rem;
}

.post-article[data-post-slug="trading"] .post-content > h2#content::before {
    display: none;
}

.post-article[data-post-slug="trading"] .post-content > h2#content a {
    color: inherit;
    border: none !important;
}

.post-article[data-post-slug="trading"] .post-content > ul:first-of-type {
    position: relative;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0 0 0 0;
    margin: 0 0 3rem;
    list-style: none;
    counter-reset: toc-counter;
}

.post-article[data-post-slug="trading"] .post-content > ul:first-of-type::before {
    display: none;
}

.post-article[data-post-slug="trading"] .post-content > ul:first-of-type li {
    counter-increment: toc-counter;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    padding: 0.5rem 0;
    border-bottom: none;
    position: relative;
    padding-left: 2.2rem;
    list-style: none;
    color: var(--tp-text-sec);
}

.post-article[data-post-slug="trading"] .post-content > ul:first-of-type li::before {
    content: counter(toc-counter, decimal-leading-zero);
    position: absolute;
    left: 0;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--tp-toc-num);
    letter-spacing: 0.04em;
}

.post-article[data-post-slug="trading"] .post-content > ul:first-of-type li a {
    color: var(--tp-text-sec) !important;
    border-bottom: none !important;
    transition: color 0.15s ease;
}

.post-article[data-post-slug="trading"] .post-content > ul:first-of-type li a:hover {
    color: var(--tp-accent) !important;
}


/* ═══════════════════════════════════════
   6. SECTION HEADERS (H2) — major venue breaks
   ═══════════════════════════════════════ */
.post-article[data-post-slug="trading"] .post-content > h2 {
    position: relative;
    font-size: clamp(1.6rem, 1.3rem + 1.1vw, 2.1rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--tp-heading);
    margin-top: 4.5rem;
    margin-bottom: 1.8rem;
    padding-top: 3rem;
    padding-bottom: 0;
    border-top: none;
    border-bottom: none;
}

.post-article[data-post-slug="trading"] .post-content > h2::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--tp-venue-line);
}

/* Header anchors — don't underline */
.post-article[data-post-slug="trading"] .post-content > h2 a.header-anchor {
    color: inherit;
    border: none !important;
    text-decoration: none !important;
}


/* ═══════════════════════════════════════
   7. SUB-HEADERS (H3) — inline label
   ═══════════════════════════════════════ */
.post-article[data-post-slug="trading"] .post-content > h3 {
    font-family: var(--font-mono);
    color: var(--tp-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.68rem;
    font-weight: 600;
    margin-top: 2.8rem;
    margin-bottom: 0.8rem;
    display: block;
    padding: 0;
    background: none;
    border: none;
    border-radius: 0;
}


/* ═══════════════════════════════════════
   8. BLOCKQUOTES — receipt evidence cards
   ═══════════════════════════════════════ */
.post-article[data-post-slug="trading"] .post-content blockquote {
    position: relative;
    background: var(--tp-surface);
    border: 1px solid var(--tp-border);
    border-left: 2px solid var(--tp-receipt-accent);
    border-radius: 0;
    padding: 1.6rem 1.8rem;
    margin: 2rem 0 2.5rem;
}

.post-article[data-post-slug="trading"] .post-content blockquote::before {
    content: 'RECEIPT';
    position: absolute;
    top: -8px;
    left: 14px;
    padding: 0 6px;
    background: var(--color-bg);
    font-family: var(--font-mono);
    font-size: 0.56rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--tp-receipt-accent);
}

.post-article[data-post-slug="trading"] .post-content blockquote p {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    line-height: 1.8;
    color: var(--tp-text-sec);
    max-width: 60ch;
    margin-bottom: 0;
}

.post-article[data-post-slug="trading"] .post-content blockquote strong {
    color: var(--tp-text);
    font-weight: 600;
}


/* ═══════════════════════════════════════
   9. FIGURE / IMAGE
   ═══════════════════════════════════════ */
.post-article[data-post-slug="trading"] .post-content figure {
    position: relative;
    display: grid;
    gap: var(--space-3);
    margin: 2.5rem 0 3rem;
    padding: 0;
}

.post-article[data-post-slug="trading"] .post-content figure img {
    width: 100%;
    height: auto;
    border: 1px solid var(--tp-border);
}

.post-article[data-post-slug="trading"] .post-content figcaption {
    font-family: var(--font-mono);
    font-size: 0.76rem;
    color: var(--tp-text-muted);
    line-height: 1.6;
    letter-spacing: 0.01em;
    padding-left: 1rem;
    border-left: 2px solid var(--tp-border);
}


/* ═══════════════════════════════════════
   10. INLINE LINKS
   ═══════════════════════════════════════ */
.post-article[data-post-slug="trading"] .post-content p a,
.post-article[data-post-slug="trading"] .post-content li a {
    text-decoration: none;
    color: var(--tp-text-sec);
    border-bottom: 1px solid var(--tp-border);
    padding-bottom: 1px;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.post-article[data-post-slug="trading"] .post-content p a:hover,
.post-article[data-post-slug="trading"] .post-content li a:hover {
    border-bottom-color: var(--tp-accent);
    color: var(--tp-accent);
}


/* ═══════════════════════════════════════
   11. VERDICT PULL-QUOTES
   ═══════════════════════════════════════ */
.post-article[data-post-slug="trading"] .verdict-line {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: clamp(1.15rem, 1rem + 0.5vw, 1.3rem) !important;
    line-height: 1.55 !important;
    color: var(--tp-heading) !important;
    max-width: 52ch !important;
    padding-left: 1.4rem;
    border-left: 2px solid var(--tp-venue-line);
    margin-top: 1rem !important;
    margin-bottom: 1rem !important;
}


/* ═══════════════════════════════════════
   12. SECTION DIVIDERS (HR)
   ═══════════════════════════════════════ */
.post-article[data-post-slug="trading"] .post-content hr {
    display: block;
    border: none;
    height: 1px;
    background: var(--tp-divider);
    margin: 3.5rem 0;
    max-width: 100%;
}


/* ═══════════════════════════════════════
   13. GLOSSARY FOOTER
   ═══════════════════════════════════════ */
.post-article[data-post-slug="trading"] .post-content .glossary-ref {
    display: block;
    margin-top: 3.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--tp-border);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--tp-text-muted);
    letter-spacing: 0.04em;
    line-height: 2;
}

.post-article[data-post-slug="trading"] .post-content .glossary-ref a {
    border-bottom: 1px dashed var(--tp-border) !important;
    padding-bottom: 1px;
    color: var(--tp-text-muted) !important;
}

.post-article[data-post-slug="trading"] .post-content .glossary-ref a:hover {
    border-bottom-style: solid !important;
    color: var(--tp-accent) !important;
}


/* ═══════════════════════════════════════
   14. POST FOOTER NOTICE
   ═══════════════════════════════════════ */
.post-article[data-post-slug="trading"] .post-content .post-footer {
    display: block;
    margin-top: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--tp-text-muted);
    letter-spacing: 0.02em;
    line-height: 1.65;
    font-style: italic;
}


/* ═══════════════════════════════════════
   15. GLOSSARY TERM REFS
   ═══════════════════════════════════════ */
.post-article[data-post-slug="trading"] .glossary-term-ref {
    font-size: 0.85em;
    color: var(--tp-text-muted);
}

.post-article[data-post-slug="trading"] .glossary-term-ref a {
    border-bottom: 1px dashed var(--tp-border) !important;
    color: var(--tp-text-muted) !important;
    font-size: inherit;
}

.post-article[data-post-slug="trading"] .glossary-term-ref a:hover {
    color: var(--tp-accent) !important;
    border-bottom-style: solid !important;
}


/* ═══════════════════════════════════════
   16. SIGN-OFF CTA
   ═══════════════════════════════════════ */
.post-article[data-post-slug="trading"] .post-content > p:last-of-type a[href^="mailto:"] {
    display: inline-flex;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    letter-spacing: 0.06em;
    padding: 0.5rem 1.1rem;
    border: 1px solid var(--tp-border) !important;
    border-bottom: 1px solid var(--tp-border) !important;
    background: transparent;
    color: var(--tp-text-sec) !important;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.post-article[data-post-slug="trading"] .post-content > p:last-of-type a[href^="mailto:"]:hover {
    background: var(--tp-surface);
    border-color: var(--tp-accent) !important;
    color: var(--tp-accent) !important;
}


/* ═══════════════════════════════════════
   17. SCROLL REVEAL (progressive)
   ═══════════════════════════════════════ */
.post-article[data-post-slug="trading"].tp-reveal-ready .post-content > h2,
.post-article[data-post-slug="trading"].tp-reveal-ready .post-content > h3,
.post-article[data-post-slug="trading"].tp-reveal-ready .post-content blockquote,
.post-article[data-post-slug="trading"].tp-reveal-ready .post-content figure {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.post-article[data-post-slug="trading"] .post-content > h2.is-visible,
.post-article[data-post-slug="trading"] .post-content > h3.is-visible,
.post-article[data-post-slug="trading"] .post-content blockquote.is-visible,
.post-article[data-post-slug="trading"] .post-content figure.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.post-article[data-post-slug="trading"] .post-content > h3.is-visible {
    transition-delay: 0.06s;
}


/* ═══════════════════════════════════════
   18. REDUCED MOTION
   ═══════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
    .trading-progress {
        transition: none;
    }

    .post-article[data-post-slug="trading"].tp-reveal-ready .post-content > h2,
    .post-article[data-post-slug="trading"].tp-reveal-ready .post-content > h3,
    .post-article[data-post-slug="trading"].tp-reveal-ready .post-content blockquote,
    .post-article[data-post-slug="trading"].tp-reveal-ready .post-content figure {
        opacity: 1;
        transform: none;
        transition: none;
    }
}


/* ═══════════════════════════════════════
   19. MOBILE
   ═══════════════════════════════════════ */
@media (max-width: 768px) {
    .post-article[data-post-slug="trading"] .post-header {
        padding-bottom: var(--space-7);
        margin-bottom: var(--space-7);
    }

    .post-article[data-post-slug="trading"] .post-title {
        font-size: clamp(2.2rem, 8vw, 2.8rem);
    }

    .post-article[data-post-slug="trading"] .post-content blockquote {
        padding: 1.2rem 1.3rem;
    }

    .post-article[data-post-slug="trading"] .post-content .disclaimer {
        padding: 0.4rem 0 0.4rem 1rem;
    }

    .post-article[data-post-slug="trading"] .verdict-line {
        padding-left: 1rem;
        font-size: 1.08rem !important;
    }

    .post-article[data-post-slug="trading"] .post-content > h2 {
        margin-top: 3.5rem;
        padding-top: 2.5rem;
    }

    .post-article[data-post-slug="trading"] .post-content > h2::before {
        width: 32px;
    }

    .post-article[data-post-slug="trading"] .post-content > p:last-of-type a[href^="mailto:"] {
        width: 100%;
        justify-content: center;
    }
}
