/* ============================================================
   POST.CSS — Individual blog post / case-study page styles
   Matches landing page light design language.
   ============================================================ */

/* ===== POST HERO ===== */
.post-hero {
    padding: 148px 0 60px;
    border-bottom: 1px solid var(--line);
    position: relative;
    overflow: hidden;
}
.post-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 70% 50% at 50% 0%, rgba(34, 87, 214, 0.08) 0%, transparent 70%);
    pointer-events: none;
}
.post-hero-inner {
    position: relative;
    z-index: 1;
    width: min(1180px, calc(100% - 44px));
    margin: 0 auto;
}
.post-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font: 800 0.72rem 'JetBrains Mono', monospace;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--blue);
    border: 1px solid rgba(34, 87, 214, 0.2);
    background: rgba(34, 87, 214, 0.06);
    padding: 6px 14px;
    border-radius: 999px;
    margin-bottom: 18px;
}
.post-hero h1 {
    font-size: clamp(2rem, 5vw, 3.8rem);
    font-weight: 700;
    line-height: 1.04;
    color: var(--ink);
    margin-bottom: 16px;
}
.post-hero-lead {
    font-size: 1.05rem;
    color: #3f4858;
    line-height: 1.7;
    max-width: 680px;
    margin-bottom: 24px;
}
.post-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}
.post-meta-row .badge {
    font: 700 0.7rem 'JetBrains Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    background: rgba(255, 253, 247, 0.82);
    border: 1px solid var(--line);
    padding: 6px 12px;
    border-radius: 999px;
}
.post-meta-row .badge.green { color: var(--green); border-color: rgba(22, 128, 61, 0.2); background: rgba(22, 128, 61, 0.06); }
.post-meta-row .badge.amber  { color: var(--amber); border-color: rgba(184, 101, 0, 0.2); background: rgba(184, 101, 0, 0.06); }
.post-meta-row .badge.blue   { color: var(--blue);  border-color: rgba(34, 87, 214, 0.2); background: rgba(34, 87, 214, 0.06); }
.post-meta-row .badge.purple { color: var(--cyan);  border-color: rgba(4, 124, 155, 0.2); background: rgba(4, 124, 155, 0.06); }
.post-hero-links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    font-weight: 800;
    font-size: 0.86rem;
    transition: var(--transition);
    cursor: pointer;
}
.btn-primary {
    background: var(--ink);
    color: var(--paper);
    border-color: var(--ink);
    box-shadow: 0 12px 28px rgba(22, 26, 34, 0.16);
}
.btn-primary:hover { background: var(--blue); color: var(--paper); border-color: var(--blue); transform: translateY(-1px); opacity: 1; }
.btn-ghost {
    color: var(--ink);
    background: rgba(255, 253, 247, 0.82);
}
.btn-ghost:hover { border-color: var(--blue); color: var(--blue); transform: translateY(-1px); opacity: 1; }

/* ===== STAT STRIP ===== */
.stat-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    margin: 28px 0;
}
.stat-strip-item {
    background: rgba(255, 253, 247, 0.9);
    padding: 20px;
    text-align: center;
}
.stat-strip-item strong {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--amber);
    line-height: 1;
    margin-bottom: 6px;
}
.stat-strip-item span {
    font: 700 0.68rem 'JetBrains Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--soft);
}

/* ===== POST LAYOUT ===== */
.post-layout {
    display: grid;
    grid-template-columns: 1fr;
    width: min(1180px, calc(100% - 44px));
    margin: 0 auto;
    padding: 60px 0 80px;
    gap: 40px;
}
@media (min-width: 1024px) {
    .post-layout {
        grid-template-columns: 220px 1fr;
        align-items: start;
    }
}

/* ===== TABLE OF CONTENTS ===== */
.post-toc { display: none; }
@media (min-width: 1024px) {
    .post-toc {
        display: block;
        position: sticky;
        top: 80px;
        background: rgba(255, 253, 247, 0.9);
        border: 1px solid var(--line-strong);
        border-radius: var(--radius-sm);
        padding: 20px;
        box-shadow: 0 12px 35px rgba(44, 37, 25, 0.07);
    }
}
.toc-title {
    font: 800 0.66rem 'JetBrains Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--soft);
    margin-bottom: 14px;
}
.toc-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.toc-list a {
    display: block;
    color: var(--muted);
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 0.78rem;
    transition: var(--transition);
    line-height: 1.4;
}
.toc-list a:hover { color: var(--blue); background: rgba(34, 87, 214, 0.06); opacity: 1; }
.toc-list a.active { color: var(--blue); background: rgba(34, 87, 214, 0.08); font-weight: 600; }
.toc-list .toc-sub { padding-left: 16px; font-size: 0.74rem; }

