/* =========================================================
   THE TEJ BLOGS — PART 04 ARTICLE SYSTEM
   Lightweight / Responsive / No Framework
========================================================= */
:root {
    --bg-main: #050914;
    --bg-secondary: #080e1b;
    --bg-card: rgba(10, 17, 31, 0.88);
    --bg-card-soft: rgba(14, 23, 40, 0.72);
    --border: rgba(130, 155, 200, 0.12);
    --border-strong: rgba(71, 125, 255, 0.26);
    --text-main: #f4f7ff;
    --text-secondary: #aeb9cb;
    --text-muted: #77849a;
    --blue: #3678ff;
    --blue-light: #6b9bff;
    --blue-soft: rgba(54, 120, 255, 0.12);
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
    --radius-lg: 18px;
    --radius-md: 13px;
    --radius-sm: 9px;
    --content-width: 1380px;
    --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html {
    scroll-behavior: smooth;
    overflow-x: clip !important;
    overflow-y: visible !important;
    height: auto !important;
}
body {
    background: transparent !important;
    background-color: transparent !important;
    color: var(--text-main);
    font-family: var(--font);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    overflow-x: clip !important;
    overflow-y: visible !important;
    height: auto !important;
}
a {
    color: inherit;
    text-decoration: none;
}
button {
    font-family: inherit;
}
/* Reading Progress */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 9999;
    background: transparent;
}
.reading-progress span {
    display: block;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--blue), #72a2ff);
    box-shadow: 0 0 14px rgba(54, 120, 255, 0.55);
    transition: width 0.08s linear;
}
/* Layout */
.blog-page {
    width: 100%;
    min-height: 100vh;
    padding: 42px 24px 100px;
    overflow: visible !important;
}
.blog-shell {
    width: min(100%, var(--content-width));
    margin: auto;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 390px !important;
    gap: 28px !important;
    align-items: start !important;
    position: relative !important;
}
/* Article Card */
.article-card {
    min-width: 0;
    background: linear-gradient(145deg, rgba(11, 18, 33, 0.75), rgba(5, 10, 21, 0.75));
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    padding: 34px 36px 48px;
}
/* Breadcrumb */
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
    margin-bottom: 28px;
    color: var(--text-muted);
    font-size: 13px;
}
.breadcrumb a {
    transition: color 0.2s ease;
}
.breadcrumb a:hover {
    color: var(--blue-light);
}
.breadcrumb span:last-child {
    color: var(--text-secondary);
}
/* Title */
.article-header h1 {
    max-width: 950px;
    font-size: clamp(34px, 4vw, 52px);
    line-height: 1.12;
    letter-spacing: -0.04em;
    font-weight: 800;
    margin-bottom: 22px;
}
.article-lead {
    max-width: 850px;
    color: var(--text-secondary);
    font-size: 19px;
    line-height: 1.7;
    margin-bottom: 28px;
    font-weight: 500;
}
/* Author Meta */
.article-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}
.author-box {
    display: flex;
    align-items: center;
    gap: 12px;
}
.author-avatar {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    border-radius: 50%;
    padding: 2px;
    background: linear-gradient(145deg, #397bff, transparent 55%, #6f9fff);
    box-shadow: 0 0 20px rgba(54, 120, 255, 0.14);
}
.author-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: block;
    object-fit: cover;
    background: #0b1220;
}
.author-details strong {
    display: block;
    font-size: 14px;
    font-weight: 700;
}
.meta-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 3px;
}
/* Share */
.share-area {
    display: flex;
    align-items: center;
    gap: 8px;
}
.share-label {
    color: var(--text-muted);
    font-size: 13px;
    margin-right: 4px;
}
.share-button {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.025);
    color: #dbe5f8;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.share-button:hover {
    transform: translateY(-2px);
    border-color: rgba(54, 120, 255, 0.45);
    background: rgba(54, 120, 255, 0.12);
}
/* Hero */
.article-hero {
    margin: 34px 0 48px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: #030711;
}
.article-hero img {
    width: 100%;
    display: block;
    aspect-ratio: 16 / 8;
    object-fit: cover;
}
/* Content */
.article-content {
    max-width: 850px;
    margin: auto;
}
.article-content p {
    color: #c2ccdc;
    font-size: 17px;
    line-height: 1.9;
    margin-bottom: 20px;
}
.article-content section {
    scroll-margin-top: 30px;
    margin-top: 56px;
}
.article-content h2 {
    position: relative;
    font-size: clamp(25px, 3vw, 32px);
    line-height: 1.28;
    letter-spacing: -0.025em;
    margin-bottom: 18px;
    font-weight: 750;
}
.article-content h2::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 24px;
    margin-right: 12px;
    border-radius: 4px;
    vertical-align: -3px;
    background: var(--blue);
    box-shadow: 0 0 12px rgba(54, 120, 255, 0.4);
}
.article-content h3 {
    font-size: 20px;
    margin: 28px 0 12px;
    color: #edf3ff;
    font-weight: 650;
}
.article-content ul,
.article-content ol {
    margin: 0 0 24px 22px;
    color: #c2ccdc;
}
.article-content li {
    padding-left: 6px;
    margin-bottom: 10px;
    line-height: 1.7;
}
.article-content em {
    color: #b8c4d8;
    font-style: italic;
}
.article-content strong {
    color: #e8eefc;
    font-weight: 600;
}
.article-content code {
    font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
    font-size: 0.9em;
    background: rgba(54, 120, 255, 0.1);
    color: #8eb4ff;
    padding: 2px 7px;
    border-radius: 5px;
    border: 1px solid rgba(54, 120, 255, 0.15);
}
.article-content pre {
    background: #030711;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin: 16px 0 22px;
    overflow-x: auto;
    font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
    font-size: 14px;
    line-height: 1.65;
    color: #a8c0e8;
}
.article-content pre code {
    background: transparent;
    border: none;
    padding: 0;
    color: inherit;
    font-size: inherit;
}
/* Table */
.table-wrapper {
    overflow-x: auto;
    margin: 22px 0 28px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}
