/* ==========================================================================
   Geopolitics Tracker — Warm Editorial Theme
   Inspired by Foreign Policy / The Economist
   ========================================================================== */

/* --- CSS Custom Properties --- */
:root {
    --bg-primary: #f5f0e8;
    --bg-secondary: #ece6db;
    --bg-card: #ffffff;
    --bg-card-hover: #faf8f5;
    --bg-code: #1a1a2e;
    --text-primary: #0a0a0c;
    --text-secondary: #4a4540;
    --text-muted: #6b6560;
    --accent: #8b1a1a;
    --accent-hover: #a82828;
    --accent-light: rgba(139, 26, 26, 0.1);
    --red: #8b1a1a;
    --red-dark: rgba(139, 26, 26, 0.1);
    --gold: #b8860b;
    --green: #2d6a4f;
    --border: #d4cdc4;
    --border-light: #e0d9d0;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.1);
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-serif: 'Georgia', 'Times New Roman', serif;
    --font-mono: 'JetBrains Mono', Consolas, monospace;
    --max-width: 1200px;
    --article-width: 760px;
    --radius: 8px;
    --radius-lg: 12px;
    --header-height: 60px;
}

/* --- Reset & Base --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-main);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent-hover);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
    list-style: none;
}

/* --- Utility --- */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --- Site Header (from header.php) --- */
.site-header {
    position: sticky;
    top: 0;
    background: rgba(245, 240, 232, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

.site-logo {
    font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
    font-style: italic;
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: 0.01em;
}

.site-logo:hover {
    color: var(--accent);
}

/* --- Navigation --- */
.main-nav .nav-list {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
}

.nav-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 6px;
    transition: color 0.2s ease, background 0.2s ease;
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

/* Dropdown */
.nav-dropdown {
    position: relative;
}

.dropdown-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 4px;
}

.dropdown-arrow {
    font-size: 0.65rem;
    transition: transform 0.2s ease;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 8px;
    z-index: 50;
    list-style: none;
    margin-top: 4px;
}

.dropdown-open .dropdown-menu {
    display: block;
}

.dropdown-open .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-link {
    display: block;
    padding: 8px 12px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    border-radius: 6px;
    transition: background 0.15s ease, color 0.15s ease;
}

.dropdown-link:hover {
    background: var(--accent-light);
    color: var(--accent);
}

/* Mobile menu toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    flex-direction: column;
    gap: 5px;
}

.hamburger-line {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

/* --- Hero Section (home.php) --- */
.hero-section {
    margin-bottom: 40px;
}

.hero-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.hero-image-wrapper {
    position: relative;
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    overflow: hidden;
    min-height: 420px;
    background: var(--bg-card);
}

.hero-image {
    width: 100%;
    height: 420px;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.hero-link:hover .hero-image {
    transform: scale(1.02);
}

.hero-image--placeholder {
    height: 420px;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--border-light) 100%);
}

.hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 48px 40px 40px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.4) 60%, transparent 100%);
}

.hero-content {
    max-width: 700px;
}

.hero-category {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #fff;
    background: var(--accent);
    padding: 4px 12px;
    border-radius: 4px;
    margin-bottom: 12px;
}

.hero-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.2;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.hero-excerpt {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.6;
    margin-bottom: 8px;
}

.hero-date {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
}

/* --- Content Layout (home.php grid + sidebar) --- */
.content-layout {
    display: flex;
    gap: 40px;
    margin-top: 20px;
}

.content-main {
    flex: 1;
    min-width: 0;
}

.content-sidebar {
    width: 280px;
    flex-shrink: 0;
}

/* --- Article Grid --- */
.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

/* --- Article Card (article-card.php) --- */
.article-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.article-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-light);
}

.article-card-image-link {
    display: block;
    height: 180px;
    overflow: hidden;
}

.article-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.article-card:hover .article-card-image {
    transform: scale(1.05);
}

.article-card-image--placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--border-light) 100%);
}

.article-card-body {
    padding: 20px;
}