/* ===== POST ARTICLE BODY ===== */
.post-article { min-width: 0; }
.post-article section { margin-bottom: 48px; }
.post-article section:last-child { margin-bottom: 0; }
.section-label {
    font: 800 0.7rem 'JetBrains Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--blue);
    margin-bottom: 10px;
    display: block;
}
.post-article h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
    scroll-margin-top: 100px;
}
.post-article h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 10px;
    margin-top: 24px;
    scroll-margin-top: 100px;
}
.post-article p {
    color: var(--muted);
    line-height: 1.8;
    margin-bottom: 16px;
}
.post-article strong { color: var(--ink); }
.post-article ul, .post-article ol {
    padding-left: 20px;
    margin-bottom: 16px;
}
.post-article li {
    color: var(--muted);
    line-height: 1.75;
    margin-bottom: 6px;
}
.post-article li strong { color: var(--ink); }
.post-article a { color: var(--blue); font-weight: 600; }
.post-article a:hover { opacity: 0.85; }

/* ===== CALLOUT ===== */
.callout {
    border-left: 3px solid var(--blue);
    background: linear-gradient(135deg, rgba(34, 87, 214, 0.055), rgba(22, 128, 61, 0.045));
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 18px 20px;
    margin: 24px 0;
}
.callout p { color: var(--ink); margin: 0; font-size: 0.95rem; line-height: 1.7; }
.callout.amber  { border-color: var(--amber); background: linear-gradient(135deg, rgba(184, 101, 0, 0.06), rgba(184, 101, 0, 0.03)); }
.callout.green  { border-color: var(--green); background: linear-gradient(135deg, rgba(22, 128, 61, 0.06), rgba(22, 128, 61, 0.03)); }
.callout.purple { border-color: var(--cyan);  background: linear-gradient(135deg, rgba(4, 124, 155, 0.06), rgba(4, 124, 155, 0.03)); }

/* ===== METRIC GRID ===== */
.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin: 24px 0;
}
.metric-card {
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: linear-gradient(180deg, rgba(255, 253, 247, 0.96), rgba(246, 241, 230, 0.94));
    padding: 20px;
    box-shadow: 0 12px 30px rgba(44, 37, 25, 0.08);
    transition: var(--transition);
}
.metric-card:hover { border-color: rgba(34, 87, 214, 0.22); transform: translateY(-2px); }
.metric-card .metric-val {
    font-size: 1.7rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 6px;
    color: var(--amber);
}
.metric-card .metric-val.blue   { color: var(--blue); }
.metric-card .metric-val.green  { color: var(--green); }
.metric-card .metric-val.purple { color: var(--cyan); }
.metric-card .metric-label {
    font-size: 0.78rem;
    color: var(--soft);
    line-height: 1.4;
    font-weight: 500;
}

/* ===== TECH STACK ===== */
.tech-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 20px 0;
}
.tech-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    background: rgba(34, 87, 214, 0.045);
    border: 1px solid rgba(34, 87, 214, 0.13);
    color: #43506a;
    border-radius: 999px;
    font: 600 0.72rem 'JetBrains Mono', monospace;
    transition: var(--transition);
}
.tech-pill:hover { background: rgba(34, 87, 214, 0.1); opacity: 1; }
.tech-pill.amber  { background: rgba(184, 101, 0, 0.045); border-color: rgba(184, 101, 0, 0.15); color: var(--amber); }
.tech-pill.green  { background: rgba(22, 128, 61, 0.045); border-color: rgba(22, 128, 61, 0.15); color: var(--green); }
.tech-pill.purple { background: rgba(4, 124, 155, 0.045); border-color: rgba(4, 124, 155, 0.15); color: var(--cyan); }

/* ===== INFO CARD GRID ===== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin: 24px 0;
}
.info-card {
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: rgba(255, 253, 247, 0.9);
    padding: 22px;
    box-shadow: 0 12px 35px rgba(44, 37, 25, 0.07);
    transition: var(--transition);
}
.info-card:hover { border-color: rgba(34, 87, 214, 0.22); transform: translateY(-2px); }
.info-card h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 8px;
}
.info-card p {
    font-size: 0.875rem;
    color: var(--muted);
    margin: 0;
    line-height: 1.6;
}
.info-card.highlight-card {
    border-color: rgba(34, 87, 214, 0.2);
    background: linear-gradient(135deg, rgba(255, 253, 247, 0.98), rgba(244, 238, 226, 0.96));
}

/* ===== CODE BLOCK ===== */
.code-block {
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    overflow-x: auto;
    margin: 24px 0;
    background: linear-gradient(180deg, rgba(255, 253, 247, 0.96), rgba(248, 244, 234, 0.92));
    box-shadow: 0 12px 35px rgba(44, 37, 25, 0.07);
}
.code-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid var(--line);
    background: rgba(22, 26, 34, 0.035);
}
.code-block-header span {
    font: 500 0.72rem 'JetBrains Mono', monospace;
    color: var(--soft);
}
.code-block pre {
    padding: 20px;
    margin: 0;
    font-size: 0.8rem;
    line-height: 1.7;
    color: #273142;
    font-family: 'JetBrains Mono', monospace;
    white-space: pre;
    overflow-x: auto;
}
code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85em;
    color: var(--blue);
    background: rgba(34, 87, 214, 0.045);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(34, 87, 214, 0.1);
}

