/*
Theme Name: DMBrief
Theme URI: https://dmbrief.com
Author: DMBrief
Description: Clean, category-first theme for DMBrief — digital marketing education blog.
Version: 1.0.1
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: dmbrief
Tags: blog, education, custom-menu, featured-images, threaded-comments
*/

/* ─────────────────────────────────────────
   RESET & BASE
───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --brand:       #1E73BE;
    --brand-dark:  #155E9E;
    --brand-light: #EBF4FF;
    --brand-tint:  #DBEAFE;
    --text:        #111827;
    --text-body:   #4B5563;
    --text-muted:  #9CA3AF;
    --border:      #E5E7EB;
    --bg:          #F9FAFB;
    --white:       #ffffff;
    --radius-sm:   8px;
    --radius:      12px;
    --radius-lg:   16px;
    --shadow-sm:   0 1px 3px rgba(0,0,0,0.06);
    --shadow:      0 4px 18px rgba(30,115,190,0.08);
    --font:        'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --nav-h:       64px;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); text-decoration: underline; }

/* ─────────────────────────────────────────
   LAYOUT UTILITIES
───────────────────────────────────────── */
.container {
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 48px;
    padding-right: 48px;
}

.section { padding: 64px 0; }
.section-sm { padding: 40px 0; }

.section-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--brand);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 8px;
}
.section-h2 {
    font-size: 30px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}
.section-sub {
    font-size: 15px;
    color: var(--text-body);
    margin-bottom: 36px;
}

/* ─────────────────────────────────────────
   BUTTONS
───────────────────────────────────────── */
.btn,
.btn-lg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 13px 26px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    border: none;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    text-decoration: none;
}
.btn:hover,
.btn-lg:hover { text-decoration: none; }

.btn-primary { background: var(--brand); color: var(--white); }
.btn-primary:hover { background: var(--brand-dark); color: var(--white); }

.btn-ghost {
    background: var(--white);
    color: #374151;
    border: 1.5px solid var(--border);
}
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }

