/* =========================================================
   THE TEJ BLOGS — M2.0 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;
}

/* =========================================================
   RESET & STICKY CONTEXT REPAIR
========================================================= */

* {
    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;
}

/* =========================================================
   PAGE & LAYOUT STRUCTURE
========================================================= */

.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);
}

/* =========================================================
   CATEGORY (Top Article Badge)
========================================================= */

.article-category {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border: 1px solid rgba(54, 120, 255, 0.22);
    border-radius: 999px;
    background: rgba(54, 120, 255, 0.09);
    color: #7ea8ff;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 20px;
}

.category-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--blue);
    box-shadow: 0 0 10px rgba(54, 120, 255, 0.7);
}

/* =========================================================
   TITLE & HEADINGS
========================================================= */

.article-header h1 {
    max-width: 950px;
    font-size: clamp(36px, 4vw, 58px);
    line-height: 1.08;
    letter-spacing: -0.045em;
    font-weight: 800;
    margin-bottom: 22px;
}

.article-lead {
    max-width: 850px;
    color: var(--text-secondary);
    font-size: 18px;
    line-height: 1.75;
    margin-bottom: 32px;
}

/* =========================================================
   AUTHOR
========================================================= */

.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;
}

.article-hero figcaption {
    padding: 10px 14px;
    color: var(--text-muted);
    font-size: 11px;
    text-align: center;
}

/* =========================================================
   ARTICLE CONTENT
========================================================= */

.article-content {
    max-width: 850px;
    margin: auto;
}

.article-content p {
    color: #c2ccdc;
    font-size: 17px;
    line-height: 1.9;
    margin-bottom: 22px;
}

.article-content section {
    scroll-margin-top: 30px;
    margin-top: 58px;
}

.article-content h2 {
    position: relative;
    font-size: clamp(26px, 3vw, 34px);
    line-height: 1.25;
    letter-spacing: -0.025em;
    margin-bottom: 20px;
    font-weight: 750;
}

.article-content h2::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 25px;
    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: 21px;
    margin: 30px 0 10px;
    color: #edf3ff;
}

.article-content ul,
.article-content ol {
    margin: 0 0 25px 24px;
    color: #c2ccdc;
}

.article-content li {
    padding-left: 5px;
    margin-bottom: 9px;
}

/* Code Snippets */
.article-content pre {
    background: #030711;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin: 18px 0 24px;
    overflow-x: auto;
}

.article-content pre code {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 14px;
    color: #82aaff;
    line-height: 1.6;
}

/* =========================================================
   FEATURE GRID
========================================================= */

.feature-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 28px 0;
}

.feature-card {
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.018);
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.feature-card:hover {
    transform: translateY(-2px);
    border-color: rgba(54, 120, 255, 0.3);
}

.feature-number {
    display: block;
    color: var(--blue-light);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin-bottom: 12px;
}

.feature-card h3 {
    margin: 0 0 7px;
    font-size: 17px;
}

.feature-card p {
    font-size: 14px;
    line-height: 1.65;
    margin: 0;
}

/* =========================================================
   INFO CARD
========================================================= */

.info-card {
    display: flex;
    gap: 15px;
    padding: 20px;
    margin: 28px 0;
    border: 1px solid rgba(54, 120, 255, 0.18);
    border-radius: var(--radius-md);
    background: linear-gradient(
        135deg,
        rgba(54, 120, 255, 0.09),
        rgba(54, 120, 255, 0.025)
    );
}

.info-icon {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: rgba(54, 120, 255, 0.13);
    color: var(--blue-light);
}

.info-card strong {
    display: block;
    font-size: 14px;
    margin-bottom: 5px;
}

.info-card p {
    font-size: 14px;
    margin: 0;
}

/* =========================================================
   QUOTE
========================================================= */

blockquote {
    position: relative;
    margin: 30px 0;
    padding: 28px 30px;
    border-left: 3px solid var(--blue);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    background: rgba(54, 120, 255, 0.055);
}

.quote-mark {
    position: absolute;
    top: 3px;
    left: 18px;
    color: rgba(54, 120, 255, 0.35);
    font-size: 48px;
    line-height: 1;
}

blockquote p {
    position: relative;
    margin: 0;
    padding-left: 15px;
    color: #dce6f8;
    font-size: 18px;
    font-weight: 500;
}

/* =========================================================
   CODE BLOCK
========================================================= */

.prompt-example {
    overflow: hidden;
    margin: 28px 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: #030711;
}