.article-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}
.article-content th {
    background: rgba(54, 120, 255, 0.1);
    color: #dce8ff;
    font-weight: 600;
    text-align: left;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
}
.article-content td {
    padding: 13px 18px;
    color: #c2ccdc;
    border-bottom: 1px solid rgba(130, 155, 200, 0.08);
}
.article-content tr:last-child td {
    border-bottom: none;
}
.article-content tr:hover td {
    background: rgba(54, 120, 255, 0.04);
}
/* Closing */
.closing-line {
    text-align: center;
    color: var(--text-muted) !important;
    font-size: 15px !important;
    letter-spacing: 0.04em;
    margin-top: 40px !important;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}
/* Article End */
.article-end {
    max-width: 850px;
    margin: 70px auto 0;
    padding-top: 30px;
    border-top: 1px solid var(--border);
}
.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 30px;
}
.article-tags span {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-muted);
    font-size: 11px;
    background: rgba(255, 255, 255, 0.02);
}
.bottom-share {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.018);
}
.bottom-share strong {
    display: block;
    font-size: 14px;
}
.bottom-share span {
    color: var(--text-muted);
    font-size: 12px;
}
.primary-share {
    border: 0;
    padding: 10px 15px;
    border-radius: 9px;
    background: linear-gradient(135deg, #286cff, #4d86ff);
    color: white;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
/* Sidebar */
.blog-sidebar {
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 24px !important;
    align-self: start !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 18px !important;
}
.sidebar-card {
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: linear-gradient(145deg, rgba(11, 18, 33, 0.92), rgba(6, 12, 23, 0.92));
    box-shadow: 0 18px 55px rgba(0, 0, 0, 0.2);
}
.sidebar-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}
.heading-line {
    width: 3px;
    height: 20px;
    border-radius: 3px;
    background: var(--blue);
    box-shadow: 0 0 10px rgba(54, 120, 255, 0.4);
}
.sidebar-heading h2 {
    font-size: 16px;
    letter-spacing: -0.02em;
}
/* TOC */
#tableOfContents {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 62vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(54, 120, 255, 0.3) transparent;
}
#tableOfContents::-webkit-scrollbar {
    width: 4px;
}
#tableOfContents::-webkit-scrollbar-thumb {
    background: rgba(54, 120, 255, 0.3);
    border-radius: 4px;
}
#tableOfContents a {
    display: grid;
    grid-template-columns: 27px 1fr;
    gap: 8px;
    padding: 7px 8px;
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.45;
    border-left: 2px solid transparent;
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
#tableOfContents a span {
    color: rgba(120, 140, 170, 0.55);
    font-size: 10px;
    padding-top: 2px;
}
#tableOfContents a:hover {
    color: #dce7fa;
    background: rgba(255, 255, 255, 0.025);
}
#tableOfContents a.active {
    color: #7da7ff;
    background: rgba(54, 120, 255, 0.08);
    border-left-color: var(--blue);
}
#tableOfContents a.active span {
    color: var(--blue-light);
}
/* Key Concepts Card */
.evidence-sources {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}
.source-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}
.source-item:hover {
    background: rgba(54, 120, 255, 0.08);
    border-color: rgba(54, 120, 255, 0.35);
    transform: translateY(-2px);
}
.source-badge {
    display: inline-block;
    align-self: flex-start;
    padding: 2px 7px;
    border-radius: 6px;
    background: rgba(54, 120, 255, 0.15);
    color: var(--blue-light);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.source-info h4 {
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-main);
}
.source-info p {
    font-size: 11px;
    color: var(--text-muted);
    margin: 0;
}
.sidebar-action-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 11px 16px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(54, 120, 255, 0.16), rgba(54, 120, 255, 0.06));
    border: 1px solid rgba(54, 120, 255, 0.3);
    color: var(--blue-light);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.sidebar-action-btn:hover {
    background: linear-gradient(135deg, #286cff, #4d86ff);
    border-color: transparent;
    color: #ffffff;
    box-shadow: 0 4px 18px rgba(54, 120, 255, 0.35);
}
.sidebar-action-btn .btn-arrow {
    font-size: 14px;
    transition: transform 0.2s ease;
}
.sidebar-action-btn:hover .btn-arrow {
    transform: translateX(4px);
}
/* Ad Slot */
.sidebar-ad-slot {
    width: 100%;
    min-height: 280px;
    border-radius: var(--radius-lg);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
/* Responsive */
@media (max-width: 1100px) {
    .blog-shell {
        grid-template-columns: minmax(0, 1fr) 320px !important;
    }
    .article-card {
        padding: 28px 28px 42px;
    }
    .article-header h1 {
        font-size: 40px;
    }
}
@media (max-width: 900px) {
    .blog-shell {
        grid-template-columns: 1fr !important;
    }
    .blog-sidebar {
        position: static !important;
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        align-items: start !important;
    }
    .toc-card {
        grid-column: 1 / -1;
    }
    .sidebar-ad-slot {
        grid-column: 1 / -1;
    }
    #tableOfContents {
        max-height: none;
    }
}
@media (max-width: 650px) {
    .blog-page {
        padding: 18px 10px 60px;
    }
    .article-card {
        padding: 22px 18px 35px;
        border-radius: 14px;
    }
    .breadcrumb {
        font-size: 11px;
        margin-bottom: 20px;
    }
    .article-header h1 {
        font-size: 30px;
        line-height: 1.15;
    }
    .article-lead {
        font-size: 16px;
        line-height: 1.65;
    }
    .article-meta-row {
        align-items: flex-start;
        flex-direction: column;
    }
    .share-area {
        width: 100%;
        padding-top: 4px;
    }
    .article-hero {
        margin: 28px 0 35px;
        border-radius: 10px;
    }
    .article-hero img {
        aspect-ratio: 16 / 9;
    }
    .article-content p {
        font-size: 15.5px;
        line-height: 1.85;
    }
    .article-content section {
        margin-top: 44px;
    }
    .article-content h2 {
        font-size: 24px;
    }
    .article-content h3 {
        font-size: 18px;
    }
    .blog-sidebar {
        display: flex !important;
    }
    .sidebar-card {
        border-radius: 14px;
    }
    .bottom-share {
        flex-direction: column;
        align-items: flex-start;
    }
    .primary-share {
        width: 100%;
    }
}
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    *,
    *::before,
    *::after {
        transition: none !important;
        animation: none !important;
    }
}