.article-card-category {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    margin-bottom: 8px;
}

.article-card-category:hover {
    color: var(--accent-hover);
}

.article-card-title {
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-card-title a {
    color: var(--text-primary);
    text-decoration: none;
}

.article-card-title a:hover {
    color: var(--accent);
}

.article-card-excerpt {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-card-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* --- Sidebar Widgets (home.php) --- */
.sidebar-widget {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 24px;
}

.sidebar-widget-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.sidebar-categories {
    list-style: none;
}

.sidebar-categories li {
    margin-bottom: 2px;
}

.sidebar-categories a {
    display: block;
    padding: 8px 12px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    border-radius: 6px;
    transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-categories a:hover {
    background: var(--accent-light);
    color: var(--accent);
}

/* --- Single Article Page (article.php) --- */
.single-article .article-header {
    max-width: var(--article-width);
    margin: 40px auto 24px;
    padding: 0 24px;
    text-align: center;
}

.article-category-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    background: var(--accent-light);
    padding: 5px 14px;
    border-radius: 4px;
    margin-bottom: 16px;
}

.article-category-badge:hover {
    color: var(--accent-hover);
}

.article-title {
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--text-primary);
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.article-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.meta-separator {
    color: var(--text-muted);
}

.reading-time {
    color: var(--text-muted);
}

/* Featured image */
.article-featured-image {
    max-width: var(--max-width);
    margin: 24px auto 40px;
    padding: 0 24px;
}

.article-featured-image img {
    width: 100%;
    border-radius: var(--radius-lg);
}

/* Article iframe — full CSS isolation for user HTML documents */
.article-frame {
    display: block;
    width: 100%;
    min-height: 400px;
    border: none;
    border-radius: var(--radius);
    overflow: hidden;
}

/* Article content — for simple HTML (no full document) */
.article-content {
    max-width: var(--article-width);
    margin: 0 auto;
    padding: 0 24px 60px;
    font-size: 1.1rem;
    line-height: 1.85;
    color: var(--text-primary);
    position: relative;
    z-index: 1;
}

.article-content h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-top: 48px;
    margin-bottom: 16px;
    line-height: 1.25;
    color: var(--text-primary);
}

.article-content h2 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-top: 40px;
    margin-bottom: 16px;
    line-height: 1.3;
    color: var(--text-primary);
}

.article-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 32px;
    margin-bottom: 12px;
    line-height: 1.4;
    color: var(--text-primary);
}

.article-content p {
    margin-bottom: 20px;
}

.article-content ul,
.article-content ol {
    margin-bottom: 20px;
    padding-left: 24px;
}

.article-content ul { list-style: disc; }
.article-content ol { list-style: decimal; }

.article-content li {
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.article-content blockquote {
    border-left: 3px solid var(--accent);
    padding: 16px 24px;
    margin: 24px 0;
    background: var(--bg-secondary);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-style: italic;
    color: var(--text-secondary);
}

.article-content blockquote p:last-child {
    margin-bottom: 0;
}

.article-content pre {
    background: var(--bg-code);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    overflow-x: auto;
    margin-bottom: 20px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.6;
}

.article-content code {
    font-family: var(--font-mono);
    font-size: 0.875em;
    background: var(--bg-code);
    padding: 2px 6px;
    border-radius: 4px;
}

.article-content pre code {
    background: none;
    padding: 0;
}

.article-content img {
    max-width: 100%;
    border-radius: var(--radius);
    margin: 24px 0;
}

.article-content a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.article-content a:hover {
    color: var(--accent-hover);
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 24px;
    font-size: 0.95rem;
}

.article-content th,
.article-content td {
    padding: 12px 16px;
    border: 1px solid var(--border);
    text-align: left;
}

.article-content th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-primary);
}

.article-content td {
    color: var(--text-secondary);
}

.article-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 40px 0;
}

.article-content strong {
    color: var(--text-primary);
    font-weight: 600;
}

