﻿.article-page {
    --article-max: 1440px;
    --article-text: var(--text-primary, #f5f7fb);
    --article-muted: var(--text-secondary, #9ca8b8);
    --article-border: var(--border-color, rgba(255, 255, 255, .09));
    --article-panel: var(--card-bg, rgba(255, 255, 255, .035));

    /* Single accent system — everything ties back to the brand orange */
    --article-accent: #FF5C00;
    --article-accent-rgb: 255, 92, 0;
    --article-accent-soft: rgba(255, 92, 0, .10);
    --article-accent-border: rgba(255, 92, 0, .28);
    --article-green: #9bea6b;

    width: 100%;
    min-height: 100vh;
    color: var(--article-text);
}

.article-shell {
    width: 100%;
    max-width: var(--article-max);
    margin: 0 auto;
    padding: 4rem 3rem 6rem;
}

/* ---------------------------------------------------------
       Breadcrumb
    --------------------------------------------------------- */

.article-breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 2.5rem;
    font-size: 0.85rem;
    color: var(--article-muted);
}

.article-breadcrumbs a {
    color: inherit;
    text-decoration: none;
    transition: color .2s ease;
    opacity: 0.8;
}

.article-breadcrumbs a:hover {
    color: var(--article-accent);
    opacity: 1;
}

.breadcrumb-separator {
    opacity: .45;
}

/* ---------------------------------------------------------
       Hero full-width editorial
    --------------------------------------------------------- */

.article-hero {
    position: relative;
    overflow: hidden;
    padding: 4rem 3.5rem;
    border: 1px solid var(--article-border);
    border-radius: 32px;
    background:
        radial-gradient(circle at 85% 15%,
            rgba(var(--article-accent-rgb), .12),
            transparent 35%),
        radial-gradient(circle at 10% 90%,
            rgba(155, 234, 107, .07),
            transparent 32%),
        var(--article-panel);
    margin-bottom: 4rem;
}

.article-hero::before {
    content: "";
    position: absolute;
    top: -150px;
    right: -150px;
    width: 350px;
    height: 350px;
    border-radius: 50%;
    border: 1px solid rgba(var(--article-accent-rgb), .12);
    pointer-events: none;
}

.article-category {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0.5rem 1rem;
    border: 1px solid var(--article-accent-border);
    border-radius: 999px;
    background: var(--article-accent-soft);
    color: var(--article-accent);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.article-title {
    max-width: 1100px;
    margin: 1.5rem 0;
    font-size: clamp(3rem, 7vw, 6rem);
    line-height: 0.98;
    letter-spacing: -.05em;
    font-weight: 800;
}

.article-excerpt {
    max-width: 900px;
    margin: 0;
    color: var(--article-muted);
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    line-height: 1.6;
}

.article-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 2rem;
    color: var(--article-muted);
    font-size: 0.9rem;
}

.article-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.article-meta-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: currentColor;
    opacity: .45;
}

/* ---------------------------------------------------------
       Main content layout — content + sidebar

       Fix: the sidebar column is explicitly pinned to the top of
       its own grid track (align-self) and content sits in its own
       stacking context above it (position + z-index), so a sticky
       sidebar card can never visually sit on top of a heading like
       "Why pricing models matter" even on short viewports.
    --------------------------------------------------------- */

.article-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 4rem;
    align-items: start;
}

.article-content {
    position: relative;
    z-index: 1;
    min-width: 0;
    max-width: 900px;
}

.article-intro {
    margin-bottom: 3rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid var(--article-border);
}

.article-intro p,
.article-section p {
    margin: 0 0 1.5rem;
    color: var(--article-text);
    font-size: 1.1rem;
    line-height: 1.85;
}

.article-section {
    scroll-margin-top: 100px;
    margin-bottom: 3.5rem;
}

.article-section:last-child {
    margin-bottom: 0;
}

.article-section h2 {
    margin: 0 0 1.5rem;
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    line-height: 1.2;
    letter-spacing: -.03em;
}

.article-section h2::before {
    content: "";
    display: inline-block;
    width: 5px;
    height: 27px;
    margin-right: 13px;
    vertical-align: -3px;
    border-radius: 4px;
    background: var(--article-accent);
}

.article-section ul {
    margin: 1.5rem 0 0;
    padding: 0;
    list-style: none;
}