.btn-white { background: var(--white); color: var(--brand); }
.btn-white:hover { background: #f0f7ff; color: var(--brand-dark); }

/* ─────────────────────────────────────────
   NAVIGATION
───────────────────────────────────────── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 200;
    background: var(--white);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    display: flex;
    align-items: center;
    gap: 28px;
    height: var(--nav-h);
}

.nav-logo {
    font-size: 22px;
    font-weight: 800;
    color: var(--brand);
    letter-spacing: -0.5px;
    text-decoration: none;
    flex-shrink: 0;
}
.nav-logo a { color: inherit; text-decoration: none; }
.nav-logo a:hover { color: inherit; text-decoration: none; }
.nav-logo .logo-accent { color: var(--brand); }
.nav-logo .custom-logo-link { display: block; }
.nav-logo .custom-logo { width: auto; max-height: 40px; }

.nav-links {
    margin-left: auto;
}
.nav-menu {
    display: flex;
    align-items: center;
    gap: 28px;
    list-style: none;
}
.nav-menu > li > a {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    white-space: nowrap;
}
.nav-menu > li > a:hover { color: var(--brand); text-decoration: none; }
.nav-menu > li.current-menu-item > a { color: var(--brand); }

.nav-cta {
    background: var(--brand) !important;
    color: var(--white) !important;
    padding: 9px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
}
.nav-cta:hover { background: var(--brand-dark) !important; }

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 4px;
    z-index: 210;
}
.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: #374151;
    border-radius: 2px;
    transition: transform 0.2s, opacity 0.2s;
}
.hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.is-open span:nth-child(2) { opacity: 0; }
.hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ─────────────────────────────────────────
   HERO (front page only)
───────────────────────────────────────── */
.hero {
    background: linear-gradient(150deg, #EBF4FF 0%, #F0F7FF 55%, var(--bg) 100%);
    padding: 80px 0 72px;
    text-align: center;
}
.hero-badge {
    display: inline-block;
    background: var(--brand-tint);
    color: #1E40AF;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    padding: 5px 14px;
    border-radius: 20px;
    margin-bottom: 22px;
}
.hero h1 {
    font-size: 54px;
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -1.5px;
    color: var(--text);
    max-width: 780px;
    margin: 0 auto 18px;
}
.hero h1 em { font-style: normal; color: var(--brand); }
.hero-sub {
    font-size: 18px;
    color: var(--text-body);
    max-width: 520px;
    margin: 0 auto 34px;
    line-height: 1.65;
}
.hero-actions,
.hero-ctas {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}
.hero-stats {
    display: flex;
    gap: 0;
    justify-content: center;
    margin-top: 48px;
    padding-top: 36px;
    border-top: 1px solid #DBEAFE;
}
.stat-item,
.stat { padding: 0 40px; text-align: center; }
.stat-item + .stat-item,
.stat + .stat { border-left: 1px solid #DBEAFE; }
.stat-num { font-size: 28px; font-weight: 800; color: var(--brand); line-height: 1; }
.stat-label { font-size: 13px; color: var(--text-muted); margin-top: 5px; }

/* ─────────────────────────────────────────
   CATEGORY GRID
───────────────────────────────────────── */
.cat-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}
.cat-card {
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: 14px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.cat-card:hover {
    border-color: #BFDBFE;
    box-shadow: var(--shadow);
    text-decoration: none;
}
.cat-icon,
.cat-card-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.cat-card-body { flex: 1; }
.cat-card h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}
.cat-card p {
    font-size: 13px;
    color: var(--text-body);
    line-height: 1.55;
    flex: 1;
}
.cat-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 14px;
}
.cat-count {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}
.cat-arrow,
.cat-card-arrow { color: #D1D5DB; font-size: 14px; transition: color 0.15s; }
.cat-card:hover .cat-arrow,
.cat-card:hover .cat-card-arrow { color: var(--brand); }

/* ─────────────────────────────────────────
   BAND (downloadables strip)
───────────────────────────────────────── */
.band,
.band-section {
    background: var(--white);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 36px 0;
}
.band-copy { display: flex; align-items: center; gap: 14px; }
.band-copy span:not(.band-icon) { display: block; font-size: 14px; color: var(--text-body); }
.band-icon { font-size: 24px; }
.band-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.band-text h3 { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.band-text p { font-size: 14px; color: var(--text-body); }

/* ─────────────────────────────────────────
   POST CARDS
───────────────────────────────────────── */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}
.posts-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.post-card {
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.post-card:hover { border-color: #BFDBFE; box-shadow: var(--shadow); text-decoration: none; }

.post-thumb,
.post-card-thumb {
    height: 180px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--brand-light);
    display: flex;
    align-items: center;
    justify-content: center;
}
.post-thumb img,
.post-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-thumb-placeholder {
    width: 100%;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-body,
.post-card-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.post-tag {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--brand);
    margin-bottom: 9px;
}
.post-body h3,
.post-card-body h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.45;
    margin-bottom: 8px;
}
.post-card-body h3 a { color: var(--text); text-decoration: none; }
.post-card-body h3 a:hover { color: var(--brand); }
.post-body h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.4;
    margin-bottom: 8px;
}
.post-excerpt {
    font-size: 13px;
    color: var(--text-body);
    line-height: 1.55;
    flex: 1;
}
.post-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 14px;
    font-weight: 500;
    display: flex;
    gap: 10px;
    align-items: center;
}
.post-meta-dot { color: var(--border); }
.posts-cta { margin-top: 32px; text-align: center; }

