/* ================================================================
   BOK HTML5-Einführungskurs – Gemeinsames Stylesheet  (kurs.css)
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --color-bg: #f5f5f3;
  --color-surface: #ffffff;
  --color-header-bg: #1e1e1e;
  --color-header-text: #ffffff;
  --color-header-sub: rgba(255, 255, 255, 0.72);
  --color-text: #1a1a1a;
  --color-text-muted: #555;
  --color-border: #ddd;
  --color-section-sep: #e0e0dd;

  /* Syntax-Highlighting (dunkel, Catppuccin-inspiriert) */
  --sh-bg: #1e1e2e;
  --sh-text: #cdd6f4;
  --sh-comment: #6c7086;
  --sh-tag: #89b4fa;
  --sh-attr: #cba6f7;
  --sh-string: #a6e3a1;
  --sh-value: #fab387;
  --sh-punct: #9399b2;
  --sh-keyword: #f38ba8;

  --font-body: 'Inter', system-ui, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
  --radius: 6px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.07), 0 4px 14px rgba(0, 0, 0, 0.06);
}

*, *::before, *::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.65;
}

/* ----------------------------------------------------------------
   HEADER  –  dunkler Erklärungsbereich oben
   ---------------------------------------------------------------- */
body > header {
  background: var(--color-header-bg);
  color: var(--color-header-text);
  padding: 2rem 2.5rem 1.8rem;
  border-bottom: 3px solid rgba(255, 255, 255, 0.06);
}

body > header h1 {
  margin: 0 0 0.55rem 0;
  font-size: 1.65rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #fff;
}

body > header p,
body > header li {
  margin: 0.35rem 0 0 0;
  font-size: 0.94rem;
  color: var(--color-header-sub);
  max-width: 74ch;
  line-height: 1.6;
}

body > header ul,
body > header ol {
  margin: 0.5rem 0 0 0;
  padding-left: 1.3rem;
}

body > header p:last-child,
body > header ol:last-child,
body > header ul:last-child {
  margin-bottom: 0;
}

body > header code {
  background: rgba(255, 255, 255, 0.11);
  color: #f4c842;
  padding: 0.1em 0.45em;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 0.87em;
}

body > header a {
  color: #7dd3e8;
  text-decoration: none;
}

body > header a:hover {
  text-decoration: underline;
  color: #b0e8f5;
}

/* ----------------------------------------------------------------
   HAUPT-CONTENT
   ---------------------------------------------------------------- */
main, body > section {
  padding: 1.6rem 2.5rem 2.5rem;
}

main > section {
  padding-bottom: 2rem;
}

main > section:not(:first-child),
body > section:not(:first-child):not(.nodash) {
  border-top: 2px dashed var(--color-section-sep);
  padding-top: 2rem;
}

h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 0.5rem 0;
}

h3 {
  font-size: 1.05rem;
  font-weight: 500;
  color: #333;
  margin: 1rem 0 0.3rem 0;
}

h4 {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-muted);
  margin: 0.8rem 0 0.3rem 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

p {
  margin: 0.5rem 0;
}

ul, ol {
  padding-left: 1.4rem;
  margin: 0.4rem 0;
}

li {
  margin: 0.2rem 0;
}

/* Inline-Code im Fließtext */
code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: rgba(0, 0, 0, 0.065);
  color: #444;
  padding: 0.1em 0.4em;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

dt {
  font-family: var(--font-mono);
  font-size: 0.92em;
  font-weight: 500;
  color: #222;
  padding-top: 0.6em;
}

dd {
  padding-bottom: 0.5em;
  color: var(--color-text-muted);
  font-size: 0.95em;
}

/* ----------------------------------------------------------------
   CODE-BLOCK  –  Dunkel mit Syntax-Highlighting
   ---------------------------------------------------------------- */
