/* SEK Systems Docs. Geen externe fonts of scripts. Palet: brand/README.md (donker standaard, licht via
   prefers-color-scheme of de themaknop, die data-theme op <html> zet). */
:root {
  --bg: #101A28;          /* Midnight Navy */
  --surface: #1B293B;     /* Deep Slate */
  --rule: #344456;        /* Steel Blue, alleen lijnen */
  --text: #F4F7FA;        /* Off White */
  --muted: #94A3B8;       /* Muted Gray */
  --accent: #4DD6B4;      /* Security Teal */
  --link: #4DD6B4;
  --code-bg: #0B131E;
  --mark-f: #F4F7FA;
  --mark-c: #4DD6B4;
  --note: #5B9BD5;
  --warn: #E0A030;
  --danger: #E06060;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #F4F7FA; --surface: #FFFFFF; --rule: #C9D2DC; --text: #101A28; --muted: #5B6B80;
    --accent: #11977A; --link: #0F7A63; --code-bg: #E9EEF3; --mark-f: #101A28; --mark-c: #11977A;
    --note: #2F6DA8; --warn: #9A6200; --danger: #B23434;
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #F4F7FA; --surface: #FFFFFF; --rule: #C9D2DC; --text: #101A28; --muted: #5B6B80;
  --accent: #11977A; --link: #0F7A63; --code-bg: #E9EEF3; --mark-f: #101A28; --mark-c: #11977A;
  --note: #2F6DA8; --warn: #9A6200; --danger: #B23434;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 4.5rem; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.skip { position: absolute; left: -999px; top: 0; padding: 0.5rem 1rem; background: var(--accent); color: var(--bg); z-index: 50; }
.skip:focus { left: 0.5rem; top: 0.5rem; }

/* Bovenbalk */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 1rem;
  height: 3.5rem; padding: 0 1rem;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
}
.brand { display: flex; align-items: center; gap: 0.6rem; color: var(--text); text-decoration: none; white-space: nowrap; }
.mark { display: block; flex: none; }
.mk-f { fill: var(--mark-f); }
.mk-c { fill: var(--mark-c); }
.brand-name { font-weight: 600; font-size: 0.8125rem; letter-spacing: 0.14em; text-transform: uppercase; }
.brand-docs { color: var(--muted); font-size: 0.875rem; border-left: 1px solid var(--rule); padding-left: 0.6rem; }
.search { position: relative; flex: 1; max-width: 28rem; margin-left: auto; }
.search input {
  width: 100%; height: 2.25rem; padding: 0 2rem 0 0.75rem;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--rule); border-radius: 4px;
  font: inherit; font-size: 0.9rem;
}
.search input::placeholder { color: var(--muted); }
.search-key {
  position: absolute; right: 0.5rem; top: 0.45rem;
  font: 0.75rem var(--mono); color: var(--muted);
  border: 1px solid var(--rule); border-radius: 3px; padding: 0 0.3rem;
}
.search-fallback { display: none; }
.search-results {
  position: absolute; top: 2.6rem; left: 0; right: 0;
  max-height: 70vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--rule); border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}
.search-results a { display: block; padding: 0.55rem 0.8rem; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--rule); }
.search-results a:last-child { border-bottom: 0; }
.search-results a:hover, .search-results a[aria-selected="true"] { background: var(--bg); }
.search-results .r-title { display: block; font-weight: 600; font-size: 0.9rem; }
.search-results .r-path { display: block; color: var(--muted); font-size: 0.75rem; }
.search-results .r-text { display: block; color: var(--muted); font-size: 0.8rem; line-height: 1.4; }
.search-results mark { background: none; color: var(--accent); font-weight: 600; }
.search-results .r-empty { padding: 0.6rem 0.8rem; color: var(--muted); font-size: 0.875rem; }
.console-link { font-size: 0.875rem; white-space: nowrap; }
.theme-toggle, .menu-toggle {
  flex: none; height: 2.25rem; padding: 0 0.6rem;
  background: transparent; color: var(--text);
  border: 1px solid var(--rule); border-radius: 4px; cursor: pointer; font: inherit; font-size: 0.85rem;
}
.theme-toggle { width: 2.25rem; padding: 0; display: grid; place-items: center; }
.theme-toggle span { width: 0.9rem; height: 0.9rem; border-radius: 50%; border: 2px solid var(--text); background: linear-gradient(90deg, var(--text) 50%, transparent 50%); }
.menu-toggle { display: none; }

/* Indeling */
.layout {
  display: grid;
  grid-template-columns: 16rem minmax(0, 1fr) 14rem;
  max-width: 90rem; margin: 0 auto;
}
.sidebar {
  position: sticky; top: 3.5rem; align-self: start;
  height: calc(100vh - 3.5rem); overflow-y: auto;
  padding: 1.5rem 1rem 3rem 1.25rem;
  border-right: 1px solid var(--rule);
  font-size: 0.9rem;
}
.nav-section {
  margin: 1.25rem 0 0.35rem; color: var(--muted);
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
}
.nav-section:first-child { margin-top: 0; }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar a { display: block; padding: 0.22rem 0.5rem; color: var(--text); text-decoration: none; border-left: 2px solid transparent; }
.sidebar a:hover { color: var(--accent); }
.sidebar a[aria-current="page"] { border-left-color: var(--accent); color: var(--accent); font-weight: 600; }

