:root {
    --article-dark: #07111f;
    --article-ink: #0f172a;
    --article-muted: #64748b;
    --article-line: rgba(148, 163, 184, 0.22);
}

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

.article-hero,
.article-content-section {
    max-width: 100%;
    overflow-x: clip;
}

.article-hero {
    align-items: center;
    background-attachment: scroll !important;
    background-position: center !important;
    background-size: cover !important;
    color: #ffffff;
    display: flex;
    justify-content: center;
    margin-top: 58px;
    min-height: 58vh;
    overflow: hidden;
    padding: 110px 0 90px;
    position: relative;
}

.article-hero::before {
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.94), rgba(2, 6, 23, 0.72)),
        radial-gradient(circle at 18% 20%, rgba(245, 158, 11, 0.20), transparent 34%);
    content: '';
    inset: 0;
    position: absolute;
    z-index: 1;
}

.article-hero::after {
    background: radial-gradient(circle, rgba(245, 158, 11, 0.16), transparent 36%);
    content: '';
    height: 520px;
    pointer-events: none;
    position: absolute;
    right: -180px;
    top: -180px;
    width: 520px;
    z-index: 1;
}

.article-hero .container {
    position: relative;
    z-index: 2;
}

.article-hero .badge {
    background: var(--secondary-color) !important;
    border-radius: 999px;
    color: #111827 !important;
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    padding: 0.62rem 0.9rem !important;
    text-transform: uppercase;
}

.article-hero h1 {
    color: #ffffff;
    font-size: clamp(2.55rem, 5.5vw, 5.2rem);
    font-weight: 900;
    letter-spacing: -0.075em;
    line-height: 0.98;
    margin-bottom: 1.2rem;
    text-shadow: none;
}

.article-meta {
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.98rem;
}

.article-meta > div {
    align-items: center;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    display: inline-flex;
    padding: 0.65rem 0.9rem;
}

.article-actions .btn-light {
    background: #ffffff;
    border-color: #ffffff;
    border-radius: 999px;
    color: var(--primary-color);
    font-weight: 850;
}

.article-content-section {
    background:
        radial-gradient(circle at top left, rgba(30, 64, 175, 0.08), transparent 32%),
        #f8fafc;
}

.article-card,
.author-card,
.comments-section,
.sidebar-card {
    background: #ffffff !important;
    border: 1px solid rgba(226, 232, 240, 0.9) !important;
    border-radius: 28px !important;
    box-shadow: 0 16px 45px rgba(15, 23, 42, 0.08) !important;
}

.article-card {
    padding: clamp(1.4rem, 4vw, 3.2rem) !important;
}

.article-reference {
    background: rgba(30, 64, 175, 0.06) !important;
    border: 1px solid rgba(30, 64, 175, 0.18) !important;
    border-left: 5px solid var(--primary-color) !important;
    border-radius: 20px !important;
}

.article-reference h6 {
    color: var(--primary-color) !important;
    font-weight: 900;
}

.article-summary {
    border-bottom: 1px solid var(--article-line) !important;
}

.article-summary .lead {
    color: var(--article-muted) !important;
    font-size: 1.12rem;
    line-height: 1.85;
}

.article-body {
    color: var(--article-ink);
    font-size: 1.06rem;
    line-height: 1.9;
}

.article-body h2,
.article-body h3,
.article-body h4 {
    color: var(--article-ink);
    font-weight: 900;
    letter-spacing: -0.04em;
    scroll-margin-top: 90px;
}

.article-body h2 {
    font-size: clamp(1.75rem, 3vw, 2.35rem);
    margin-top: 2.8rem;
}

.article-body h3 {
    font-size: clamp(1.4rem, 2.3vw, 1.8rem);
    margin-top: 2.2rem;
}

.article-body p,
.article-body li {
    color: #334155;
}

.article-body img {
    border-radius: 22px;
    box-shadow: 0 16px 45px rgba(15, 23, 42, 0.12);
    height: auto;
    max-width: 100%;
}

