/* ── TruvAI blog ────────────────────────────────────────────────────────────
   Shared by blog.html and every post under blog/. Tokens are copied from
   index.html rather than imported, since index.html keeps its CSS inline and
   there is no build step to share them through.
   ------------------------------------------------------------------------ */

:root {
    --primary: #1b6156;
    --primary-dark: #144a42;
    --primary-light: #237a6c;
    --secondary: #e7f0ec;
    --text: #0c1d14;
    --text-muted: #4a6358;
    --bg: #ffffff;
    --border: #d0e0d8;
    --shadow: 0 1px 3px rgba(12, 29, 20, 0.06), 0 4px 16px rgba(12, 29, 20, 0.04);
    --shadow-lg: 0 4px 12px rgba(12, 29, 20, 0.08), 0 16px 48px rgba(12, 29, 20, 0.06);
    --radius: 12px;
    --radius-lg: 20px;
    --danger: #b4362b;
    --danger-bg: #fdf2f0;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    overflow-x: hidden;
    overflow-wrap: break-word;
}

/* ── Nav ─────────────────────────────────────────────────────────────────── */

nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo { display: flex; align-items: center; text-decoration: none; }
.logo img { height: 90px; width: auto; }

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.25s ease;
    padding: 6px 12px;
    border-radius: 8px;
}

.nav-links a:hover { color: var(--primary); }
.nav-links a.active { color: var(--primary); font-weight: 600; }

/* `.nav-links a` outranks `.btn-primary` on specificity, so without this the
   waitlist button renders muted-green-on-green and is effectively unreadable. */
.nav-links a.btn-primary { color: #fff; }
.nav-links a.btn-primary:hover { color: #fff; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(27, 97, 86, 0.3);
}

.btn-lg { padding: 14px 30px; font-size: 1rem; }

/* ── Shared layout ───────────────────────────────────────────────────────── */

.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 720px; margin: 0 auto; padding: 0 24px; }

.page-head {
    padding: 132px 24px 56px;
    background: linear-gradient(180deg, var(--secondary) 0%, var(--bg) 100%);
    text-align: center;
}

.section-label {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 14px;
}

.page-head h1 {
    font-size: clamp(2.1rem, 5vw, 3.1rem);
    line-height: 1.12;
    letter-spacing: -0.03em;
    margin-bottom: 16px;
}

.page-head p {
    color: var(--text-muted);
    font-size: 1.08rem;
    max-width: 560px;
    margin: 0 auto;
}

/* ── Post grid ───────────────────────────────────────────────────────────── */

.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 28px;
    padding: 56px 0 96px;
}

.post-card {
    display: flex;
    flex-direction: column;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
}

.post-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.post-card .thumb { display: block; width: 100%; height: auto; background: var(--secondary); }
.post-card .body { padding: 22px 24px 26px; display: flex; flex-direction: column; flex: 1; }

.tag {
    align-self: flex-start;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--primary);
    background: var(--secondary);
    padding: 5px 10px;
    border-radius: 999px;
    margin-bottom: 12px;
}

.post-card h2 {
    font-size: 1.22rem;
    line-height: 1.32;
    letter-spacing: -0.02em;
    margin-bottom: 10px;
}

.post-card p { color: var(--text-muted); font-size: 0.94rem; flex: 1; }

.meta {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.83rem;
    margin-top: 18px;
}

.meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--border); }

/* ── Article ─────────────────────────────────────────────────────────────── */

.article-head { padding: 116px 24px 0; }
.article-head .inner { max-width: 720px; margin: 0 auto; }

.article-head h1 {
    font-size: clamp(1.9rem, 4.4vw, 2.7rem);
    line-height: 1.16;
    letter-spacing: -0.03em;
    margin: 14px 0 16px;
}

.article-meta {
    margin-top: 20px;
    padding: 16px 0;
    border-top: 1px solid var(--border);
}

.meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.meta-row + .meta-row { margin-top: 6px; }

