/* ---------------------------------------------------------------
   ethiopia-regions-map — docs site styles
   Clean, single-file, no framework. Light/dark via prefers-color-scheme.
   --------------------------------------------------------------- */

:root {
  --bg: #ffffff;
  --bg-alt: #f8fafc;
  --bg-card: #ffffff;
  --fg: #0f172a;
  --fg-dim: #475569;
  --fg-mute: #94a3b8;
  --border: #e2e8f0;
  --accent: #14532d;       /* deep green — matches default palette */
  --accent-soft: #dcfce7;
  --accent-hi: #22c55e;
  --code-bg: #f1f5f9;
  --code-fg: #0f172a;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 12px rgba(15, 23, 42, 0.06);
  --radius: 12px;
  --content: 1100px;
  --content-narrow: 720px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1220;
    --bg-alt: #0f172a;
    --bg-card: #131c2e;
    --fg: #e2e8f0;
    --fg-dim: #94a3b8;
    --fg-mute: #64748b;
    --border: #1e293b;
    --accent: #4ade80;
    --accent-soft: #14532d;
    --accent-hi: #86efac;
    --code-bg: #0a1020;
    --code-fg: #e2e8f0;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 4px 16px rgba(0, 0, 0, 0.4);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui,
    "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover { color: var(--accent-hi); text-decoration: underline; }

code, pre {
  font-family: "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  font-size: 0.92em;
}

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

.section { padding: 64px 0; border-top: 1px solid var(--border); }
.section-alt { background: var(--bg-alt); }
.section-lead {
  color: var(--fg-dim);
  font-size: 1.05rem;
  margin: 0.25rem 0 1.5rem;
  max-width: 60ch;
}

h1, h2, h3 { letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 4vw, 3rem); line-height: 1.15; margin: 0 0 1rem; }
h2 { font-size: 1.65rem; margin: 0 0 0.25rem; }
h3 { font-size: 1.05rem; margin: 0 0 0.75rem; }

/* ---------------------------------------------------------------
   Header
   --------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in oklab, var(--bg) 90%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  padding-bottom: 12px;
}
.brand { display: flex; align-items: center; gap: 8px; color: var(--fg); }
.brand strong { font-weight: 600; }
.logo { font-size: 1.2rem; }
.site-nav { display: flex; align-items: center; gap: 20px; }
.site-nav a {
  color: var(--fg-dim);
  font-size: 0.92rem;
  font-weight: 500;
}
.site-nav a:hover { color: var(--fg); text-decoration: none; }
.site-nav .nav-cta {
  background: var(--accent);
  color: #fff;
  padding: 6px 12px;
  border-radius: 8px;
}
.site-nav .nav-cta:hover { background: var(--accent-hi); color: #fff; }
@media (max-width: 640px) {
  .site-nav a:not(.nav-cta) { display: none; }
}

/* ---------------------------------------------------------------
   Hero
   --------------------------------------------------------------- */
.hero { padding: 72px 0 56px; }
.hero h1 .accent { color: var(--accent); }
.lead {
  font-size: 1.15rem;
  color: var(--fg-dim);
  max-width: 64ch;
  margin: 0 0 28px;
}

.install-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 8px 8px 16px;
  margin-bottom: 18px;
  max-width: 100%;
  overflow: hidden;
}
.install-box code {
  color: var(--code-fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.install-box button {
  background: var(--accent);
  color: #fff;
  border: 0;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: background 0.15s;
}
.install-box button:hover { background: var(--accent-hi); }
.install-box button.copied { background: var(--accent-hi); }

.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--fg);
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-hi); color: #fff; border-color: var(--accent-hi); }
.btn-soft {
  background: var(--bg-card);
  color: var(--fg-dim);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
}
.btn-soft:hover { color: var(--fg); border-color: var(--accent); }

.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badges img { height: 22px; }

/* ---------------------------------------------------------------
   Demo
   --------------------------------------------------------------- */