.article-body blockquote {
    background: #f8fafc;
    border: 1px solid var(--article-line);
    border-left: 5px solid var(--secondary-color);
    border-radius: 20px;
    color: var(--article-muted);
    margin: 2rem 0;
    padding: 1.4rem;
}

.article-body pre,
.article-body code {
    background: #0f172a;
    color: #e2e8f0;
}

.article-body pre {
    border-radius: 18px;
    overflow-x: auto;
    padding: 1.2rem;
}

.article-tags {
    border-top: 1px solid var(--article-line) !important;
}

.article-tags .badge {
    background: rgba(30, 64, 175, 0.08) !important;
    border-radius: 999px;
    color: var(--primary-color) !important;
    font-weight: 850;
    text-decoration: none;
}

.article-share {
    border-top: 1px solid var(--article-line) !important;
}

.article-share h6,
.sidebar-card h5,
.comments-section h4,
.author-card h5 {
    color: var(--article-ink);
    font-weight: 900;
    letter-spacing: -0.035em;
}

.article-share .btn,
.author-card .btn,
.sidebar-card .btn {
    align-items: center;
    border-radius: 999px;
    display: inline-flex;
    font-weight: 850;
    justify-content: center;
    min-height: 40px;
}

.btn-outline-primary {
    background: rgba(30, 64, 175, 0.07) !important;
    border-color: rgba(30, 64, 175, 0.32) !important;
    color: var(--primary-color) !important;
}

.btn-outline-info {
    background: rgba(14, 165, 233, 0.08) !important;
    border-color: rgba(14, 165, 233, 0.34) !important;
    color: #0369a1 !important;
}

.btn-outline-success {
    background: rgba(22, 163, 74, 0.08) !important;
    border-color: rgba(22, 163, 74, 0.34) !important;
    color: #15803d !important;
}

.btn-outline-secondary {
    background: rgba(100, 116, 139, 0.08) !important;
    border-color: rgba(100, 116, 139, 0.34) !important;
    color: #334155 !important;
}

.btn-outline-primary:hover,
.btn-outline-info:hover,
.btn-outline-success:hover,
.btn-outline-secondary:hover {
    background: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: #ffffff !important;
}

.author-card img,
.author-avatar {
    border: 4px solid rgba(30, 64, 175, 0.10);
    flex-shrink: 0;
    object-fit: cover;
}

.author-avatar {
    background: var(--primary-color) !important;
}

.comments-section .alert {
    border: 0;
    border-radius: 18px;
}

.sticky-sidebar {
    position: sticky;
    top: 86px;
}

.sidebar-card {
    padding: 1.35rem !important;
}

#tableOfContents {
    max-height: 420px;
    overflow-y: auto;
}

#tableOfContents ul {
    list-style: none;
    margin: 0;
    padding-left: 0;
}

#tableOfContents a {
    border-radius: 14px;
    color: var(--article-muted);
    display: block;
    font-size: 0.92rem;
    padding: 0.65rem 0.75rem;
    text-decoration: none;
}

#tableOfContents a:hover,
#tableOfContents a.active {
    background: rgba(30, 64, 175, 0.08);
    color: var(--primary-color);
    font-weight: 850;
}

.related-article-item {
    border-bottom: 1px solid var(--article-line);
    padding: 0.85rem 0;
}

.related-article-item:last-child {
    border-bottom: 0;
}

.related-article-item a {
    color: var(--article-ink);
    font-weight: 800;
    text-decoration: none;
}

.related-article-item a:hover {
    color: var(--primary-color);
}

@media (max-width: 992px) {
    .sticky-sidebar {
        position: relative;
        top: 0;
    }
}

@media (max-width: 768px) {
    .article-hero {
        min-height: auto;
        padding: 76px 0 52px;
    }

    .article-hero h1 {
        font-size: clamp(2.1rem, 11vw, 3.2rem);
    }

    .article-meta {
        align-items: stretch !important;
        flex-direction: column;
        gap: 0.55rem !important;
    }

    .article-meta > div {
        justify-content: center;
        width: 100%;
    }

    .article-card {
        padding: 1.35rem !important;
    }

    .author-card .d-flex {
        align-items: flex-start !important;
        flex-direction: column;
        text-align: left;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