.content { min-width: 0; padding: 2rem clamp(1rem, 4vw, 3rem) 3rem; }
article { max-width: 48rem; }
.crumb { margin: 0 0 0.25rem; color: var(--muted); font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; }
h1 { font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.4rem); line-height: 1.15; letter-spacing: -0.015em; margin: 0 0 1.25rem; font-weight: 600; }
h2 { font-size: 1.45rem; line-height: 1.25; margin: 2.5rem 0 0.75rem; padding-top: 1.25rem; border-top: 1px solid var(--rule); font-weight: 600; }
h3 { font-size: 1.12rem; margin: 1.75rem 0 0.5rem; font-weight: 600; }
h4 { font-size: 1rem; margin: 1.25rem 0 0.4rem; }
h2, h3 { position: relative; }
.anchor { position: absolute; left: -1.1rem; color: var(--muted); text-decoration: none; opacity: 0; font-weight: 400; }
h2 .anchor { top: 1.25rem; }
h2:hover .anchor, h3:hover .anchor, .anchor:focus { opacity: 1; }
p, ul, ol, dl { margin: 0 0 1rem; }
li { margin: 0.2rem 0; }
li > ul, li > ol { margin: 0.2rem 0 0; }
dt { font-weight: 600; }
dd { margin: 0 0 0.6rem 1.25rem; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 2rem 0; }
strong { font-weight: 600; }
img { max-width: 100%; height: auto; border: 1px solid var(--rule); border-radius: 4px; }

code {
  font-family: var(--mono); font-size: 0.86em;
  background: var(--code-bg); padding: 0.1em 0.35em; border-radius: 3px;
  overflow-wrap: anywhere;
}
pre {
  position: relative;
  margin: 0 0 1.25rem; padding: 0.9rem 1rem;
  background: var(--code-bg); border: 1px solid var(--rule); border-radius: 4px;
  overflow-x: auto; line-height: 1.5;
}
pre code { background: none; padding: 0; font-size: 0.85rem; overflow-wrap: normal; white-space: pre; }
.copy {
  position: absolute; top: 0.4rem; right: 0.4rem;
  padding: 0.15rem 0.5rem; font: 0.75rem var(--font);
  background: var(--surface); color: var(--muted);
  border: 1px solid var(--rule); border-radius: 3px; cursor: pointer;
  opacity: 0;
}
pre:hover .copy, .copy:focus { opacity: 1; }
@media (hover: none) { .copy { opacity: 1; } }

.table-wrap { overflow-x: auto; margin: 0 0 1.25rem; }
table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
th, td { text-align: left; vertical-align: top; padding: 0.5rem 0.65rem; border-bottom: 1px solid var(--rule); }
th { font-weight: 600; color: var(--muted); font-size: 0.8rem; letter-spacing: 0.04em; text-transform: uppercase; border-bottom-width: 2px; }

blockquote { margin: 0 0 1.25rem; padding: 0.75rem 1rem; border-left: 3px solid var(--rule); background: var(--surface); color: var(--text); }
blockquote > :last-child { margin-bottom: 0; }
.callout { border-left-color: var(--note); }
.callout-title { margin-bottom: 0.25rem; font-weight: 600; font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--note); }
.callout-tip, .callout-security { border-left-color: var(--accent); }
.callout-tip .callout-title, .callout-security .callout-title { color: var(--accent); }
.callout-warning, .callout-important { border-left-color: var(--warn); }
.callout-warning .callout-title, .callout-important .callout-title { color: var(--warn); }
.callout-caution { border-left-color: var(--danger); }
.callout-caution .callout-title { color: var(--danger); }

.pager { display: flex; justify-content: space-between; gap: 1rem; max-width: 48rem; margin-top: 3rem; padding-top: 1.25rem; border-top: 1px solid var(--rule); }
.pager a { display: flex; flex-direction: column; text-decoration: none; font-weight: 600; max-width: 48%; }
.pager a span { color: var(--muted); font-size: 0.75rem; font-weight: 400; letter-spacing: 0.08em; text-transform: uppercase; }
.pager .next { text-align: right; margin-left: auto; }
.footer { max-width: 48rem; margin-top: 2.5rem; color: var(--muted); font-size: 0.8rem; }
.footer a { color: var(--muted); }

.toc {
  position: sticky; top: 3.5rem; align-self: start;
  max-height: calc(100vh - 3.5rem); overflow-y: auto;
  padding: 2rem 1rem 2rem 0.5rem; font-size: 0.82rem;
}
.toc-title { margin: 0 0 0.5rem; color: var(--muted); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--rule); }
.toc li { margin: 0; }
.toc a { display: block; padding: 0.15rem 0 0.15rem 0.75rem; color: var(--muted); text-decoration: none; }
.toc .l3 a { padding-left: 1.5rem; }
.toc a:hover, .toc a.active { color: var(--accent); }

/* Startpagina-tegels: gewone lijst met class "cards" via een wrapper-alinea is niet mogelijk in Markdown, dus de
   lijst direct na een h2 met id "start-here" krijgt een rasteropmaak. */
#start-here + ul { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 0.75rem; }
#start-here + ul li { margin: 0; padding: 0.9rem 1rem; border: 1px solid var(--rule); border-radius: 4px; background: var(--surface); }
#start-here + ul li a { font-weight: 600; }

@media (max-width: 1200px) {
  .layout { grid-template-columns: 15rem minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .menu-toggle { display: block; }
  .console-link, .brand-docs, .search-key { display: none; }
  .topbar { gap: 0.5rem; padding: 0 0.75rem; }
  .brand-name { display: none; }
  .sidebar {
    display: none;
    position: fixed; top: 3.5rem; left: 0; right: 0; bottom: 0; z-index: 15;
    height: auto; background: var(--bg); border-right: 0;
  }
  body.nav-open .sidebar { display: block; }
  body.nav-open { overflow: hidden; }
  .content { padding: 1.25rem 1rem 2.5rem; }
  .anchor { display: none; }
}
@media print {
  .topbar, .sidebar, .toc, .pager, .copy { display: none !important; }
  .layout { display: block; }
}
th[align="center"], td[align="center"] { text-align: center; }
