/* ==========================================================================
   Basis: Schrift, Farben (hell/dunkel), Reset, Grundbausteine
   --------------------------------------------------------------------------
   Farben werden mit light-dark() definiert. Welche Seite gilt, steuert
   color-scheme: Standard folgt dem System, der Schalter im Dock setzt
   data-theme="hell" bzw. "dunkel" auf <html>.
   ========================================================================== */

/* Inter (Variable Font, selbst gehostet, Lizenz: vendor/lizenzen/inter-OFL.txt) */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('../vendor/schriften/inter-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('../vendor/schriften/inter-latin-ext-wght-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: italic;
  font-display: swap;
  font-weight: 100 900;
  src: url('../vendor/schriften/inter-latin-wght-italic.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: italic;
  font-display: swap;
  font-weight: 100 900;
  src: url('../vendor/schriften/inter-latin-ext-wght-italic.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: light dark;

  /* Schrift */
  --schrift: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --schrift-mono: ui-monospace, 'SF Mono', 'Cascadia Mono', 'JetBrains Mono', Menlo, Consolas, monospace;

  /* Maße */
  --radius-s: 8px;
  --radius-m: 12px;
  --radius-l: 16px;
  --radius-xl: 22px;
  --dock-reserve: 100px;      /* Platz unten, den Fenster frei lassen */

  /* Bewegung (bei prefers-reduced-motion auf 0 gesetzt) */
  --dauer: 180ms;
  --dauer-kurz: 120ms;
  --kurve: cubic-bezier(0.2, 0.8, 0.2, 1);

  /* Farben: light-dark(hell, dunkel) */
  --text: light-dark(#17202b, #e7ecf1);
  --text-2: light-dark(#475467, #b3bfcb);
  --text-3: light-dark(#5f6b7a, #919dab);
  --flaeche: light-dark(#ffffff, #161c23);
  --flaeche-2: light-dark(#f4f6f8, #1b222a);
  --flaeche-3: light-dark(#e9edf1, #242d36);
  --linie: light-dark(rgb(16 24 40 / 0.10), rgb(255 255 255 / 0.09));
  --linie-stark: light-dark(rgb(16 24 40 / 0.18), rgb(255 255 255 / 0.17));

  /* Die eine Akzentfarbe: Petrol */
  --akzent: light-dark(#0b7a74, #3fc1b4);
  --akzent-hover: light-dark(#086660, #66d2c7);
  --akzent-auf: light-dark(#ffffff, #05211f);          /* Text auf Akzentfläche */
  --akzent-sanft: light-dark(rgb(11 122 116 / 0.10), rgb(63 193 180 / 0.14));
  --akzent-sanft-text: light-dark(#086660, #7fdcd2);

  --gefahr: light-dark(#c93a3a, #f07a7a);

  --glas: light-dark(rgb(255 255 255 / 0.62), rgb(24 30 38 / 0.58));
  --glas-stark: light-dark(rgb(250 251 252 / 0.88), rgb(26 32 40 / 0.9));
  --glas-rand: light-dark(rgb(255 255 255 / 0.7), rgb(255 255 255 / 0.08));

  --schatten-s: 0 1px 2px light-dark(rgb(16 24 40 / 0.08), rgb(0 0 0 / 0.3));
  --schatten-m: 0 1px 2px light-dark(rgb(16 24 40 / 0.06), rgb(0 0 0 / 0.25)),
                0 8px 24px -8px light-dark(rgb(16 24 40 / 0.18), rgb(0 0 0 / 0.5));
  --schatten-fenster: 0 1px 2px light-dark(rgb(16 24 40 / 0.06), rgb(0 0 0 / 0.3)),
                      0 14px 34px -10px light-dark(rgb(16 24 40 / 0.20), rgb(0 0 0 / 0.55)),
                      0 30px 70px -30px light-dark(rgb(16 24 40 / 0.22), rgb(0 0 0 / 0.6));
  --schatten-fenster-aktiv: 0 1px 2px light-dark(rgb(16 24 40 / 0.08), rgb(0 0 0 / 0.35)),
                      0 20px 44px -12px light-dark(rgb(16 24 40 / 0.28), rgb(0 0 0 / 0.65)),
                      0 44px 90px -30px light-dark(rgb(16 24 40 / 0.30), rgb(0 0 0 / 0.7));

  /* Hintergrund (Desktop) */
  --wp-basis: light-dark(#edf1f0, #0d1318);
  --wp-kuehl: light-dark(#cbe8e3, #0f3434);
  --wp-warm: light-dark(#f4e2d1, #1d2238);
  --wp-glanz: light-dark(rgb(255 255 255 / 0.75), rgb(63 193 180 / 0.07));
  --wp-punkt: light-dark(rgb(16 24 40 / 0.075), rgb(255 255 255 / 0.05));
}

:root[data-theme='hell'] { color-scheme: light; }
:root[data-theme='dunkel'] { color-scheme: dark; }

@media (prefers-reduced-motion: reduce) {
  :root { --dauer: 0ms; --dauer-kurz: 0ms; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--schrift);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--wp-basis);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg, video { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--akzent); }
h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; }
[hidden] { display: none !important; }

/* Sichtbarer Fokusrahmen nur bei Tastaturbedienung */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; border-radius: 6px; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Icons ---------- */
.ico { width: 20px; height: 20px; flex: none; }
.ico-gefuellt { fill: currentColor; stroke: none; }

/* ---------- Buttons ---------- */
.knopf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid var(--linie-stark);
  border-radius: 10px;
  background: var(--flaeche);
  color: var(--text);
  font-weight: 560;
  font-size: 14px;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--dauer-kurz), border-color var(--dauer-kurz), color var(--dauer-kurz), transform var(--dauer-kurz);
}
.knopf:hover { background: var(--flaeche-2); border-color: var(--linie-stark); }
.knopf:active { transform: translateY(1px); }
.knopf .ico { width: 18px; height: 18px; }
.knopf-primaer { background: var(--akzent); border-color: transparent; color: var(--akzent-auf); }
.knopf-primaer:hover { background: var(--akzent-hover); }
.knopf-gross { min-height: 52px; padding: 12px 20px; font-size: 15px; border-radius: 12px; }
.knopf-klein { min-height: 32px; padding: 5px 11px; font-size: 13px; border-radius: 8px; }

/* Runder Symbol-Knopf (z. B. Fenstersteuerung, Galerie) */
.symbolknopf {
  display: inline-grid;
  place-items: center;
  width: 32px; height: 32px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-2);
  transition: background var(--dauer-kurz), color var(--dauer-kurz);
}
.symbolknopf:hover { background: var(--flaeche-3); color: var(--text); }
.symbolknopf .ico { width: 18px; height: 18px; }

/* ---------- Tags ---------- */
.tags { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; list-style: none; }
.tag {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--akzent-sanft);
  color: var(--akzent-sanft-text);
  font-size: 12.5px;
  font-weight: 560;
  line-height: 1.5;
  white-space: nowrap;
}
.tag-neutral { background: var(--flaeche-3); color: var(--text-2); }

/* ---------- Tooltips (data-tooltip), bei Hover und Tastaturfokus ---------- */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  translate: -50% 4px;
  padding: 5px 9px;
  border-radius: 7px;
  background: light-dark(#1d2632, #eef2f5);
  color: light-dark(#ffffff, #121820);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--dauer-kurz), translate var(--dauer-kurz);
  z-index: 10;
}
[data-tooltip-unten]::after { bottom: auto; top: calc(100% + 8px); translate: -50% -4px; }
[data-tooltip-links]::after { left: auto; right: 0; translate: 0 4px; }
[data-tooltip-unten][data-tooltip-links]::after { translate: 0 -4px; }
[data-tooltip]:hover::after,
[data-tooltip]:focus-visible::after { opacity: 1; translate: -50% 0; transition-delay: 350ms; }
[data-tooltip-links]:hover::after,
[data-tooltip-links]:focus-visible::after { translate: 0 0; }
[data-tooltip]:focus-visible::after { transition-delay: 0ms; }

/* ---------- Lade- und Fehlerzustände ---------- */
.ladeanzeige {
  display: grid;
  place-items: center;
  min-height: 160px;
  height: 100%;
  color: var(--text-3);
}
.ladeanzeige::before {
  content: '';
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 2.5px solid var(--linie-stark);
  border-top-color: var(--akzent);
  animation: drehen 0.8s linear infinite;
}
@keyframes drehen { to { rotate: 360deg; } }

.fehlermeldung {
  display: grid;
  gap: 10px;
  max-width: 460px;
  margin: 32px auto;
  padding: 24px;
  border: 1px solid var(--linie);
  border-radius: var(--radius-m);
  background: var(--flaeche-2);
  text-align: center;
  color: var(--text-2);
}
.fehlermeldung > .ico { width: 30px; height: 30px; margin: 0 auto; color: var(--gefahr); }
.fehlermeldung strong { color: var(--text); font-size: 16px; }
.fehlermeldung details { text-align: left; font-size: 13px; }
.fehlermeldung summary { cursor: pointer; color: var(--text-3); }
.fehlermeldung code { display: block; margin-top: 6px; white-space: pre-wrap; font-family: var(--schrift-mono); font-size: 12px; color: var(--text-2); }
.fehlermeldung .knopf { justify-self: center; }

/* Scrollbalken dezent */
* { scrollbar-width: thin; scrollbar-color: var(--linie-stark) transparent; }

/* Hinweis ohne JavaScript */
.noscript { max-width: 520px; margin: 15vh auto; padding: 24px; text-align: center; }
.noscript h1 { font-size: 26px; margin-bottom: 8px; }
