/* ============================================
   Blog Shared Styles — matches main site style.css
   ============================================ */
:root {
    --bg-color: #f8f9fa;
    --text-color: #212529;
    --primary-color: #ff0000;
    --primary-hover: #cc0000;
    --card-bg: #ffffff;
    --border-radius: 8px;
    --muted: #6c757d;
    --border: #dee2e6;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.7;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 50px;
}

/* ---- Nav (same as main site) ---- */
.topnav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--card-bg);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    z-index: 1000;
}
.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--text-color);
}
.nav-brand a {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.brand-name {
    text-decoration: none;
    color: var(--text-color);
    font-size: 1.25rem;
    margin: 0;
}
.nav-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}
.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    margin-left: 1.5rem;
    font-weight: 500;
    transition: color 0.2s;
}
.nav-links a:hover { color: var(--primary-color); }

/* ---- Page layout ---- */
.page-wrapper {
    width: 100%;
    max-width: 780px;
    margin: 2rem 1rem 4rem;
    padding: 0 1rem;
}

/* ---- Breadcrumb ---- */
.breadcrumb {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 2rem;
    margin-top: 1.5rem;
}
.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
}
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { margin: 0 0.4rem; }

/* ---- Article header ---- */
.article-header { margin-bottom: 2.5rem; }
.article-header h1 {
    font-size: 2.2rem;
    line-height: 1.25;
    color: #111;
    margin-bottom: 0.75rem;
}
.article-meta {
    font-size: 0.88rem;
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}
.tag {
    background-color: rgba(255,0,0,0.08);
    color: var(--primary-color);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ---- Article body ---- */
.article-body { color: #333; }
.article-body h2 {
    font-size: 1.45rem;
    color: #111;
    margin-top: 2.5rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid var(--border);
}
.article-body h3 {
    font-size: 1.15rem;
    color: #222;
    margin-top: 1.75rem;
    margin-bottom: 0.5rem;
}
.article-body p { margin-bottom: 1.25rem; }
.article-body ul, .article-body ol {
    margin: 0.75rem 0 1.25rem 1.5rem;
}
.article-body li { margin-bottom: 0.4rem; }
.article-body strong { color: #111; }
.article-body a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}
.article-body a:hover { text-decoration: underline; }

/* ---- Callout box ---- */
.callout {
    background: rgba(255,0,0,0.05);
    border-left: 4px solid var(--primary-color);
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    padding: 1rem 1.25rem;
    margin: 1.75rem 0;
}
.callout p { margin: 0; color: #333; }
.callout strong { color: var(--primary-color); }

/* ---- CTA box ---- */
.cta-box {
    background: var(--card-bg);
    border: 2px solid var(--primary-color);
    border-radius: var(--border-radius);
    padding: 1.75rem;
    text-align: center;
    margin: 3rem 0 1rem;
    box-shadow: 0 4px 16px rgba(255,0,0,0.08);
}
.cta-box h3 {
    font-size: 1.3rem;
    color: #111;
    margin-bottom: 0.5rem;
}
.cta-box p {
    color: var(--muted);
    margin-bottom: 1.2rem;
    font-size: 0.95rem;
}
.cta-btn {
    display: inline-block;
    background-color: var(--primary-color);
    padding: 0.85rem 2rem;
    border-radius: var(--border-radius);
    font-weight: 700;
    font-size: 1rem;
    color: white !important;
    transition: background-color 0.2s;
}
.cta-btn:hover {
    background-color: var(--primary-hover);
    color: white;
}

/* ---- Blog index cards ---- */
.blog-header {
    text-align: center;
    margin: 2.5rem 0 2rem;
}
.blog-header h1 {
    font-size: 2.4rem;
    color: #111;
    margin-bottom: 0.5rem;
}
.blog-header p { color: var(--muted); font-size: 1rem; }

.post-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.post-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
    padding: 1.75rem;
    transition: box-shadow 0.2s, transform 0.2s;
    text-decoration: none;
    color: inherit;
    display: block;
    border-left: 4px solid transparent;
}
.post-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    transform: translateY(-2px);
    border-left-color: var(--primary-color);
    text-decoration: none;
    color: inherit;
}
.post-card .tag { margin-bottom: 0.6rem; display: inline-block; }
.post-card h2 {
    font-size: 1.3rem;
    color: #111;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}
.post-card p {
    color: var(--muted);
    font-size: 0.93rem;
    margin-bottom: 0.75rem;
}
.post-card .post-meta {
    font-size: 0.82rem;
    color: #aaa;
}

/* ---- Related posts ---- */
.related-posts {
    margin-top: 3rem;
    border-top: 1px solid var(--border);
    padding-top: 2rem;
}
.related-posts h3 {
    font-size: 1.1rem;
    color: #111;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.85rem;
}
.related-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.related-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 1rem 1.25rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    text-decoration: none;
    color: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    color: #222;
    transition: color 0.2s;
    border-top: 3px solid var(--border);
}
.related-card:hover {
    color: var(--primary-color);
    border-top-color: var(--primary-color);
}
.related-card span {
    display: block;
    font-weight: 400;
    color: var(--muted);
    font-size: 0.8rem;
    margin-top: 0.3rem;
}

/* ---- Responsive ---- */
@media screen and (max-width: 890px) {
    .topnav { gap: 4px 40px; justify-content: center; }
    .nav-brand { font-size: 1rem; }
    .brand-name { font-size: 1rem; }
}
@media screen and (max-width: 600px) {
    .nav-brand { font-size: 0.7rem; }
    .article-header h1 { font-size: 1.7rem; }
    .related-grid { grid-template-columns: 1fr; }
    .page-wrapper { margin: 1rem 0 3rem; }
}