/* =========================================================
   SOUTH SUDAN OBSERVATORY (SS-O)
   Global Style Sheet — Full Framework
   ========================================================= */

/* ---------------------------------------------------------
   RESET & BASE
--------------------------------------------------------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", sans-serif;
  background: #0b0f19;
  color: #e5e7eb;
  line-height: 1.6;
  overflow-x: hidden;
}

body[data-theme="light"] {
  background: #ffffff;
  color: #1e293b;
}

img {
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ---------------------------------------------------------
   LAYOUT CONTAINERS
--------------------------------------------------------- */
.container {
  width: 92%;
  max-width: 1180px;
  margin: 0 auto;
}

.section {
  padding: 3rem 0;
}

.section-alt {
  background: rgba(255,255,255,0.04);
}

body[data-theme="light"] .section-alt {
  background: rgba(0,0,0,0.03);
}

/* ---------------------------------------------------------
   THEME VARIABLES
--------------------------------------------------------- */
:root {
  --accent: #ffd15b;
  --text-main: #e5e7eb;
  --text-muted: #9ca3af;
  --text-soft: #94a3b8;

  --bg-main: #0b0f19;
  --bg-card: #111827;
  --border-subtle: rgba(255,255,255,0.12);
  --shadow-soft: 0 4px 10px rgba(0,0,0,0.25);

  --r-md: 12px;
}

body[data-theme="light"] {
  --text-main: #1e293b;
  --text-muted: #4b5563;
  --text-soft: #64748b;

  --bg-main: #ffffff;
  --bg-card: #f8fafc;
  --border-subtle: rgba(0,0,0,0.15);
  --shadow-soft: 0 2px 6px rgba(0,0,0,0.08);
}

/* =========================================================
   HEADER & NAVIGATION
========================================================= */
.site-header {
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 900;
}

body[data-theme="light"] .site-header {
  background: rgba(255,255,255,0.7);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 0;
}

