/* ============================================
   NAIROBI LOOP — Main Stylesheet
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;500;600;700&family=Merriweather:ital,wght@0,400;0,700;1,400&family=Inter:wght@300;400;500;600;700&display=swap');

/* ---- CSS Variables ---- */
:root {
    --red: #d32f2f;
    --red-dark: #b71c1c;
    --red-light: #ffebee;
    --black: #111111;
    --dark: #1a1a1a;
    --gray-900: #212121;
    --gray-800: #333333;
    --gray-700: #555555;
    --gray-500: #888888;
    --gray-300: #cccccc;
    --gray-100: #f5f5f5;
    --white: #ffffff;
    --bg: #ffffff;
    --bg-secondary: #f8f8f8;
    --text: #111111;
    --text-muted: #666666;
    --border: #e8e8e8;
    --card-bg: #ffffff;
    --header-bg: #ffffff;
    --nav-bg: #111111;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --shadow-hover: 0 8px 30px rgba(0,0,0,0.15);
    --font-heading: 'Oswald', sans-serif;
    --font-article: 'Merriweather', serif;
    --font-body: 'Inter', sans-serif;
    --headline-weight: 700;
    --radius: 6px;
    --transition: 0.2s ease;
}

/* Dark Mode */
[data-theme="dark"] {
    --bg: #0f0f0f;
    --bg-secondary: #1a1a1a;
    --text: #f0f0f0;
    --text-muted: #aaaaaa;
    --border: #2a2a2a;
    --card-bg: #1a1a1a;
    --header-bg: #111111;
    --nav-bg: #0a0a0a;
    --shadow: 0 2px 12px rgba(0,0,0,0.4);
    --shadow-hover: 0 8px 30px rgba(0,0,0,0.6);
    --gray-100: #1a1a1a;
    --gray-300: #333333;
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    transition: background 0.3s, color 0.3s;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* ---- Reading Progress Bar ---- */
#progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: var(--red);
    z-index: 9999;
    transition: width 0.1s;
}

/* ---- Cookie Banner ---- */
#cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--dark);
    color: #fff;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    z-index: 9998;
    font-size: 14px;
    flex-wrap: wrap;
}
#cookie-banner p { flex: 1; }
#cookie-banner a { color: var(--red); text-decoration: underline; }
.cookie-btn {
    background: var(--red);
    color: #fff;
    padding: 8px 20px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
}
.cookie-btn:hover { background: var(--red-dark); }

/* ---- Header ---- */
#site-header {
    background: var(--header-bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: background 0.3s;
}
.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    max-width: 1280px;
    margin: 0 auto;
    gap: 16px;
}
.site-logo {
    font-family: var(--font-heading);
    font-size: clamp(22px, 4vw, 32px);
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text);
    flex-shrink: 0;
}
.site-logo span { color: var(--red); }

.header-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Search */
.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
#search-input {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 8px 16px 8px 38px;
    font-size: 14px;
    width: 220px;
    color: var(--text);
    transition: width 0.3s, border-color 0.2s;
    font-family: var(--font-body);
}
#search-input:focus {
    outline: none;
    border-color: var(--red);
    width: 280px;
}
.search-icon {
    position: absolute;
    left: 12px;
    color: var(--gray-500);
    font-size: 15px;
    pointer-events: none;
}
#search-results {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 380px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-hover);
    z-index: 1001;
    max-height: 400px;
    overflow-y: auto;
    display: none;
}
.search-result-item {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}
.search-result-item:hover { background: var(--bg-secondary); }
.search-result-item:last-child { border-bottom: none; }
.search-result-img {
    width: 60px;
    height: 45px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}
.search-result-title { font-size: 13px; font-weight: 600; line-height: 1.4; color: var(--text); }
.search-result-cat { font-size: 11px; color: var(--red); margin-top: 3px; text-transform: uppercase; font-weight: 600; }
.search-no-results { padding: 20px; text-align: center; color: var(--text-muted); font-size: 14px; }

/* Dark mode toggle */
#theme-toggle {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all var(--transition);
    flex-shrink: 0;
}
#theme-toggle:hover { background: var(--red); color: #fff; border-color: var(--red); }