.article-content em {
    color: var(--text-secondary);
}

/* --- Related Articles (article.php) --- */
.related-articles {
    border-top: 1px solid var(--border);
    padding-top: 40px;
    margin-top: 20px;
}

.section-heading {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text-primary);
}

/* --- Pagination (home.php) --- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px 0;
}

.pagination-link {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-secondary);
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.pagination-link:hover {
    background: var(--bg-card);
    border-color: var(--accent);
    color: var(--accent);
}

.pagination-info {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.pagination-disabled {
    opacity: 0.3;
    pointer-events: none;
}

/* --- Ad Slots --- */
.ad-slot {
    display: none; /* Hidden until ad code is inserted */
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    text-align: center;
    min-height: 90px;
    margin: 24px 0;
}

/* Show ad slots that have actual ad content (not just a comment) */
.ad-slot:has(iframe),
.ad-slot:has(ins),
.ad-slot:has(script) {
    display: flex;
}

.ad-slot-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* --- Section Label --- */
.section-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

/* --- Explore Topics Section --- */
.topics-section {
    padding: 48px 0 20px;
}

.topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.topic-card {
    display: block;
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
    padding: 24px;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.topic-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
    border-left-color: var(--accent);
}

.topic-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.topic-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 8px;
}

.topic-arrow {
    font-size: 0.85rem;
    color: var(--accent);
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    display: inline-block;
}

.topic-card:hover .topic-arrow {
    opacity: 1;
    transform: translateX(3px);
}

/* --- Mission / About Section --- */
.mission-section {
    padding: 20px 0 40px;
}

.mission-inner {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 48px;
    text-align: center;
    max-width: 720px;
    margin: 0 auto;
}

.mission-heading {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    letter-spacing: -0.01em;
}

.mission-text {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 20px;
}

.mission-link {
    display: inline-block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    padding: 10px 24px;
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    transition: background 0.2s ease, color 0.2s ease;
}

.mission-link:hover {
    background: var(--accent);
    color: #fff;
}

/* --- Empty Hero (no articles) --- */
.empty-hero {
    padding: 80px 0 40px;
    text-align: center;
}

.empty-hero-inner {
    max-width: 600px;
    margin: 0 auto;
}

.empty-hero-title {
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin-bottom: 16px;
}

.empty-hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 24px;
}

.empty-hero-note {
    font-size: 0.875rem;
    color: var(--text-muted);
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

/* --- Empty State (legacy) --- */
.empty-state {
    text-align: center;
    padding: 80px 24px;
}

.empty-state h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 1rem;
    color: var(--text-muted);
}

/* --- Site Footer (footer.php) --- */
.site-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 32px 0;
    margin-top: 60px;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-links a {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.footer-links a:hover {
    color: var(--accent);
}

.footer-copyright {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* --- 404 Page --- */
.error-page {
    text-align: center;
    padding: 100px 24px;
}

.error-page h1 {
    font-size: 4rem;
    font-weight: 800;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.error-page p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.error-page a {
    color: var(--accent);
    font-weight: 500;
}

/* --- About Page --- */
.about-page {
    max-width: var(--article-width);
    margin: 40px auto 60px;
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-primary);
}

.about-page h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 24px;
}

.about-page h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-top: 36px;
    margin-bottom: 12px;
}

.about-page p {
    margin-bottom: 16px;
    color: var(--text-secondary);
}

.about-page ul {
    list-style: none;
    margin-bottom: 16px;
}

.about-page li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
}

.about-page li:last-child {
    border-bottom: none;
}

.about-page a {
    color: var(--accent);
}

/* --- Reading Progress Bar --- */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: var(--accent);
    z-index: 200;
    transition: width 0.1s linear;
}

/* --- Category Page --- */
.category-header {
    padding: 40px 0 20px;
}

.category-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
}