/* Brand */
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.brand-mark {
  background: var(--accent);
  color: #000;
  font-weight: 800;
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
  font-size: 1rem;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.brand-tagline {
  font-size: 0.7rem;
  color: var(--text-soft);
}

/* Main nav */
.main-nav {
  display: flex;
  gap: 1.2rem;
  align-items: center;
}

.main-nav a {
  font-size: 0.9rem;
  padding: 0.3rem 0;
  color: var(--text-muted);
  transition: 0.2s ease;
}

.main-nav a:hover {
  color: var(--accent);
}

.main-nav .nav-active {
  color: var(--accent);
  font-weight: 600;
}

/* Theme Toggle */
.theme-toggle {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1.2rem;
  margin-left: 0.4rem;
}

.theme-icon {
  font-size: 1.2rem;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-toggle-line {
  width: 28px;
  height: 3px;
  background: var(--text-main);
  border-radius: 6px;
}

/* Mobile Menu */
@media (max-width: 760px) {
  .nav-toggle {
    display: flex;
  }

  .main-nav {
    position: absolute;
    top: 62px;
    right: 0;
    background: var(--bg-card);
    flex-direction: column;
    width: 60%;
    padding: 1rem;
    border-left: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
    display: none;
  }

  .main-nav.nav-open {
    display: flex;
  }
}

/* =========================================================
   HERO SECTION (Vertical Observatory Stack)
========================================================= */
.hero {
  padding: 4.5rem 0 3rem;
  background: var(--bg-main);
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 2rem;
  align-items: center;
}

.hero-kicker {
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hero-title {
  margin-top: 0.6rem;
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--text-main);
}

.hero-sub {
  color: var(--text-muted);
  margin: 0.7rem 0 1.3rem;
  max-width: 520px;
}

.hero-btn {
  padding: 0.7rem 1.3rem;
  background: var(--accent);
  color: #000;
  border-radius: 8px;
  font-weight: 600;
  display: inline-block;
}

.hub-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
}

.hub-block {
  background: var(--bg-card);
  padding: 0.65rem 1rem;
  width: 240px;
  text-align: center;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  font-weight: 600;
  box-shadow: var(--shadow-soft);
}

.hub-core {
  width: 110px;
  height: 110px;
  background: var(--accent);
  border-radius: 50%;
  color: #000;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 18px rgba(255,200,80,0.45);
}

/* Color accents */
.hub-block.governance { border-left: 4px solid #7fa6ff; }
.hub-block.security { border-left: 4px solid #ff8a8a; }
.hub-block.economy { border-left: 4px solid #ffd580; }
.hub-block.humanitarian { border-left: 4px solid #ffb4e6; }

/* Mobile hero */
@media (max-width: 780px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

/* =========================================================
   OBSERVATORIES CARDS
========================================================= */
.obs-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 1.5rem;
}

@media (max-width: 760px) {
  .obs-grid {
    grid-template-columns: 1fr;
  }
}

.obs-card {
  background: var(--bg-card);
  padding: 1.5rem;
  border-radius: var(--r-md);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-soft);
}

.obs-card h2 {
  margin-bottom: 0.5rem;
}

.obs-card ul {
  margin-top: 0.6rem;
  padding-left: 1.2rem;
  color: var(--text-soft);
}

.card-link {
  margin-top: 0.9rem;
  display: inline-block;
  color: var(--accent);
}

/* =========================================================
   SUBSCRIBE BOX
========================================================= */
.subscribe-box {
  text-align: center;
}

.subscribe-form {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  gap: 0.6rem;
}

.subscribe-form input {
  padding: 0.6rem;
  border-radius: var(--r-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-main);
}

.subscribe-form button {
  padding: 0.6rem 1.2rem;
  background: var(--accent);
  color: #000;
  border-radius: var(--r-md);
  border: none;
  font-weight: 600;
}

/* =========================================================
   INSIGHTS GRID
========================================================= */
.insights-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 1.5rem;
}

@media (max-width: 900px) {
  .insights-grid {
    grid-template-columns: repeat(2, minmax(0,1fr));
  }
}

@media (max-width: 600px) {
  .insights-grid {
    grid-template-columns: 1fr;
  }
}

.insight-card {
  background: var(--bg-card);
  border-radius: var(--r-md);
  padding: 1.3rem;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-soft);
}

.insight-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  margin-bottom: 0.4rem;
}

.insight-tag {
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  color: #000;
  font-weight: 600;
}

.insight-tag.security { background: #ff8a8a; }
.insight-tag.economy { background: #ffd580; }
.insight-tag.humanitarian { background: #ffb4e6; }
.insight-tag.governance { background: #7fa6ff; }

/* =========================================================
   ARTICLE TEMPLATE
========================================================= */
.breadcrumb {
  padding: 1.2rem 0;
}

.breadcrumb-link {
  color: var(--accent);
  font-size: 0.9rem;
}

.article-hero {
  padding: 1.5rem 0;
}

.article-title {
  font-size: 1.9rem;
  margin: 0.4rem 0 0.8rem;
}

.article-sub {
  color: var(--text-muted);
  max-width: 600px;
}

.article-body {
  padding: 2rem 0;
  max-width: 780px;
  margin: auto;
}

.pull-quote {
  border-left: 4px solid var(--accent);
  padding-left: 1rem;
  margin: 1.4rem 0;
  font-style: italic;
}

/* =========================================================
   MAP HUB (maps.html)
========================================================= */
.map-hub-grid {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 1.5rem;
}

@media (max-width: 900px) {
  .map-hub-grid {
    grid-template-columns: 1fr;
  }
}

.map-panel {
  background: var(--bg-card);
  padding: 1.4rem;
  border-radius: var(--r-md);
  border: 1px solid var(--border-subtle);
}

.map-placeholder {
  margin-top: 0.6rem;
  height: 260px;
  border-radius: var(--r-md);
  border: 1px dashed rgba(255,255,255,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-soft);
}

/* =========================================================
   MAP DASHBOARD (map-dashboard.html)
========================================================= */
.map-dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 1.6rem;
}

@media (max-width: 900px) {
  .map-dashboard-layout {
    grid-template-columns: 1fr;
  }
}

.map-dashboard-main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.map-live-placeholder {
  height: 480px;
  border-radius: var(--r-md);
  border: 1px dashed rgba(255,255,255,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-soft);
  text-align: center;
}

.map-dashboard-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.map-dashboard-sidebar {
  background: var(--bg-card);
  padding: 1.3rem;
  border-radius: var(--r-md);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.sidebar-label {
  font-size: 0.85rem;
  margin-top: 0.4rem;
  margin-bottom: 0.2rem;
  color: var(--text-soft);
}

.map-dashboard-sidebar select {
  width: 100%;
  padding: 0.45rem;
  border-radius: 8px;
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
}

body[data-theme="light"] .map-dashboard-sidebar select {
  background: #fff;
  border-color: #cbd5e1;
}

.checkbox-column label {
  font-size: 0.85rem;
  margin-bottom: 4px;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.legend-color {
  width: 16px;
  height: 16px;
  border-radius: 4px;
}

.legend-low { background: #4ade80; }
.legend-medium { background: #facc15; }
.legend-high { background: #fb7185; }

/* =========================================================
   FOOTER
========================================================= */
.site-footer {
  background: rgba(255,255,255,0.04);
  margin-top: 2rem;
  padding: 2.5rem 0;
}

body[data-theme="light"] .site-footer {
  background: rgba(0,0,0,0.05);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 2rem;
}

@media (max-width: 760px) {
  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

.footer-monogram {
  background: var(--accent);
  color: #000;
  padding: 0.4rem 0.7rem;
  display: inline-block;
  font-weight: 700;
  border-radius: 6px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.footer-links a:hover {
  color: var(--accent);
}