/* Hamburger */
#hamburger {
    background: var(--nav-bg);
    border-radius: 4px;
    width: 36px;
    height: 36px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    flex-shrink: 0;
    transition: background var(--transition);
}
#hamburger:hover { background: var(--red); }
#hamburger span {
    display: block;
    width: 18px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: all 0.3s;
}
#hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
#hamburger.active span:nth-child(2) { opacity: 0; }
#hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Nav Menu */
#main-nav {
    background: var(--nav-bg);
    display: none;
    border-top: 1px solid rgba(255,255,255,0.1);
}
#main-nav.open { display: block; }
.nav-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 0;
}
.nav-inner a {
    display: block;
    padding: 14px 16px;
    color: #fff;
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: color var(--transition);
    white-space: nowrap;
}
.nav-inner a:hover, .nav-inner a.active { color: var(--red); }

/* Breaking News Ticker */
#breaking-ticker {
    background: var(--red);
    color: #fff;
    display: flex;
    align-items: center;
    overflow: hidden;
    height: 36px;
}
.ticker-label {
    background: var(--red-dark);
    padding: 0 16px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
    white-space: nowrap;
    height: 100%;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.ticker-wrap {
    flex: 1;
    overflow: hidden;
    position: relative;
}
.ticker-scroll {
    display: flex;
    animation: ticker 35s linear infinite;
    white-space: nowrap;
}
.ticker-scroll:hover { animation-play-state: paused; }
.ticker-item {
    display: inline-flex;
    align-items: center;
    padding: 0 30px;
    font-size: 13px;
    font-weight: 500;
    height: 36px;
    white-space: nowrap;
}
.ticker-item::before {
    content: '•';
    margin-right: 10px;
    opacity: 0.7;
}
.ticker-item a { color: #fff; }
.ticker-item a:hover { text-decoration: underline; }
@keyframes ticker {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Ad Banner */
.ad-slot {
    background: var(--bg-secondary);
    border: 1px dashed var(--gray-300);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--gray-500);
    font-size: 12px;
    font-family: var(--font-body);
    overflow: hidden;
}
.ad-slot-leaderboard { width: 100%; min-height: 90px; max-width: 728px; margin: 12px auto; }
.ad-slot-rectangle { width: 100%; min-height: 250px; }
.ad-slot-mobile { width: 100%; min-height: 50px; }
.ad-placeholder-text { opacity: 0.6; font-size: 11px; }

/* ---- Layout ---- */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}
.page-wrapper {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 32px;
    padding: 28px 20px;
    max-width: 1280px;
    margin: 0 auto;
}
.main-content { min-width: 0; }
.sidebar { min-width: 0; }

/* ---- Section Heading ---- */
.section-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 10px;
}
.section-heading h2 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.section-heading .bar {
    width: 4px;
    height: 20px;
    background: var(--red);
    border-radius: 2px;
    flex-shrink: 0;
}

/* ---- Story Cards ---- */
.stories-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}
.story-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: box-shadow var(--transition), transform var(--transition);
    display: flex;
    flex-direction: column;
}
.story-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}
.card-image-wrap {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: var(--gray-100);
}
.card-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.4s ease;
}
.story-card:hover .card-image-wrap img { transform: scale(1.04); }
.card-category {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--red);
    color: #fff;
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.card-title {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: var(--headline-weight);
    line-height: 1.35;
    color: var(--text);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.card-title:hover { color: var(--red); }
.card-excerpt {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.55;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}
.card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: var(--gray-500);
    flex-wrap: wrap;
    margin-top: auto;
}
.card-meta .dot { color: var(--gray-300); }
.card-meta .read-time { color: var(--red); font-weight: 600; }
.card-meta .views { display: flex; align-items: center; gap: 3px; }

/* Featured / Hero Card */
.featured-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 32px;
}
.featured-main .card-title { font-size: 22px; -webkit-line-clamp: 4; }
.featured-main .card-image-wrap { aspect-ratio: 16/9; }
.featured-sidebar { display: flex; flex-direction: column; gap: 16px; }
.featured-sidebar .story-card { flex-direction: row; }
.featured-sidebar .card-image-wrap { width: 110px; flex-shrink: 0; aspect-ratio: unset; height: 85px; }
.featured-sidebar .card-body { padding: 10px 12px; }
.featured-sidebar .card-title { font-size: 13px; -webkit-line-clamp: 3; }
.featured-sidebar .card-excerpt, .featured-sidebar .card-meta { display: none; }

