/* =============================================================
   Renauer Design System — Tokens & Semantic Typography
   Brand: Renauer IT-Solutions (Ternitz, AT)
   Version: 1.0
   ============================================================= */

/* -------------------------------------------------------------
   Font strategy — Office 365 native, with web fallbacks.

   Body / UI:  Aptos (M365 default since 2024) → Calibri → Segoe UI
               → Inter (web fallback for non-Office systems)
   Mono:       Cascadia Mono → Cascadia Code → Consolas
               → JetBrains Mono (web fallback)

   Word-Empfänger auf M365 sehen Aptos / Cascadia direkt aus dem
   System. Browser ohne diese Familien laden Inter / JetBrains Mono
   von Google Fonts und bleiben visuell konsistent.
   ------------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* ---------- Brand ---------- */
  --brand-blue:        #323C8D;
  --brand-blue-deep:   #1F2566;
  --brand-blue-tint:   #EEF0FA;
  --brand-blue-soft:   #D7DBF0;

  /* ---------- Ink (foreground) ---------- */
  --fg-1: #111318;   /* primary text */
  --fg-2: #4A4F5A;   /* secondary / captions */
  --fg-3: #7B8190;   /* metadata / subtle */
  --fg-on-brand: #FFFFFF;

  /* ---------- Paper (background) ---------- */
  --bg-1: #FFFFFF;   /* document paper */
  --bg-2: #F7F8FA;   /* app gutter / table zebra */
  --bg-3: #EFF1F5;   /* sidebar */

  /* ---------- Borders ---------- */
  --border-1: #E3E6EC;  /* hairlines */
  --border-2: #C7CBD4;  /* stronger rules */
  --border-3: #A0A7B4;  /* emphatic rule */

  /* ---------- Status ---------- */
  --status-ok:   #1F7A4C;
  --status-ok-bg:   #E6F2EC;
  --status-warn: #B46B00;
  --status-warn-bg: #FBF0DE;
  --status-crit: #A72525;
  --status-crit-bg: #F9E3E3;
  --status-info: #2555A7;
  --status-info-bg: #E3EAF6;

  /* ---------- Typography ----------
     Office-365-first stacks. First family that resolves on the
     reader's system wins — Aptos on M365, Calibri on legacy Office,
     Inter on everything else. */
  --font-sans:  'Aptos', 'Calibri', 'Segoe UI', 'Inter',
                -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  --font-display: 'Aptos Display', 'Aptos', 'Calibri', 'Segoe UI', 'Inter',
                  -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif: 'Cambria', 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --font-mono:  'Cascadia Mono', 'Cascadia Code', 'Consolas',
                'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* Type scale — 8px grid, 1.125 ratio for body, 1.25 for display */
  --fs-display:  40px;   /* cover / hero */
  --fs-h1:       28px;   /* chapter */
  --fs-h2:       22px;   /* section */
  --fs-h3:       17px;   /* subsection */
  --fs-h4:       15px;   /* inline heading */
  --fs-body:     15px;   /* running text */
  --fs-small:    13px;   /* captions, meta */
  --fs-micro:    11px;   /* stamps, labels */

  --lh-tight:   1.2;
  --lh-snug:    1.35;
  --lh-normal:  1.55;
  --lh-loose:   1.7;

  --fw-regular: 400;
  --fw-medium:  500;
  --fw-semi:    600;
  --fw-bold:    700;

  /* Letter spacing */
  --ls-caps:    0.08em;  /* uppercase labels */
  --ls-normal:  0em;
  --ls-tight:   -0.01em; /* large display */

  /* ---------- Spacing (8px grid) ---------- */
  --sp-1:  4px;
  --sp-2:  8px;
  --sp-3:  12px;
  --sp-4:  16px;
  --sp-5:  24px;
  --sp-6:  32px;
  --sp-7:  48px;
  --sp-8:  64px;
  --sp-9:  96px;

  /* ---------- Radius ---------- */
  --radius-1: 2px;   /* tables, inputs, stamps */
  --radius-2: 6px;   /* cards, buttons */
  --radius-3: 10px;  /* large surfaces */
  --radius-pill: 999px;

  /* ---------- Elevation ---------- */
  --shadow-0: none;
  --shadow-1: 0 1px 2px rgba(17, 19, 24, .04);
  --shadow-2: 0 1px 2px rgba(17, 19, 24, .04), 0 8px 24px rgba(17, 19, 24, .05);
  --shadow-3: 0 2px 4px rgba(17, 19, 24, .06), 0 16px 40px rgba(17, 19, 24, .08);

  /* ---------- Motion ---------- */
  --dur-fast:  80ms;
  --dur-base:  150ms;
  --dur-slow:  260ms;
  --ease-out:  cubic-bezier(0.2, 0.7, 0.3, 1);

  /* ---------- Layout ---------- */
  --doc-max-w:   720px;
  --doc-gutter:  48px;
  --page-pad:    96px;
}

