/* Nabu.NET documentation site */
:root {
  --bg: #ffffff;
  --bg-soft: #f6f8fa;
  --bg-code: #f6f8fa;
  --text: #1f2328;
  --text-soft: #59636e;
  --accent: #0b5cad;
  --accent-strong: #0a4f95;
  --border: #d1d9e0;
  --hero-bg: linear-gradient(135deg, #0b3054 0%, #0b5cad 60%, #1173d4 100%);
  --hero-text: #ffffff;
  --badge-bg: #ddf4ff;
  --badge-text: #0b5cad;
  --table-stripe: #f6f8fa;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --bg-soft: #161b22;
    --bg-code: #161b22;
    --text: #e6edf3;
    --text-soft: #9198a1;
    --accent: #58a6ff;
    --accent-strong: #79b8ff;
    --border: #30363d;
    --hero-bg: linear-gradient(135deg, #0a2540 0%, #0b3d6e 60%, #0b5cad 100%);
    --hero-text: #e6edf3;
    --badge-bg: #0b3d6e;
    --badge-text: #9ecbff;
    --table-stripe: #161b22;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

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

code, pre {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.9em;
}

code {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1em 0.35em;
}

pre {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  overflow-x: auto;
  line-height: 1.5;
}

pre code { background: none; border: none; padding: 0; }

/* Header / nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.site-header .inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0.65rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand:hover { text-decoration: none; }
.brand img { width: 26px; height: 26px; }

.site-nav { display: flex; gap: 1rem; flex-wrap: wrap; margin-left: auto; }

.site-nav a {
  color: var(--text-soft);
  font-size: 0.95rem;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover { color: var(--accent); text-decoration: none; }
.site-nav a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }

/* Hero */
.hero {
  background: var(--hero-bg);
  color: var(--hero-text);
  padding: 4rem 1.25rem 4.5rem;
  text-align: center;
}

.hero h1 {
  font-size: clamp(1.8rem, 4.5vw, 2.9rem);
  margin: 0 auto 1rem;
  max-width: 820px;
  line-height: 1.2;
}

.hero p.tagline {
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  max-width: 720px;
  margin: 0 auto 2rem;
  opacity: 0.92;
}

.hero .actions { display: flex; gap: 0.9rem; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-block;
  padding: 0.7rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  border: 1px solid transparent;
}

.btn-primary { background: #ffffff; color: #0b3054; }
.btn-primary:hover { background: #eef4fb; text-decoration: none; }
.btn-ghost { border-color: rgba(255, 255, 255, 0.6); color: var(--hero-text); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.12); text-decoration: none; }

.hero pre {
  max-width: 640px;
  margin: 2.25rem auto 0;
  text-align: left;
  background: rgba(0, 0, 0, 0.35);
  border-color: rgba(255, 255, 255, 0.25);
  color: #e6edf3;
}

/* Layout */
main { max-width: 1080px; margin: 0 auto; padding: 2rem 1.25rem 4rem; }

article.doc { max-width: 820px; margin: auto; }

h1 { font-size: 2rem; line-height: 1.25; margin: 0.5rem 0 1rem; }
h2 { font-size: 1.5rem; margin-top: 2.5rem; padding-bottom: 0.3rem; border-bottom: 1px solid var(--border); }
h3 { font-size: 1.2rem; margin-top: 2rem; }

h2 a.anchor, h3 a.anchor { color: inherit; }
h2 a.anchor:hover, h3 a.anchor:hover { color: var(--accent); text-decoration: none; }

.lede { font-size: 1.1rem; color: var(--text-soft); }

/* Feature grid */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin: 2.5rem 0;
}

.feature {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1.4rem;
  background: var(--bg-soft);
}

.feature h3 { margin: 0 0 0.5rem; font-size: 1.05rem; }
.feature p { margin: 0; color: var(--text-soft); font-size: 0.95rem; }

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: 0.95rem;
  display: block;
  overflow-x: auto;
}

th, td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.8rem;
  text-align: left;
  vertical-align: top;
}

th { background: var(--bg-soft); }
tbody tr:nth-child(even) { background: var(--table-stripe); }

/* Callouts */
.note, .warning {
  border-left: 4px solid var(--accent);
  background: var(--bg-soft);
  border-radius: 0 8px 8px 0;
  padding: 0.8rem 1.1rem;
  margin: 1.25rem 0;
}

.warning { border-left-color: #d4a72c; }

/* Prev / next pager */
.pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.pager a {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.7rem 1.1rem;
  max-width: 48%;
}

.pager a:hover { border-color: var(--accent); text-decoration: none; }
.pager .dir { display: block; font-size: 0.8rem; color: var(--text-soft); }

/* FAQ */
details.faq {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1.1rem;
  margin: 0.75rem 0;
  background: var(--bg-soft);
}

details.faq summary { cursor: pointer; font-weight: 600; }
details.faq[open] summary { margin-bottom: 0.5rem; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 1.25rem;
  color: var(--text-soft);
  font-size: 0.9rem;
}

.site-footer .inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-footer a { color: var(--text-soft); text-decoration: underline; }
.site-footer a:hover { color: var(--accent); }

/* Badges row */
.badges { display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; margin-top: 1.5rem; }
.badges img { height: 20px; }

@media (max-width: 640px) {
  .hero { padding: 3rem 1rem; }
  .pager a { max-width: 100%; }
}