/* ---- Category Section ---- */
.category-section { margin-bottom: 40px; }
.cat-stories-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
.cat-stories-grid .story-card { flex-direction: row; }
.cat-stories-grid .card-image-wrap { width: 120px; flex-shrink: 0; aspect-ratio: unset; height: 90px; border-radius: 0; }
.cat-stories-grid .card-body { padding: 10px 14px; }
.cat-stories-grid .card-title { font-size: 14px; -webkit-line-clamp: 3; }
.cat-stories-grid .card-excerpt { display: none; }

/* In-feed Ad */
.in-feed-ad { grid-column: 1 / -1; }

/* ---- Sidebar ---- */
.sidebar-widget {
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}
.widget-header {
    background: var(--gray-900);
    color: #fff;
    padding: 12px 16px;
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 8px;
}
[data-theme="dark"] .widget-header { background: #000; }
.widget-header .icon { color: var(--red); }
.widget-body { padding: 0; }

.trending-item {
    display: flex;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
    align-items: flex-start;
}
.trending-item:last-child { border-bottom: none; }
.trending-item:hover { background: var(--bg-secondary); }
.trending-num {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    color: var(--red);
    line-height: 1;
    flex-shrink: 0;
    width: 28px;
}
.trending-title {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.trending-title:hover { color: var(--red); }
.trending-meta { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

.recent-item {
    display: flex;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
    align-items: flex-start;
}
.recent-item:last-child { border-bottom: none; }
.recent-item:hover { background: var(--bg-secondary); }
.recent-img {
    width: 64px;
    height: 48px;
    object-fit: cover;
    object-position: center;
    border-radius: 4px;
    flex-shrink: 0;
}
.recent-title {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.recent-title:hover { color: var(--red); }
.recent-date { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ---- Article / Story Page ---- */
.article-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 32px;
    padding: 28px 20px;
    max-width: 1280px;
    margin: 0 auto;
}
.article-main { min-width: 0; }
.article-header { margin-bottom: 24px; }
.article-category-tag {
    display: inline-block;
    background: var(--red);
    color: #fff;
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}
.article-title {
    font-family: var(--font-article);
    font-size: clamp(22px, 3.5vw, 34px);
    font-weight: 700;
    line-height: 1.25;
    color: var(--text);
    margin-bottom: 16px;
}
.article-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--text-muted);
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}
.article-meta .meta-item { display: flex; align-items: center; gap: 5px; }
.article-meta .meta-icon { color: var(--red); }
.article-views { font-weight: 600; color: var(--text); }
.article-read-time { font-weight: 600; color: var(--red); }

/* Share buttons */
.share-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}
.share-label {
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}
.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    transition: opacity var(--transition);
    font-family: var(--font-body);
}
.share-btn:hover { opacity: 0.85; }
.share-wa { background: #25D366; }
.share-fb { background: #1877F2; }
.share-x { background: #000; }
.share-copy { background: var(--gray-700); }
.share-copy.copied { background: #2e7d32; }

/* Article image */
.article-image-wrap {
    margin-bottom: 24px;
    border-radius: var(--radius);
    overflow: hidden;
}
.article-image-wrap img {
    width: 100%;
    max-height: 520px;
    height: auto;
    min-height: 280px;
    object-fit: contain;
    object-position: center;
    background: var(--gray-100);
}
@media (max-width: 768px) {
    .article-image-wrap img {
        max-height: 320px;
        min-height: 200px;
    }
}
.image-caption {
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

/* Article body */
.article-body {
    font-family: var(--font-article);
    font-size: 17px;
    line-height: 1.85;
    color: var(--text);
}
.article-body p { margin-bottom: 20px; }
.article-body h2 {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    margin: 32px 0 12px;
    color: var(--text);
}
.article-body h3 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    margin: 24px 0 10px;
    color: var(--text);
}
.article-body blockquote {
    border-left: 4px solid var(--red);
    padding: 16px 20px;
    margin: 24px 0;
    background: var(--bg-secondary);
    font-style: italic;
    border-radius: 0 var(--radius) var(--radius) 0;
}
.article-body a { color: var(--red); text-decoration: underline; }
.article-body ul, .article-body ol {
    margin: 16px 0 20px 24px;
}
.article-body ul li, .article-body ol li { margin-bottom: 8px; }
.article-body strong { font-weight: 700; }

/* Read Also — in-article related */
.read-also {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-left: 4px solid var(--red);
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 14px 18px;
    margin: 28px 0;
}
.read-also-label {
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--red);
    letter-spacing: 1px;
    margin-bottom: 6px;
}
.read-also-title {
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
}
.read-also-title:hover { color: var(--red); }

/* Tags */
.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 24px 0;
    padding: 20px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.tag-label {
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    margin-right: 4px;
    align-self: center;
}
.tag {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    transition: all var(--transition);
}
.tag:hover { background: var(--red); color: #fff; border-color: var(--red); }

/* Related Stories at bottom */
.related-stories { margin: 32px 0; }
.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* ---- Pagination ---- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 32px 0;
    flex-wrap: wrap;
}
.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--text);
    transition: all var(--transition);
    font-family: var(--font-body);
}
.page-btn:hover, .page-btn.active {
    background: var(--red);
    color: #fff;
    border-color: var(--red);
}
.page-btn.dots { border: none; background: none; cursor: default; }

/* ---- Footer ---- */
#site-footer {
    background: var(--gray-900);
    color: #ccc;
    padding: 48px 20px 20px;
    margin-top: 40px;
}
[data-theme="dark"] #site-footer { background: #000; }
.footer-grid {
    max-width: 1280px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}