.article-section li {
    position: relative;
    margin: 0 0 0.8rem;
    padding: 1rem 1.2rem 1rem 3rem;
    border: 1px solid var(--article-border);
    border-radius: 14px;
    background: rgba(255, 255, 255, .025);
    color: var(--article-text);
    line-height: 1.65;
    transition: background 0.2s ease;
}

.article-section li:hover {
    background: rgba(255, 255, 255, .04);
}

.article-section li::before {
    content: "";
    position: absolute;
    left: 1.2rem;
    top: 1.4rem;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--article-accent);
    box-shadow: 0 0 0 4px var(--article-accent-soft);
}

/* ---------------------------------------------------------
       Article callout
    --------------------------------------------------------- */

.article-callout {
    margin: 2.5rem 0;
    padding: 2rem;
    border-left: 3px solid var(--article-accent);
    border-radius: 0 18px 18px 0;
    background:
        linear-gradient(90deg,
            var(--article-accent-soft),
            rgba(var(--article-accent-rgb), .02));
}

.article-callout strong {
    display: block;
    margin-bottom: 0.6rem;
    font-size: 0.85rem;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--article-accent);
}

.article-callout p {
    margin: 0;
    color: var(--article-muted);
    line-height: 1.75;
}

/* ---------------------------------------------------------
       Sidebar

       Fix: align-self keeps this column pinned to the top of its
       own track (never drifting down over content), and a lower
       z-index than .article-content guarantees content always wins
       if the two ever get close on narrow/short layouts.
    --------------------------------------------------------- */

.article-sidebar {
    position: sticky;
    top: 100px;
    align-self: start;
    z-index: 0;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.article-sidebar-card {
    flex-shrink: 0;
    height: auto;
    min-height: 0;
    margin-bottom: 0;
    padding: 1.75rem 1.5rem;
    border: 1px solid var(--article-border);
    border-radius: 20px;
    background: var(--article-panel);
    overflow: visible;
}

.sidebar-title {
    margin: 0 0 1rem;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    opacity: 0.7;
}

.toc {
    display: flex;
    flex-direction: column;
    gap: 6px;
    height: auto;
    overflow: visible;
}

.toc a {
    display: block;
    box-sizing: border-box;
    width: 100%;
    padding: 0.7rem 0.8rem;
    border-radius: 10px;
    color: var(--article-muted);
    text-decoration: none;
    font-size: 0.85rem;
    line-height: 1.4;
    transition:
        color .2s ease,
        background .2s ease;
}

.toc a:hover,
.toc a.active {
    color: var(--article-accent);
    background: var(--article-accent-soft);
}

.article-share {
    display: flex;
    gap: 0.5rem;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--article-border);
    border-radius: 12px;
    background: var(--article-accent);
    color: #fff;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 800;
    cursor: pointer;
    transition:
        transform .2s ease,
        background .2s ease,
        box-shadow .2s ease;
}

.share-btn:hover {
    transform: translateY(-2px);
    background: #e35300;
    box-shadow: 0 10px 24px rgba(var(--article-accent-rgb), .3);
}

/* ---------------------------------------------------------
       Tags
    --------------------------------------------------------- */

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 3.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--article-border);
}

.article-tag {
    padding: 0.5rem 0.9rem;
    border: 1px solid var(--article-border);
    border-radius: 999px;
    color: var(--article-muted);
    background: rgba(255, 255, 255, .025);
    font-size: 0.75rem;
    transition:
        background 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease;
}

.article-tag:hover {
    background: var(--article-accent-soft);
    color: var(--article-accent);
    border-color: var(--article-accent-border);
}

/* ---------------------------------------------------------
       Bottom navigation
    --------------------------------------------------------- */

.article-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.2rem;
    margin-top: 3.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--article-border);
}

.article-back {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--article-accent);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    transition: opacity 0.2s ease;
}

.article-back:hover {
    opacity: 0.8;
}

/* ---------------------------------------------------------
       Related articles — full width
    --------------------------------------------------------- */

.related-section {
    margin-top: 5rem;
}

.related-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1.2rem;
    margin-bottom: 2rem;
}

.related-header h2 {
    margin: 0;
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    letter-spacing: -.03em;
}

.related-header a {
    color: var(--article-accent);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 700;
    transition: opacity 0.2s ease;
}

.related-header a:hover {
    opacity: 0.8;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
}

.related-card {
    display: flex;
    flex-direction: column;
    min-height: 240px;
    padding: 2rem;
    border: 1px solid var(--article-border);
    border-radius: 24px;
    background: var(--article-panel);
    text-decoration: none;
    color: inherit;
    transition:
        transform .25s ease,
        border-color .25s ease,
        box-shadow .25s ease;
}