.code-block {
  background: var(--sh-bg);
  border-radius: var(--radius);
  padding: 1.1rem 1.4rem;
  margin: 1rem 0 1.4rem 0;
  overflow-x: auto;
  box-shadow: var(--shadow);
  position: relative;
}

.code-block pre {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  line-height: 1.65;
  color: var(--sh-text);
  white-space: pre;
}

.code-block::before {
  content: attr(data-lang);
  position: absolute;
  top: 0.5rem;
  right: 0.8rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.28);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Syntax-Token-Klassen */
.sh-tag {
  color: var(--sh-tag);
}

.sh-attr {
  color: var(--sh-attr);
}

.sh-string {
  color: var(--sh-string);
}

.sh-value {
  color: var(--sh-value);
}

.sh-comment {
  color: var(--sh-comment);
  font-style: italic;
}

.sh-punct {
  color: var(--sh-punct);
}

.sh-keyword {
  color: var(--sh-keyword);
}

.sh-selector {
  color: var(--sh-attr);
}

.sh-property {
  color: var(--sh-tag);
}

/* ----------------------------------------------------------------
   BEISPIEL-BEREICH  (Live-Vorschau)
   ---------------------------------------------------------------- */
.beispiel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.2rem 1.5rem;
  margin: 0.8rem 0 1.4rem 0;
  box-shadow: var(--shadow);
  position: relative;
}

.beispiel::before {
  content: "Beispiel";
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #aaa;
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid #eee;
}

/* ----------------------------------------------------------------
   ABWÄRTSKOMPATIBILITÄT  –  bestehende .example / .example2
   ---------------------------------------------------------------- */
section div.example,
section div.example2 {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  margin: 0.8rem 0 1.2rem 0;
  box-shadow: var(--shadow);
}

/* ----------------------------------------------------------------
   TABELLEN
   ---------------------------------------------------------------- */
table {
  border-collapse: collapse;
  width: auto;
  margin: 0.5rem 0;
}

th, td {
  border: 1px solid #b5c9de;
  padding: 0.35em 0.7em;
  text-align: left;
}

th {
  background: #8db1ff;
  color: #fff;
  font-weight: 500;
}

td {
  background: #fff;
}

tfoot td, tfoot th {
  background: #f0f0f0;
  font-weight: 500;
}

/* ----------------------------------------------------------------
   FORMULARE
   ---------------------------------------------------------------- */
div.form-group {
  margin-bottom: 1em;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
}

div.form-group label {
  flex: 0 0 20%;
}

input, select, textarea {
  font-family: var(--font-body);
  font-size: 16px;
  display: inline-block;
}

input[type=radio], input[type=checkbox] {
  display: inline;
}

/* ----------------------------------------------------------------
   DIVBOXES  (b_14, b_15 etc.)
   ---------------------------------------------------------------- */
section div.divboxes {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  padding: 1em;
  background: rgba(0, 0, 0, 0.06);
  border-radius: var(--radius);
  gap: 0.5em;
  min-height: 10vh;
}

section div.divboxes div {
  flex: 0 0 100px;
  height: 100px;
}

/* ----------------------------------------------------------------
   CODE-LIST  (Werte-Auflistungen in b_24 etc.)
   ---------------------------------------------------------------- */
ul.code-list {
  list-style: none;
  padding-left: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4em;
  margin: 0.5rem 0;
}

ul.code-list li {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.84em;
  background: rgba(0, 0, 0, 0.065);
  color: #444;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 3px;
  padding: 0.15em 0.5em;
}

ul.code-list li.default {
  font-weight: 600;
  color: #222;
  border-color: rgba(0, 0, 0, 0.2);
}

/* ----------------------------------------------------------------
   UTILITIES
   ---------------------------------------------------------------- */
.info-box {
  background: #fff8dc;
  border-left: 4px solid #f0c040;
  padding: 0.7em 1em;
  margin: 1em 0;
  font-size: 0.92em;
  border-radius: 0 var(--radius) var(--radius) 0;
}