.footer-brand { }
.footer-logo {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 10px;
    letter-spacing: 1px;
}
.footer-logo span { color: var(--red); }
.footer-motto {
    font-size: 13px;
    color: #888;
    font-style: italic;
    margin-bottom: 16px;
}
.footer-desc { font-size: 13px; color: #888; line-height: 1.7; margin-bottom: 20px; }
.social-links { display: flex; gap: 10px; flex-wrap: wrap; }
.social-link {
    width: 36px;
    height: 36px;
    background: #333;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #ccc;
    transition: all var(--transition);
}
.social-link:hover { background: var(--red); color: #fff; }
.footer-col h4 {
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #fff;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--red);
    display: inline-block;
}
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col ul li a { font-size: 13px; color: #888; transition: color var(--transition); }
.footer-col ul li a:hover { color: var(--red); }
.footer-bottom {
    max-width: 1280px;
    margin: 0 auto;
    padding-top: 20px;
    border-top: 1px solid #2a2a2a;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 12px;
    color: #666;
}
.footer-bottom a { color: #888; }
.footer-bottom a:hover { color: var(--red); }

/* ---- Back to Top ---- */
#back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 42px;
    height: 42px;
    background: var(--red);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 4px 16px rgba(211,47,47,0.4);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s;
    z-index: 998;
}
#back-to-top.visible { opacity: 1; pointer-events: all; }
#back-to-top:hover { background: var(--red-dark); transform: translateY(-2px); }

/* ---- Static Pages ---- */
.page-hero {
    background: var(--nav-bg);
    color: #fff;
    padding: 48px 20px;
    text-align: center;
}
.page-hero h1 {
    font-family: var(--font-heading);
    font-size: clamp(28px, 5vw, 42px);
    font-weight: 700;
    margin-bottom: 8px;
}
.page-hero p { color: #aaa; font-size: 15px; }
.page-content {
    max-width: 820px;
    margin: 0 auto;
    padding: 48px 20px;
    font-size: 16px;
    line-height: 1.8;
    color: var(--text);
}
.page-content h2 {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    margin: 32px 0 12px;
    color: var(--text);
}
.page-content p { margin-bottom: 16px; }
.page-content ul { margin: 12px 0 16px 24px; }
.page-content ul li { margin-bottom: 6px; }

/* Contact Form */
.contact-form { max-width: 600px; margin: 0 auto; }
.form-group { margin-bottom: 20px; }
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.form-control {
    width: 100%;
    padding: 11px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 15px;
    color: var(--text);
    font-family: var(--font-body);
    transition: border-color var(--transition);
}
.form-control:focus { outline: none; border-color: var(--red); }
textarea.form-control { min-height: 140px; resize: vertical; }
.btn-primary {
    background: var(--red);
    color: #fff;
    padding: 12px 28px;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 700;
    font-family: var(--font-body);
    transition: background var(--transition);
    display: inline-block;
}
.btn-primary:hover { background: var(--red-dark); }

/* ---- Admin Panel ---- */
.admin-body { background: #f0f0f0; min-height: 100vh; }
[data-theme="dark"] .admin-body { background: #0a0a0a; }
.admin-login {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background: #111;
}
.login-box {
    background: #1a1a1a;
    border-radius: 10px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}
.login-logo {
    font-family: var(--font-heading);
    font-size: 26px;
    font-weight: 700;
    color: #fff;
    text-align: center;
    margin-bottom: 6px;
    letter-spacing: 1px;
}
.login-logo span { color: var(--red); }
.login-subtitle { text-align: center; color: #888; font-size: 13px; margin-bottom: 28px; }
.login-box .form-group label { color: #aaa; }
.login-box .form-control { background: #222; border-color: #333; color: #fff; }
.login-box .form-control:focus { border-color: var(--red); }
.login-error { background: #3c1010; color: #ff6b6b; padding: 10px 14px; border-radius: 4px; font-size: 13px; margin-bottom: 16px; border-left: 3px solid var(--red); }

.admin-header {
    background: #111;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
.admin-logo { font-family: var(--font-heading); font-size: 20px; font-weight: 700; color: #fff; }
.admin-logo span { color: var(--red); }
.admin-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.admin-nav a {
    color: #aaa;
    font-size: 12px;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 4px;
    transition: all var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-family: var(--font-body);
}
.admin-nav a:hover, .admin-nav a.active { background: var(--red); color: #fff; }
.admin-logout { color: #888; font-size: 12px; font-weight: 600; padding: 8px 12px; border-radius: 4px; transition: all var(--transition); font-family: var(--font-body); }
.admin-logout:hover { background: #333; color: #fff; }

.admin-main { max-width: 1100px; margin: 0 auto; padding: 28px 20px; }
.admin-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 24px;
}
[data-theme="dark"] .admin-card { background: #1a1a1a; }
.admin-card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.admin-card-header h2 {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.admin-card-body { padding: 20px; }

.admin-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    text-align: center;
    border-top: 3px solid var(--red);
}
[data-theme="dark"] .stat-card { background: #1a1a1a; }
.stat-num {
    font-family: var(--font-heading);
    font-size: 32px;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
    margin-bottom: 4px;
}
.stat-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }

/* Story form */
.story-form-grid { display: grid; grid-template-columns: 1fr 300px; gap: 24px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.full-width { grid-column: 1 / -1; }
#content-editor {
    width: 100%;
    min-height: 380px;
    padding: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 15px;
    color: var(--text);
    font-family: var(--font-article);
    line-height: 1.8;
    resize: vertical;
    transition: border-color var(--transition);
}
#content-editor:focus { outline: none; border-color: var(--red); }
.editor-toolbar {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    padding: 8px 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: var(--radius) var(--radius) 0 0;
}
.editor-toolbar + #content-editor { border-radius: 0 0 var(--radius) var(--radius); }
.toolbar-btn {
    padding: 5px 10px;
    border: 1px solid var(--border);
    border-radius: 3px;
    font-size: 12px;
    font-weight: 700;
    background: var(--card-bg);
    color: var(--text);
    transition: all var(--transition);
    font-family: var(--font-body);
}
.toolbar-btn:hover { background: var(--red); color: #fff; border-color: var(--red); }

/* Stories table */
.stories-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.stories-table th {
    background: var(--bg-secondary);
    padding: 10px 14px;
    text-align: left;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}
.stories-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    vertical-align: middle;
}
.stories-table tr:hover td { background: var(--bg-secondary); }
.story-thumb { width: 60px; height: 45px; object-fit: cover; object-position: center; border-radius: 4px; }
.table-title { font-weight: 600; color: var(--text); }
.table-title a:hover { color: var(--red); }
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}
.badge-pub { background: #e8f5e9; color: #2e7d32; }
.badge-draft { background: #fff8e1; color: #f57f17; }
.badge-break { background: var(--red-light); color: var(--red); }
.action-btns { display: flex; gap: 6px; }
.btn-edit, .btn-del, .btn-view {
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 700;
    transition: all var(--transition);
    font-family: var(--font-body);
}
.btn-edit { background: #e3f2fd; color: #1565c0; }
.btn-edit:hover { background: #1565c0; color: #fff; }
.btn-del { background: #ffebee; color: var(--red); }
.btn-del:hover { background: var(--red); color: #fff; }
.btn-view { background: #e8f5e9; color: #2e7d32; }
.btn-view:hover { background: #2e7d32; color: #fff; }

/* Settings grid */
.settings-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.color-preview { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--border); display: inline-block; vertical-align: middle; margin-left: 8px; }

/* Alert messages */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    margin-bottom: 16px;
    font-weight: 500;
}
.alert-success { background: #e8f5e9; color: #2e7d32; border-left: 4px solid #4caf50; }
.alert-error { background: #ffebee; color: #c62828; border-left: 4px solid var(--red); }

/* ---- Utility ---- */
.text-red { color: var(--red); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-24 { margin-bottom: 24px; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.no-image-card {
    background: linear-gradient(135deg, #1a1a1a, #333);
    aspect-ratio: 16/9;
    display: flex;
    align-items: center;
    justify-content: center;
}
.no-image-card span { color: #555; font-size: 32px; }

/* ---- Responsive ---- */
@media (max-width: 1024px) {
    .page-wrapper, .article-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .sidebar { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
    .stories-grid { grid-template-columns: repeat(2, 1fr); }
    .admin-stats { grid-template-columns: repeat(2, 1fr); }
    .story-form-grid { grid-template-columns: 1fr; }
    .settings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .featured-grid { grid-template-columns: 1fr; }
    .featured-sidebar { display: none; }
    .stories-grid { grid-template-columns: 1fr; }
    .cat-stories-grid { grid-template-columns: 1fr; }
    .related-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
    .sidebar { grid-template-columns: 1fr; }
    #search-input { width: 160px; }
    #search-input:focus { width: 200px; }
    #search-results { width: 300px; right: -20px; }
    .form-row { grid-template-columns: 1fr; }
    .admin-stats { grid-template-columns: repeat(2, 1fr); }
    .admin-nav { display: none; }
    .stories-table { font-size: 12px; }
    .article-title { font-size: 22px; }
}
@media (max-width: 480px) {
    .header-top { padding: 10px 14px; }
    .site-logo { font-size: 20px; }
    #search-input { width: 120px; font-size: 13px; }
    .related-grid { grid-template-columns: 1fr; }
    .page-wrapper, .article-layout { padding: 16px 14px; }
    .admin-stats { grid-template-columns: 1fr 1fr; }
}

/* ---- Category page header ---- */
.cat-page-header {
    background: var(--nav-bg);
    padding: 28px 20px;
    color: #fff;
    border-bottom: 3px solid var(--red);
}
.cat-page-header .container { max-width: 1280px; margin: 0 auto; }
.cat-page-header h1 {
    font-family: var(--font-heading);
    font-size: clamp(24px, 4vw, 36px);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.cat-page-header p { color: #aaa; font-size: 14px; margin-top: 4px; }

/* ---- Mobile sticky ad ---- */
.mobile-sticky-ad {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 997;
    background: var(--bg);
    border-top: 1px solid var(--border);
    padding: 4px;
    text-align: center;
}
@media (max-width: 768px) { .mobile-sticky-ad { display: block; } }

/* ---- Global image auto-fit ---- */
.card-image-wrap img,
.article-image-wrap img,
.recent-img,
.story-thumb,
.search-result-img {
    object-fit: cover;
    object-position: center;
}
.featured-sidebar .card-image-wrap {
    overflow: hidden;
}
.featured-sidebar .card-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}
.cat-stories-grid .card-image-wrap img {
    width: 120px;
    height: 90px;
    object-fit: cover;
    object-position: center;
}

/* ---- WhatsApp Float Button ---- */
#wa-float {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 52px;
    height: 52px;
    background: #25D366;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 16px rgba(37,211,102,0.5);
    z-index: 996;
    transition: all 0.3s;
    opacity: 0;
    pointer-events: none;
    text-decoration: none;
}
#wa-float.visible {
    opacity: 1;
    pointer-events: all;
}
#wa-float:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37,211,102,0.7);
}
#wa-float .wa-tooltip {
    position: absolute;
    right: 60px;
    background: #111;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    font-family: var(--font-body);
}
#wa-float:hover .wa-tooltip { opacity: 1; }
