/* OpenGraphs Docs — dark theme, 3-column responsive layout */

* { box-sizing: border-box; }

:root {
  --bg: #0a0a0b;
  --bg-elev: #131316;
  --bg-code: #0f0f12;
  --border: #27272a;
  --border-strong: #3f3f46;
  --text: #e4e4e7;
  --text-2: #a1a1aa;
  --text-3: #71717a;
  --accent: #60a5fa;
  --accent-2: #93c5fd;
  --accent-bg: rgba(96, 165, 250, 0.1);
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #f87171;
  --sidebar-w: 260px;
  --toc-w: 220px;
  --content-max: 760px;
  --radius: 0.5rem;
}

html { scroll-behavior: smooth; scroll-padding-top: 1.5rem; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.12s, border-color 0.12s;
}
a:hover { color: var(--accent-2); border-bottom-color: var(--accent-2); }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85em;
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 0.25rem;
  padding: 0.1em 0.35em;
  color: #fcd34d;
}

pre {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.6;
  color: #e4e4e7;
}
pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

/* ===== Layout ===== */

.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr var(--toc-w);
  min-height: 100vh;
}

/* ===== Sidebar ===== */

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--bg-elev);
  border-right: 1px solid var(--border);
  padding: 1.5rem 1rem 2rem;
  font-size: 0.85rem;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 1.5rem;
  padding: 0 0.5rem;
}
.sidebar-brand-mark {
  width: 1.4rem;
  height: 1.4rem;
  background: linear-gradient(135deg, var(--accent), #a855f7);
  border-radius: 0.35rem;
  display: inline-block;
}
.sidebar-group {
  margin-bottom: 1.2rem;
}
.sidebar-group-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 0 0.5rem;
  margin-bottom: 0.4rem;
}
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li a {
  display: block;
  padding: 0.35rem 0.65rem;
  border-radius: 0.35rem;
  color: var(--text-2);
  border-bottom: none;
  transition: background 0.12s, color 0.12s;
}
.sidebar li a:hover { background: rgba(255,255,255,0.04); color: var(--text); }
.sidebar li a.active {
  background: var(--accent-bg);
  color: var(--accent-2);
  font-weight: 500;
}

/* ===== Main content ===== */

main {
  padding: 2.5rem 3rem 5rem;
  max-width: 100%;
  min-width: 0;
}
.content {
  max-width: var(--content-max);
  margin: 0 auto;
}

.breadcrumb {
  font-size: 0.78rem;
  color: var(--text-3);
  margin-bottom: 1.5rem;
}
.breadcrumb a { color: var(--text-3); border-bottom: none; }
.breadcrumb a:hover { color: var(--text-2); }
.breadcrumb-sep { margin: 0 0.4rem; color: var(--border-strong); }

h1, h2, h3, h4 { color: var(--text); font-weight: 600; line-height: 1.3; }
h1 { font-size: 2.1rem; margin: 0 0 0.5rem; letter-spacing: -0.02em; }
h2 { font-size: 1.45rem; margin: 2.5rem 0 0.8rem; padding-top: 0.5rem; border-top: 1px solid var(--border); }
h2:first-of-type { border-top: none; margin-top: 1.2rem; padding-top: 0; }
h3 { font-size: 1.1rem; margin: 1.8rem 0 0.6rem; }
h4 { font-size: 0.95rem; margin: 1.4rem 0 0.4rem; color: var(--text-2); }

p { margin: 0 0 1rem; }
strong { color: var(--text); font-weight: 600; }
em { color: var(--text-2); }

ul, ol { padding-left: 1.4rem; margin: 0 0 1rem; }
li { margin-bottom: 0.3rem; }

.lead {
  font-size: 1.05rem;
  color: var(--text-2);
  margin: 0 0 1.5rem;
}

.tag {
  display: inline-block;
  font-size: 0.68rem;
  padding: 0.1rem 0.5rem;
  border-radius: 0.3rem;
  background: var(--bg-code);
  border: 1px solid var(--border);
  color: var(--text-2);
  vertical-align: middle;
  margin-left: 0.3rem;
  letter-spacing: 0.02em;
}
.tag-new { background: rgba(52, 211, 153, 0.1); border-color: rgba(52, 211, 153, 0.3); color: var(--success); }

.callout {
  border-left: 3px solid var(--accent);
  background: var(--accent-bg);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 0.8rem 1rem;
  margin: 1.2rem 0;
  font-size: 0.9rem;
}
.callout-warn { border-left-color: var(--warning); background: rgba(251, 191, 36, 0.08); }
.callout-danger { border-left-color: var(--danger); background: rgba(248, 113, 113, 0.08); }
.callout-title { font-weight: 600; margin-bottom: 0.3rem; color: var(--text); }

/* ===== Tables ===== */

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: 0.88rem;
}
th, td {
  text-align: left;
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid var(--border);
}
th {
  color: var(--text-2);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--bg-elev);
}
tbody tr:hover { background: rgba(255,255,255,0.02); }
td kbd, td code { font-size: 0.8rem; }

kbd {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.75rem;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 0.25rem;
  padding: 0.05rem 0.4rem;
  color: var(--text);
  min-width: 1.4rem;
  text-align: center;
}

/* ===== TOC (right) ===== */

.toc {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 2.5rem 1.5rem;
  font-size: 0.78rem;
  border-left: 1px solid var(--border);
}
.toc-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 0.6rem;
}
.toc ul { list-style: none; padding: 0; margin: 0; }
.toc li { margin: 0; }
.toc li a {
  display: block;
  padding: 0.25rem 0;
  color: var(--text-3);
  border-bottom: none;
  line-height: 1.4;
}
.toc li a:hover { color: var(--text-2); }
.toc ul ul { padding-left: 0.8rem; }

/* ===== Cards / grids ===== */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.8rem;
  margin: 1rem 0 1.5rem;
}
.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  display: block;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  transition: border-color 0.12s, background 0.12s;
}
.card:hover { border-color: var(--border-strong); background: #18181b; color: var(--text); }
.card-title { font-weight: 600; font-size: 0.9rem; margin-bottom: 0.2rem; }
.card-desc { color: var(--text-2); font-size: 0.82rem; line-height: 1.5; }

/* ===== Footer ===== */

footer.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 3rem;
  color: var(--text-3);
  font-size: 0.82rem;
  background: var(--bg-elev);
}
footer.site-footer .content { max-width: var(--content-max); margin: 0 auto; }
footer.site-footer a { color: var(--text-2); }

/* ===== Mobile ===== */

@media (max-width: 1100px) {
  .layout { grid-template-columns: var(--sidebar-w) 1fr; }
  .toc { display: none; }
}
@media (max-width: 720px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  main { padding: 1.5rem 1.2rem 3rem; }
  h1 { font-size: 1.7rem; }
  h2 { font-size: 1.25rem; }
}