.meta-source {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: var(--text);
    font-size: 0.9rem;
}

.meta-source .trust-dot {
    width: 7px; height: 7px;
}

.meta-author {
    font-size: 0.88rem;
    color: var(--text-muted);
}

.meta-date {
    font-size: 0.88rem;
    color: var(--text-muted);
}

.meta-sep {
    color: var(--border);
    font-size: 0.7rem;
}

.article-hero {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--radius-lg);
    margin: 32px 0 8px;
    background: var(--secondary);
}

article { padding: 24px 0 40px; }

article > * + * { margin-top: 22px; }

article h2 {
    font-size: 1.5rem;
    line-height: 1.3;
    letter-spacing: -0.02em;
    margin-top: 44px;
}

article h3 {
    font-size: 1.13rem;
    line-height: 1.4;
    margin-top: 30px;
}

article p { color: #21382c; font-size: 1.045rem; }

article ul, article ol { padding-left: 22px; color: #21382c; font-size: 1.045rem; }
article li + li { margin-top: 9px; }

article strong { font-weight: 650; color: var(--text); }

article a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }

.lead { font-size: 1.16rem; color: var(--text-muted); line-height: 1.62; }

/* Callouts */
.callout {
    border-left: 3px solid var(--primary);
    background: var(--secondary);
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 18px 22px;
}

.callout.warn {
    border-left-color: var(--danger);
    background: var(--danger-bg);
}

.callout p { font-size: 0.99rem; }
.callout strong { display: block; margin-bottom: 5px; }

/* Red-flag checklist */
.flags { list-style: none; padding-left: 0; }

.flags li {
    position: relative;
    padding-left: 30px;
    margin-top: 12px;
}

.flags li::before {
    content: "";
    position: absolute;
    left: 0; top: 8px;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: var(--danger-bg);
    border: 1.5px solid var(--danger);
}

/* Numbered steps */
.steps { list-style: none; counter-reset: step; padding-left: 0; }

.steps li {
    position: relative;
    counter-increment: step;
    padding-left: 42px;
    margin-top: 16px;
}

.steps li::before {
    content: counter(step);
    position: absolute;
    left: 0; top: 1px;
    width: 27px; height: 27px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 0.83rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* End-of-post CTA */
.post-cta {
    margin: 56px 0 0;
    padding: 34px 32px;
    background: var(--primary);
    border-radius: var(--radius-lg);
    text-align: center;
    color: #fff;
}

.post-cta h2 { margin: 0 0 10px; font-size: 1.42rem; letter-spacing: -0.02em; }
.post-cta p { color: rgba(255,255,255,0.85); margin-bottom: 22px; font-size: 1rem; }
.post-cta .btn { background: #fff; color: var(--primary); }
.post-cta .btn:hover { background: var(--secondary); transform: translateY(-1px); }

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.back-link:hover { color: var(--primary); }

/* ── Filter bar ────────────────────────────────────────────────────────── */

.filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.filter-bar::-webkit-scrollbar { display: none; }

.filter-label {
    flex-shrink: 0;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-right: 4px;
}

.source-bar {
    padding-top: 4px;
    gap: 6px;
}

.filter-btn, .source-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg);
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.filter-btn:hover, .source-btn:hover { border-color: var(--primary); color: var(--primary); }
.filter-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.source-btn.active {
    background: var(--secondary);
    color: var(--primary);
    border-color: var(--primary);
}
.source-btn .trust-dot {
    width: 5px; height: 5px;
}
.source-count {
    font-size: 0.7rem;
    opacity: 0.6;
    margin-left: 2px;
}

/* ── Feed stats ────────────────────────────────────────────────────────── */

.feed-stats {
    padding: 16px 0 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ── Intel card extras ─────────────────────────────────────────────────── */

.card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
}

.trust-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}
.trust-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #22c55e;
    display: inline-block;
}

