:root {
    --primary: #1a56db;
    --primary-dark: #1642a8;
    --accent: #f59e0b;
    --accent-dark: #d97706;
    --text: #1f2937;
    --text-light: #6b7280;
    --bg: #ffffff;
    --bg-alt: #f9fafb;
    --bg-dark: #111827;
    --border: #e5e7eb;
    --success: #10b981;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
    --max-width: 1200px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.7;
    font-size: 17px;
}

a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; height: auto; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }

/* ===== HEADER / NAV ===== */
header {
    background: var(--bg-dark);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-md);
}

header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.logo { font-size: 1.5rem; font-weight: 800; color: #fff; display: flex; align-items: center; gap: 0.5rem; }
.logo span { color: var(--accent); }
.logo:hover { color: #fff; }

nav { display: flex; gap: 1.5rem; align-items: center; }
nav a { color: #d1d5db; font-weight: 500; font-size: 0.95rem; transition: color 0.2s; }
nav a:hover { color: #fff; }

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
}

/* ===== HERO ===== */
.hero {
    background: linear-gradient(135deg, var(--bg-dark) 0%, #1e3a5f 100%);
    color: #fff;
    padding: 5rem 0 4rem;
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.15;
}

.hero h1 .highlight { color: var(--accent); }

.hero p {
    font-size: 1.25rem;
    color: #d1d5db;
    max-width: 650px;
    margin: 0 auto 2rem;
}

.hero-cta {
    display: inline-block;
    background: var(--accent);
    color: var(--bg-dark);
    padding: 0.9rem 2rem;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 1.05rem;
    transition: background 0.2s, transform 0.2s;
}
.hero-cta:hover { background: var(--accent-dark); color: var(--bg-dark); transform: translateY(-2px); }

/* ===== SECTION HEADINGS ===== */
.section { padding: 4rem 0; }
.section-alt { background: var(--bg-alt); }

.section-title {
    font-size: 2rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 0.5rem;
}

.section-subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 2.5rem;
    font-size: 1.1rem;
}

/* ===== CARD GRID ===== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.75rem;
}

.card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.card-body { padding: 1.5rem; }

.card-category {
    display: inline-block;
    background: #eff6ff;
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.75rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}
.card-title a { color: var(--text); }
.card-title a:hover { color: var(--primary); }

.card-excerpt {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.card-meta { display: flex; gap: 1rem; font-size: 0.85rem; color: var(--text-light); }

/* ===== FEATURED CARDS ===== */
.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.75rem;
}

.featured-card {
    background: linear-gradient(135deg, #1e3a5f, var(--bg-dark));
    color: #fff;
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    transition: transform 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.featured-card:hover { transform: translateY(-4px); }

.featured-card .card-category { background: rgba(245, 158, 11, 0.2); color: var(--accent); }
.featured-card .card-title a { color: #fff; }
.featured-card .card-excerpt { color: #d1d5db; }
.featured-card .card-meta { color: #9ca3af; }

/* ===== CATEGORY PILLS ===== */
.category-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    margin-bottom: 2.5rem;
}

.pill {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    border: 2px solid var(--border);
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
    transition: all 0.2s;
}
.pill:hover, .pill.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ===== QUICK STATS ===== */
.quick-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    background: linear-gradient(135deg, #1e3a5f, var(--bg-dark));
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 2.5rem;
}

.quick-stats .stat {
    text-align: center;
    padding: 0.5rem;
}

.quick-stats .stat-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #9ca3af;
    margin-bottom: 0.35rem;
}

.quick-stats .stat-value {
    display: block;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--accent);
}

@media (max-width: 600px) {
    .quick-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===== ARTICLE PAGE ===== */
.article-header {
    padding: 4rem 0 2rem;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
}

.article-header .container { max-width: 800px; }

.article-header .card-category { margin-bottom: 1rem; }

.article-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.article-header .meta {
    color: var(--text-light);
    font-size: 0.95rem;
    display: flex;
    gap: 1.5rem;
}

.article-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 4rem;
}

.article-content h2 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-top: 2.5rem;
    margin-bottom: 0.75rem;
    color: var(--text);
}

.article-content h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 0.5rem;
}

.article-content p { margin-bottom: 1.25rem; }

.article-content ul, .article-content ol {
    margin-bottom: 1.25rem;
    padding-left: 1.75rem;
}

.article-content li { margin-bottom: 0.4rem; }

.article-content blockquote {
    border-left: 4px solid var(--accent);
    background: var(--bg-alt);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 var(--radius) var(--radius) 0;
    color: var(--text-light);
    font-style: italic;
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.article-content th, .article-content td {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    text-align: left;
}

.article-content th { background: var(--bg-alt); font-weight: 600; }

.article-content .source-note {
    font-size: 0.85rem;
    color: var(--text-light);
    font-style: italic;
}

/* Affiliate box */
.affiliate-box {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border: 2px solid var(--accent);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin: 2rem 0;
}
.affiliate-box h4 { color: var(--accent-dark); margin-bottom: 0.5rem; }
.affiliate-box ul { margin-top: 0.5rem; }

/* ===== SIDEBAR (for related) ===== */
.related-section { padding: 3rem 0; background: var(--bg-alt); }
.related-section .card-grid { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }

/* ===== ABOUT PAGE ===== */
.about-hero {
    background: linear-gradient(135deg, var(--bg-dark) 0%, #1e3a5f 100%);
    color: #fff;
    padding: 4rem 0;
    text-align: center;
}
.about-hero h1 { font-size: 2.5rem; font-weight: 800; margin-bottom: 1rem; }
.about-hero p { color: #d1d5db; font-size: 1.15rem; max-width: 600px; margin: 0 auto; }

.about-content { max-width: 800px; margin: 0 auto; padding: 3rem 1.5rem; }
.about-content h2 { font-size: 1.6rem; font-weight: 700; margin: 2rem 0 0.75rem; }
.about-content p { margin-bottom: 1.25rem; }

/* ===== FOOTER ===== */
footer {
    background: var(--bg-dark);
    color: #9ca3af;
    padding: 3rem 0 1.5rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-brand p { margin-top: 0.5rem; font-size: 0.9rem; line-height: 1.6; }
.footer-links h4 { color: #fff; font-size: 0.95rem; margin-bottom: 0.75rem; }
.footer-links ul { list-style: none; }
.footer-links li { margin-bottom: 0.4rem; }
.footer-links a { color: #9ca3af; font-size: 0.9rem; }
.footer-links a:hover { color: #fff; }

.footer-bottom {
    border-top: 1px solid #374151;
    padding-top: 1.5rem;
    text-align: center;
    font-size: 0.85rem;
}

/* ===== 404 ===== */
.not-found { text-align: center; padding: 6rem 0; }
.not-found h1 { font-size: 6rem; font-weight: 800; color: var(--primary); }
.not-found p { font-size: 1.2rem; color: var(--text-light); margin: 1rem 0 2rem; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .hero h1 { font-size: 2rem; }
    .hero p { font-size: 1.05rem; }

    nav { display: none; }
    nav.open { display: flex; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0; background: var(--bg-dark); padding: 1rem 1.5rem; gap: 1rem; }
    .mobile-menu-btn { display: block; }

    .card-grid, .featured-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }

    .article-header h1 { font-size: 1.75rem; }
    .section-title { font-size: 1.5rem; }
}
