/* CatchMailNot blog — styling lifted from the main landing page */

:root {
    --primary: #5C9AEB;
    --primary-dark: #4A88D9;
    --secondary: #0B1727;
    --dark: #212529;
    --light: #f8f9fa;
    --success: #2dce89;
    --info: #11cdef;
    --warning: #fb6340;
    --danger: #f5365c;

    --bg-color: #ffffff;
    --bg-secondary: #f8f9fa;
    --text-color: #212529;
    --muted-color: #6c757d;
    --border-color: rgba(0, 0, 0, 0.1);
    --code-bg: #0B1727;

    /* Dark mode variables */
    --bg-dark: #121212;
    --bg-dark-secondary: #1e1e1e;
    --text-dark: #e0e0e0;
    --border-dark: #2d2d2d;
}

[data-theme="dark"] {
    --bg-color: var(--bg-dark);
    --bg-secondary: var(--bg-dark-secondary);
    --text-color: var(--text-dark);
    --muted-color: #a0a0a0;
    --border-color: var(--border-dark);
    --code-bg: #0a0f16;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.7;
    padding-top: 66px; /* fixed navbar */
}

[data-theme="dark"] body { background-color: var(--bg-color); color: var(--text-color); }
[data-theme="dark"] .bg-light { background-color: var(--bg-secondary) !important; }
[data-theme="dark"] .text-muted { color: #a0a0a0 !important; }
[data-theme="dark"] .border { border-color: var(--border-color) !important; }
[data-theme="dark"] .feature-card,
[data-theme="dark"] .post-card {
    background-color: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

a { color: var(--primary); }
a:hover { color: var(--primary-dark); }

.bg-gradient-primary { background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%); }
.text-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.btn-primary { background-color: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background-color: var(--primary-dark); border-color: var(--primary-dark); }
.btn-outline-primary { color: var(--primary); border-color: var(--primary); }
.btn-outline-primary:hover { background-color: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- navbar ---------- */
.navbar.bg-dark { background-color: #000 !important; }
.navbar-brand { font-weight: 600; }
.brand-sub { color: var(--primary); font-weight: 500; }
.nav-link { color: rgba(255,255,255,0.8); transition: all 0.3s ease; }
.nav-link:hover { color: #fff; }

.theme-toggle {
    background: none;
    border: none;
    color: rgba(255,255,255,0.8);
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}
.theme-toggle:hover { color: #fff; }

/* ---------- hero (home) ---------- */
.hero {
    display: flex;
    align-items: center;
    background-color: #000;
    color: #fff;
    position: relative;
    overflow: hidden;
}
.hero-blog { min-height: 62vh; padding: 6rem 0 5rem; }
.hero-bg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 0; }
.hero-kicker {
    color: var(--primary);
    font-weight: 600;
    letter-spacing: 0.12em;
    font-size: 0.8rem;
    margin-bottom: 1rem;
}
.hero .btn-outline-light:hover { color: #000; }

/* ---------- sections ---------- */
section { padding: 5rem 0; }
.posts-section { padding: 4rem 0 5rem; }
.cta-ribbon { padding: 4rem 0; }
.related { padding: 4rem 0 5rem; }

/* ---------- cards ---------- */
.feature-card,
.post-card {
    border-radius: 16px;
    transition: all 0.3s ease;
    height: 100%;
    border: 1px solid var(--border-color);
    background-color: var(--bg-color);
}
.feature-card { padding: 2rem; }
.feature-card:hover,
.post-card:hover { transform: translateY(-10px); box-shadow: 0 10px 30px rgba(0,0,0,0.1); }

.post-card { display: flex; flex-direction: column; overflow: hidden; }
.post-card-media { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg-secondary); }
.post-card-media img { width: 100%; height: 100%; object-fit: cover; }
.post-card-body { padding: 1.5rem 1.5rem 1.25rem; display: flex; flex-direction: column; flex: 1; }
.post-card.no-media .post-card-body { padding-top: 1.75rem; }
.post-card-tags { min-height: 1.5rem; margin-bottom: 0.5rem; }
.post-card-title { font-size: 1.2rem; font-weight: 600; line-height: 1.35; margin-bottom: 0.6rem; }
.post-card-title a { color: inherit; text-decoration: none; }
.post-card-title a:hover { color: var(--primary); }
.post-card-excerpt {
    font-size: 0.95rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 1rem;
}
.post-card-meta { margin-top: auto; }
.dot { margin: 0 0.45rem; opacity: 0.5; }

/* ---------- tags ---------- */
.tag-pill {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--primary);
    background: rgba(92, 154, 235, 0.12);
    border-radius: 999px;
    padding: 0.2rem 0.65rem;
    margin: 0 0.35rem 0.35rem 0;
    text-decoration: none;
    transition: all 0.2s ease;
}
.tag-pill:hover { background: var(--primary); color: #fff; }
.tag-pill-light { background: rgba(255,255,255,0.12); color: #fff; }
.tag-pill-light:hover { background: var(--primary); }
.tag-pill-lg { font-size: 0.8rem; padding: 0.35rem 0.85rem; }
.tag-pill .count { opacity: 0.6; margin-left: 0.2rem; }
.tag-cloud { display: flex; flex-wrap: wrap; }

/* ---------- pager ---------- */
.pager { display: flex; align-items: center; justify-content: space-between; margin-top: 3rem; }

/* ---------- post ---------- */
.post-hero {
    background: radial-gradient(1200px 500px at 15% -10%, rgba(92,154,235,0.35), transparent 60%),
                linear-gradient(135deg, #000 0%, var(--secondary) 100%);
    color: #fff;
    padding: 5rem 0 3.5rem;
}
.post-hero-compact { padding: 4rem 0 3rem; }
.post-hero-inner { max-width: 820px; }
.post-title { font-weight: 700; line-height: 1.2; font-size: clamp(1.9rem, 4vw, 2.9rem); margin-bottom: 1rem; }
.post-meta { font-size: 0.95rem; }
.post-updated { margin-left: 0.75rem; font-style: italic; }
.post-updated:empty { display: none; }

.post { padding: 3.5rem 0 4rem; }
.post-inner { max-width: 820px; margin: 0 auto; }
.post-feature { margin: -6.5rem 0 2.5rem; }
.post-feature img { width: 100%; border-radius: 16px; box-shadow: 0 10px 30px rgba(0,0,0,0.15); }

.article-body { font-size: 1.125rem; line-height: 1.8; }
.article-body > * + * { margin-top: 1.25rem; }
.article-body h2, .article-body h3, .article-body h4 {
    font-weight: 700;
    line-height: 1.3;
    margin-top: 2.5rem;
    position: relative;
}
.article-body h2 { font-size: 1.75rem; }
.article-body h3 { font-size: 1.4rem; }
.article-body h4 { font-size: 1.15rem; }
.article-body .anchor {
    position: absolute;
    left: -1.4rem;
    color: var(--primary);
    opacity: 0;
    text-decoration: none;
    font-weight: 400;
}
.article-body h2:hover .anchor, .article-body h3:hover .anchor, .article-body h4:hover .anchor { opacity: 0.7; }
.article-body img { display: block; margin: 2rem auto; max-width: 100%; border-radius: 12px; }
.article-body p > em:only-child { display: block; text-align: center; color: var(--muted-color); font-size: 0.9rem; margin-top: -1.25rem; }
.article-body ul, .article-body ol { padding-left: 1.5rem; }
.article-body li + li { margin-top: 0.35rem; }
.article-body blockquote {
    border-left: 4px solid var(--primary);
    background: rgba(92,154,235,0.07);
    padding: 1rem 1.25rem;
    border-radius: 0 12px 12px 0;
    color: var(--muted-color);
}
.article-body blockquote p:last-child { margin-bottom: 0; }
.article-body code {
    font-size: 0.9em;
    background: rgba(92,154,235,0.12);
    color: inherit;
    padding: 0.15em 0.4em;
    border-radius: 6px;
}
.article-body pre {
    background: var(--code-bg);
    color: #e6edf3;
    padding: 1.25rem 1.5rem;
    border-radius: 12px;
    overflow-x: auto;
    font-size: 0.9rem;
    line-height: 1.6;
}
.article-body pre code { background: none; padding: 0; color: inherit; }
.article-body hr { border: 0; border-top: 1px solid var(--border-color); margin: 2.5rem 0; opacity: 1; }
.article-body iframe { max-width: 100%; border-radius: 12px; }
.article-body table { color: inherit; }
[data-theme="dark"] .article-body .table { --bs-table-color: var(--text-color); --bs-table-bg: transparent; --bs-table-striped-color: var(--text-color); --bs-table-striped-bg: rgba(255,255,255,0.03); --bs-table-border-color: var(--border-color); }

/* ---------- inline diagrams ({{svg:...}} in markdown) ---------- */
/* Diagram colours live inside each SVG (content/diagrams/_diagram.css is injected at build time). */
.diagram { margin: 2.5rem 0; }
.diagram svg { width: 100%; height: auto; display: block; }
.diagram figcaption { text-align: center; color: var(--muted-color); font-size: 0.95rem; margin-top: 0.75rem; }
[data-theme="dark"] .diagram { --bg-secondary: #242424; }

.post-share { display: flex; align-items: center; gap: 0.5rem; margin: 3rem 0 2rem; }
.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-color);
    transition: all 0.2s ease;
}
.share-btn:hover { background: var(--primary); border-color: var(--primary); color: #fff; }

.post-cta { margin: 2rem 0; }

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 2.5rem; }
.post-nav-link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    padding: 1rem 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.2s ease;
}
.post-nav-link:hover { border-color: var(--primary); color: var(--primary); }
.post-nav-link strong { font-weight: 600; line-height: 1.3; }

/* ---------- footer (same as landing) ---------- */
footer {
    background-color: #000;
    color: #fff;
    padding: 5rem 0 2rem;
}
.footer-link { color: rgba(255,255,255,0.7); text-decoration: none; transition: all 0.3s ease; }
.footer-link:hover { color: var(--primary); }

/* ---------- misc ---------- */
.copied-toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--secondary);
    color: #fff;
    padding: 0.6rem 1.1rem;
    border-radius: 999px;
    font-size: 0.9rem;
    z-index: 2000;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

@media (max-width: 767.98px) {
    .hero-blog { min-height: auto; padding: 4.5rem 0 3.5rem; }
    .post-nav { grid-template-columns: 1fr; }
    .post-feature { margin-top: -4.5rem; }
    .article-body { font-size: 1.05rem; }
    .article-body .anchor { display: none; }
}
