/*
Theme Name:  Dexter Nights
Theme URI:   https://www.dexternights.com
Author:      Dexter Nights
Description: A modern news theme covering technology, financial markets, and jobs & layoffs. Built for speed, SEO, and AdSense monetisation.
Version:     1.2.1
License:     GNU General Public License v2 or later
Text Domain: dexternights
Tags:        news, technology, finance, two-columns, custom-menu, featured-images, widgets, responsive-layout
*/

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

:root {
    /* DARK (default) */
    --bg:          #0a1120;
    --surface:     #111a2e;
    --surface-2:   #172338;
    --navy:        #060b16;      /* top bar, header, footer chrome */
    --navy-light:  #0d1627;      /* nav bar */
    --accent:      #ff4757;
    --accent-dark: #e03142;
    --blue:        #5eb0ff;
    --blue-light:  rgba(94,176,255,.10);
    --finance:     #34d3b8;
    --jobs:        #ff8a65;
    --text:        #dfe6f1;
    --heading:     #f4f7fb;
    --body:        #c9d3e3;
    --muted:       #8d9ab0;
    --border:      #223049;
    --ad-bg:       #0d1627;
    --input-bg:    #0d1627;
    --radius:      6px;
    --shadow:      0 1px 3px rgba(0,0,0,.45);
    --shadow-md:   0 6px 18px rgba(0,0,0,.5);
    --c-technology: #3b9cff;
    --c-markets:    #2fc9ae;
    --c-security:   #ff4d5f;
    --c-layoffs-jobs: #ff8a4c;
    --c-immigration: #9b7bff;
    --c-it-industry: #20b8e6;
    --c-politics-policy: #f0b429;
    --c-health-tech: #3ccf7e;
    --ticker-label: #2f6fed;
    color-scheme: dark;
}
:root[data-theme="light"] {
    --bg:          #f4f6f9;
    --surface:     #ffffff;
    --surface-2:   #f1f4f8;
    --navy:        #0d1b2a;
    --navy-light:  #1b2d42;
    --accent:      #e63946;
    --accent-dark: #c1121f;
    --blue:        #1d6fa4;
    --blue-light:  #e8f4fd;
    --finance:     #2a9d8f;
    --jobs:        #e76f51;
    --text:        #1a1a2e;
    --heading:     #0d1b2a;
    --body:        #2d3748;
    --muted:       #6b7280;
    --border:      #e2e8f0;
    --ad-bg:       #f8f9fa;
    --input-bg:    #ffffff;
    --shadow:      0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --shadow-md:   0 4px 12px rgba(0,0,0,.1);
    --c-technology: #1d6fa4;
    --c-markets:    #1f8f80;
    --c-security:   #d62839;
    --c-layoffs-jobs: #d9622e;
    --c-immigration: #6d4fd6;
    --c-it-industry: #0b87b0;
    --c-politics-policy: #b9810a;
    --c-health-tech: #1f9a58;
    --ticker-label: #1d4ed8;
    color-scheme: light;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--accent); }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }

.container { max-width: 1240px; margin: 0 auto; padding: 0 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ============================================================
   TOP BAR
   ============================================================ */
.top-bar {
    background: var(--navy);
    color: #9ca3af;
    font-size: .75rem;
    padding: 6px 0;
}
.top-bar .container { display: flex; justify-content: space-between; align-items: center; }
.top-bar a { color: #9ca3af; }
.top-bar a:hover { color: #fff; }
.top-bar-social a { margin-left: 12px; }
.top-bar-social svg { width: 14px; height: 14px; vertical-align: middle; }
.top-bar-social { display: flex; align-items: center; }
.theme-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 26px; margin-left: 12px; padding: 0;
    background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15);
    color: #cbd5e1; border-radius: 13px; cursor: pointer; transition: background .2s, color .2s;
}
.theme-toggle:hover { background: rgba(255,255,255,.18); color: #fff; }
.theme-toggle svg { width: 14px; height: 14px; }
:root[data-theme="dark"] .theme-toggle .icon-moon, :root:not([data-theme]) .theme-toggle .icon-moon { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: none; }

/* ============================================================
   HEADER (logo + nav + search in one sticky bar)
   ============================================================ */
.site-header {
    background: var(--navy);
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255,255,255,.06);
    box-shadow: 0 2px 10px rgba(0,0,0,.35);
}
.header-inner { display: flex; align-items: center; gap: 20px; }

.site-branding { flex-shrink: 0; }
.site-title { font-family: "Playfair Display", Georgia, "Times New Roman", serif; font-size: 1.45rem; font-weight: 700; text-transform: uppercase; color: #fff; letter-spacing: .09em; line-height: 1; display: block; white-space: nowrap; }
.site-title:hover { color: #fff; }
.site-title span { color: inherit; }
.site-title::after { content: ""; display: block; width: 2.6rem; height: 3px; margin-top: 7px; background: var(--accent); }
.site-tagline { display: none; }

/* Ads — space is reserved so content does not jump when an ad loads */
.ad-slot { text-align: center; overflow: hidden; position: relative; }
.ad-slot .ad-label { display: block; font-size: .62rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 4px; }
.ad-slot.ad-empty { border: 1px dashed var(--border); color: var(--muted); font-size: .75rem; padding: 12px; }
.ad-leaderboard { width: 100%; max-width: 970px; margin: 0 auto; min-height: 120px; }
.ad-rectangle   { width: 300px; max-width: 100%; min-height: 270px; margin: 0 auto; }
.ad-in-article  { width: 100%; max-width: 100%; margin: 26px auto; min-height: 280px; }
.ad-footer      { width: 100%; max-width: 970px; margin: 0 auto; min-height: 120px; }
.header-ad-band { background: var(--surface); border-bottom: 1px solid var(--border); padding: 10px 0; }
.header-ad-band:not(:has(.ad-slot)) { display: none; }
.sidebar { align-self: stretch; }
.sidebar-sticky { position: sticky; top: 84px; }
.sidebar-sticky .widget { padding: 12px; }

/* ============================================================
   NAVIGATION
   ============================================================ */
.site-nav { flex: 1; min-width: 0; }
.primary-menu { display: flex; flex-wrap: nowrap; }
.primary-menu > li { position: relative; }
.primary-menu a {
    display: block;
    padding: 10px 11px;
    color: #cbd5e1;
    font-size: .83rem;
    font-weight: 600;
    white-space: nowrap;
    border-radius: 5px;
    transition: color .2s, background .2s;
}
.primary-menu a:hover,
.primary-menu .current-menu-item > a,
.primary-menu .current-menu-ancestor > a,
.primary-menu .current-category-ancestor > a { color: #fff; background: rgba(255,255,255,.08); }
.primary-menu > li.menu-item-has-children > a::after {
    content: ''; display: inline-block; margin-left: 6px; vertical-align: 2px;
    border: 4px solid transparent; border-top-color: currentColor; border-bottom: 0; opacity: .7;
}
/* dropdown */
.primary-menu .sub-menu {
    position: absolute; top: 100%; left: 0; min-width: 210px; z-index: 300;
    background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
    padding: 6px; box-shadow: var(--shadow-md);
    opacity: 0; visibility: hidden; transform: translateY(6px); transition: opacity .15s, transform .15s, visibility .15s;
}
.primary-menu > li:hover > .sub-menu,
.primary-menu > li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: none; }
.primary-menu .sub-menu a { color: var(--text); font-weight: 500; padding: 8px 12px; }
.primary-menu .sub-menu a:hover { background: var(--surface-2); color: var(--accent); }

.header-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-shrink: 0; }
.nav-search { display: flex; }
.nav-search input {
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.12);
    border-right: none;
    color: #fff;
    padding: 6px 12px;
    font-size: .8rem;
    border-radius: var(--radius) 0 0 var(--radius);
    width: 130px;
    transition: width .2s;
}
.nav-search input:focus { width: 200px; outline: none; }
.nav-search input::placeholder { color: #9ca3af; }
.nav-search button {
    background: var(--accent); border: none; color: #fff; padding: 6px 12px; cursor: pointer;
    border-radius: 0 var(--radius) var(--radius) 0;
}
.nav-search button:hover { background: var(--accent-dark); }

.hamburger { display: none; background: none; border: none; color: #fff; cursor: pointer; padding: 6px; }
.hamburger svg { width: 24px; height: 24px; }

/* ============================================================
   BREAKING NEWS TICKER
   ============================================================ */
.breaking-bar {
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-size: .8rem;
    padding: 8px 0;
    overflow: hidden;
}
.breaking-inner { display: flex; align-items: center; gap: 16px; }
.breaking-label {
    background: var(--ticker-label, #2f6fed);
    color: #fff;
    font-weight: 700;
    font-size: .7rem;
    letter-spacing: .08em;
    padding: 3px 10px;
    border-radius: 3px;
    white-space: nowrap;
    text-transform: uppercase;
    flex-shrink: 0;
}
.ticker-wrap { overflow: hidden; flex: 1; }
.ticker-items { display: flex; gap: 48px; animation: ticker 40s linear infinite; white-space: nowrap; }
.ticker-items a { color: var(--text); font-weight: 500; }
.ticker-items a:hover { color: var(--blue); text-decoration: underline; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.ticker-wrap:hover .ticker-items { animation-play-state: paused; }

/* ============================================================
   LAYOUT
   ============================================================ */
.site-main { padding: 28px 0; }
.content-area { display: grid; grid-template-columns: 1fr 300px; gap: 28px; align-items: start; }

/* ============================================================
   HERO / FEATURED POST
   ============================================================ */
.hero-section { margin-bottom: 32px; }
.hero-post {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--navy);
    box-shadow: var(--shadow-md);
}
.hero-post img { width: 100%; height: 460px; object-fit: cover; opacity: .7; }
.hero-overlay {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: linear-gradient(to top, rgba(13,27,42,.95) 0%, rgba(13,27,42,.4) 70%, transparent 100%);
    padding: 32px;
}
.hero-category {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 3px;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    margin-bottom: 10px;
}
.hero-title { font-size: 2rem; font-weight: 800; color: #fff; line-height: 1.2; margin-bottom: 10px; }
.hero-title a { color: #fff; }
.hero-title a:hover { color: var(--accent); }
.hero-meta { color: #9ca3af; font-size: .8rem; }
.hero-meta span { margin-right: 12px; }

/* ============================================================
   SECTION HEADINGS
   ============================================================ */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--border);
}
.section-title {
    font-size: 1rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--heading);
    position: relative;
}
.section-title::before {
    content: '';
    position: absolute;
    bottom: -13px;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--accent);
}
.section-title.finance-title::before { background: var(--finance); }
.section-title.jobs-title::before { background: var(--jobs); }

.view-all { font-size: .78rem; color: var(--muted); font-weight: 500; }
.view-all:hover { color: var(--accent); }

/* ============================================================
   ARTICLE CARDS
   ============================================================ */
.posts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 32px; }
.posts-grid-2 { grid-template-columns: repeat(2, 1fr); }

.post-card {
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform .2s, box-shadow .2s;
    display: flex;
    flex-direction: column;
}
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.post-card-thumb { position: relative; overflow: hidden; aspect-ratio: 16/9; }
.post-card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.post-card:hover .post-card-thumb img { transform: scale(1.04); }

.post-card-cat {
    position: absolute;
    top: 10px; left: 10px;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 3px;
    color: #fff;
}
.cat-technology      { --c: var(--c-technology); }
.cat-markets         { --c: var(--c-markets); }
.cat-security        { --c: var(--c-security); }
.cat-layoffs-jobs    { --c: var(--c-layoffs-jobs); }
.cat-immigration     { --c: var(--c-immigration); }
.cat-it-industry     { --c: var(--c-it-industry); }
.cat-politics-policy { --c: var(--c-politics-policy); }
.cat-health-tech     { --c: var(--c-health-tech); }
.cat-default         { --c: var(--navy-light); }
.post-card-cat, .article-cat-badge, .hero-category { background: var(--c, var(--navy-light)); color: #fff; }
.post-card-cat:hover, .article-cat-badge:hover, .hero-category:hover { color: #fff; filter: brightness(1.12); }

.post-card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.post-card-title {
    font-size: .95rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 8px;
    flex: 1;
}
.post-card-title a { color: var(--heading); }
.post-card-title a:hover { color: var(--accent); }
.post-card-excerpt { font-size: .82rem; color: var(--muted); line-height: 1.5; margin-bottom: 12px; }
.post-card-meta { font-size: .75rem; color: var(--muted); display: flex; gap: 10px; align-items: center; margin-top: auto; }
.post-card-meta .dot { width: 3px; height: 3px; background: var(--muted); border-radius: 50%; }

/* List style card (sidebar / recent posts) */
.post-list-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.post-list-item:last-child { border-bottom: none; }
.post-list-thumb { width: 80px; height: 60px; flex-shrink: 0; border-radius: 4px; overflow: hidden; }
.post-list-thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-list-body { flex: 1; }
.post-list-cat { color: var(--c, var(--blue)); font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.post-list-title { font-size: .83rem; font-weight: 600; line-height: 1.3; color: var(--text); }
.post-list-title:hover { color: var(--accent); }
.post-list-date { font-size: .72rem; color: var(--muted); margin-top: 4px; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar { display: flex; flex-direction: column; gap: 24px; }
.widget {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}
.widget-title {
    font-size: .85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--heading);
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--accent);
}
.ad-widget { padding: 12px; background: var(--ad-bg); text-align: center; }

.category-list li { padding: 7px 0; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; }
.category-list li:last-child { border-bottom: none; }
.category-list a { font-size: .85rem; color: var(--text); font-weight: 500; }
.category-list a:hover { color: var(--accent); }
.category-count { font-size: .75rem; background: var(--bg); color: var(--muted); padding: 1px 7px; border-radius: 20px; }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination { margin: 32px 0; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.pagination .page-numbers.dots { background: none; border-color: transparent; width: auto; }
.pagination .prev, .pagination .next { font-size: 1.1rem; }
.pagination a, .pagination span {
    display: flex; align-items: center; justify-content: center;
    min-width: 36px; height: 36px; padding: 0 8px;
    border-radius: var(--radius);
    font-size: .85rem;
    font-weight: 600;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    transition: all .2s;
}
.pagination a:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.pagination .current { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ============================================================
   SINGLE POST
   ============================================================ */
.single-layout { display: grid; grid-template-columns: 1fr 300px; gap: 28px; align-items: start; }

.article-header { margin-bottom: 24px; }
.article-cats { display: flex; gap: 8px; margin-bottom: 12px; }
.article-cat-badge {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 3px;
    color: #fff;
}
.article-title {
    font-size: 2.1rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--heading);
    margin-bottom: 14px;
}
.article-excerpt { font-size: 1.1rem; color: var(--muted); line-height: 1.6; margin-bottom: 16px; font-style: italic; }
.article-meta { display: flex; align-items: center; gap: 16px; font-size: .82rem; color: var(--muted); padding: 14px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.article-meta strong { color: var(--text); }

.article-featured-image { border-radius: var(--radius); overflow: hidden; margin-bottom: 28px; }
.article-featured-image img { width: 100%; max-height: 480px; object-fit: cover; }
.image-caption { font-size: .78rem; color: var(--muted); text-align: center; margin-top: 6px; }

.article-content { font-size: 1.02rem; line-height: 1.8; color: var(--body); }
.article-content h2 { font-size: 1.4rem; font-weight: 800; color: var(--heading); margin: 32px 0 14px; padding-left: 14px; border-left: 4px solid var(--accent); }
.article-content h3 { font-size: 1.15rem; font-weight: 700; margin: 24px 0 10px; }
.article-content p { margin-bottom: 18px; }
.article-content ul, .article-content ol { margin: 0 0 18px 24px; }
.article-content li { margin-bottom: 6px; }
.article-content blockquote { border-left: 4px solid var(--accent); padding: 12px 20px; margin: 24px 0; background: var(--blue-light); border-radius: 0 var(--radius) var(--radius) 0; font-style: italic; color: var(--text); }
.article-content a { color: var(--blue); text-decoration: underline; }
.article-content table { width: 100%; border-collapse: collapse; margin: 0 0 20px; font-size: .92rem; }
.article-content th, .article-content td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; }
.article-content th { background: var(--surface-2); color: var(--heading); }
.article-content pre, .article-content code { background: var(--surface-2); color: var(--text); border-radius: 4px; }
.article-content pre { padding: 14px; overflow-x: auto; margin: 0 0 18px; }
.article-content code { padding: 1px 5px; font-size: .9em; }
.article-content img { border-radius: var(--radius); }
.article-content input, .article-content textarea, .article-content select { background: var(--input-bg); color: var(--text); border: 1px solid var(--border); border-radius: 4px; padding: 6px 8px; }

.article-tags { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 8px; }
.tag-badge { font-size: .78rem; padding: 4px 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 20px; color: var(--muted); transition: all .2s; }
.tag-badge:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

.author-box { display: flex; gap: 16px; background: var(--blue-light); border-radius: var(--radius); padding: 20px; margin-top: 32px; }
.author-avatar { width: 64px; height: 64px; border-radius: 50%; flex-shrink: 0; overflow: hidden; }
.author-avatar img { width: 100%; height: 100%; object-fit: cover; }
.author-name { font-weight: 700; font-size: .95rem; margin-bottom: 4px; color: var(--heading); }
.author-bio { font-size: .83rem; color: var(--muted); line-height: 1.5; }

/* Related posts */
.related-posts { margin-top: 36px; }
.related-title { font-size: 1rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 16px; color: var(--heading); }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer-ad-bar { background: var(--navy-light); padding: 16px 0; text-align: center; }

.site-footer { background: var(--navy); color: #9ca3af; padding: 40px 0 0; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; margin-bottom: 32px; }

.footer-brand .footer-logo { font-family: "Playfair Display", Georgia, "Times New Roman", serif; font-size: 1.4rem; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: #fff; margin-bottom: 10px; }
.footer-brand .footer-logo span { color: inherit; }
.footer-brand p { font-size: .83rem; line-height: 1.6; }

.footer-widget h4 { color: #fff; font-size: .83rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 14px; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { font-size: .83rem; color: #9ca3af; transition: color .2s; }
.footer-links a:hover { color: #fff; }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,.08);
    padding: 16px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: .78rem;
}
.footer-bottom a { color: #9ca3af; }
.footer-bottom a:hover { color: #fff; }

/* ============================================================
   CATEGORY BADGE COLOURS (dynamic)
   ============================================================ */

/* ============================================================
   SEARCH & ARCHIVE
   ============================================================ */
.page-header { background: var(--navy); color: #fff; padding: 28px 0; margin-bottom: 28px; }
.page-header h1 { font-size: 1.6rem; font-weight: 800; }
.page-header p { color: #9ca3af; margin-top: 4px; font-size: .9rem; }
.search-form-large { display: flex; max-width: 480px; margin-top: 16px; }
.search-form-large input { flex: 1; padding: 10px 16px; border: none; background: var(--input-bg); color: var(--text); border-radius: var(--radius) 0 0 var(--radius); font-size: .95rem; }
.search-form-large button { background: var(--accent); color: #fff; border: none; padding: 10px 20px; border-radius: 0 var(--radius) var(--radius) 0; font-weight: 600; cursor: pointer; }

/* ============================================================
   404
   ============================================================ */
.error-404 { text-align: center; padding: 80px 20px; }
.error-404 .error-code { font-size: 8rem; font-weight: 900; color: var(--accent); line-height: 1; }
.error-404 h2 { font-size: 1.6rem; margin: 12px 0; }
.error-404 p { color: var(--muted); margin-bottom: 24px; }
.btn { display: inline-block; padding: 10px 24px; background: var(--accent); color: #fff; border-radius: var(--radius); font-weight: 600; transition: background .2s; }
.btn:hover { background: var(--accent-dark); color: #fff; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .content-area, .single-layout { grid-template-columns: 1fr; }
    .sidebar { display: grid; grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .ad-leaderboard { width: 100%; }
    
}
@media (max-width: 768px) {
    .posts-grid { grid-template-columns: repeat(2, 1fr); }
    .related-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .sidebar { grid-template-columns: 1fr; }
    .hero-post img { height: 280px; }
    .hero-title { font-size: 1.3rem; }
    .article-title { font-size: 1.5rem; }
}
@media (max-width: 480px) {
    .posts-grid { grid-template-columns: 1fr; }
    .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
}

/* ============================================================
   DARK/LIGHT POLISH
   ============================================================ */
.widget, .post-card, .author-box { border: 1px solid var(--border); }
.author-box { background: var(--blue-light); }
:root[data-theme="light"] .widget, :root[data-theme="light"] .post-card { border-color: transparent; }
input[type="search"], input[type="text"], input[type="email"], textarea, select { background: var(--input-bg); color: var(--text); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
@media (max-width: 768px) {
    .ad-leaderboard, .ad-footer { min-height: 110px; }
    .ad-in-article { min-height: 260px; }
    .sidebar-sticky { position: static; }
}
@media (prefers-reduced-motion: reduce) { .ticker-items { animation: none; } html { scroll-behavior: auto; } }

/* ============================================================
   MOBILE / TABLET NAV  (hamburger below 1100px)
   ============================================================ */
@media (max-width: 1100px) {
    .hamburger { display: block; }
    .site-nav {
        display: none; position: absolute; top: 100%; left: 0; right: 0; z-index: 200;
        background: var(--navy-light); border-top: 1px solid rgba(255,255,255,.08);
        max-height: calc(100vh - 64px); overflow-y: auto; box-shadow: var(--shadow-md);
    }
    .site-nav.open { display: block; }
    .primary-menu { flex-direction: column; padding: 8px 20px 14px; max-width: 1240px; margin: 0 auto; }
    .primary-menu a { padding: 11px 8px; border-radius: 0; border-bottom: 1px solid rgba(255,255,255,.06); }
    .primary-menu > li.menu-item-has-children > a::after { display: none; }
    .primary-menu .sub-menu { position: static; opacity: 1; visibility: visible; transform: none; background: none; border: 0; box-shadow: none; padding: 0 0 0 14px; min-width: 0; }
    .primary-menu .sub-menu a { color: #9fb0c8; font-size: .8rem; }
    .primary-menu .sub-menu a:hover { background: none; color: #fff; }
}
@media (max-width: 560px) {
    .nav-search input { width: 90px; }
    .nav-search input:focus { width: 130px; }
    .site-title { font-size: 1.1rem; letter-spacing: .06em; }
}

/* ============================================================
   HOMEPAGE: TOP STORIES, LATEST, CATEGORY SECTIONS
   ============================================================ */
.top-stories { display: grid; grid-template-columns: 1.65fr 1fr; gap: 20px; margin-bottom: 36px; }
.top-stories .hero-post { margin: 0; border-radius: 10px; min-height: 100%; }
.top-stories .hero-post img { height: 100%; min-height: 440px; max-height: 520px; }
.top-side { display: flex; flex-direction: column; gap: 14px; }
.side-story {
    display: flex; gap: 14px; flex: 1; align-items: center;
    background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px;
    transition: border-color .2s, transform .2s;
}
.side-story:hover { border-color: var(--accent); transform: translateX(2px); }
.side-thumb { width: 112px; height: 84px; flex-shrink: 0; border-radius: 6px; overflow: hidden; display: block; }
.side-thumb img { width: 100%; height: 100%; object-fit: cover; }
.side-body { min-width: 0; }
.side-cat { display: inline-block; background: none; color: var(--c, var(--blue)); font-size: .66rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; margin-bottom: 4px; }
.side-cat:hover { color: var(--c, var(--blue)); filter: brightness(1.15); }
.side-title { font-size: .95rem; font-weight: 700; line-height: 1.3; }
.side-title a { color: var(--heading); }
.side-title a:hover { color: var(--accent); }
.side-date { font-size: .72rem; color: var(--muted); }

.cat-section { margin: 12px 0 32px; }
.cat-section .section-header { border-bottom-color: var(--border); }
.cat-section .section-title a { color: var(--heading); }
.cat-section .section-title::before { background: var(--c, var(--accent)); }
.posts-grid-4 { grid-template-columns: repeat(4, 1fr); }
.posts-grid-4 .post-card-excerpt { display: none; }

.infeed-ad { margin: 8px 0 32px; }
.ad-infeed { width: 100%; max-width: 970px; margin: 0 auto; min-height: 250px; }

/* Breadcrumbs */
.breadcrumbs { font-size: .78rem; color: var(--muted); margin-bottom: 12px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs .sep { opacity: .5; }

@media (max-width: 1024px) {
    .top-stories { grid-template-columns: 1fr; }
    .top-stories .hero-post img { min-height: 300px; }
    .posts-grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
    .posts-grid-4 { grid-template-columns: 1fr; }
    .side-thumb { width: 92px; height: 70px; }
}