.trust-badge-lg {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

.threat-level {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.threat-critical { color: #dc2626; }
.threat-high { color: #ea580c; }
.threat-medium { color: #ca8a04; }
.threat-low { color: var(--text-muted); }

.tag-phishing { color: #7c3aed; background: #f3f0ff; }
.tag-ransomware { color: #dc2626; background: #fef2f2; }
.tag-malware { color: #c2410c; background: #fff7ed; }
.tag-scam { color: #b45309; background: #fffbeb; }
.tag-breach { color: #be123c; background: #fff1f2; }
.tag-vuln { color: #0369a1; background: #f0f9ff; }
.tag-crypto { color: #7c3aed; background: #f5f3ff; }
.tag-ai { color: #0d9488; background: #f0fdfa; }
.tag-payment { color: #059669; background: #ecfdf5; }
.tag-default { color: var(--primary); background: var(--secondary); }

/* ── Skeleton loading ──────────────────────────────────────────────────── */

.skeleton-card {
    border-radius: var(--radius-lg);
    background: linear-gradient(110deg, #f0f0f0 30%, #e8e8e8 50%, #f0f0f0 70%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    min-height: 220px;
    border: 1px solid var(--border);
}
.skeleton-detail {
    height: 200px;
    border-radius: var(--radius-lg);
    background: linear-gradient(110deg, #f0f0f0 30%, #e8e8e8 50%, #f0f0f0 70%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.load-more-wrap {
    display: flex;
    justify-content: center;
    padding: 24px 0 0;
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    background: transparent;
    color: var(--text);
    font-weight: 600;
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.feed-empty {
    text-align: center;
    padding: 60px 0;
    color: var(--text-muted);
}

.article-body-content p { margin-bottom: 16px; }

/* ── Source article (fetched content) ──────────────────────────────────── */

.source-article {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text);
    margin-bottom: 32px;
}

.source-article h1 { font-size: 1.6rem; margin: 32px 0 12px; }
.source-article h2 { font-size: 1.35rem; margin: 28px 0 10px; }
.source-article h3 { font-size: 1.15rem; margin: 24px 0 8px; }
.source-article h4, .source-article h5, .source-article h6 { font-size: 1rem; margin: 20px 0 6px; }

.source-article p { margin-bottom: 16px; }

.source-article img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
    margin: 20px 0;
    background: var(--tertiary);
}

.source-article a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.source-article a:hover { opacity: 0.8; }

.source-article blockquote {
    border-left: 3px solid var(--primary);
    padding: 12px 20px;
    margin: 20px 0;
    background: var(--secondary);
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: var(--text-muted);
}

.source-article pre {
    background: #1a1a2e;
    color: #e0e0e0;
    padding: 16px 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 20px 0;
    font-size: 0.88rem;
    line-height: 1.5;
}

.source-article code {
    background: var(--secondary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

.source-article pre code {
    background: none;
    padding: 0;
}

.source-article ul, .source-article ol {
    padding-left: 24px;
    margin: 16px 0;
}

.source-article li { margin-bottom: 8px; }

.source-article-fallback {
    padding: 32px;
    background: var(--secondary);
    border-radius: 12px;
    text-align: center;
    margin-bottom: 24px;
}

.source-article-fallback .lead {
    font-size: 1rem;
    line-height: 1.8;
}

/* ── Footer ──────────────────────────────────────────────────────────────── */

footer {
    border-top: 1px solid var(--border);
    padding: 26px 24px;
    margin-top: 72px;
}

.footer-inner {
    max-width: 1120px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.footer-text { color: var(--text-muted); font-size: 0.87rem; }
.footer-text a { color: var(--primary); text-decoration: none; font-weight: 600; }

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .nav-links { display: none; }
    .logo img { height: 60px; }
    .page-head { padding-top: 108px; }
    .article-head { padding-top: 96px; }
    .post-grid { grid-template-columns: 1fr; gap: 22px; padding: 40px 0 72px; }
    .footer-inner { flex-direction: column; text-align: center; }
    .post-cta { padding: 28px 22px; }
}