/* =============================================================
   Base element styles — semantic defaults
   ============================================================= */

html, body {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-normal);
  color: var(--fg-1);
  background: var(--bg-1);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Display — cover sheet, hero. Uses Aptos Display when available
   (M365), falls back to Aptos / Calibri / Inter at the same weight. */
.rd-display {
  font-family: var(--font-display);
  font-size: var(--fs-display);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  color: var(--brand-blue);
  text-wrap: balance;
}

/* H1 — chapter (numbered like "1  Hardware") */
h1, .rd-h1 {
  font-family: var(--font-sans);
  font-size: var(--fs-h1);
  font-weight: var(--fw-semi);
  line-height: var(--lh-tight);
  color: var(--fg-1);
  margin: var(--sp-7) 0 var(--sp-4);
  text-wrap: pretty;
}

/* H2 — section */
h2, .rd-h2 {
  font-family: var(--font-sans);
  font-size: var(--fs-h2);
  font-weight: var(--fw-semi);
  line-height: var(--lh-snug);
  color: var(--fg-1);
  margin: var(--sp-6) 0 var(--sp-3);
}

/* H3 — subsection */
h3, .rd-h3 {
  font-family: var(--font-sans);
  font-size: var(--fs-h3);
  font-weight: var(--fw-semi);
  line-height: var(--lh-snug);
  color: var(--fg-1);
  margin: var(--sp-5) 0 var(--sp-2);
}

/* H4 — inline heading */
h4, .rd-h4 {
  font-family: var(--font-sans);
  font-size: var(--fs-h4);
  font-weight: var(--fw-semi);
  line-height: var(--lh-snug);
  color: var(--fg-1);
  margin: var(--sp-4) 0 var(--sp-1);
}

/* Body */
p, .rd-p {
  font-size: var(--fs-body);
  line-height: var(--lh-normal);
  color: var(--fg-1);
  margin: 0 0 var(--sp-4);
  text-wrap: pretty;
}

/* Lead — first paragraph of chapter */
.rd-lead {
  font-size: 17px;
  line-height: var(--lh-normal);
  color: var(--fg-2);
}

/* Small / caption */
small, .rd-small, figcaption {
  font-size: var(--fs-small);
  line-height: var(--lh-snug);
  color: var(--fg-2);
}

figcaption {
  font-style: italic;
  margin-top: var(--sp-2);
}

/* Micro — stamps, uppercase labels */
.rd-micro, .rd-label {
  font-size: var(--fs-micro);
  line-height: 1.3;
  font-weight: var(--fw-semi);
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: var(--fg-2);
}

/* Mono — hostnames, IPs, file paths */
code, kbd, .rd-mono {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: var(--bg-2);
  padding: 1px 5px;
  border-radius: var(--radius-1);
  color: var(--fg-1);
}

pre {
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  background: var(--bg-2);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-2);
  padding: var(--sp-4);
  overflow-x: auto;
  line-height: var(--lh-snug);
}

pre code {
  background: transparent;
  padding: 0;
  font-size: inherit;
}

/* Serif — pull-quote, chapter opener flourish */
.rd-serif {
  font-family: var(--font-serif);
}

blockquote, .rd-quote {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 18px;
  line-height: var(--lh-normal);
  color: var(--fg-2);
  border-left: 3px solid var(--brand-blue);
  padding: var(--sp-1) 0 var(--sp-1) var(--sp-4);
  margin: var(--sp-5) 0;
}

/* Links */
a {
  color: var(--brand-blue);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);
}
a:hover {
  color: var(--brand-blue-deep);
  border-bottom-color: currentColor;
}
a:focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 2px;
  border-radius: var(--radius-1);
}

/* Lists */
ul, ol {
  padding-left: var(--sp-5);
  margin: 0 0 var(--sp-4);
}
li + li { margin-top: var(--sp-1); }

/* Horizontal rule */
hr {
  border: 0;
  height: 1px;
  background: var(--border-1);
  margin: var(--sp-5) 0;
}

/* Tables — the workhorse of this system */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-small);
  margin: var(--sp-4) 0 var(--sp-5);
  background: var(--bg-1);
}
thead th {
  text-align: left;
  font-weight: var(--fw-semi);
  font-size: var(--fs-micro);
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: var(--fg-2);
  background: var(--brand-blue-tint);
  padding: var(--sp-2) var(--sp-3);
  border-bottom: 1px solid var(--border-2);
}
tbody td {
  padding: var(--sp-2) var(--sp-3);
  border-bottom: 1px solid var(--border-1);
  vertical-align: top;
}
tbody tr:last-child td { border-bottom: 1px solid var(--border-2); }

/* Selection */
::selection {
  background: var(--brand-blue);
  color: var(--fg-on-brand);
}
