/*
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.0.0
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 {
    --bg:          #f4f6f9;
    --surface:     #ffffff;
    --navy:        #0d1b2a;
    --navy-light:  #1b2d42;
    --accent:      #e63946;
    --accent-dark: #c1121f;
    --blue:        #1d6fa4;
    --blue-light:  #e8f4fd;
    --finance:     #2a9d8f;
    --jobs:        #e76f51;
    --text:        #1a1a2e;
    --muted:       #6b7280;
    --border:      #e2e8f0;
    --ad-bg:       #f8f9fa;
    --radius:      6px;
    --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);
}

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; }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
    background: var(--navy);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; }

.site-branding { flex-shrink: 0; }
.site-title { font-size: 1.6rem; font-weight: 800; color: #fff; letter-spacing: -.5px; line-height: 1; }
.site-title span { color: var(--accent); }
.site-tagline { font-size: .72rem; color: #9ca3af; margin-top: 2px; letter-spacing: .04em; text-transform: uppercase; }

/* Header leaderboard ad */
.header-ad {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}
.ad-slot {
    background: var(--ad-bg);
    border: 1px dashed #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.ad-leaderboard { width: 728px; height: 90px; max-width: 100%; }
.ad-rectangle  { width: 300px; height: 250px; }
.ad-in-article { width: 100%; max-width: 336px; height: 280px; margin: 24px auto; }
.ad-footer     { width: 728px; height: 90px; max-width: 100%; }

/* ============================================================
   NAVIGATION
   ============================================================ */
.site-nav { background: var(--navy-light); border-top: 1px solid rgba(255,255,255,.07); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; }

.primary-menu { display: flex; }
.primary-menu li { position: relative; }
.primary-menu a {
    display: block;
    padding: 12px 16px;
    color: #cbd5e1;
    font-size: .85rem;
    font-weight: 500;
    letter-spacing: .02em;
    transition: color .2s, background .2s;
}
.primary-menu a:hover,
.primary-menu .current-menu-item > a { color: #fff; background: rgba(255,255,255,.06); }

.menu-cat-technology a:hover { color: var(--blue); border-bottom: 2px solid var(--blue); }
.menu-cat-finance    a:hover { color: var(--finance); border-bottom: 2px solid var(--finance); }
.menu-cat-jobs       a:hover { color: var(--jobs); border-bottom: 2px solid var(--jobs); }

.nav-search { display: flex; align-items: center; }
.nav-search form { 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: 180px;
}
.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: 8px; }
.hamburger svg { width: 22px; height: 22px; }

/* ============================================================
   BREAKING NEWS TICKER
   ============================================================ */
.breaking-bar {
    background: var(--accent);
    color: #fff;
    font-size: .8rem;
    padding: 7px 0;
    overflow: hidden;
}
.breaking-inner { display: flex; align-items: center; gap: 16px; }
.breaking-label {
    background: #fff;
    color: var(--accent);
    font-weight: 800;
    font-size: .72rem;
    letter-spacing: .08em;
    padding: 2px 10px;
    border-radius: 2px;
    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: #fff; font-weight: 500; }
.ticker-items a:hover { 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(--navy);
    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 { background: var(--blue); }
.cat-finance    { background: var(--finance); }
.cat-jobs       { background: var(--jobs); }
.cat-default    { background: var(--navy); }

.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(--text); }
.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(--border); 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 { 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(--navy);
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--accent);
}
.ad-widget { padding: 12px; background: var(--ad-bg); text-align: center; }
.ad-widget .ad-label { font-size: .65rem; color: #94a3b8; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }

.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 { display: flex; gap: 6px; justify-content: center; margin: 32px 0; }
.pagination a, .pagination span {
    display: flex; align-items: center; justify-content: center;
    width: 36px; height: 36px;
    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(--navy);
    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: #2d3748; }
.article-content h2 { font-size: 1.4rem; font-weight: 800; color: var(--navy); 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(--navy); }
.article-content a { color: var(--blue); text-decoration: underline; }

.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(--navy); color: #fff; border-color: var(--navy); }

.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; }
.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(--navy); }
.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-size: 1.4rem; font-weight: 800; color: #fff; margin-bottom: 10px; }
.footer-brand .footer-logo span { color: var(--accent); }
.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)
   ============================================================ */
.cat-color-technology { background: var(--blue); }
.cat-color-finance, .cat-color-financial-markets { background: var(--finance); }
.cat-color-jobs, .cat-color-jobs-layoffs { background: var(--jobs); }

/* ============================================================
   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; 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%; }
    .header-ad { display: none; }
}
@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; }
    .primary-menu { display: none; flex-direction: column; background: var(--navy-light); position: absolute; top: 100%; left: 0; right: 0; z-index: 200; }
    .primary-menu.open { display: flex; }
    .hamburger { display: block; }
    .nav-inner { position: relative; }
}
@media (max-width: 480px) {
    .posts-grid { grid-template-columns: 1fr; }
    .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
}
