/* ==========================================================================
   Sudan Media Monitor — Base styles
   ========================================================================== */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}

/* Vue uses v-cloak on app roots while JS/locales load; without this rule
   the raw mustache/template state can flash before the page app mounts. */
[v-cloak] { display: none !important; }

body.smf-body {
  font-family: var(--body-font);
  background: var(--grad-subtle);
  color: var(--ink);
  font-size: var(--fs-body);
  min-height: 100vh;
  margin: 0;
}

a { color: var(--tealD); text-decoration: none; }
a:hover { text-decoration: underline; }

/* WCAG 2.2 · visible focus indicator for every keyboard-reachable control.
   Components may override with a stronger ring, but nothing should remove it. */
:focus-visible {
  outline: 2px solid var(--blueD);
  outline-offset: 2px;
  border-radius: 3px;
}
.grad-band :focus-visible,
.smf-topbar :focus-visible { outline-color: #ffffff; }

/* ── top bar ───────────────────────────────────────────────────────────── */
.smf-topbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--topbar-h);
  background: var(--grad); color: #fff; z-index: var(--z-topbar);
  display: flex; align-items: center; gap: 14px; padding: 0 20px;
  box-shadow: 0 2px 12px rgba(19,42,61,.25);
}
.smf-topbar .brand {
  font-family: var(--head-font); font-weight: 700; font-size: 14px;
  text-shadow: 0 1px 3px rgba(0,0,0,.25); white-space: nowrap;
}
.smf-topbar .brand-icon {
  width: 26px; height: 26px; border-radius: 7px;
  background: rgba(255,255,255,.9); flex-shrink: 0;
}
.smf-topbar .topbar-search {
  flex: 1; max-width: 420px; height: 30px;
  border: 1px solid rgba(255,255,255,.5); border-radius: 15px;
  background: rgba(255,255,255,.25); backdrop-filter: blur(4px);
  display: flex; align-items: center; padding: 0 14px; color: #fff; gap: 8px;
  font-size: var(--fs-sm);
}
.smf-topbar .topbar-search input {
  background: none; border: none; color: #fff; font-family: var(--body-font);
  font-size: var(--fs-sm); outline: none; width: 100%;
}
.smf-topbar .topbar-search input::placeholder { color: rgba(255,255,255,.65); }
.smf-topbar .brand-home {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: inherit; flex-shrink: 0;
}
.smf-topbar .topbar-pill {
  border: 1px solid rgba(255,255,255,.55); border-radius: 13px;
  padding: 3px 10px; background: rgba(255,255,255,.18);
  font-size: 11px; color: #fff; font-weight: 600; cursor: pointer;
}
.smf-topbar .topbar-pill.on, .smf-topbar .topbar-pill:hover {
  background: #fff; color: var(--tealD); font-weight: 800;
}

/* ── horizontal nav tabs (below topbar) ────────────────────────────────── */
.smf-navtabs {
  position: fixed; top: var(--topbar-h); inset-inline-start: 0; inset-inline-end: 0;
  height: var(--navtab-h); background: #fff; border-bottom: 1px solid var(--line);
  z-index: var(--z-navtabs); display: flex; align-items: stretch; padding: 0 20px; gap: 2px;
  overflow-x: auto; white-space: nowrap;
  box-shadow: 0 1px 4px rgba(19,42,61,.06);
}
.smf-navtabs a {
  display: inline-flex; align-items: center; gap: 6px; padding: 0 13px;
  font-size: 12px; font-weight: 700; color: var(--mut); text-decoration: none;
  border-bottom: 3px solid transparent; flex-shrink: 0;
}
.smf-navtabs a:hover { color: var(--tealD); }
.smf-navtabs a.active {
  color: var(--tealD); border-bottom-color: var(--cyan);
  background: linear-gradient(180deg, rgba(69,184,201,.07), transparent);
}
.smf-navtabs .nav-divider {
  width: 1px; background: var(--line); margin: 8px 6px; flex-shrink: 0;
}

/* ── sidebar (admin-only) ──────────────────────────────────────────────── */
.smf-sidebar {
  position: fixed; top: calc(var(--topbar-h) + var(--navtab-h)); inset-inline-start: 0; bottom: 0;
  width: var(--sidebar-w); background: rgba(255,255,255,.82);
  backdrop-filter: blur(8px); border-inline-end: 1px solid var(--line);
  padding: 14px 0; overflow-y: auto; z-index: var(--z-sidebar);
  font-size: var(--fs-sm);
}
.smf-sidebar .nav-section {
  font-size: 10px; font-weight: 800; letter-spacing: 1.4px;
  color: var(--faint); padding: 6px 20px; text-transform: uppercase;
}
.smf-sidebar a {
  display: block; padding: 8px 20px; color: var(--mut); text-decoration: none;
  border-inline-start: 3px solid transparent; font-size: var(--fs-sm);
}
.smf-sidebar a:hover { background: rgba(69,184,201,.08); }
.smf-sidebar a.active {
  border-inline-start-color: var(--tealD); background: rgba(69,184,201,.13);
  color: var(--tealD); font-weight: 700;
}
.smf-sidebar a .nav-icon { margin-inline-end: 8px; }

/* ── main area ─────────────────────────────────────────────────────────── */
.smf-main {
  margin-block-start: calc(var(--topbar-h) + var(--navtab-h));
  margin-inline-start: 0;
  padding: 26px 30px 60px;
  max-width: 100vw;
  min-height: calc(100vh - var(--topbar-h) - var(--navtab-h));
  box-sizing: border-box;
}
/* Admin users have the sidebar open — push content right */
.smf-main.has-sidebar {
  margin-inline-start: var(--sidebar-w);
  max-width: calc(100vw - var(--sidebar-w));
}

