/* ==========================================================================
   Minimalistisches CSS-Stylesheet
   --------------------------------------------------------------------------
   Akzentfarbe ändern: nur --accent unten anpassen (oder in deinem eigenen
   CSS / inline am <html>-Tag überschreiben). Alle Hover-, Hintergrund- und
   Rahmenfarben werden automatisch daraus abgeleitet.

   Aufbau:
   1. Variablen (Farben, Abstände, Schrift)
   2. Reset & Grundlagen
   3. Typografie
   4. Links, Listen, Zitate, Code
   5. Tabellen
   6. Formulare & Buttons
   7. Weitere Elemente (details, dialog, progress, ...)
   8. Layout-Helfer & Komponenten (container, grid, card, badge, alert)
   ========================================================================== */


/* 1. VARIABLEN
   ========================================================================== */
:root {
  /* >>> Hier die Akzentfarbe ändern <<< */
  --accent: #3c9c7d;
  --on-accent: #ffffff;               /* Textfarbe auf Akzentfläche */

  /* Abgeleitete Akzentfarben (müssen nicht angepasst werden) */
  --accent-hover: color-mix(in srgb, var(--accent) 82%, black);
  --accent-soft: color-mix(in srgb, var(--accent) 12%, transparent);
  --accent-border: color-mix(in srgb, var(--accent) 40%, transparent);

  /* Neutrale Farben (Hellmodus) */
  --bg: #fafaf9;
  --surface: #ffffff;
  --surface-2: #f2f2f0;
  --text: #1f2421;
  --text-muted: #666d69;
  --border: #e2e4e1;

  /* Statusfarben */
  --success: #2e9e6b;
  --warning: #d9902f;
  --danger: #d2514a;
  --info: #3b82c4;

  /* Schrift */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --font-size: 1rem;
  --line-height: 1.65;

  /* Abstände (Skala) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2.5rem;
  --space-6: 4rem;

  /* Sonstiges */
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 4px 16px rgb(0 0 0 / 0.05);
  --content-width: 46rem;
  --transition: 0.15s ease;

  color-scheme: light dark;
}

/* Dunkelmodus: automatisch nach Systemeinstellung ... */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121514;
    --surface: #1a1e1c;
    --surface-2: #232825;
    --text: #e7ebe9;
    --text-muted: #98a09c;
    --border: #2d3330;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 4px 16px rgb(0 0 0 / 0.25);
  }
}

/* ... oder manuell erzwingen mit <html data-theme="dark"> */
:root[data-theme="dark"] {
  --bg: #121514;
  --surface: #1a1e1c;
  --surface-2: #232825;
  --text: #e7ebe9;
  --text-muted: #98a09c;
  --border: #2d3330;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 4px 16px rgb(0 0 0 / 0.25);
}


/* 2. RESET & GRUNDLAGEN
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--font-size);
  line-height: var(--line-height);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg,
video,
canvas,
audio,
iframe {
  display: block;
  max-width: 100%;
}

img,
video {
  height: auto;
  border-radius: var(--radius-sm);
}

::selection {
  background: var(--accent);
  color: var(--on-accent);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: var(--space-5) 0;
}

[hidden] {
  display: none !important;
}


/* 3. TYPOGRAFIE
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
  margin: var(--space-5) 0 var(--space-3);
  line-height: 1.25;
  font-weight: 650;
  letter-spacing: -0.015em;
}

h1 { font-size: clamp(2rem, 4vw + 1rem, 2.75rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(1.5rem, 2vw + 1rem, 1.9rem); }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.15rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }

/* Das erste Element im Container braucht keinen Abstand nach oben */
:is(h1, h2, h3, h4, h5, h6):first-child { margin-top: 0; }

p,
ul,
ol,
dl,
blockquote,
pre,
table,
figure,
details,
fieldset {
  margin: 0 0 var(--space-3);
}

small { font-size: 0.85em; color: var(--text-muted); }
strong, b { font-weight: 650; }

mark {
  background: var(--accent-soft);
  color: inherit;
  padding: 0.1em 0.3em;
  border-radius: 4px;
  box-shadow: inset 0 -2px 0 var(--accent-border);
}

abbr[title] {
  text-decoration: underline dotted var(--text-muted);
  text-underline-offset: 3px;
  cursor: help;
}

sub, sup {
  font-size: 0.75em;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}
sup { top: -0.5em; }
sub { bottom: -0.25em; }

