/* ioniqx docs site — shared styles */

:root {
  --brand:        #0d6efd;
  --brand-dark:   #0b5ed7;
  --brand-light:  #e8f0fe;
  --text-primary: #212529;
  --text-muted:   #6c757d;
  --border:       #dee2e6;
  --bg-light:     #f8f9fa;
  --bg-dark:      #0f1117;
  --radius:       10px;
}

/* ── Reset / base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text-primary);
  line-height: 1.6;
  background: #fff;
}
img { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Nav ──────────────────────────────────────────────────────────────────── */
.site-nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  display: flex; align-items: center; justify-content: space-between;
  height: 60px;
}
.site-nav .brand {
  font-weight: 700; font-size: 1.15rem; color: var(--text-primary);
  letter-spacing: -.02em;
}
.site-nav .brand span { color: var(--brand); }
.nav-links { display: flex; gap: 2rem; align-items: center; }
.nav-links a { color: var(--text-muted); font-size: .9rem; font-weight: 500; }
.nav-links a:hover { color: var(--text-primary); text-decoration: none; }
.nav-links .btn-nav {
  background: var(--brand); color: #fff;
  padding: .4rem 1rem; border-radius: 6px; font-size: .875rem;
}
.nav-links .btn-nav:hover { background: var(--brand-dark); text-decoration: none; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-block; padding: .65rem 1.4rem;
  border-radius: 7px; font-size: .9rem; font-weight: 500;
  cursor: pointer; transition: background .15s, color .15s;
  border: 1.5px solid transparent;
}
.btn-primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); text-decoration: none; }
.btn-outline { background: transparent; color: var(--brand); border-color: var(--brand); }
.btn-outline:hover { background: var(--brand-light); text-decoration: none; }
.btn-lg { padding: .8rem 1.75rem; font-size: 1rem; }

