/* ==========================================================================
   core.docs — site styles
   Uses UNVRSL Design System tokens from core.assets
   ========================================================================== */


/* ---- Design System import ---- */

/* @import url("https://core.assets.medkronos.com/design/standards/"); */
/* @import url("https://core.assets.medkronos.com/design/ui/"); */
/* @import url("https://core.assets.medkronos.com/design/layouts/"); */

/* design system loaded via DocumentShell head links — no @import here */


/* ---- Docs-specific overrides ---- */
:root {
  --brand-hue: var(--brand-hue-blue);
}

body {
  font-family: var(--font-sans, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif);
}

/* ---- Header ---- */
header {
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  padding: var(--space-m) var(--space-l);
  display: flex;
  align-items: center;
  gap: var(--space-m);
}

header h1 {
  margin: 0;
  font-size: var(--text-xl);
  color: var(--text);
}

/* ---- Layout ---- */
.container {
  display: flex;
  min-height: calc(100vh - 57px);
  max-width: 100%;
  padding: 0;
}

.toc {
  width: 260px;
  padding: var(--space-m);
  padding-left: var(--space-s);
  background: var(--surface);
  border-right: 1px solid var(--border);
  min-height: calc(100vh - 57px);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  flex-shrink: 0;
}

.content {
  flex: 1;
  padding: var(--space-l);
  max-width: 860px;
}

/* ---- Breadcrumbs ---- */
.breadcrumbs ul {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-l) 0;
}

.breadcrumbs li {
  display: inline;
  margin-right: var(--space-xs);
  font-size: var(--text-s);
  color: var(--text-muted);
}

.breadcrumbs li:not(:last-child)::after {
  content: "/";
  margin-left: var(--space-xs);
  color: var(--text-faint);
}

.breadcrumbs a {
  color: var(--brand);
  text-decoration: none;
}

.breadcrumbs a:hover {
  text-decoration: underline;
}

/* ---- TOC navigation ---- */
.toc ul {
  list-style: none;
  padding-left: 0;
}

/* Nesting indentation: each depth level gets a left indent */
.toc .toc-depth-0 { padding-left: 0; }
.toc .toc-depth-1 { padding-left: var(--space-m); }
.toc .toc-depth-2 { padding-left: calc(var(--space-m) * 2); }
.toc .toc-depth-3 { padding-left: calc(var(--space-m) * 3); }
.toc .toc-depth-4 { padding-left: calc(var(--space-m) * 4); }
.toc .toc-depth-5 { padding-left: calc(var(--space-m) * 5); }

/* TOC icons — small inline SVG / image next to each entry */
.toc-icon {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin-right: 0.25em;
}
.toc-icon svg,
.toc-icon-img {
  width: 14px;
  height: 14px;
  display: block;
}
.toc-icon svg {
  stroke: var(--text-muted);
  stroke-width: 2;
}


.toc li {
  margin: 0.125rem 0;
}

.toc a {
  display: flex;
  align-items: center;
  gap: var(--space-xs);

  color: var(--text);
  text-decoration: none;
  font-size: var(--text-s);
  padding: var(--space-xs) var(--space-s);
  border-radius: var(--radius-s);
  transition: background var(--duration-fast) var(--ease-out);
}

.toc a:hover {
  background: var(--surface-2);
  color: var(--text);
}

.toc li.active > a {
  font-weight: var(--weight-semibold);
  color: var(--brand);
  background: var(--brand-faint);
}

/* ---- Article Header ---- */
.article-header {
  margin-bottom: var(--space-l);
  border-bottom: 1px solid var(--border);
  padding-bottom: var(--space-m);
}

.title-row {
  display: flex;
  align-items: center;
  gap: var(--space-s);
  margin-bottom: var(--space-xs);
}

.title-row h1 {
  margin: 0;
  font-size: var(--text-xxl);
  color: var(--text);
}

.article-icon {
  display: inline-flex;
  align-items: center;
}

.article-icon svg {
  width: 32px;
  height: 32px;
}

.article-meta {
  display: flex;
  gap: var(--space-m);
  font-size: var(--text-s);
  color: var(--text-muted);
}

.meta-item:not(:last-child)::after {
  content: "•";
  margin-left: var(--space-m);
}

/* ---- Doc content ---- */
.doc {
  line-height: var(--leading-normal);
}

.doc h1,
.doc h2,
.doc h3,
.doc h4 {
  margin-top: var(--space-xl);
  margin-bottom: var(--space-s);
}

.doc h1:first-child,
.doc h2:first-child,
.doc h3:first-child {
  margin-top: 0;
}

.doc p {
  margin-bottom: var(--space-m);
  max-width: 70ch;
}

.doc ul,
.doc ol {
  margin-bottom: var(--space-m);
  padding-left: var(--space-l);
}

.doc li {
  margin-bottom: var(--space-xs);
}

.doc a {
  color: var(--brand);
  text-decoration: none;
}

.doc a:hover {
  text-decoration: underline;
}

.doc hr {
  margin: var(--space-l) 0;
}

/* ---- Code blocks ---- */
.doc pre {
  margin: var(--space-m) 0;
  border-radius: var(--radius-m);
  border: 1px solid var(--border);
  overflow-x: auto;
  max-width: 100%;
}

.doc pre code {
  display: block;
  padding: var(--space-m);
  font-size: var(--text-s);
  line-height: 1.6;
  background: transparent;
  border: none;
  color: var(--text);
}

.doc code {
  padding: 0.125rem 0.375rem;
  font-size: 0.875em;
  background: var(--surface-2);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-s);
  color: var(--text);
}

/* ---- Demo blocks (live preview) ---- */
.demo {
  margin: var(--space-m) 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  overflow: hidden;
}

.demo__preview {
  padding: var(--space-l);
  background: var(--bg);
}

.demo__code {
  border-top: 1px solid var(--border-faint);
  background: var(--surface-2);
}

.demo__code pre {
  margin: 0;
  border: none;
  border-radius: 0;
}

.demo__code pre code {
  padding: var(--space-m);
}

/* ---- Tables ---- */
.doc table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-m) 0;
  font-size: var(--text-s);
}

.doc th,
.doc td {
  padding: var(--space-s) var(--space-m);
  text-align: left;
  border-bottom: 1px solid var(--border-faint);
}

.doc th {
  font-weight: var(--weight-semibold);
  color: var(--text-muted);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.doc tr:hover td {
  background: var(--surface-2);
}

/* ---- Demo wrapper for rendered UI examples ---- */
.demo-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-s);
  align-items: center;
}

.demo-grid--col {
  flex-direction: column;
  align-items: flex-start;
}

.demo-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-bottom: var(--space-xs);
}

/* ---- Example group ---- */
.example-group {
  margin: var(--space-l) 0;
}

.example-group h3 {
  margin-bottom: var(--space-s);
}