/*
Theme Name: Newsletter Hub
Theme URI: https://github.com/newsletter-portal
Description: Professional newsletter & content site theme for email marketing domains. Clean, modern, and conversion-focused.
Version: 1.0
Author: Newsletter Portal
License: GPL v2 or later
Text Domain: newsletter-hub
*/

/* ══════════════════════════════════════════════════
   CSS VARIABLES  — edit here to change brand colors
   ══════════════════════════════════════════════════ */
:root {
    --primary:        #4f46e5;
    --primary-dark:   #3730a3;
    --primary-light:  #eef2ff;
    --accent:         #059669;
    --accent-hover:   #047857;
    --text:           #0f172a;
    --text-muted:     #64748b;
    --text-light:     #94a3b8;
    --bg:             #ffffff;
    --bg-secondary:   #f8fafc;
    --bg-hero:        #0f172a;
    --border:         #e2e8f0;
    --radius:         10px;
    --radius-lg:      16px;
    --shadow-sm:      0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md:      0 4px 16px rgba(0,0,0,0.10);
    --shadow-lg:      0 12px 40px rgba(0,0,0,0.14);
    --font:           'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --max-width:      1160px;
    --nav-height:     64px;
}

/* ══════════════════════════════════════════════════
   RESET & BASE
   ══════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; transition: color 150ms; }
a:hover { color: var(--primary-dark); }
p { margin-bottom: 1em; }
h1,h2,h3,h4 {
    font-weight: 700; line-height: 1.25;
    letter-spacing: -0.02em; color: var(--text);
}

/* ══════════════════════════════════════════════════
   UTILITY
   ══════════════════════════════════════════════════ */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }
.section    { padding: 72px 0; }
.section-sm { padding: 48px 0; }
.badge {
    display: inline-block; font-size: 11px; font-weight: 700;
    letter-spacing: 0.06em; text-transform: uppercase;
    padding: 4px 10px; border-radius: 20px;
    background: var(--primary-light); color: var(--primary);
}
.visually-hidden { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); }

/* ══════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font-family: var(--font); font-size: 15px; font-weight: 600;
    padding: 12px 24px; border-radius: var(--radius); border: none;
    cursor: pointer; transition: all 150ms; text-decoration: none; white-space: nowrap;
}
.btn:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.btn-primary  { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; box-shadow: var(--shadow-md); }
.btn-accent   { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-hover); color: #fff; }
.btn-outline  { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-outline:hover { background: var(--primary-light); }
.btn-white    { background: #fff; color: var(--primary); }
.btn-white:hover { background: #f0f4ff; }
.btn-lg { padding: 15px 32px; font-size: 16px; border-radius: 12px; }
.btn-sm { padding: 8px 16px; font-size: 13px; border-radius: 7px; }

/* ══════════════════════════════════════════════════
   NAVIGATION
   ══════════════════════════════════════════════════ */