del { color: var(--text-muted); }
ins { text-decoration: none; background: var(--accent-soft); padding: 0 0.2em; border-radius: 3px; }

/* Einleitungsabsatz: <p class="lead"> */
.lead {
  font-size: 1.2rem;
  color: var(--text-muted);
}

.muted { color: var(--text-muted); }


/* 4. LINKS, LISTEN, ZITATE, CODE
   ========================================================================== */
a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent-border);
  text-underline-offset: 0.2em;
  transition: color var(--transition), text-decoration-color var(--transition);
}

a:hover {
  color: var(--accent-hover);
  text-decoration-color: currentColor;
}

ul, ol { padding-left: 1.4rem; }
li { margin: 0.25rem 0; }
li > ul, li > ol { margin: 0.25rem 0 0; }
li::marker { color: var(--accent); }

dt { font-weight: 650; margin-top: var(--space-3); }
dd { margin: 0.2rem 0 0 var(--space-3); color: var(--text-muted); }

blockquote {
  padding: var(--space-2) var(--space-4);
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
blockquote > :last-child { margin-bottom: 0; }
blockquote footer,
blockquote cite {
  display: block;
  margin-top: var(--space-2);
  font-size: 0.875rem;
  color: var(--text-muted);
  font-style: normal;
}

code, kbd, samp, pre {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

code, samp {
  background: var(--surface-2);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

pre {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-3);
  overflow-x: auto;
  line-height: 1.5;
}
pre code { background: none; padding: 0; font-size: inherit; }

kbd {
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 0.1em 0.45em;
  font-size: 0.85em;
}

figure { margin-inline: 0; }
figcaption {
  margin-top: var(--space-2);
  font-size: 0.875rem;
  color: var(--text-muted);
  text-align: center;
}


/* 5. TABELLEN
   ========================================================================== */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}

caption {
  caption-side: bottom;
  padding-top: var(--space-2);
  font-size: 0.875rem;
  color: var(--text-muted);
  text-align: left;
}

th, td {
  padding: 0.65rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

thead th {
  font-size: 0.8rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 2px solid var(--accent);
}

tbody tr { transition: background var(--transition); }
tbody tr:hover { background: var(--accent-soft); }
tfoot td, tfoot th { font-weight: 650; border-top: 2px solid var(--border); border-bottom: 0; }

/* Auf kleinen Bildschirmen scrollbar: <div class="table-wrap"><table>…</table></div> */
.table-wrap { overflow-x: auto; margin-bottom: var(--space-3); }
.table-wrap table { margin-bottom: 0; }


/* 6. FORMULARE & BUTTONS
   ========================================================================== */
fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
}
legend { padding: 0 var(--space-2); font-weight: 650; }

label {
  display: inline-block;
  margin-bottom: 0.3rem;
  font-size: 0.9rem;
  font-weight: 550;
}

input:not([type="checkbox"], [type="radio"], [type="range"], [type="color"], [type="file"], [type="submit"], [type="button"], [type="reset"]),
select,
textarea {
  display: block;
  width: 100%;
  padding: 0.6rem 0.8rem;
  margin-bottom: var(--space-3);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
}

textarea { min-height: 7rem; resize: vertical; }

input::placeholder,
textarea::placeholder { color: var(--text-muted); opacity: 0.7; }

input:hover,
select:hover,
textarea:hover { border-color: var(--accent-border); }

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

input:disabled,
select:disabled,
textarea:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: var(--surface-2);
}

/* Validierung (nur nach Interaktion sichtbar) */
input:user-invalid,
textarea:user-invalid,
select:user-invalid { border-color: var(--danger); }

/* Checkbox, Radio, Range, Farbwahl nutzen die Akzentfarbe nativ */
input[type="checkbox"],
input[type="radio"],
input[type="range"],
progress,
meter { accent-color: var(--accent); }

input[type="checkbox"],
input[type="radio"] {
  width: 1.1rem;
  height: 1.1rem;
  margin: 0 0.4rem 0 0;
  vertical-align: -0.2em;
}

input[type="range"] { width: 100%; margin-bottom: var(--space-3); }

input[type="color"] {
  width: 3rem;
  height: 2.2rem;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
}

input[type="file"] {
  display: block;
  width: 100%;
  margin-bottom: var(--space-3);
  font: inherit;
  color: var(--text-muted);
}

::file-selector-button {
  margin-right: var(--space-3);
  padding: 0.45rem 0.9rem;
  font: inherit;
  font-weight: 550;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
}
::file-selector-button:hover { background: var(--accent-border); }

