/*
 * Post Design — 2026 Editorial Tech
 * Newsreader serif body + Inter UI + JetBrains Mono code
 * Typographic scale: 1.250 (Major Third)
 */

/* ============================================
   RESET
   ============================================ */
.layout-post .site-content { padding-top: 0; margin-top: 57px; }
.layout-post header.mainheading,
.layout-post .mainheading.sitetitle { display: none; }
.layout-post .main-content { padding: 0; }
.layout-post .container > .main-content {
    margin: 0 calc(-50vw + 50%);
    width: 100vw; max-width: 100vw;
}
.layout-post .col-md-2.pl-0 { display: none; }
.layout-post .col-md-9 { max-width: 100%; flex: 0 0 100%; }
.layout-post .jumbotron.fortags { display: none; }

/* ============================================
   HERO
   ============================================ */
.post-hero {
    background: #fafbfc;
    border-bottom: 1px solid #edf0f4;
    padding: 4.5rem 0 3.5rem;
}

.post-hero-inner {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 2rem;
}

.post-breadcrumb {
    margin-bottom: 2rem;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.post-breadcrumb a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.15s;
}

.post-breadcrumb a:hover { color: #d97706; }

.post-breadcrumb .sep-arrow {
    color: #cbd5e1;
    margin: 0 0.6rem;
    font-weight: 300;
}

/* Title — the star of the show */
.post-hero-title {
    font-family: 'Newsreader', Georgia, 'Times New Roman', serif;
    font-size: 3.2rem;
    font-weight: 600;
    line-height: 1.08;
    letter-spacing: -0.025em;
    color: #0c1220;
    margin: 0 0 2rem;
    font-optical-sizing: auto;
    text-wrap: balance;
}

/* Author + Meta row */
.post-hero-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1.25rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e8ecf1;
}

.post-hero-author {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.post-hero-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #e2e8f0;
    object-fit: cover;
}