.related-card:hover {
    transform: translateY(-5px);
    border-color: var(--article-accent-border);
    box-shadow: 0 20px 45px rgba(0, 0, 0, .15);
}

.related-card-category {
    margin-bottom: 1rem;
    color: var(--article-accent);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.related-card h3 {
    margin: 0;
    font-size: 1.2rem;
    line-height: 1.35;
    letter-spacing: -.015em;
}

.related-card p {
    margin: 0.8rem 0 0;
    color: var(--article-muted);
    font-size: 0.85rem;
    line-height: 1.65;
}

.related-card-meta {
    margin-top: auto;
    padding-top: 1.2rem;
    color: var(--article-muted);
    font-size: 0.75rem;
}

/* ---------------------------------------------------------
       CTA full width
    --------------------------------------------------------- */

.article-cta {
    position: relative;
    overflow: hidden;
    margin-top: 5rem;
    padding: 4rem;
    border: 1px solid var(--article-accent-border);
    border-radius: 32px;
    background:
        radial-gradient(circle at 90% 10%,
            rgba(var(--article-accent-rgb), .14),
            transparent 35%),
        linear-gradient(135deg,
            rgba(var(--article-accent-rgb), .07),
            rgba(155, 234, 107, .035));
}

.article-cta h2 {
    max-width: 800px;
    margin: 0 0 0.8rem;
    font-size: clamp(2rem, 4vw, 3.5rem);
    line-height: 1.1;
    letter-spacing: -.035em;
}

.article-cta p {
    max-width: 750px;
    margin: 0 0 1.5rem;
    color: var(--article-muted);
    line-height: 1.75;
    font-size: 1.05rem;
}

.article-cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    padding: 0 1.5rem;
    border-radius: 14px;
    background: linear-gradient(135deg,
            var(--article-accent),
            #ff8a4d);
    color: #ffffff;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 800;
    transition:
        transform .2s ease,
        box-shadow .2s ease;
}

.article-cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(var(--article-accent-rgb), .3);
}

/* ---------------------------------------------------------
       Reading progress
    --------------------------------------------------------- */

.reading-progress {
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg,
            var(--article-accent),
            #ff8a4d);
    transition: width .08s linear;
}

/* ---------------------------------------------------------
       Light theme
    --------------------------------------------------------- */

html.light .article-page,
body.light .article-page {
    --article-text: #17202b;
    --article-muted: #667384;
    --article-border: rgba(17, 32, 48, .10);
    --article-panel: rgba(255, 255, 255, .82);
}

html.light .article-hero,
body.light .article-hero {
    box-shadow: 0 24px 70px rgba(20, 40, 60, .08);
}

html.light .article-section li,
body.light .article-section li,
html.light .article-sidebar-card,
body.light .article-sidebar-card,
html.light .related-card,
body.light .related-card {
    background: rgba(255, 255, 255, .78);
}

/* ---------------------------------------------------------
       Responsive

       Fix: below 1100px the sidebar drops out of sticky/grid mode
       entirely (static + its own 2-col grid) so it can never
       overlap the content column that now stacks above it.
    --------------------------------------------------------- */

@media (max-width: 1100px) {
    .article-layout {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .article-content {
        max-width: none;
    }

    .article-sidebar {
        position: static;
        max-height: none;
        overflow: visible;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1.2rem;
    }

    .related-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 700px) {
    .article-shell {
        padding: 2rem 1.2rem 4rem;
    }

    .article-hero {
        padding: 2rem 1.5rem;
        border-radius: 24px;
        margin-bottom: 2.5rem;
    }

    .article-title {
        font-size: clamp(2.2rem, 10vw, 3.5rem);
    }

    .article-excerpt {
        font-size: 1rem;
        line-height: 1.6;
    }

    .article-section {
        margin-bottom: 2.5rem;
    }

    .article-section p,
    .article-intro p {
        font-size: 1rem;
        line-height: 1.75;
    }

    .article-sidebar {
        grid-template-columns: 1fr;
    }

    .related-section {
        margin-top: 3.5rem;
    }

    .related-grid {
        grid-template-columns: 1fr;
    }

    .article-bottom {
        margin-top: 2.5rem;
    }

    .article-cta {
        margin-top: 3.5rem;
        padding: 2rem 1.5rem;
        border-radius: 24px;
    }
}