/* Buttons */
button,
input[type="submit"],
input[type="button"],
input[type="reset"],
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  color: var(--on-accent);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  text-decoration: none;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}

button:hover,
input[type="submit"]:hover,
input[type="button"]:hover,
input[type="reset"]:hover,
.btn:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--on-accent);
}

button:active,
.btn:active { transform: translateY(1px); }

button:disabled,
.btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; transform: none; }

/* Varianten */
.btn-outline {
  color: var(--accent);
  background: transparent;
  border-color: var(--accent);
}
.btn-outline:hover { color: var(--on-accent); }

.btn-ghost {
  color: var(--accent);
  background: transparent;
  border-color: transparent;
}
.btn-ghost:hover { color: var(--accent-hover); background: var(--accent-soft); border-color: transparent; }

.btn-danger { background: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 82%, black); border-color: transparent; }

.btn-sm { padding: 0.35rem 0.8rem; font-size: 0.875rem; }
.btn-lg { padding: 0.8rem 1.6rem; font-size: 1.1rem; }


/* 7. WEITERE ELEMENTE
   ========================================================================== */
details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 var(--space-3);
  background: var(--surface);
}
summary {
  padding: var(--space-3) 0;
  font-weight: 600;
  cursor: pointer;
  list-style-position: outside;
}
summary::marker { color: var(--accent); }
details[open] summary { border-bottom: 1px solid var(--border); margin-bottom: var(--space-3); }
details > :last-child { margin-bottom: var(--space-3); }

progress,
meter {
  width: 100%;
  height: 0.75rem;
  margin-bottom: var(--space-3);
}

dialog {
  max-width: min(32rem, calc(100% - 2rem));
  padding: var(--space-4);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgb(0 0 0 / 0.25);
}
dialog::backdrop { background: rgb(0 0 0 / 0.45); backdrop-filter: blur(3px); }

address { font-style: normal; }

/* Scrollbar (dezent) */
* { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }


/* 8. LAYOUT-HELFER & KOMPONENTEN
   ========================================================================== */
.container {
  width: 100%;
  max-width: var(--content-width);
  margin-inline: auto;
  padding-inline: var(--space-3);
}
.container-wide { max-width: 72rem; }

main { padding-block: var(--space-5); }

/* Header & Navigation */
body > header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-3);
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
}
nav li { margin: 0; }
nav a {
  display: inline-block;
  padding: 0.9rem 0.2rem;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}
nav a:hover { color: var(--text); }
nav a[aria-current="page"],
nav a.active { color: var(--accent); border-bottom-color: var(--accent); }
.nav-brand { font-weight: 700; color: var(--text); margin-right: auto; }

body > footer {
  padding-block: var(--space-5);
  margin-top: var(--space-6);
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Grid: <div class="grid grid-3"> (automatisch responsive) */
.grid { display: grid; gap: var(--space-3); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); }

.stack > * + * { margin-top: var(--space-3); }
.row { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }

/* Card */
.card {
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card > :last-child { margin-bottom: 0; }
.card h3, .card h4 { margin-top: 0; }

/* Badge */
.badge {
  display: inline-block;
  padding: 0.15em 0.65em;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: 999px;
}
.badge-success { --c: var(--success); }
.badge-warning { --c: var(--warning); }
.badge-danger  { --c: var(--danger); }
.badge-info    { --c: var(--info); }
:is(.badge-success, .badge-warning, .badge-danger, .badge-info) {
  color: var(--c);
  background: color-mix(in srgb, var(--c) 12%, transparent);
  border-color: color-mix(in srgb, var(--c) 40%, transparent);
}

/* Alert / Hinweisbox */
.alert {
  --c: var(--accent);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-3);
  background: color-mix(in srgb, var(--c) 10%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--c) 35%, transparent);
  border-left: 4px solid var(--c);
  border-radius: var(--radius-sm);
}
.alert > :last-child { margin-bottom: 0; }
.alert-success { --c: var(--success); }
.alert-warning { --c: var(--warning); }
.alert-danger  { --c: var(--danger); }
.alert-info    { --c: var(--info); }

/* Ausgabe reduzieren, wenn Nutzer Animationen abgeschaltet hat */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Druck */
@media print {
  body > header, body > footer, button, .btn { display: none; }
  body { background: #fff; color: #000; }
  a { color: inherit; text-decoration: underline; }
}