.post-hero-author-name {
    font-family: 'Inter', system-ui, sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    color: #1e293b;
    text-decoration: none;
    display: block;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.post-hero-author-name:hover { color: #d97706; text-decoration: none; }

.post-hero-author-title {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.75rem;
    color: #94a3b8;
    display: block;
    font-weight: 450;
}

.post-hero-details {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.78rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 450;
}

.post-hero-details time { color: #64748b; font-weight: 500; }
.meta-sep { color: #d4d8e0; }
.post-hero-details .reading-time { color: #d97706; font-weight: 600; }

/* ============================================
   ARTICLE
   ============================================ */
.post-article { background: #fff; }

.post-article-inner {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 2rem 4rem;
}

/* ============================================
   FEATURED IMAGE
   ============================================ */
.post-featured-fig {
    margin: 0 -2rem 3rem;
    overflow: hidden;
}

.post-featured-img {
    width: 100%;
    display: block;
}

@media (min-width: 800px) {
    .post-featured-fig {
        margin: 0 -4rem 3rem;
        border-radius: 16px;
        overflow: hidden;
        box-shadow: 0 8px 40px rgba(0, 0, 0, 0.06);
    }
    .post-featured-img { border-radius: 16px; }
}

/* ============================================
   TABLE OF CONTENTS
   ============================================ */
.post-toc {
    background: #fafbfc;
    border: 1px solid #edf0f4;
    border-radius: 16px;
    padding: 1.75rem 2rem 1.75rem 2.25rem;
    margin: 0 0 3rem;
    position: relative;
}

.post-toc::before {
    content: "";
    position: absolute;
    top: 16px;
    bottom: 16px;
    left: 0;
    width: 3px;
    background: linear-gradient(180deg, #f59e0b, #fbbf24, #fde68a);
    border-radius: 0 2px 2px 0;
}

.post-toc-label {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: #d97706;
    margin-bottom: 1rem;
}

.post-toc ul { list-style: none; padding: 0; margin: 0; }
.post-toc li { margin-bottom: 0.4rem; }

.post-toc a {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.85rem;
    font-weight: 450;
    color: #64748b;
    text-decoration: none;
    transition: color 0.12s, transform 0.12s;
    display: inline-block;
    line-height: 1.45;
}

.post-toc a:hover { color: #d97706; transform: translateX(3px); }

/* ============================================
   BODY — EDITORIAL SERIF
   ============================================ */
.post-body {
    font-family: 'Newsreader', Georgia, 'Times New Roman', serif;
    font-size: 1.18rem;
    line-height: 1.85;
    color: #2d3748;
    font-optical-sizing: auto;
    -webkit-font-smoothing: antialiased;
    hanging-punctuation: first allow-end last;
}

.post-body p {
    margin: 0 0 1.75rem;
}

.post-body p:first-child {
    font-size: 1.28rem;
    line-height: 1.75;
    color: #1e293b;
}

.post-body strong {
    color: #0f172a;
    font-weight: 600;
}

.post-body em {
    font-style: italic;
    color: #475569;
}

.post-body a {
    color: #b45309;
    text-decoration: underline;
    text-decoration-color: rgba(180, 83, 9, 0.2);
    text-decoration-thickness: 1.5px;
    text-underline-offset: 3px;
    transition: all 0.12s;
}

.post-body a:hover {
    color: #92400e;
    text-decoration-color: #d97706;
}

/* ============================================
   HEADINGS — INTER SANS-SERIF CONTRAST
   ============================================ */
.post-body h2 {
    font-family: 'Inter', -apple-system, system-ui, sans-serif;
    font-size: 1.75rem;
    font-weight: 800;
    color: #0c1220;
    margin: 4rem 0 1.25rem;
    letter-spacing: -0.03em;
    line-height: 1.15;
    position: relative;
    padding-top: 2rem;
}

.post-body h2::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 32px;
    height: 3px;
    background: #f59e0b;
    border-radius: 2px;
}

.post-body h3 {
    font-family: 'Inter', -apple-system, system-ui, sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: #1e293b;
    margin: 3rem 0 0.85rem;
    letter-spacing: -0.02em;
    line-height: 1.25;
}

.post-body h4 {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 2.5rem 0 0.6rem;
}

/* ============================================
   CODE — DARK TERMINAL
   ============================================ */
.post-body pre {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    background: #0c1220;
    border: none;
    border-radius: 14px;
    padding: 2.25rem 1.75rem 1.5rem;
    margin: 2.5rem 0;
    overflow-x: auto;
    font-size: 0.84rem;
    line-height: 1.75;
    color: #c9d6e5;
    box-shadow: 0 6px 32px rgba(12, 18, 32, 0.18);
    position: relative;
    tab-size: 4;
}

/* Traffic light dots — only on direct pre, not table inner pres */
.post-body > pre::before,
.post-body .highlighter-rouge:not(:has(.rouge-table)) .highlight > pre.highlight::before {
    content: "";
    position: absolute;
    top: 14px;
    left: 18px;
    width: 9px; height: 9px;
    border-radius: 50%;
    background: #ff5f56;
    box-shadow: 15px 0 0 #ffbd2e, 30px 0 0 #27c93f;
}

.post-body pre code {
    font-family: inherit;
    background: none;
    padding: 0; border: none;
    color: inherit; font-size: inherit;
    border-radius: 0; font-weight: 400;
}

.post-body code {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    background: #fef9ee;
    color: #92400e;
    padding: 0.12em 0.4em;
    border-radius: 5px;
    font-size: 0.82em;
    border: 1px solid #fde68a;
    font-weight: 500;
    letter-spacing: -0.01em;
}

/* Rouge code table with line numbers */
.post-body .rouge-table {
    border: none;
    margin: 0;
    background: transparent;
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    table-layout: auto;
    box-shadow: none;
    border-radius: 0;
    overflow: visible;
}

.post-body .rouge-table,
.post-body .rouge-table thead,
.post-body .rouge-table tbody,
.post-body .rouge-table tr,
.post-body .rouge-table td {
    border: none;
    padding: 0;
    background: transparent;
    box-shadow: none;
}

/* Line numbers gutter */
.post-body .rouge-table .rouge-gutter,
.post-body .rouge-table .gutter,
.post-body .rouge-table td:first-child {
    width: 1px;
    min-width: auto;
    vertical-align: top;
}

.post-body .rouge-table .rouge-gutter pre,
.post-body .rouge-table .gutter pre,
.post-body .rouge-table .gl,
.post-body .rouge-table .lineno {
    color: #3e4c64;
    padding: 0 1.25rem 0 0;
    margin: 0;
    user-select: none;
    text-align: right;
    font-size: 0.78rem;
    line-height: 1.75;
    background: transparent;
    border: none;
    box-shadow: none;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    opacity: 0.5;
}

/* Code column */
.post-body .rouge-table .rouge-code,
.post-body .rouge-table td:last-child {
    vertical-align: top;
    width: 100%;
}

.post-body .rouge-table .rouge-code pre,
.post-body .rouge-table td:last-child pre {
    margin: 0;
    padding: 0 0 0 1.25rem;
    background: transparent;
    border: none;
    box-shadow: none;
    border-radius: 0;
}

/* Fix the wrapper pre that contains the table */
.post-body .highlighter-rouge .highlight {
    background: #0c1220;
    border-radius: 14px;
    margin: 2.5rem 0;
    overflow-x: auto;
    box-shadow: 0 6px 32px rgba(12, 18, 32, 0.18);
}

.post-body .highlighter-rouge .highlight > pre.highlight {
    background: transparent;
    border: none;
    box-shadow: none;
    margin: 0;
    padding: 2.25rem 1.75rem 1.5rem;
    border-radius: 0;
    position: relative;
}

/* Traffic light dots on wrapper, not inner pre */
.post-body .highlighter-rouge .highlight > pre.highlight::before {
    content: "";
    position: absolute;
    top: 14px;
    left: 18px;
    width: 9px; height: 9px;
    border-radius: 50%;
    background: #ff5f56;
    box-shadow: 15px 0 0 #ffbd2e, 30px 0 0 #27c93f;
}

/* Remove dots from inner pre elements to prevent duplicates */
.post-body .rouge-table pre::before,
.post-body .rouge-code pre::before,
.post-body .rouge-gutter pre::before,
.post-body .gutter pre::before,
.post-body .lineno::before {
    display: none !important;
}

/* ============================================
   BLOCKQUOTES
   ============================================ */
.post-body blockquote {
    border: none;
    background: #fefcf3;
    padding: 1.5rem 1.75rem 1.5rem 2rem;
    margin: 2.5rem 0;
    border-radius: 14px;
    font-family: 'Newsreader', Georgia, serif;
    font-style: italic;
    font-size: 1.12rem;
    color: #6b5c2a;
    position: relative;
    box-shadow: inset 4px 0 0 #f59e0b;
    line-height: 1.75;
}

.post-body blockquote strong {
    color: #78350f;
    font-style: normal;
}

.post-body blockquote p { margin-bottom: 0.6rem; }
.post-body blockquote p:last-child { margin-bottom: 0; }

/* ============================================
   TABLES
   ============================================ */
.post-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 2.5rem 0;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.88rem;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 0 0 1px #e8ecf1;
}

.post-body thead { background: #f7f9fb; }

.post-body th {
    font-weight: 700;
    padding: 0.9rem 1.2rem;
    text-align: left;
    color: #475569;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-bottom: 2px solid #e2e8f0;
}

.post-body td {
    padding: 0.8rem 1.2rem;
    color: #475569;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.88rem;
}

.post-body tr:last-child td { border-bottom: none; }
.post-body tbody tr { transition: background 0.1s; }
.post-body tbody tr:hover { background: #fefce8; }

/* ============================================
   LISTS
   ============================================ */
.post-body ul, .post-body ol {
    padding-left: 1.5rem;
    margin-bottom: 1.75rem;
}

.post-body li {
    margin-bottom: 0.6rem;
    padding-left: 0.35rem;
}

.post-body li strong { color: #1e293b; font-weight: 600; }
.post-body li::marker { color: #d97706; font-weight: 700; }

/* ============================================
   IMAGES
   ============================================ */
.post-body img {
    border-radius: 12px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.05);
    margin: 1rem 0;
}

/* ============================================
   HR — editorial divider
   ============================================ */
.post-body hr {
    border: none;
    height: 0;
    margin: 3.5rem auto;
    text-align: center;
    max-width: 100px;
}

.post-body hr::after {
    content: "* * *";
    display: block;
    font-family: 'Newsreader', Georgia, serif;
    font-size: 1.2rem;
    letter-spacing: 0.5em;
    color: #cbd5e1;
}

/* ============================================
   TAGS
   ============================================ */
.post-tags-section {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 2.5rem 0;
    border-top: 1px solid #edf0f4;
    margin-top: 3.5rem;
}

.post-tag {
    display: inline-block;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.75rem;
    font-weight: 550;
    padding: 5px 15px;
    border-radius: 100px;
    background: #f8fafc;
    color: #64748b;
    border: 1px solid #e8ecf1;
    text-decoration: none;
    transition: all 0.12s;
    letter-spacing: 0.01em;
}

.post-tag:hover {
    background: #fef3c7;
    border-color: #fde68a;
    color: #92400e;
    text-decoration: none;
}

.post-tag-cat {
    background: #fffbeb;
    border-color: #fde68a;
    color: #d97706;
    font-weight: 650;
}

/* ============================================
   SHARE BAR
   ============================================ */
.post-share-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.75rem 0;
    border-top: 1px solid #edf0f4;
}

.post-share-label {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #94a3b8;
}

.post-share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e8ecf1;
    color: #64748b;
    text-decoration: none;
    transition: all 0.12s;
    font-size: 0.88rem;
}

.post-share-btn:hover {
    background: #fef3c7;
    border-color: #fde68a;
    color: #d97706;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

/* ============================================
   PREV/NEXT
   ============================================ */
.post-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    padding: 2.5rem 0;
    border-top: 1px solid #edf0f4;
}

.post-nav-item {
    display: block;
    padding: 1.5rem;
    border-radius: 16px;
    background: #fafbfc;
    border: 1px solid #edf0f4;
    text-decoration: none;
    transition: all 0.15s;
}

.post-nav-item:hover {
    background: #fffbeb;
    border-color: #fde68a;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
}

.post-nav-next { text-align: right; }

.post-nav-dir {
    display: block;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #d97706;
    margin-bottom: 0.4rem;
}

.post-nav-title {
    display: block;
    font-family: 'Newsreader', Georgia, serif;
    font-size: 1rem;
    font-weight: 500;
    color: #334155;
    line-height: 1.4;
}

/* ============================================
   RELATED POSTS
   ============================================ */
.post-article .related-posts {
    padding-top: 2.5rem;
    border-top: 1px solid #edf0f4;
    margin-top: 0;
}

.post-article .related-posts h3 {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: #94a3b8;
    margin-bottom: 1.25rem;
}

.post-article .related-posts .card {
    border: 1px solid #edf0f4;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.15s;
    box-shadow: none;
}

.post-article .related-posts .card:hover {
    border-color: #fde68a;
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.05);
}

.post-article .related-posts .card-title {
    font-family: 'Newsreader', Georgia, serif;
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.35;
}

.post-article .related-posts .card-title a {
    color: #1e293b;
    text-decoration: none;
}

.post-article .related-posts .card-title a:hover { color: #d97706; }

/* ============================================
   RATING / COMMENTS / FOOTER
   ============================================ */
.post-rating {
    padding: 1.25rem 0;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.9rem;
    color: #475569;
}

.post-rating strong { color: #1e293b; }

.post-comments {
    background: #fafbfc;
    padding: 3rem 2rem;
    border-top: 1px solid #edf0f4;
}

.layout-post .footer { border-top: 1px solid #edf0f4; }

/* ============================================
   SELECTION / SCROLLBAR
   ============================================ */
.layout-post ::selection { background: #fef3c7; color: #78350f; }

.layout-post ::-webkit-scrollbar { width: 5px; height: 5px; }
.layout-post ::-webkit-scrollbar-track { background: transparent; }
.layout-post ::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
.layout-post ::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ============================================
   DROP CAP — first paragraph of article
   ============================================ */
.post-body > p:first-child::first-letter {
    font-family: 'Newsreader', Georgia, serif;
    float: left;
    font-size: 4rem;
    line-height: 0.8;
    font-weight: 600;
    color: #0c1220;
    padding: 0.05em 0.12em 0 0;
    margin-top: 0.05em;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .post-hero { padding: 3rem 0 2rem; }

    .post-hero-title { font-size: 2.2rem; line-height: 1.12; }

    .post-hero-meta { flex-direction: column; align-items: flex-start; }

    .post-hero-inner, .post-article-inner { padding: 0 1.25rem; }

    .post-body { font-size: 1.08rem; }

    .post-body > p:first-child { font-size: 1.15rem; }

    .post-body > p:first-child::first-letter { font-size: 3.2rem; }

    .post-body h2 { font-size: 1.45rem; margin-top: 3rem; }

    .post-body h3 { font-size: 1.2rem; }

    .post-body pre {
        font-size: 0.78rem;
        padding: 2rem 1rem 1.25rem;
        border-radius: 10px;
        margin: 2rem -0.75rem;
    }

    .post-nav { grid-template-columns: 1fr; }
    .post-nav-next { text-align: left; }

    .post-featured-fig { margin: 0 -1.25rem 2.5rem; }
}

@media (min-width: 769px) and (max-width: 1200px) {
    .post-hero-title { font-size: 2.7rem; }
}

/* ============================================
   PRINT
   ============================================ */
@media print {
    .post-hero { background: none; border: none; padding: 1rem 0; }
    .post-share-bar, .post-nav, .post-comments, .related-posts { display: none; }
    .post-body pre {
        background: #f8f8f8; color: #333;
        box-shadow: none; border: 1px solid #ddd;
    }
    .post-body pre::before { display: none; }
    .post-body { font-size: 11pt; }
    .post-hero-title { font-size: 22pt; }
}
