/* Surviving South Africa (v2.0.0) - Clean Rugged Theme */
:root {
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --bg-dark: #0f1416;
  --bg-surface: #172023;
  --bg-card: #1b262a;
  --bg-card-hover: #223035;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-subtle: #cbd5e1;
  --border: #2c3e45;
  --border-focus: #47626d;
  --accent: #d97706;
  --accent-light: #f59e0b;
  --accent-hover: #fbbf24;
  --radius: 8px;
  --max-w: 1200px;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -2px rgba(0, 0, 0, 0.4);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-family: var(--font-sans); background: var(--bg-dark); color: var(--text-main); line-height: 1.65; }
body { min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--accent-light); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--accent-hover); text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
.container { width: 100%; max-width: var(--max-w); margin: 0 auto; padding: 0 1.25rem; }

/* Top Ticker */
.top-ticker { background: #0b0f10; border-bottom: 1px solid var(--border); padding: 0.4rem 0; font-size: 0.8rem; color: var(--text-muted); text-align: center; }
.top-ticker span { color: var(--accent-light); font-weight: 600; }

/* Header */
.site-header { background: rgba(23, 32, 35, 0.95); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 100; border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand-link { display: flex; align-items: center; gap: 0.85rem; text-decoration: none; }
.brand-logo { height: 46px; width: auto; }
.brand-titles { display: flex; flex-direction: column; }
.brand-name { font-size: 1.2rem; font-weight: 800; color: #fff; letter-spacing: 0.02em; text-transform: uppercase; }
.brand-tag { font-size: 0.7rem; color: var(--text-muted); font-weight: 500; }

.main-nav { display: flex; align-items: center; gap: 1.5rem; }
.nav-item { color: var(--text-subtle); font-size: 0.95rem; font-weight: 500; }
.nav-item:hover, .nav-item.active { color: var(--accent-light); text-decoration: none; }
.nav-btn { background: var(--accent); color: #fff !important; padding: 0.5rem 1rem; border-radius: var(--radius); font-weight: 600; }
.nav-btn:hover { background: var(--accent-light); text-decoration: none; }
.mobile-btn { display: none; background: none; border: none; color: #fff; font-size: 1.6rem; cursor: pointer; }

/* Hero */
.hero { position: relative; background: #131c1f url('/assets/images/mountains-hero.jpg') center/cover no-repeat; padding: 5rem 0 4.5rem; border-bottom: 2px solid var(--border); }
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(15,20,22,0.85) 0%, rgba(15,20,22,0.96) 100%); }
.hero-inner { position: relative; z-index: 2; max-width: 820px; }
.hero-tag { display: inline-block; background: rgba(217,119,6,0.2); border: 1px solid rgba(217,119,6,0.4); color: var(--accent-light); font-size: 0.78rem; font-weight: 700; text-transform: uppercase; padding: 0.35rem 0.85rem; border-radius: 999px; margin-bottom: 1rem; }
.hero-title { font-size: 2.75rem; font-weight: 900; line-height: 1.2; margin-bottom: 1rem; color: #fff; }
.hero-desc { font-size: 1.2rem; color: var(--text-subtle); margin-bottom: 2rem; line-height: 1.6; }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.75rem 1.5rem; font-size: 0.95rem; font-weight: 600; border-radius: var(--radius); border: none; cursor: pointer; transition: transform 0.1s, background 0.15s; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-light); color: #fff; text-decoration: none; transform: translateY(-1px); }
.btn-outline { background: var(--bg-surface); border: 1px solid var(--border); color: #fff; }
.btn-outline:hover { background: var(--bg-card-hover); color: #fff; text-decoration: none; }

/* Pillars */
.pillars { padding: 3rem 0; background: var(--bg-surface); border-bottom: 1px solid var(--border); }
.pillars-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }
.pillar-box { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.75rem; }
.pillar-box h3 { font-size: 1.2rem; margin-bottom: 0.5rem; color: #fff; }
.pillar-box p { font-size: 0.92rem; color: var(--text-muted); }

/* Section styling */
.section { padding: 4rem 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 2rem; border-bottom: 1px solid var(--border); padding-bottom: 1rem; flex-wrap: wrap; gap: 1rem; }
.section-head h2 { font-size: 1.85rem; color: #fff; }
.section-head p { color: var(--text-muted); font-size: 0.95rem; margin-top: 0.25rem; }

/* Grid */
.articles-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 2rem; }
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: transform 0.2s, border-color 0.2s; box-shadow: var(--shadow); }
.card:hover { transform: translateY(-3px); border-color: var(--accent); background: var(--bg-card-hover); }
.card-img-wrap { position: relative; aspect-ratio: 16/9; overflow: hidden; background: #0c1012; }
.card-img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
.card:hover .card-img { transform: scale(1.03); }
.card-cat { position: absolute; top: 0.75rem; left: 0.75rem; background: rgba(15,20,22,0.85); color: var(--accent-light); font-size: 0.72rem; font-weight: 700; padding: 0.25rem 0.6rem; border-radius: 4px; border: 1px solid var(--border); }
.card-body { padding: 1.4rem; display: flex; flex-direction: column; flex-grow: 1; }
.card-meta { display: flex; gap: 0.8rem; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.card-title { font-size: 1.25rem; line-height: 1.35; margin-bottom: 0.75rem; font-weight: 700; }
.card-title a { color: #fff; text-decoration: none; }
.card-title a:hover { color: var(--accent-light); }
.card-text { font-size: 0.92rem; color: var(--text-subtle); line-height: 1.55; margin-bottom: 1.25rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-foot { margin-top: auto; border-top: 1px solid var(--border); padding-top: 0.85rem; display: flex; justify-content: space-between; font-size: 0.85rem; font-weight: 600; }

/* Filter Tabs */
.filter-tabs { display: flex; gap: 0.5rem; margin-bottom: 2rem; flex-wrap: wrap; }
.filter-btn { background: var(--bg-card); border: 1px solid var(--border); color: var(--text-subtle); padding: 0.5rem 1rem; border-radius: 999px; font-size: 0.85rem; cursor: pointer; text-decoration: none; }
.filter-btn:hover, .filter-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); text-decoration: none; }
.search-box { width: 100%; max-width: 400px; padding: 0.6rem 1rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); color: #fff; font-size: 0.95rem; margin-bottom: 1.5rem; }
.search-box:focus { outline: none; border-color: var(--accent); }

/* Article View */
.article-page { padding: 2.5rem 0 4rem; }
.progress-bar { position: fixed; top: 72px; left: 0; height: 3px; background: var(--accent); z-index: 99; width: 0%; }
.breadcrumbs { display: flex; gap: 0.5rem; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 1.25rem; flex-wrap: wrap; }
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--accent-light); }
.article-header { max-width: 820px; margin-bottom: 2rem; }
.article-title { font-size: 2.5rem; font-weight: 800; line-height: 1.2; color: #fff; margin: 0.5rem 0 1rem; }
.article-meta { display: flex; gap: 1.25rem; font-size: 0.9rem; color: var(--text-muted); flex-wrap: wrap; margin-bottom: 1.5rem; }
.article-banner { border-radius: var(--radius); overflow: hidden; margin-bottom: 2.5rem; border: 1px solid var(--border); }
.article-banner img { width: 100%; max-height: 520px; object-fit: cover; }
.article-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 3rem; }
.article-content { font-size: 1.1rem; line-height: 1.8; color: #e2e8f0; word-break: break-word; }
.article-content p { margin-bottom: 1.5rem; }
.article-content h2 { font-size: 1.7rem; color: #fff; margin: 2.5rem 0 1rem; border-bottom: 1px solid var(--border); padding-bottom: 0.5rem; }
.article-content h3 { font-size: 1.35rem; color: #fff; margin: 2rem 0 0.75rem; }
.article-content ul, .article-content ol { margin: 1rem 0 1.5rem 1.75rem; }
.article-content li { margin-bottom: 0.5rem; }
.article-content blockquote { border-left: 4px solid var(--accent); padding: 0.75rem 1.25rem; background: var(--bg-card); margin: 1.5rem 0; font-style: italic; color: var(--text-subtle); border-radius: 0 6px 6px 0; }
.article-figure { margin: 2rem 0; text-align: center; }
.article-figure img { border-radius: var(--radius); margin: 0 auto; }
.article-figure figcaption { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.5rem; font-style: italic; }

.sidebar-sticky { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 1.5rem; }
.widget { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; }
.widget h4 { font-size: 1.05rem; margin-bottom: 1rem; border-bottom: 1px solid var(--border); padding-bottom: 0.5rem; color: #fff; }
.toc-list { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; font-size: 0.88rem; }
.toc-list a { color: var(--text-muted); }
.toc-list a:hover { color: var(--accent-light); }

/* Author Box */
.author-box { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem; margin: 3rem 0; display: flex; gap: 1.5rem; align-items: flex-start; }
.author-img { width: 72px; height: 72px; border-radius: 999px; border: 2px solid var(--accent); object-fit: cover; flex-shrink: 0; }
.author-info h4 { font-size: 1.2rem; color: #fff; margin-bottom: 0.25rem; }
.author-role { font-size: 0.8rem; color: var(--accent-light); font-weight: 700; text-transform: uppercase; margin-bottom: 0.5rem; }
.author-bio { font-size: 0.95rem; color: var(--text-subtle); line-height: 1.6; }

/* Call To Action */
.cta-box { background: linear-gradient(135deg, #1e2a2e 0%, #151e21 100%); border: 1px solid var(--border); border-radius: var(--radius); padding: 3.5rem 2rem; text-align: center; margin: 4rem 0; }
.cta-box h2 { font-size: 2.2rem; color: #fff; margin-bottom: 1rem; }
.cta-box p { font-size: 1.1rem; color: var(--text-subtle); max-width: 650px; margin: 0 auto 2rem; }

/* Footer */
.site-footer { background: #0b0f10; border-top: 1px solid var(--border); padding: 4rem 0 2rem; margin-top: auto; font-size: 0.9rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.5fr; gap: 2.5rem; margin-bottom: 3rem; }
.footer-col h5 { font-size: 1rem; color: #fff; margin-bottom: 1.25rem; text-transform: uppercase; letter-spacing: 0.05em; }
.footer-links { list-style: none; display: flex; flex-direction: column; gap: 0.6rem; }
.footer-links a { color: var(--text-muted); }
.footer-links a:hover { color: var(--accent-light); }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 2rem; display: flex; justify-content: space-between; color: var(--text-muted); flex-wrap: wrap; gap: 1rem; }

/* POPIA Banner */
.popia-banner { position: fixed; bottom: 1.5rem; left: 1.5rem; right: 1.5rem; max-width: 640px; background: rgba(23,32,35,0.98); backdrop-filter: blur(12px); border: 1px solid var(--accent); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); z-index: 1000; display: flex; flex-direction: column; gap: 1rem; }
.popia-title { display: flex; align-items: center; gap: 0.5rem; font-size: 1.05rem; font-weight: 700; color: var(--accent-light); }
.popia-text { font-size: 0.88rem; color: var(--text-subtle); line-height: 1.5; }
.popia-btns { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.btn-sm { padding: 0.45rem 0.9rem; font-size: 0.82rem; }

/* Modal */
.modal-bg { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.75); z-index: 1100; align-items: center; justify-content: center; padding: 1.25rem; }
.modal-box { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); max-width: 520px; width: 100%; padding: 2rem; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.modal-close { background: none; border: none; color: #fff; font-size: 1.5rem; cursor: pointer; }
.pref-item { padding: 1rem 0; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 1rem; }

/* Responsive */
@media (max-width: 960px) {
  .article-grid { grid-template-columns: 1fr; }
  .sidebar-sticky { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .hero-title { font-size: 2.1rem; }
  .main-nav { display: none; position: absolute; top: 72px; left: 0; right: 0; background: var(--bg-surface); border-bottom: 1px solid var(--border); flex-direction: column; padding: 1.5rem; gap: 1rem; }
  .main-nav.show { display: flex; }
  .mobile-btn { display: block; }
  .footer-grid { grid-template-columns: 1fr; }
  .articles-grid { grid-template-columns: 1fr; }
}