/* ── Section helpers ──────────────────────────────────────────────────────── */
.section { padding: 5rem 2rem; }
.section-sm { padding: 3rem 2rem; }
.section-dark { background: var(--bg-dark); color: #f1f3f5; }
.section-light { background: var(--bg-light); }
.container { max-width: 1080px; margin: 0 auto; }
.section-label {
  text-transform: uppercase; letter-spacing: .12em;
  font-size: .72rem; font-weight: 700; color: var(--brand);
  margin-bottom: .75rem;
}
.section-title {
  font-size: 2rem; font-weight: 700; line-height: 1.25;
  letter-spacing: -.025em; margin-bottom: 1rem;
}
.section-sub {
  font-size: 1.05rem; color: var(--text-muted); max-width: 56ch; margin-bottom: 2.5rem;
}

/* ── Cards ────────────────────────────────────────────────────────────────── */
.card-grid { display: grid; gap: 1.5rem; }
.card-grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.card-grid-2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.card {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.75rem;
}
.card-icon {
  width: 44px; height: 44px; border-radius: 9px;
  background: var(--brand-light); color: var(--brand);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; margin-bottom: 1rem;
}
.card h3 { font-size: 1rem; font-weight: 600; margin-bottom: .4rem; }
.card p  { font-size: .875rem; color: var(--text-muted); }

/* ── Steps ────────────────────────────────────────────────────────────────── */
.steps { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.step { position: relative; padding: 1.5rem; }
.step-num {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--brand); color: #fff;
  font-size: .85rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1rem;
}
.step h3 { font-size: .95rem; font-weight: 600; margin-bottom: .35rem; }
.step p  { font-size: .85rem; color: var(--text-muted); }

/* ── Code blocks ──────────────────────────────────────────────────────────── */
pre, code {
  font-family: "SFMono-Regular", "Cascadia Code", Consolas, "Liberation Mono", Menlo, monospace;
}
pre {
  background: #0f1117; color: #e2e8f0;
  border-radius: var(--radius); padding: 1.25rem 1.5rem;
  overflow-x: auto; font-size: .82rem; line-height: 1.65;
  tab-size: 2;
}
code {
  background: #f1f3f5; color: #c0392b;
  padding: .1em .35em; border-radius: 4px; font-size: .85em;
}
pre code { background: none; color: inherit; padding: 0; font-size: inherit; }

/* ── Syntax token colours (hand-applied via spans) ───────────────────────── */
.tok-kw  { color: #c792ea; }   /* keyword */
.tok-str { color: #c3e88d; }   /* string */
.tok-cm  { color: #546e7a; font-style: italic; } /* comment */
.tok-fn  { color: #82aaff; }   /* function / method name */
.tok-num { color: #f78c6c; }   /* number */
.tok-obj { color: #ffcb6b; }   /* object / identifier */
.tok-op  { color: #89ddff; }   /* operator / punctuation */

/* ── API reference table ──────────────────────────────────────────────────── */
.api-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.api-table th {
  background: var(--bg-light); text-align: left;
  padding: .6rem 1rem; border: 1px solid var(--border);
  font-size: .75rem; text-transform: uppercase; letter-spacing: .06em;
}
.api-table td { padding: .65rem 1rem; border: 1px solid var(--border); vertical-align: top; }
.api-table tr:hover td { background: #fafbfc; }

/* ── Alert / callout ──────────────────────────────────────────────────────── */
.callout {
  display: flex; gap: .75rem; align-items: flex-start;
  padding: 1rem 1.25rem; border-radius: var(--radius);
  font-size: .875rem; margin: 1.5rem 0;
}
.callout-info  { background: #e8f0fe; border-left: 3px solid var(--brand); }
.callout-warn  { background: #fff8e1; border-left: 3px solid #f59e0b; }
.callout-icon  { font-size: 1.1rem; line-height: 1.5; flex-shrink: 0; }

/* ── Sidebar layout (docs pages) ─────────────────────────────────────────── */
.docs-layout { display: grid; grid-template-columns: 220px 1fr; gap: 0; min-height: calc(100vh - 60px); }
.docs-sidebar {
  position: sticky; top: 60px; height: calc(100vh - 60px);
  overflow-y: auto; padding: 2rem 1.25rem;
  border-right: 1px solid var(--border); background: var(--bg-light);
}
.docs-sidebar .sidebar-title {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .1em;
  color: var(--text-muted); font-weight: 700; margin-bottom: .75rem; padding-left: .5rem;
}
.docs-sidebar ul { list-style: none; }
.docs-sidebar ul li a {
  display: block; padding: .35rem .5rem; border-radius: 5px;
  font-size: .875rem; color: var(--text-muted);
}
.docs-sidebar ul li a:hover,
.docs-sidebar ul li a.active { color: var(--brand); background: var(--brand-light); text-decoration: none; }
.docs-sidebar ul li + li { margin-top: .1rem; }
.docs-sidebar .sidebar-group { margin-bottom: 1.5rem; }
.docs-content { padding: 3rem; max-width: 820px; }
.docs-content h1 { font-size: 1.75rem; font-weight: 700; letter-spacing: -.02em; margin-bottom: .5rem; }
.docs-content h2 { font-size: 1.2rem; font-weight: 600; margin: 2.5rem 0 .75rem; padding-top: 2.5rem; border-top: 1px solid var(--border); }
.docs-content h2:first-of-type { border-top: none; padding-top: 0; }
.docs-content h3 { font-size: 1rem; font-weight: 600; margin: 1.5rem 0 .5rem; }
.docs-content p  { margin-bottom: 1rem; font-size: .9375rem; color: #374151; }
.docs-content ul, .docs-content ol { padding-left: 1.5rem; margin-bottom: 1rem; font-size: .9375rem; color: #374151; }
.docs-content li { margin-bottom: .35rem; }
.docs-content pre { margin: 1.25rem 0; }

/* ── Footer ───────────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem; text-align: center;
  font-size: .8rem; color: var(--text-muted);
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .section { padding: 3.5rem 1.25rem; }
  .section-title { font-size: 1.5rem; }
  .docs-layout { grid-template-columns: 1fr; }
  .docs-sidebar { display: none; }
  .docs-content { padding: 1.5rem; }
}