.site-header {
    position: sticky; top: 0; z-index: 100;
    height: var(--nav-height);
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 8px rgba(0,0,0,0.06);
}
.nav-inner {
    max-width: var(--max-width); margin: 0 auto; padding: 0 24px;
    height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 32px;
}
.nav-logo {
    display: flex; align-items: center; gap: 10px;
    font-size: 18px; font-weight: 800; color: var(--text);
    letter-spacing: -0.03em; text-decoration: none;
    flex-shrink: 0;
}
.nav-logo:hover { color: var(--primary); }
.nav-logo-icon {
    width: 34px; height: 34px; border-radius: 9px;
    background: var(--primary);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.nav-menu { display: flex; align-items: center; gap: 6px; list-style: none; }
.nav-menu a {
    padding: 7px 12px; border-radius: 7px;
    font-size: 14px; font-weight: 500; color: var(--text-muted);
    transition: all 150ms;
}
.nav-menu a:hover { color: var(--text); background: var(--bg-secondary); }
.nav-menu a.current { color: var(--primary); background: var(--primary-light); }
.nav-cta { margin-left: 8px; }

/* Mobile nav toggle */
.nav-toggle {
    display: none; background: none; border: none;
    cursor: pointer; padding: 8px; color: var(--text);
}
.nav-toggle svg { display: block; }

/* ══════════════════════════════════════════════════
   HERO
   ══════════════════════════════════════════════════ */
.hero {
    background: var(--bg-hero);
    padding: 88px 0 80px;
    position: relative; overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(79,70,229,0.3) 0%, transparent 70%);
    pointer-events: none;
}
.hero-grid-bg {
    position: absolute; inset: 0; opacity: 0.05;
    background-image: linear-gradient(rgba(255,255,255,0.3) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(255,255,255,0.3) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}
.hero-inner {
    position: relative; z-index: 1;
    max-width: 760px; margin: 0 auto; text-align: center; padding: 0 24px;
}
.hero-badge {
    display: inline-flex; align-items: center; gap: 8px;
    background: rgba(79,70,229,0.15); border: 1px solid rgba(79,70,229,0.3);
    color: #a5b4fc; padding: 6px 14px; border-radius: 20px;
    font-size: 12px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase;
    margin-bottom: 24px;
}
.hero-badge-dot { width: 6px; height: 6px; border-radius: 50%; background: #6366f1; animation: pulse 2s infinite; }
.hero h1 {
    font-size: clamp(32px, 5vw, 54px); font-weight: 800;
    color: #f8fafc; line-height: 1.15; margin-bottom: 20px;
}
.hero h1 span { color: #818cf8; }
.hero-desc {
    font-size: 18px; color: #94a3b8; line-height: 1.7;
    max-width: 560px; margin: 0 auto 36px;
}
.hero-form {
    display: flex; gap: 10px; max-width: 480px;
    margin: 0 auto 24px;
}
.hero-form input {
    flex: 1; height: 50px; padding: 0 18px;
    background: rgba(255,255,255,0.09); border: 1px solid rgba(255,255,255,0.15);
    border-radius: var(--radius); font-size: 15px; color: #f1f5f9;
    font-family: var(--font); outline: none; transition: all 150ms;
}
.hero-form input::placeholder { color: #64748b; }
.hero-form input:focus { border-color: #6366f1; background: rgba(255,255,255,0.12); box-shadow: 0 0 0 3px rgba(99,102,241,0.2); }
.hero-form .btn { height: 50px; padding: 0 24px; flex-shrink: 0; }
.hero-form-success {
    display: none;
    background: rgba(5,150,105,0.15); border: 1px solid rgba(5,150,105,0.3);
    color: #34d399; padding: 14px 20px; border-radius: var(--radius);
    font-size: 15px; font-weight: 500; max-width: 480px; margin: 0 auto 24px;
}
.hero-trust {
    display: flex; align-items: center; justify-content: center;
    gap: 24px; flex-wrap: wrap;
}
.hero-trust-item {
    display: flex; align-items: center; gap: 6px;
    font-size: 13px; color: #64748b;
}
.hero-trust-item svg { color: #34d399; flex-shrink: 0; }

/* ══════════════════════════════════════════════════
   FEATURES
   ══════════════════════════════════════════════════ */
.features { background: var(--bg-secondary); padding: 72px 0; }
.features-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 48px;
}
.feature-card {
    background: var(--bg); padding: 32px 28px; border-radius: var(--radius-lg);
    border: 1px solid var(--border); transition: all 200ms;
}
.feature-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: rgba(79,70,229,0.2); }
.feature-icon {
    width: 48px; height: 48px; border-radius: 12px;
    background: var(--primary-light); display: flex; align-items: center; justify-content: center;
    margin-bottom: 20px;
}
.feature-card h3 { font-size: 17px; margin-bottom: 10px; }
.feature-card p { font-size: 14px; color: var(--text-muted); line-height: 1.65; margin: 0; }

/* ══════════════════════════════════════════════════
   SECTION HEADERS
   ══════════════════════════════════════════════════ */
.section-header { text-align: center; max-width: 560px; margin: 0 auto 48px; }
.section-header h2 { font-size: clamp(24px, 3.5vw, 36px); margin-bottom: 12px; }
.section-header p { font-size: 16px; color: var(--text-muted); margin: 0; }

/* ══════════════════════════════════════════════════
   POSTS GRID
   ══════════════════════════════════════════════════ */
.posts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.post-card {
    background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--radius-lg); overflow: hidden;
    transition: all 200ms; display: flex; flex-direction: column;
}
.post-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: rgba(79,70,229,0.2); }
.post-card-thumb {
    aspect-ratio: 16/9; overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex; align-items: center; justify-content: center;
}
.post-card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 300ms; }
.post-card:hover .post-card-thumb img { transform: scale(1.04); }
.post-card-thumb-placeholder {
    font-size: 32px; color: rgba(255,255,255,0.5);
}
.post-card-body { padding: 22px; flex: 1; display: flex; flex-direction: column; }
.post-card-meta {
    display: flex; align-items: center; gap: 10px;
    font-size: 12px; color: var(--text-light); margin-bottom: 12px;
}
.post-card-meta .cat { color: var(--primary); font-weight: 600; }
.post-card h3 { font-size: 16px; margin-bottom: 10px; line-height: 1.4; }
.post-card h3 a { color: var(--text); }
.post-card h3 a:hover { color: var(--primary); }
.post-card p { font-size: 14px; color: var(--text-muted); line-height: 1.6; flex: 1; margin-bottom: 18px; }
.post-card-link {
    font-size: 13px; font-weight: 600; color: var(--primary);
    display: inline-flex; align-items: center; gap: 4px;
    margin-top: auto;
}
.post-card-link:hover { gap: 8px; }

/* Archive page */
.archive-header { padding: 48px 0 32px; border-bottom: 1px solid var(--border); margin-bottom: 48px; }
.archive-header h1 { font-size: 32px; }
.archive-header p { color: var(--text-muted); margin: 8px 0 0; }
.posts-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 48px; }
.pagination a, .pagination span {
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: var(--radius); font-size: 14px; font-weight: 600;
    border: 1px solid var(--border); color: var(--text);
    transition: all 150ms;
}
.pagination a:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }
.pagination .current { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ══════════════════════════════════════════════════
   SINGLE POST
   ══════════════════════════════════════════════════ */
.single-wrap { max-width: 740px; margin: 0 auto; padding: 48px 24px 72px; }
.single-header { margin-bottom: 36px; }
.single-meta { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; font-size: 13px; color: var(--text-muted); }
.single-meta .cat { background: var(--primary-light); color: var(--primary); padding: 3px 10px; border-radius: 20px; font-weight: 600; }
.single-header h1 { font-size: clamp(24px, 4vw, 38px); margin-bottom: 16px; line-height: 1.2; }
.single-thumb {
    aspect-ratio: 16/9; width: 100%; border-radius: var(--radius-lg);
    overflow: hidden; margin-bottom: 36px;
    background: linear-gradient(135deg, var(--primary) 0%, #764ba2 100%);
}
.single-thumb img { width: 100%; height: 100%; object-fit: cover; }
.single-content { font-size: 17px; line-height: 1.8; color: #1e293b; }
.single-content h2 { font-size: 24px; margin: 36px 0 16px; }
.single-content h3 { font-size: 20px; margin: 28px 0 12px; }
.single-content p { margin-bottom: 20px; }
.single-content a { text-decoration: underline; }
.single-content img { border-radius: var(--radius); margin: 24px 0; }
.single-content blockquote {
    border-left: 4px solid var(--primary); padding: 16px 24px; margin: 28px 0;
    background: var(--primary-light); border-radius: 0 var(--radius) var(--radius) 0;
    font-style: italic; color: var(--text-muted);
}
.source-link {
    margin-top: 32px; padding: 16px 20px;
    background: var(--bg-secondary); border-radius: var(--radius);
    border: 1px solid var(--border);
    font-size: 13px; color: var(--text-muted);
}
.source-link a { color: var(--primary); font-weight: 500; }

/* Newsletter CTA (mid-article or post footer) */
.newsletter-cta {
    background: var(--bg-hero); border-radius: var(--radius-lg);
    padding: 36px 32px; text-align: center; margin: 48px 0;
}
.newsletter-cta h3 { color: #f1f5f9; font-size: 20px; margin-bottom: 8px; }
.newsletter-cta p { color: #94a3b8; font-size: 14px; margin-bottom: 24px; }
.newsletter-cta .hero-form { max-width: 420px; }

/* ══════════════════════════════════════════════════
   OFFERS SECTION (homepage preview)
   ══════════════════════════════════════════════════ */
.offers-section { background: var(--bg-secondary); }
.offers-preview {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 32px;
}
.offer-card {
    background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg);
    overflow: hidden; transition: all 200ms;
}
.offer-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.offer-card-img { height: 140px; overflow: hidden; background: linear-gradient(135deg, #667eea, #764ba2); }
.offer-card-img img { width: 100%; height: 100%; object-fit: cover; }
.offer-card-body { padding: 18px; }
.offer-card-tag {
    font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--accent); margin-bottom: 8px;
}
.offer-card-body h4 { font-size: 15px; margin-bottom: 8px; }
.offer-card-body p { font-size: 13px; color: var(--text-muted); margin-bottom: 14px; line-height: 1.5; }
.offer-card-body .btn { width: 100%; }

/* ══════════════════════════════════════════════════
   NEWSLETTER CTA SECTION (homepage bottom)
   ══════════════════════════════════════════════════ */
.cta-section {
    background: linear-gradient(135deg, #4f46e5 0%, #2563eb 100%);
    padding: 72px 0; text-align: center;
}
.cta-section h2 { font-size: clamp(24px, 3.5vw, 36px); color: #fff; margin-bottom: 14px; }
.cta-section p { color: rgba(255,255,255,0.75); font-size: 17px; max-width: 520px; margin: 0 auto 36px; }
.cta-section .hero-form { max-width: 460px; margin: 0 auto; }
.cta-section .hero-form input { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.2); }

/* ══════════════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════════════ */
.site-footer {
    background: var(--bg-hero);
    padding: 48px 0 32px; color: #94a3b8;
}
.footer-inner {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 24px; margin-bottom: 32px;
}
.footer-brand { font-size: 18px; font-weight: 800; color: #f1f5f9; letter-spacing: -0.02em; }
.footer-links { display: flex; gap: 24px; flex-wrap: wrap; }
.footer-links a { font-size: 13px; color: #64748b; transition: color 150ms; }
.footer-links a:hover { color: #f1f5f9; }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.07); padding-top: 24px;
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 12px;
}
.footer-bottom p { font-size: 13px; color: #334155; margin: 0; }
.footer-bottom a { color: #475569; }
.footer-bottom a:hover { color: #94a3b8; }

/* ══════════════════════════════════════════════════
   404 PAGE
   ══════════════════════════════════════════════════ */
.error-page { min-height: 70vh; display: flex; align-items: center; justify-content: center; text-align: center; padding: 48px 24px; }
.error-page h1 { font-size: 72px; color: var(--primary); line-height: 1; margin-bottom: 16px; }
.error-page h2 { font-size: 24px; margin-bottom: 12px; }
.error-page p  { color: var(--text-muted); margin-bottom: 28px; }

/* ══════════════════════════════════════════════════
   PAGE (generic: Privacy, Offers, etc.)
   ══════════════════════════════════════════════════ */
.page-wrap { max-width: 800px; margin: 0 auto; padding: 56px 24px 80px; }
.page-header { margin-bottom: 40px; padding-bottom: 32px; border-bottom: 1px solid var(--border); }
.page-header h1 { font-size: 34px; }
.page-content { font-size: 16px; line-height: 1.8; color: #1e293b; }
.page-content h2 { font-size: 22px; margin: 36px 0 14px; padding-top: 8px; }
.page-content h3 { font-size: 18px; margin: 24px 0 10px; }
.page-content p  { margin-bottom: 18px; }
.page-content ul, .page-content ol { padding-left: 24px; margin-bottom: 18px; }
.page-content li { margin-bottom: 8px; }
.page-content a  { text-decoration: underline; }

/* ══════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════ */
@media (max-width: 900px) {
    .features-grid, .posts-grid { grid-template-columns: repeat(2, 1fr); }
    .offers-preview { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .features-grid, .posts-grid, .posts-grid-2, .offers-preview { grid-template-columns: 1fr; }
    .hero { padding: 60px 0 56px; }
    .hero-form { flex-direction: column; }
    .hero-form input, .hero-form .btn { width: 100%; height: 48px; }
    .nav-menu, .nav-cta { display: none; }
    .nav-toggle { display: flex; }
    .nav-menu.open {
        display: flex; flex-direction: column; align-items: stretch;
        position: absolute; top: var(--nav-height); left: 0; right: 0;
        background: rgba(255,255,255,0.97); backdrop-filter: blur(12px);
        border-bottom: 1px solid var(--border); padding: 12px; gap: 4px;
    }
    .footer-inner { flex-direction: column; align-items: flex-start; }
    .footer-bottom { flex-direction: column; align-items: flex-start; }
    .section { padding: 52px 0; }
    .cta-section .hero-form { flex-direction: column; }
}

/* ══════════════════════════════════════════════════
   ARCHIVE / BLOG LISTING
   ══════════════════════════════════════════════════ */
.archive-main { padding-top: 40px; }
.archive-header { text-align: center; margin-bottom: 48px; }
.archive-header h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 700; letter-spacing: -0.03em; color: var(--text); margin: 8px 0 12px; }
.archive-header .archive-desc { color: var(--text-muted); max-width: 480px; margin: 0 auto; }
.archive-header .badge { margin: 0 auto 8px; }

/* Pagination */
.pagination { display: flex; justify-content: center; margin-top: 48px; }
.pagination .page-numbers { list-style: none; display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.pagination .page-numbers li a,
.pagination .page-numbers li span {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 14px; border-radius: var(--radius);
    font-size: 0.875rem; font-weight: 500;
    border: 1px solid var(--border); color: var(--text-muted);
    text-decoration: none; transition: all 0.15s;
}
.pagination .page-numbers li a:hover { border-color: var(--primary); color: var(--primary); }
.pagination .page-numbers li span.current { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Not found box */
.not-found-box {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; padding: 64px 24px; gap: 16px;
}
.not-found-box h2 { font-size: 1.5rem; font-weight: 700; color: var(--text); }
.not-found-box p { color: var(--text-muted); max-width: 360px; }

/* ══════════════════════════════════════════════════
   SINGLE POST
   ══════════════════════════════════════════════════ */
.single-hero {
    background: var(--bg-hero);
    padding: calc(var(--nav-height) + 32px) 0 40px;
}
.single-hero .container { max-width: 800px; }

/* Breadcrumb */
.breadcrumb {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
    font-size: 0.8rem; color: rgba(255,255,255,0.4); margin-bottom: 20px;
}
.breadcrumb a { color: rgba(255,255,255,0.4); text-decoration: none; transition: color 0.15s; }
.breadcrumb a:hover { color: rgba(255,255,255,0.8); }
.breadcrumb span { color: rgba(255,255,255,0.55); }

.single-cat {
    display: inline-flex; align-items: center;
    font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
    color: #818cf8; background: rgba(99,102,241,0.12); border: 1px solid rgba(99,102,241,0.2);
    padding: 4px 10px; border-radius: 20px; margin-bottom: 16px;
}
.single-title {
    font-size: clamp(1.7rem, 4vw, 2.4rem); font-weight: 800;
    color: #f8fafc; line-height: 1.22; letter-spacing: -0.03em; margin-bottom: 20px;
}
.single-meta {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    font-size: 0.82rem; color: rgba(255,255,255,0.4);
}
.single-meta time, .single-meta span { display: flex; align-items: center; gap: 5px; }
.single-meta-sep { color: rgba(255,255,255,0.2); }

/* Featured image */
.single-thumb-wrap { background: var(--bg-hero); padding-bottom: 0; }
.single-thumb-wrap .container { max-width: 860px; }
.single-thumb { width: 100%; height: 380px; object-fit: cover; border-radius: var(--radius-lg); display: block; }
.single-thumb-fallback { width: 100%; height: 340px; border-radius: var(--radius-lg); }

/* Content layout */
.single-content-wrap .container { max-width: 1100px; }
.single-layout {
    display: grid; grid-template-columns: 1fr 320px; gap: 48px; align-items: start;
}

/* Article body */
.single-body { min-width: 0; }
.single-body h2, .single-body h3, .single-body h4 {
    font-weight: 700; letter-spacing: -0.02em; color: var(--text); margin: 1.8em 0 0.6em;
}
.single-body h2 { font-size: 1.45rem; }
.single-body h3 { font-size: 1.2rem; }
.single-body h4 { font-size: 1rem; }
.single-body p { color: var(--text); margin-bottom: 1.2em; line-height: 1.75; }
.single-body a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.single-body a:hover { color: var(--primary-dark); }
.single-body ul, .single-body ol { padding-left: 1.5rem; margin-bottom: 1.2em; color: var(--text); line-height: 1.75; }
.single-body li { margin-bottom: 0.4em; }
.single-body blockquote {
    border-left: 3px solid var(--primary); padding: 12px 20px;
    margin: 1.6em 0; background: var(--bg-secondary); border-radius: 0 var(--radius) var(--radius) 0;
    color: var(--text-muted); font-style: italic;
}
.single-body img { border-radius: var(--radius); margin: 1.6em 0; }
.single-body .wp-block-image { margin: 1.6em 0; }
.single-body code {
    font-family: 'Fira Code', 'Courier New', monospace;
    background: var(--bg-secondary); border: 1px solid var(--border);
    padding: 2px 6px; border-radius: 4px; font-size: 0.85em;
}
.single-body pre {
    background: #0f172a; color: #e2e8f0; border-radius: var(--radius); padding: 20px;
    overflow-x: auto; margin: 1.6em 0; font-size: 0.875rem; line-height: 1.6;
}
.single-body pre code { background: none; border: none; padding: 0; color: inherit; }

/* Tags */
.single-tags {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--border);
}
.tag-pill {
    font-size: 0.78rem; font-weight: 500; padding: 4px 12px;
    background: var(--bg-secondary); border: 1px solid var(--border);
    border-radius: 20px; color: var(--text-muted); text-decoration: none;
    transition: all 0.15s;
}
.tag-pill:hover { border-color: var(--primary); color: var(--primary); }

/* Source link */
.single-source {
    display: flex; align-items: center; gap: 6px;
    margin-top: 20px; font-size: 0.8rem; color: var(--text-muted);
}
.single-source a { color: var(--primary); word-break: break-all; }

/* Sidebar */
.single-sidebar { position: sticky; top: calc(var(--nav-height) + 24px); display: flex; flex-direction: column; gap: 24px; }

/* Sidebar newsletter */
.sidebar-newsletter {
    background: var(--bg-hero); border-radius: var(--radius-lg); padding: 24px;
    border: 1px solid rgba(99,102,241,0.15);
}
.sidebar-newsletter-icon {
    width: 44px; height: 44px; border-radius: 12px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 16px; box-shadow: 0 0 24px rgba(99,102,241,0.3);
}
.sidebar-newsletter h3 { font-size: 1rem; font-weight: 700; color: #f8fafc; margin-bottom: 6px; }
.sidebar-newsletter p { font-size: 0.82rem; color: rgba(255,255,255,0.45); margin-bottom: 16px; }
.sidebar-form { display: flex; flex-direction: column; gap: 8px; }
.sidebar-form input {
    height: 40px; padding: 0 12px; border-radius: var(--radius);
    background: rgba(255,255,255,0.06); border: 1px solid rgba(148,163,184,0.15);
    color: #f1f5f9; font-size: 0.875rem; outline: none; font-family: var(--font);
    transition: border-color 0.15s;
}
.sidebar-form input::placeholder { color: rgba(255,255,255,0.25); }
.sidebar-form input:focus { border-color: #6366f1; }
.sidebar-form .btn { width: 100%; justify-content: center; }
.sidebar-newsletter .hero-form-success { font-size: 0.82rem; color: #34d399; }

/* Related articles */
.sidebar-related { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; }
.sidebar-related-title { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 16px; }
.related-item {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 10px 0; text-decoration: none; color: inherit;
    border-top: 1px solid var(--border); transition: opacity 0.15s;
}
.related-item:first-of-type { border-top: none; padding-top: 0; }
.related-item:hover { opacity: 0.75; }
.related-thumb { width: 60px; height: 48px; border-radius: 6px; overflow: hidden; flex-shrink: 0; }
.related-thumb img { width: 100%; height: 100%; object-fit: cover; }
.related-thumb .post-thumb-fallback { width: 100%; height: 100%; }
.related-info { flex: 1; min-width: 0; }
.related-title { font-size: 0.82rem; font-weight: 600; color: var(--text); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.related-date { font-size: 0.72rem; color: var(--text-light); margin-top: 4px; display: block; }

/* Post navigation */
.post-nav-wrap { background: var(--bg-secondary); border-top: 1px solid var(--border); padding: 32px 0; }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.post-nav-item {
    display: flex; flex-direction: column; gap: 6px; padding: 20px;
    background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg);
    text-decoration: none; transition: all 0.15s;
}
.post-nav-item:hover { border-color: var(--primary); box-shadow: var(--shadow-md); }
.post-nav-prev { align-items: flex-start; }
.post-nav-next { align-items: flex-end; text-align: right; }
.post-nav-label { display: flex; align-items: center; gap: 6px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.post-nav-next .post-nav-label { flex-direction: row-reverse; }
.post-nav-title { font-size: 0.9rem; font-weight: 600; color: var(--text); line-height: 1.4; }

/* ══════════════════════════════════════════════════
   GENERIC PAGE (page.php)
   ══════════════════════════════════════════════════ */
.page-main { padding-top: 40px; }
.page-layout { display: grid; grid-template-columns: 1fr 320px; gap: 48px; align-items: start; }
.page-header { margin-bottom: 32px; }
.page-hero-img { margin-bottom: 28px; }
.page-hero-img img { width: 100%; height: 280px; object-fit: cover; border-radius: var(--radius-lg); }
.page-title { font-size: clamp(1.7rem, 3.5vw, 2.4rem); font-weight: 800; color: var(--text); letter-spacing: -0.03em; line-height: 1.2; }
.page-body { min-width: 0; }
.page-sidebar { position: sticky; top: calc(var(--nav-height) + 24px); display: flex; flex-direction: column; gap: 24px; }

/* Page entry content */
.entry-content h2, .entry-content h3, .entry-content h4 { font-weight: 700; letter-spacing: -0.02em; color: var(--text); margin: 1.8em 0 0.6em; }
.entry-content h2 { font-size: 1.45rem; }
.entry-content h3 { font-size: 1.2rem; }
.entry-content p { color: var(--text); margin-bottom: 1.2em; line-height: 1.75; }
.entry-content a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.entry-content ul, .entry-content ol { padding-left: 1.5rem; margin-bottom: 1.2em; line-height: 1.75; }
.entry-content li { margin-bottom: 0.4em; }
.entry-content blockquote { border-left: 3px solid var(--primary); padding: 12px 20px; margin: 1.6em 0; background: var(--bg-secondary); color: var(--text-muted); font-style: italic; border-radius: 0 var(--radius) var(--radius) 0; }
.entry-content img { border-radius: var(--radius); margin: 1.6em 0; }
.entry-content table { width: 100%; border-collapse: collapse; margin: 1.6em 0; font-size: 0.9rem; }
.entry-content th { background: var(--bg-secondary); font-weight: 600; text-align: left; padding: 10px 14px; border: 1px solid var(--border); }
.entry-content td { padding: 10px 14px; border: 1px solid var(--border); }

/* ══════════════════════════════════════════════════
   404 PAGE
   ══════════════════════════════════════════════════ */
.page-404 { padding: 80px 0; }
.not-found-inner { text-align: center; max-width: 560px; margin: 0 auto; }
.not-found-code {
    font-size: clamp(5rem, 15vw, 9rem); font-weight: 900; letter-spacing: -0.05em;
    color: transparent; -webkit-text-stroke: 2px rgba(79,70,229,0.2); line-height: 1;
    margin-bottom: -16px;
}
.not-found-icon { margin-bottom: 16px; }
.not-found-inner h1 { font-size: 1.8rem; font-weight: 800; color: var(--text); letter-spacing: -0.03em; margin-bottom: 12px; }
.not-found-inner > p { color: var(--text-muted); margin-bottom: 28px; line-height: 1.65; }
.not-found-search { margin-bottom: 20px; max-width: 420px; margin-left: auto; margin-right: auto; }
.not-found-search .search-form { display: flex; gap: 8px; }
.not-found-search input[type="search"] {
    flex: 1; height: 44px; padding: 0 14px; border-radius: var(--radius);
    border: 1px solid var(--border); font-size: 0.9rem; font-family: var(--font);
    background: var(--bg); color: var(--text); outline: none; transition: border-color 0.15s;
}
.not-found-search input[type="search"]:focus { border-color: var(--primary); }
.not-found-search button {
    height: 44px; padding: 0 18px; border-radius: var(--radius);
    background: var(--primary); color: #fff; font-size: 0.875rem; font-weight: 600;
    border: none; cursor: pointer; font-family: var(--font); transition: background 0.15s;
}
.not-found-search button:hover { background: var(--primary-dark); }
.not-found-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 48px; }
.not-found-latest { margin-top: 48px; padding-top: 48px; border-top: 1px solid var(--border); }
.not-found-latest-label { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 24px; }
.posts-grid-3 { grid-template-columns: repeat(3, 1fr); }

/* ══════════════════════════════════════════════════
   RESPONSIVE — single/page/404
   ══════════════════════════════════════════════════ */
@media (max-width: 900px) {
    .single-layout, .page-layout { grid-template-columns: 1fr; }
    .single-sidebar, .page-sidebar { position: static; }
    .post-nav { grid-template-columns: 1fr; }
    .single-thumb { height: 260px; }
    .posts-grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .post-nav { grid-template-columns: 1fr; }
    .not-found-code { font-size: 5rem; }
    .posts-grid-3 { grid-template-columns: 1fr; }
    .breadcrumb { font-size: 0.72rem; }
    .single-thumb { height: 200px; }
}

/* ══════════════════════════════════════════════════
   ANIMATIONS
   ══════════════════════════════════════════════════ */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
    html { scroll-behavior: auto; }
}