/* ===== TIMELINE ===== */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 24px 0;
    position: relative;
}
.timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--line);
}
.timeline-item {
    display: flex;
    gap: 20px;
    padding-bottom: 28px;
    position: relative;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: rgba(255, 253, 247, 0.9);
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font: 700 0.78rem 'JetBrains Mono', monospace;
    color: var(--blue);
    position: relative;
    z-index: 1;
    box-shadow: 0 4px 12px rgba(44, 37, 25, 0.06);
}
.timeline-content h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 6px;
    padding-top: 8px;
}
.timeline-content p { font-size: 0.875rem; color: var(--muted); margin: 0; }

/* ===== DATA TABLE ===== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    background: rgba(255, 253, 247, 0.9);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    overflow: hidden;
    font-size: 0.875rem;
}
.data-table thead th {
    padding: 12px 16px;
    text-align: left;
    color: var(--soft);
    font: 800 0.66rem 'JetBrains Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    background: rgba(22, 26, 34, 0.035);
    border-bottom: 1px solid var(--line);
}
.data-table tbody td {
    padding: 12px 16px;
    color: var(--muted);
    border-bottom: 1px solid rgba(22, 26, 34, 0.06);
    vertical-align: top;
    line-height: 1.6;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: rgba(34, 87, 214, 0.03); }
.data-table .td-em     { color: var(--ink); font-weight: 600; }
.data-table .td-code   { color: var(--blue); font-family: 'JetBrains Mono', monospace; font-size: 0.8rem; }
.data-table .td-green  { color: var(--green); }
.data-table .td-amber  { color: var(--amber); }

/* ===== PR ENTRY ===== */
.pr-list { display: flex; flex-direction: column; gap: 16px; margin: 24px 0; }
.pr-entry {
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: rgba(255, 253, 247, 0.9);
    padding: 22px;
    box-shadow: 0 12px 35px rgba(44, 37, 25, 0.07);
    transition: var(--transition);
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 16px;
    align-items: start;
}
.pr-entry:hover { border-color: rgba(34, 87, 214, 0.22); }
.pr-repo-badge {
    font: 700 0.68rem 'JetBrains Mono', monospace;
    color: var(--green);
    background: rgba(22, 128, 61, 0.06);
    border: 1px solid rgba(22, 128, 61, 0.15);
    padding: 6px 10px;
    border-radius: 4px;
    white-space: nowrap;
}
.pr-entry h4 { font-size: 0.95rem; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.pr-entry p { font-size: 0.875rem; color: var(--muted); margin: 0; }
.pr-entry a { color: var(--blue); font-size: 0.82rem; font-weight: 600; }

/* ===== DECISION BOXES ===== */
.decision-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin: 24px 0;
}
.decision-box {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: rgba(255, 253, 247, 0.9);
    padding: 20px;
}
.decision-box.selected {
    border-color: var(--green);
    background: rgba(22, 128, 61, 0.04);
}
.decision-box.rejected {
    border-color: rgba(194, 75, 75, 0.2);
    background: rgba(194, 75, 75, 0.03);
    opacity: 0.75;
}
.decision-box .decision-label {
    font: 800 0.66rem 'JetBrains Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 8px;
}
.decision-box.selected .decision-label { color: var(--green); }
.decision-box.rejected .decision-label { color: var(--red); }
.decision-box.neutral .decision-label  { color: var(--soft); }
.decision-box h4 { font-size: 0.95rem; font-weight: 700; color: var(--ink); margin-bottom: 8px; }
.decision-box p { font-size: 0.85rem; color: var(--muted); margin: 0; }

/* ===== POST FOOTER NAV ===== */
.post-footer-nav {
    width: min(1180px, calc(100% - 44px));
    margin: 0 auto;
    padding: 32px 0 48px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--line);
    gap: 16px;
    flex-wrap: wrap;
}

/* ===== RANK SYSTEM ===== */
.rank-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin: 20px 0;
}
.rank-item {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: rgba(255, 253, 247, 0.9);
    padding: 16px;
}
.rank-badge {
    display: inline-block;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--amber);
    margin-bottom: 6px;
}
.rank-item p { font-size: 0.8rem; color: var(--muted); margin: 0; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .post-hero { padding: 118px 0 40px; }
    .post-hero h1 { font-size: 1.8rem; }
    .post-layout { padding: 40px 0 60px; }
    .stat-strip { grid-template-columns: repeat(2, 1fr); }
    .metric-grid { grid-template-columns: repeat(2, 1fr); }
    .post-footer-nav { flex-direction: column; align-items: flex-start; }
    .data-table { font-size: 0.8rem; }
    .data-table thead th, .data-table tbody td { padding: 10px 12px; }
    .card-grid { grid-template-columns: 1fr; }
    .pr-entry { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
    .stat-strip { grid-template-columns: 1fr; }
    .tech-grid { gap: 6px; }
    .rank-list { grid-template-columns: repeat(2, 1fr); }
    .container { width: min(100% - 28px, 1180px); }
}
