/* Styles for the GitHub Pages rendering of the docs/ OKF bundle. */

:root {
  --bg: #ffffff;
  --fg: #1f2328;
  --muted: #59636e;
  --border: #d1d9e0;
  --surface: #f6f8fa;
  --accent: #0b5cad;
  --code-bg: #eff2f5;
  --pill-stable: #1a7f37;
  --pill-draft: #9a6700;
  --pill-deprecated: #cf222e;
  --pill-unverified: #59636e;
  --pill-machine: #0969da;
  --pill-human: #1a7f37;
  --sidebar-width: 17rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --fg: #e6edf3;
    --muted: #9198a1;
    --border: #3d444d;
    --surface: #151b23;
    --accent: #4493f8;
    --code-bg: #1f2630;
    --pill-stable: #3fb950;
    --pill-draft: #d29922;
    --pill-deprecated: #f85149;
    --pill-unverified: #9198a1;
    --pill-machine: #4493f8;
    --pill-human: #3fb950;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

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

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

.skip {
  position: absolute;
  left: -999px;
}
.skip:focus { left: 1rem; top: 1rem; background: var(--bg); padding: .5rem; z-index: 10; }

/* Header */
.site-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.site-title { font-weight: 600; font-size: 1.1rem; color: var(--fg); }
.site-badge {
  font-size: .75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .05rem .55rem;
  color: var(--muted);
}
.site-repo { margin-left: auto; }

/* Layout */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  max-width: 80rem;
  margin: 0 auto;
}
.sidebar {
  border-right: 1px solid var(--border);
  padding: 1.5rem 1rem;
  font-size: .92rem;
  position: sticky;
  top: 0;
  align-self: start;
  max-height: 100vh;
  overflow-y: auto;
}
.content { padding: 2rem 2.5rem 3rem; max-width: 52rem; min-width: 0; }

@media (max-width: 52rem) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  /* Content first on narrow screens; the navigation follows it */
  .sidebar { order: 2; position: static; max-height: none; border-right: 0; border-top: 1px solid var(--border); }
  .content { order: 1; }
  .site-header { flex-wrap: wrap; padding: .75rem 1rem; }
  .content { padding: 1.5rem 1rem 2.5rem; }
}

/* Navigation */
.nav-sections, .nav-sections ul { list-style: none; margin: 0; padding: 0; }
.nav-sections > li { margin-bottom: 1rem; }
.nav-heading {
  display: block;
  font-weight: 600;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  margin-bottom: .25rem;
}
.nav-sections ul a { display: block; padding: .15rem .5rem; border-radius: 6px; color: var(--fg); }
.nav-sections ul a:hover { background: var(--surface); text-decoration: none; }
.nav-sections ul a[aria-current="page"] { background: var(--surface); color: var(--accent); font-weight: 600; }

/* Concept header (OKF frontmatter) */
.concept-header { margin: 0 0 1.5rem; }
.concept-type {
  margin: 0 0 .25rem;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
}
.concept-description { margin: 0 0 1rem; font-size: 1.05rem; color: var(--muted); }
.concept-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.5rem;
  margin: 0;
  padding: .75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  font-size: .85rem;
}
.concept-meta div { min-width: 0; }
.concept-meta dt { color: var(--muted); font-size: .75rem; }
.concept-meta dd { margin: 0; overflow-wrap: anywhere; }
.concept-meta code { white-space: normal; overflow-wrap: anywhere; }
.markdown-body p, .markdown-body li { overflow-wrap: break-word; }

.pill {
  display: inline-block;
  padding: 0 .5rem;
  border-radius: 999px;
  border: 1px solid currentColor;
  font-size: .78rem;
  line-height: 1.5;
}
.pill-stable { color: var(--pill-stable); }
.pill-draft { color: var(--pill-draft); }
.pill-deprecated, .pill-stale { color: var(--pill-deprecated); }
.pill-unverified { color: var(--pill-unverified); }
.pill-machine-confirmed { color: var(--pill-machine); }
.pill-human-reviewed { color: var(--pill-human); }

.tags { display: flex; flex-wrap: wrap; gap: .3rem; }
.tag { background: var(--code-bg); border-radius: 4px; padding: 0 .4rem; }

.notice {
  border-left: 4px solid var(--pill-deprecated);
  padding: .5rem .75rem;
  background: var(--surface);
}

/* Markdown content */
.markdown-body h1 { font-size: 2rem; line-height: 1.25; margin: 0 0 1rem; }
.markdown-body h2 { font-size: 1.45rem; margin: 2rem 0 .75rem; padding-bottom: .3rem; border-bottom: 1px solid var(--border); }
.markdown-body h3 { font-size: 1.15rem; margin: 1.5rem 0 .5rem; }
.markdown-body code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: .87em;
  background: var(--code-bg);
  border-radius: 4px;
  padding: .1em .35em;
}
.markdown-body pre {
  max-width: 100%;
  background: var(--code-bg);
  border-radius: 8px;
  padding: 1rem;
  overflow-x: auto;
  line-height: 1.45;
}
.markdown-body pre code { background: none; padding: 0; font-size: .85rem; }
.markdown-body table {
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: .9rem;
}
.markdown-body th, .markdown-body td { border: 1px solid var(--border); padding: .4rem .7rem; text-align: left; vertical-align: top; }
.markdown-body th { background: var(--surface); }
.markdown-body blockquote { margin: 1rem 0; padding: 0 1rem; color: var(--muted); border-left: 4px solid var(--border); }
.markdown-body .footnotes { font-size: .85rem; color: var(--muted); border-top: 1px solid var(--border); margin-top: 2rem; }

/* Sources (OKF provenance) */
.concept-sources { margin-top: 2rem; font-size: .9rem; }
.concept-sources h2 { font-size: 1.1rem; border-bottom: 1px solid var(--border); padding-bottom: .3rem; }
.concept-sources li { margin-bottom: .35rem; overflow-wrap: anywhere; }
.source-id { font-size: .78rem; color: var(--muted); }
.source-signals { color: var(--muted); }

.page-footer {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: .85rem;
  color: var(--muted);
}

/* Home page (bundle-root index.md) */
.home-header h1 { font-size: 2.1rem; line-height: 1.2; margin: 0 0 .5rem; }
.home-note {
  font-size: .9rem;
  color: var(--muted);
  border-left: 4px solid var(--border);
  padding-left: .75rem;
}