/* Horizontal post card (for archive/search) */
.post-card-h {
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: row;
    text-decoration: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.post-card-h:hover { border-color: #BFDBFE; box-shadow: var(--shadow); text-decoration: none; }
.post-card-h .post-thumb {
    width: 200px;
    height: auto;
    min-height: 160px;
    flex-shrink: 0;
}
.post-card-h .post-body { padding: 24px; }
.post-card-h .post-body h2 { font-size: 18px; }

/* ─────────────────────────────────────────
   NEWSLETTER
───────────────────────────────────────── */
.newsletter-wrap,
.newsletter-section { padding: 0 0 64px; }
.newsletter-box {
    background: linear-gradient(135deg, var(--brand) 0%, #1457A8 100%);
    border-radius: 20px;
    padding: 56px 64px;
    text-align: center;
    color: var(--white);
}
.newsletter-box h2 {
    font-size: 30px;
    font-weight: 800;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}
.newsletter-box p { font-size: 15px; opacity: 0.85; margin-bottom: 28px; line-height: 1.6; }
.email-row {
    display: flex;
    gap: 10px;
    max-width: 420px;
    margin: 0 auto;
}
.email-input {
    flex: 1;
    padding: 13px 16px;
    border-radius: 9px;
    border: 1.5px solid rgba(255,255,255,0.25);
    font-size: 14px;
    font-family: var(--font);
    background: rgba(255,255,255,0.12);
    color: var(--white);
    outline: none;
}
.email-input::placeholder { color: rgba(255,255,255,0.55); }
.email-input:focus { border-color: rgba(255,255,255,0.6); }
.email-btn {
    background: var(--white);
    color: var(--brand);
    padding: 13px 22px;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    font-family: var(--font);
    white-space: nowrap;
    transition: background 0.15s;
}
.email-btn:hover { background: #f0f7ff; }
.email-btn:disabled { opacity: 0.6; cursor: wait; }
.nl-status {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    opacity: 1;
    margin: 14px auto 0;
    max-width: 420px;
    display: none;
}
.nl-status.is-success { display: block; color: #d1fae5; }
.nl-status.is-error   { display: block; color: #ffe4e6; }
.newsletter-note,
.nl-privacy { font-size: 12px; opacity: 0.6; margin-top: 14px; }

/* ─────────────────────────────────────────
   FOOTER
───────────────────────────────────────── */
.site-footer {
    background: #111827;
    padding: 56px 0 0;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2.2fr 1fr 1fr 1fr;
    gap: 48px;
    padding-bottom: 48px;
}
.footer-brand .footer-logo {
    font-size: 20px;
    font-weight: 800;
    color: var(--white);
    margin-bottom: 12px;
    display: block;
    text-decoration: none;
}
.footer-brand .footer-logo:hover { text-decoration: none; }
.footer-logo-accent { color: #60A5FA; }
.footer-desc { font-size: 13px; color: #6B7280; line-height: 1.7; max-width: 260px; }
.footer-col h4 {
    font-size: 11px;
    font-weight: 700;
    color: #9CA3AF;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 16px;
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer-col ul li a { font-size: 13px; color: #6B7280; }
.footer-col ul li a:hover { color: var(--white); text-decoration: none; }
.footer-bottom {
    border-top: 1px solid #1F2937;
    padding: 20px 0;
    font-size: 12px;
    color: #4B5563;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.footer-bottom a { color: #6B7280; }
.footer-bottom a:hover { color: var(--white); text-decoration: none; }

/* ─────────────────────────────────────────
   SINGLE POST
───────────────────────────────────────── */
/* Layout: article + sticky "On this page" rail (rail only shows on wide screens, via .has-toc added by JS) */
.single-wrap {
    max-width: 1400px;
    margin: 0 auto;
    padding: 48px 48px 96px;
}
.single-wrap .post-tag { display: inline-block; margin-bottom: 14px; }

.single-grid {
    display: flex;
    align-items: flex-start;
    gap: 64px;
}
.single-main {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 860px;
    margin: 0 auto;
}

/* TOC rail */
.single-toc {
    display: none;
    flex: 0 0 300px;
    width: 300px;
    align-self: stretch; /* let the sticky card travel the full article height */
}
.toc-inner {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 20px;
}
.toc-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--text-muted);
    margin-bottom: 10px;
}
.toc-links { list-style: none; }
.toc-root { list-style: none; }
.toc-root li { margin: 0; }
.toc-root a {
    display: block;
    font-size: 13px;
    line-height: 1.45;
    color: var(--text-body);
    padding: 6px 10px;
    border-left: 2px solid transparent;
    border-radius: 0 6px 6px 0;
    transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.toc-root li.toc-h3 a { padding-left: 18px; font-size: 12.5px; }
.toc-root a:hover { color: var(--brand); background: var(--brand-light); text-decoration: none; }
.toc-root a.is-active {
    color: var(--brand);
    background: var(--brand-light);
    border-left-color: var(--brand);
    font-weight: 600;
}

/* Offset in-page anchors under the sticky header */
.entry-content h2,
.entry-content h3 { scroll-margin-top: calc(var(--nav-h) + 16px); }

/* On wide screens, show the TOC rail beside the article */
@media (min-width: 1200px) {
    .single-wrap.has-toc .single-main { max-width: none; margin: 0; }
    .single-wrap.has-toc .single-toc { display: block; }
    .single-wrap.has-toc .toc-inner {
        position: sticky;
        top: calc(var(--nav-h) + 24px);
        max-height: calc(100vh - var(--nav-h) - 48px);
        overflow-y: auto;
    }
}
.entry-title {
    font-size: 40px;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -1px;
    color: var(--text);
    margin-bottom: 20px;
}
.entry-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: var(--text-muted);
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 40px;
    flex-wrap: wrap;
}
.entry-meta a { color: var(--text-muted); }
.entry-meta a:hover { color: var(--brand); }

.entry-content {
    font-size: 17px;
    line-height: 1.75;
    color: #1F2937;
}
.entry-content h2 {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.3px;
    color: var(--text);
    margin: 48px 0 18px;
    line-height: 1.25;
}
.entry-content h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin: 36px 0 14px;
}
.entry-content p { margin-bottom: 22px; }
.entry-content ul, .entry-content ol {
    margin: 0 0 22px 24px;
}
.entry-content li { margin-bottom: 8px; }
.entry-content strong { font-weight: 700; color: var(--text); }
.entry-content a { color: var(--brand); text-decoration: underline; }
.entry-content a:hover { color: var(--brand-dark); }
.entry-content blockquote {
    border-left: 4px solid var(--brand);
    padding: 16px 24px;
    background: var(--brand-light);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin: 28px 0;
    font-size: 16px;
    color: #1E40AF;
    font-style: normal;
}
.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 28px 0;
    font-size: 14px;
}
.entry-content th {
    background: var(--bg);
    padding: 10px 14px;
    text-align: left;
    font-weight: 700;
    border: 1px solid var(--border);
    color: var(--text);
}
.entry-content td {
    padding: 10px 14px;
    border: 1px solid var(--border);
    color: var(--text-body);
}
.entry-content tr:nth-child(even) td { background: #FAFAFA; }
.entry-content img { border-radius: var(--radius); margin: 24px 0; }
.entry-content code {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 14px;
    font-family: 'Courier New', monospace;
}
.entry-content pre {
    background: #1F2937;
    color: #E5E7EB;
    padding: 20px 24px;
    border-radius: var(--radius);
    overflow-x: auto;
    margin: 24px 0;
    font-size: 14px;
    font-family: 'Courier New', monospace;
    line-height: 1.6;
}
.entry-content pre code { background: none; border: none; padding: 0; color: inherit; }

/* Callout blocks (Kadence / custom classes) */
.wp-block-group.is-style-callout,
.callout {
    background: var(--brand-light);
    border: 1px solid #BFDBFE;
    border-radius: var(--radius);
    padding: 20px 24px;
    margin: 28px 0;
}
.wp-block-group.is-style-warning,
.warning {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: var(--radius);
    padding: 20px 24px;
    margin: 28px 0;
}

/* Post nav */
.post-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 56px;
    padding-top: 40px;
    border-top: 1px solid var(--border);
}
.post-nav a {
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 22px;
    display: block;
    text-decoration: none;
    transition: border-color 0.15s;
}
.post-nav a:hover { border-color: var(--brand); text-decoration: none; }
.post-nav-dir { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 6px; font-weight: 600; }
.post-nav-title { font-size: 14px; font-weight: 700; color: var(--text); line-height: 1.4; }
.post-nav-next { text-align: right; }

/* Related posts */
.related-posts { margin-top: 64px; }
.related-posts h2 { font-size: 22px; font-weight: 800; margin-bottom: 24px; }

/* ─────────────────────────────────────────
   ARCHIVE / CATEGORY PAGE
───────────────────────────────────────── */
.archive-header {
    padding: 48px 0 0;
}
.archive-header-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    padding-bottom: 40px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 48px;
}
.archive-cat-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.archive-title { font-size: 34px; font-weight: 800; color: var(--text); letter-spacing: -0.5px; }
.archive-desc { font-size: 15px; color: var(--text-body); margin-top: 6px; }

/* ─────────────────────────────────────────
   PAGE TEMPLATE
───────────────────────────────────────── */
.page-wrap {
    max-width: 900px;
    margin: 0 auto;
    padding: 56px 24px 80px;
}
.page-title {
    font-size: 40px;
    font-weight: 800;
    letter-spacing: -0.8px;
    margin-bottom: 36px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border);
}

/* ─────────────────────────────────────────
   BREADCRUMB
───────────────────────────────────────── */
.breadcrumb {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--brand); text-decoration: none; }
.breadcrumb-sep { color: var(--border); }

/* ─────────────────────────────────────────
   SEARCH
───────────────────────────────────────── */
.search-form-wrap {
    display: flex;
    gap: 10px;
    max-width: 540px;
}
.search-form-wrap input[type="search"] {
    flex: 1;
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: var(--font);
    background: var(--white);
    color: var(--text);
    outline: none;
}
.search-form-wrap input[type="search"]:focus { border-color: var(--brand); }
.search-form-wrap button {
    background: var(--brand);
    color: var(--white);
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    border: none;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
}

/* ─────────────────────────────────────────
   404
───────────────────────────────────────── */
.error-404-wrap {
    text-align: center;
    padding: 100px 24px;
    max-width: 540px;
    margin: 0 auto;
}
.error-404-wrap h1 { font-size: 80px; font-weight: 800; color: var(--brand); line-height: 1; margin-bottom: 16px; }
.error-404-wrap h2 { font-size: 28px; font-weight: 700; margin-bottom: 12px; }
.error-404-wrap p { color: var(--text-body); margin-bottom: 28px; }

/* ─────────────────────────────────────────
   PAGINATION
───────────────────────────────────────── */
.pagination {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 48px;
    flex-wrap: wrap;
}
.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-body);
    border: 1.5px solid var(--border);
    background: var(--white);
    text-decoration: none;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.pagination .page-numbers:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.pagination .page-numbers.current { background: var(--brand); color: var(--white); border-color: var(--brand); }
.pagination .page-numbers.dots { border: none; background: none; color: var(--text-muted); }

/* ─────────────────────────────────────────
   RESPONSIVE
───────────────────────────────────────── */
@media (max-width: 1024px) {
    .container { padding-left: 32px; padding-right: 32px; }
    .single-wrap { padding: 40px 32px 80px; }
    .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .posts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
    .newsletter-box { padding: 40px 32px; }
}

@media (max-width: 768px) {
    :root { --nav-h: 56px; }
    .container { padding-left: 20px; padding-right: 20px; }

    /* Nav mobile */
    .hamburger { display: flex; }
    .nav-cta { display: none; }
    .nav-links {
        display: none;
        position: fixed;
        top: var(--nav-h);
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--white);
        padding: 24px 20px;
        overflow-y: auto;
        z-index: 199;
    }
    .nav-links.is-open { display: block; }
    .nav-menu {
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
    }
    .nav-menu > li { width: 100%; border-bottom: 1px solid var(--border); }
    .nav-menu > li > a { display: block; padding: 14px 0; font-size: 16px; }

    /* Hero */
    .hero { padding: 48px 0 44px; }
    .hero h1 { font-size: 34px; letter-spacing: -0.8px; }
    .hero-sub { font-size: 15px; }
    .hero-stats { gap: 0; }
    .stat-item,
    .stat { padding: 0 20px; }
    .stat-num { font-size: 22px; }

    /* Grids */
    .cat-grid { grid-template-columns: 1fr; }
    .posts-grid { grid-template-columns: 1fr; }
    .post-card-h { flex-direction: column; }
    .post-card-h .post-thumb { width: 100%; height: 180px; }

    /* Band */
    .band-inner { flex-direction: column; align-items: flex-start; }

    /* Newsletter */
    .newsletter-box { padding: 36px 24px; }
    .email-row { flex-direction: column; }
    .email-input { width: 100%; }
    .email-btn { width: 100%; padding: 13px; }

    /* Footer */
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
    .footer-brand { grid-column: 1 / -1; }
    .footer-desc { max-width: 100%; }

    /* Single */
    .entry-title { font-size: 28px; }
    .single-wrap { padding: 28px 20px 64px; }
    .post-nav { grid-template-columns: 1fr; }

    /* Archive */
    .archive-header-inner { flex-direction: column; align-items: flex-start; }
    .archive-title { font-size: 26px; }
}

@media (max-width: 480px) {
    .hero h1 { font-size: 28px; }
    .hero-stats { flex-direction: column; gap: 16px; }
    .stat-item,
    .stat { padding: 0; border: none !important; }
    .cat-card { padding: 20px; }
    .footer-grid { grid-template-columns: 1fr; }
    .entry-title { font-size: 24px; }
}

/* ─────────────────────────────────────────
   404 & ERROR PAGE
───────────────────────────────────────── */
.error-404 { max-width: 600px; margin: 0 auto; }
.error-code { font-size: 96px; font-weight: 800; color: var(--brand-tint); line-height: 1; margin-bottom: 8px; }
.error-title { font-size: 28px; font-weight: 800; color: var(--text); margin-bottom: 14px; }
.error-desc { font-size: 16px; color: var(--text-body); margin-bottom: 28px; line-height: 1.65; }
.error-search { max-width: 440px; margin: 0 auto 28px; }
.error-cats { margin-top: 8px; }
.error-cats-label { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }
.error-cat-pills { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.cat-pill {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 30px;
    border: 1.5px solid;
    font-size: 13px;
    font-weight: 600;
    transition: opacity .15s;
}
.cat-pill:hover { opacity: 0.75; }

/* ─────────────────────────────────────────
   SEARCH REFINE BAR
───────────────────────────────────────── */
.search-refine { max-width: 480px; margin: 0 0 36px; }

/* ─────────────────────────────────────────
   NO-RESULTS
───────────────────────────────────────── */
.no-results {
    padding: 56px 0;
    color: var(--text-body);
    font-size: 16px;
}

/* ─────────────────────────────────────────
   ENTRY TAGS (single post)
───────────────────────────────────────── */
.entry-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 40px;
    padding-top: 28px;
    border-top: 1px solid var(--border);
}
.entry-tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 30px;
    background: var(--bg);
    border: 1.5px solid var(--border);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-body);
    transition: border-color .15s, color .15s;
}
.entry-tag:hover { border-color: var(--brand); color: var(--brand); }