/* ── footer ────────────────────────────────────────────────────────────── */
.smf-footer {
  margin-inline-start: 0;
  border-top: 1px solid var(--line);
  padding: 16px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 11px;
  color: var(--mut);
  flex-wrap: wrap;
}
.smf-footer.has-sidebar {
  margin-inline-start: var(--sidebar-w);
}
.smf-footer-eu {
  display: flex;
  align-items: center;
  gap: 8px;
}
.smf-footer-eu-flag { font-size: 18px; line-height: 1; }
.smf-footer-eu-text { font-weight: 600; color: var(--ink); }
.smf-footer-eu-grant {
  color: var(--faint);
  font-size: 10px;
}
.smf-footer-copy a { color: var(--mut); }
.smf-footer-copy a:hover { color: var(--tealD); }

/* ── tabs ──────────────────────────────────────────────────────────────── */
.smf-tabs {
  display: flex; gap: 2px; background: #fff;
  border-bottom: 2px solid var(--line); padding: 0 14px; margin-bottom: var(--sp-md);
}
.smf-tab {
  padding: 10px 13px; font-size: 11.5px; font-weight: 700;
  color: var(--faint); border-bottom: 3px solid transparent;
  white-space: nowrap; cursor: pointer;
}
.smf-tab.on {
  color: var(--tealD); border-bottom-color: var(--cyan);
  background: linear-gradient(180deg, rgba(69,184,201,.08), transparent);
}

/* ── glass ─────────────────────────────────────────────────────────────── */
.glass {
  background: linear-gradient(135deg, rgba(255,255,255,.66), rgba(255,255,255,.30));
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.8); border-radius: var(--radius-md);
  box-shadow: var(--shadow-md); padding: 11px 14px; color: var(--ink);
}
.glass h6 {
  font-size: 9.5px; font-weight: 800; letter-spacing: .8px;
  text-transform: uppercase; color: var(--blueD); margin-bottom: 4px;
}

/* ── hero gradient band ────────────────────────────────────────────────── */
.grad-band {
  background: linear-gradient(100deg, #123e58 0%, #0e3249 55%, #09263a 100%);
  border-radius: var(--radius-md);
  min-height: 104px; margin-bottom: var(--sp-md); position: relative;
  overflow: hidden; color: #ffffff; padding: 18px 22px;
}
.grad-band::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(90% 120% at 95% 0%, rgba(69,184,201,.16) 0%, rgba(69,184,201,0) 48%);
}
.grad-band > * { position: relative; }
.grad-band h2 {
  font-family: var(--head-font); font-size: 22px; font-weight: 700;
  margin-bottom: 6px; text-shadow: 0 1px 2px rgba(0,0,0,.18);
  color: #ffffff;
}
.grad-band p {
  font-size: var(--fs-sm); line-height: 1.6; max-width: 660px;
  color: #f3f9fb; text-shadow: 0 1px 2px rgba(0,0,0,.16);
}

/* ── page-level response classes ───────────────────────────────────────── */
.meta-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px; color: var(--faint); font-size: 11px;
}
.kpi-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
  margin-bottom: var(--sp-md);
}
@media (max-width: 1000px) {
  .smf-sidebar { display: none; }
  .smf-main, .smf-main.has-sidebar { margin-inline-start: 0; max-width: 100vw; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .cmp-kpis { grid-template-columns: repeat(3, 1fr); }
}

/* ── mobile bottom nav (≤800px) ────────────────────────────────────────── */
.smf-bottomnav { display: none; }

@media (max-width: 800px) {
  .smf-navtabs { display: none; }
  .smf-bottomnav {
    display: flex;
    position: fixed; bottom: 0; left: 0; right: 0;
    height: 56px; background: #fff;
    border-top: 1px solid var(--line); z-index: var(--z-navtabs);
    justify-content: space-around; align-items: stretch;
    box-shadow: 0 -2px 8px rgba(19,42,61,.08);
  }
  .smf-bottomnav a {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; flex: 1;
    text-decoration: none; color: var(--mut);
    gap: 2px; padding: 4px 2px;
  }
  .smf-bottomnav a.active { color: var(--tealD); }
  .smf-bottomnav .bn-icon { font-size: 17px; line-height: 1; }
  .smf-bottomnav .bn-label { font-size: 9.5px; font-weight: 600; }

  /* More button — same layout as a nav link but is a button */
  .smf-bottomnav .bn-more-btn {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; flex: 1;
    background: none; border: none; cursor: pointer;
    color: var(--mut); gap: 2px; padding: 4px 2px;
    font-family: inherit;
  }
  .smf-bottomnav .bn-more-btn.active { color: var(--tealD); }

  /* More drawer — slides up above the bottom nav */
  .bn-more-drawer {
    position: fixed; bottom: 56px; right: 0;
    background: #fff; border: 1px solid var(--line);
    border-radius: 8px 0 0 0;
    box-shadow: -2px -2px 12px rgba(19,42,61,.12);
    display: flex; flex-direction: column; z-index: calc(var(--z-navtabs) + 1);
    min-width: 160px;
  }
  .bn-more-drawer a {
    padding: 12px 18px; font-size: 13px; font-weight: 600;
    color: var(--dark); text-decoration: none; border-bottom: 1px solid var(--line);
  }
  .bn-more-drawer a:last-child { border-bottom: none; }
  .bn-more-drawer a:hover { background: var(--bg); }

  .smf-main { padding-bottom: calc(56px + 20px); }
}