.category-header p {
    font-size: 1rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* --- Article Card Footer (date + reading time) --- */
.article-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.article-card-reading-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* --- Article Author Byline --- */
.article-author {
    font-weight: 500;
    color: var(--text-secondary);
}

/* --- Share Buttons (article.php) --- */
.article-share {
    max-width: var(--article-width);
    margin: 0 auto;
    padding: 32px 24px 40px;
    display: flex;
    align-items: center;
    gap: 16px;
    border-top: 1px solid var(--border);
}

.share-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    white-space: nowrap;
}

.share-buttons {
    display: flex;
    gap: 8px;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    font-family: inherit;
}

.share-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.share-twitter:hover { color: #000; border-color: #000; }
.share-linkedin:hover { color: #0077b5; border-color: #0077b5; }
.share-whatsapp:hover { color: #25d366; border-color: #25d366; }
.share-copy.copied { color: var(--green); border-color: var(--green); background: rgba(45, 106, 79, 0.08); }

/* --- Newsletter Section --- */
.newsletter-section {
    padding: 20px 0;
}

.newsletter-inner {
    background: var(--bg-code);
    border-radius: var(--radius-lg);
    padding: 48px;
    text-align: center;
    max-width: 720px;
    margin: 0 auto;
}

.newsletter-heading {
    font-size: 1.5rem;
    font-weight: 700;
    color: #f1f5f9;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.newsletter-text {
    font-size: 0.95rem;
    color: #94a3b8;
    line-height: 1.6;
    margin-bottom: 24px;
}

.newsletter-form {
    display: flex;
    gap: 10px;
    max-width: 440px;
    margin: 0 auto;
}

.newsletter-input {
    flex: 1;
    padding: 12px 16px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: var(--radius);
    color: #f1f5f9;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.newsletter-input::placeholder {
    color: #64748b;
}

.newsletter-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(139, 26, 26, 0.2);
}

.newsletter-btn {
    padding: 12px 24px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.newsletter-btn:hover {
    background: var(--accent-hover);
}

.newsletter-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.newsletter-msg {
    margin-top: 12px;
    font-size: 0.85rem;
    min-height: 1.2em;
}

.newsletter-msg.success { color: #4ade80; }
.newsletter-msg.error { color: #f87171; }

/* --- Category Color Coding --- */
.article-card-category[href*="/analysis"] { color: #2563eb; }
.article-card-category[href*="/conflict"] { color: var(--accent); }
.article-card-category[href*="/diplomacy"] { color: var(--green); }
.article-card-category[href*="/defense"] { color: #7c3aed; }
.article-card-category[href*="/trade"] { color: var(--gold); }
.article-card-category[href*="/energy"] { color: #ea580c; }

.article-category-badge[href*="/analysis"] { color: #2563eb; background: rgba(37, 99, 235, 0.1); }
.article-category-badge[href*="/conflict"] { color: var(--accent); background: var(--accent-light); }
.article-category-badge[href*="/diplomacy"] { color: var(--green); background: rgba(45, 106, 79, 0.1); }
.article-category-badge[href*="/defense"] { color: #7c3aed; background: rgba(124, 58, 237, 0.1); }
.article-category-badge[href*="/trade"] { color: var(--gold); background: rgba(184, 134, 11, 0.1); }
.article-category-badge[href*="/energy"] { color: #ea580c; background: rgba(234, 88, 12, 0.1); }

.hero-category[class] { background: var(--accent); color: #fff; }

/* --- Sticky Table of Contents --- */
.article-toc {
    max-width: var(--article-width);
    margin: 0 auto 32px;
    padding: 0 24px;
}

.toc-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
}

.toc-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.toc-list {
    list-style: none;
    padding: 0;
}

.toc-list li {
    margin-bottom: 6px;
}

.toc-list a {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 4px 0;
    display: block;
    border-left: 2px solid transparent;
    padding-left: 12px;
    transition: all 0.15s ease;
}

.toc-list a:hover,
.toc-list a.active {
    color: var(--accent);
    border-left-color: var(--accent);
}

.toc-list .toc-h3 {
    padding-left: 28px;
    font-size: 0.825rem;
}