/* ─────────────────────────────────────────
   ARCHIVE ICON
───────────────────────────────────────── */
.archive-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}
.archive-count { font-size: 13px; color: var(--text-muted); margin-top: 6px; }

/* ─────────────────────────────────────────
   SCROLLED HEADER SHADOW
───────────────────────────────────────── */
.site-header.scrolled {
    box-shadow: 0 2px 16px rgba(0,0,0,0.07);
}

/* ─────────────────────────────────────────
   POST TAG (large — single page)
───────────────────────────────────────── */
.post-tag--lg {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: inline-block;
    margin-bottom: 14px;
}

/* ─────────────────────────────────────────
   PAGE TEMPLATE
───────────────────────────────────────── */
.page-wrap { padding: 48px 0 80px; }
.page-header { margin-bottom: 36px; }
.page-title { font-size: 36px; font-weight: 800; letter-spacing: -0.5px; line-height: 1.2; }

/* ─────────────────────────────────────────
   POSTS-GRID WIDE MODIFIER
───────────────────────────────────────── */
.posts-grid--wide {
    grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 1024px) {
    .posts-grid--wide { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .posts-grid--wide { grid-template-columns: 1fr; }
}

/* ─────────────────────────────────────────
   SKIP LINK (accessibility)
───────────────────────────────────────── */
.skip-link {
    position: absolute;
    left: -9999px;
    top: auto;
    overflow: hidden;
    z-index: 9999;
    padding: 10px 20px;
    background: var(--brand);
    color: #fff;
    font-weight: 700;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}
.skip-link:focus { left: 16px; }

/* ─────────────────────────────────────────
   BODY NAV-OPEN (prevent scroll)
───────────────────────────────────────── */
body.nav-open { overflow: hidden; }