.demo-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.demo-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.demo-controls label {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
  color: var(--fg-dim);
}
.demo-controls label.check {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--fg);
}
.demo-controls select {
  font: inherit;
  font-size: 0.92rem;
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
}
.demo-controls select:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}

.demo-map { min-height: 220px; }
.demo-map svg { width: 100%; height: auto; display: block; }
.demo-map .ethiopia-region {
  cursor: pointer;
  transition: opacity 0.12s ease;
}
.demo-map .ethiopia-region:hover { opacity: 0.7; }
.demo-map .ethiopia-region.is-active {
  stroke-width: 2.4;
  stroke: var(--fg);
}

.demo-readout {
  font-size: 0.92rem;
  color: var(--fg-dim);
  padding-top: 14px;
  border-top: 1px solid var(--border);
  margin-top: 14px;
  min-height: 1.5em;
}
.demo-readout strong { color: var(--fg); }

/* ---------------------------------------------------------------
   Snippets
   --------------------------------------------------------------- */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 18px;
}
.snippet {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.snippet h3 { margin-top: 0; color: var(--fg); }
.snippet pre {
  background: var(--code-bg);
  color: var(--code-fg);
  padding: 14px 16px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.55;
}
.snippet pre code { background: transparent; padding: 0; }

/* ---------------------------------------------------------------
   Configuration section
   --------------------------------------------------------------- */
.cfg-group {
  margin-top: 32px;
  margin-bottom: 10px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-dim);
}
.cfg-group:first-of-type { margin-top: 12px; }
.cfg-note {
  font-size: 0.9rem;
  color: var(--fg-dim);
  background: var(--code-bg);
  border-left: 3px solid var(--accent);
  padding: 12px 16px;
  border-radius: 0 8px 8px 0;
  margin: 18px 0 8px;
}

.palette-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}
.palette-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}
.palette-card h4 {
  margin: 0 0 8px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--fg);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.palette-card h4 code {
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--fg-dim);
  background: var(--code-bg);
  padding: 1px 6px;
  border-radius: 4px;
}
.palette-strip {
  display: flex;
  height: 24px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.palette-strip span { flex: 1; }

.presets-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.preset-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.preset-card h4 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--fg);
}
.preset-card .preset-mini {
  background: var(--bg-alt);
  border-radius: 8px;
  padding: 6px;
  overflow: hidden;
}
.preset-card .preset-mini svg { width: 100%; height: auto; display: block; }
.preset-card pre {
  background: var(--code-bg);
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 0.78rem;
  margin: 0;
  overflow-x: auto;
  line-height: 1.45;
}

/* ---------------------------------------------------------------
   CDN sub-section inside Quick start
   --------------------------------------------------------------- */
.cdn-subheading {
  margin-top: 40px;
  margin-bottom: 4px;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--fg);
}
.cdn-subheading code {
  font-size: 0.9em;
  color: var(--accent);
  background: transparent;
  padding: 0;
}
.snippet-wide {
  grid-column: 1 / -1;
  margin-top: 18px;
}

/* ---------------------------------------------------------------
   Tables
   --------------------------------------------------------------- */
.table-wrap {
  overflow-x: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
th, td {
  text-align: left;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}
th {
  font-weight: 600;
  color: var(--fg);
  background: var(--bg-alt);
  position: sticky;
  top: 0;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
td code {
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85em;
}
tr:last-child td { border-bottom: 0; }

/* ---------------------------------------------------------------
   Footer
   --------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0 40px;
  background: var(--bg-alt);
  font-size: 0.9rem;
  color: var(--fg-dim);
}
.site-footer p { margin: 0 0 6px; }
.copyright { color: var(--fg-mute); font-size: 0.85rem; }

/* ---------------------------------------------------------------
   Inline code in prose
   --------------------------------------------------------------- */
p code, li code {
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

/* ---------------------------------------------------------------
   Reduce motion if user prefers
   --------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