.prompt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 12px;
}

.copy-code {
    border: 0;
    border-radius: 6px;
    padding: 5px 9px;
    background: rgba(54, 120, 255, 0.12);
    color: #82aaff;
    font-size: 11px;
    cursor: pointer;
}

.prompt-example pre {
    overflow-x: auto;
    padding: 20px;
    color: #cbd7eb;
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 13px;
    line-height: 1.7;
    margin: 0;
    border: none;
    border-radius: 0;
}

/* =========================================================
   HIGHLIGHT
========================================================= */

.highlight-box {
    padding: 22px;
    margin: 28px 0;
    border: 1px solid rgba(54, 120, 255, 0.2);
    border-radius: var(--radius-md);
    background: rgba(54, 120, 255, 0.055);
}

.highlight-label {
    display: block;
    color: var(--blue-light);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}

.highlight-box p {
    margin: 0;
}

/* =========================================================
   WARNING
========================================================= */

.warning-card {
    margin: 28px 0;
    padding: 20px;
    border: 1px solid rgba(255, 180, 80, 0.17);
    border-radius: var(--radius-md);
    background: rgba(255, 180, 80, 0.035);
}

.warning-card strong {
    display: block;
    color: #e8d2a5;
    font-size: 14px;
    margin-bottom: 7px;
}

.warning-card p {
    margin: 0;
    font-size: 14px;
}

/* =========================================================
   COMPARISON
========================================================= */

.comparison-box {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-top: 25px;
}

.comparison-column {
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.018);
}

.comparison-column h3 {
    margin: 0 0 15px;
    color: #e9f0ff;
    font-size: 17px;
}

.comparison-column ul {
    margin: 0 0 0 17px;
}

.comparison-column li {
    font-size: 14px;
}

/* =========================================================
   NUMBERED LIST
========================================================= */

.numbered-list {
    counter-reset: item;
    list-style: none;
    margin-left: 0 !important;
}

.numbered-list li {
    position: relative;
    padding: 16px 16px 16px 52px;
    margin-bottom: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.015);
}

.numbered-list li::before {
    counter-increment: item;
    content: counter(item);
    position: absolute;
    left: 16px;
    top: 16px;
    width: 25px;
    height: 25px;
    display: grid;
    place-items: center;
    border-radius: 7px;
    background: rgba(54, 120, 255, 0.12);
    color: var(--blue-light);
    font-size: 11px;
    font-weight: 700;
}

/* =========================================================
   FAQ
========================================================= */

.faq-list {
    border-top: 1px solid var(--border);
}

.faq-list details {
    border-bottom: 1px solid var(--border);
}

.faq-list summary {
    list-style: none;
    cursor: pointer;
    padding: 18px 0;
    font-size: 15px;
    font-weight: 600;
}

.faq-list summary::-webkit-details-marker {
    display: none;
}

.faq-list summary::after {
    content: "+";
    float: right;
    color: var(--blue-light);
    font-size: 18px;
}

.faq-list details[open] summary::after {
    content: "−";
}

.faq-list details p {
    padding-bottom: 18px;
    margin: 0;
    font-size: 14px;
}

/* =========================================================
   REFERENCES
========================================================= */

.reference-list li {
    font-size: 14px;
    color: var(--text-secondary);
}

/* =========================================================
   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 (PERMANENT ZERO-DRIFT LOCK TO SIDE)
========================================================= */

.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 & SCROLL INDICATOR
========================================================= */

#tableOfContents {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

#tableOfContents a {
    display: grid;
    grid-template-columns: 27px 1fr;
    gap: 8px;
    padding: 8px 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);
}

/* =========================================================
   EVIDENCE & SOURCES CARD (REPLACES RECENT POSTS)
========================================================= */

.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 Bottom Action Button */
.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 (RESERVED EMPTY SPACE FOR ADS)
========================================================= */

.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: 43px;
    }
}

@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;
    }
}

@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: 33px;
        line-height: 1.12;
    }

    .article-lead {
        font-size: 15px;
        line-height: 1.7;
    }

    .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: 46px;
    }

    .article-content h2 {
        font-size: 25px;
    }

    .feature-grid,
    .comparison-box {
        grid-template-columns: 1fr;
    }

    .info-card,
    blockquote,
    .prompt-example,
    .highlight-box,
    .warning-card {
        margin-left: 0;
        margin-right: 0;
    }

    .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;
    }
}