/* ==========================================================================
   flexible-pc – zentrale Gestaltung für alle Seiten
   --------------------------------------------------------------------------
   Aufbau dieser Datei:
     1. Schriften (liegen lokal im Ordner /fonts, keine Verbindung zu Google)
     2. Farben für Hell und Dunkel
     3. Grundlagen (Text, Links, Abstände)
     4. Kopf mit Logo, Menü und Hell/Dunkel-Schalter
     5. Bausteine (Knopf, Einstieg, Rack, Hardware-Liste, Vergleichstabelle, Textseiten, Inhaltsseiten)
     6. Fußzeile und „Nach oben“-Knopf
     7. Anpassungen für Handy und Tablet (und 8. nur Handy)
   Farben ändern: nur Abschnitt 2 anpassen – der Rest greift darauf zu.
   ========================================================================== */


/* ---------- 1. Schriften ---------- */
@font-face { font-family: "Young Serif"; src: url("../fonts/YoungSerif-Regular.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("../fonts/InstrumentSans-Regular.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("../fonts/InstrumentSans-Bold.woff") format("woff"); font-weight: 700; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/JetBrainsMono-Regular.woff") format("woff"); font-weight: 400; font-display: swap; }


/* ---------- 2. Farben ---------- */
/* Hell (Standard) */
:root {
  --bg: #F2F5F8;            /* Seitenhintergrund */
  --panel: #FFFFFF;         /* Kästen, Tabellen */
  --ink: #0F2236;           /* Haupttext */
  --ink-soft: #4B5D72;      /* Nebentext */
  --line: #D5DDE6;          /* Trennlinien, Rahmen */
  --steel: #2F6DB5;         /* Stahlblau: Links, Knöpfe, Logo */
  --steel-strong: #1F5291;  /* Stahlblau beim Darüberfahren */
  --on-steel: #FFFFFF;      /* Text auf Stahlblau */
  --rack: #1A2D44;          /* Rack-Gehäuse */
  --rack-unit: #233A56;     /* Rack-Einschub */
  --led-ok: #3FAE6A;        /* grüne LED */
  --led-act: #E8A33D;       /* orange LED, Fokus-Rahmen */
}

/* Dunkel, wenn das Gerät auf dunkel steht und niemand von Hand „Hell“ gewählt hat */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F2236; --panel: #15304B; --ink: #E3EBF4; --ink-soft: #9FB2C7; --line: #24425F;
    --steel: #6FA6E6; --steel-strong: #9CC3F0; --on-steel: #0F2236; --rack: #0A1828; --rack-unit: #132A42;
  }
}

/* Dunkel, wenn von Hand „Dunkel“ gewählt wurde (gleiche Werte wie oben) */
:root[data-theme="dark"] {
  --bg: #0F2236; --panel: #15304B; --ink: #E3EBF4; --ink-soft: #9FB2C7; --line: #24425F;
  --steel: #6FA6E6; --steel-strong: #9CC3F0; --on-steel: #0F2236; --rack: #0A1828; --rack-unit: #132A42;
}


/* ---------- 3. Grundlagen ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* Sanftes Scrollen (z. B. „Nach oben“) – nur wenn das Gerät Bewegung nicht reduziert haben möchte */
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 1.0625rem/1.6 "Instrument Sans", system-ui, sans-serif; }
a { color: var(--steel); text-underline-offset: .18em; }
a:hover { color: var(--steel-strong); }
:focus-visible { outline: 3px solid var(--led-act); outline-offset: 3px; border-radius: 3px; }

/* Inhaltsbreite: max. 1160 px, am Rand immer etwas Luft */
.wrap { width: min(1160px, 100% - 2.5rem); margin-inline: auto; }

/* Überschriften in der Serifenschrift */
h1, h2, h3 { font-family: "Young Serif", Georgia, serif; font-weight: 400; letter-spacing: -.015em; line-height: 1.1; margin: 0; }
h1 { font-size: clamp(2.4rem, 5.4vw, 4.2rem); }
h2 { font-size: clamp(1.8rem, 3.2vw, 2.6rem); margin-bottom: 1rem; }

/* Befehle und Code */
code { font: .9em "JetBrains Mono", ui-monospace, monospace; background: var(--panel); border: 1px solid var(--line); padding: .1em .35em; border-radius: 4px; }

/* „Zum Inhalt springen“ – nur sichtbar, wenn man per Tastatur navigiert */
.skip { position: absolute; left: -999px; top: .5rem; background: var(--panel); color: var(--ink); padding: .5rem 1rem; border-radius: 6px; z-index: 20; }
.skip:focus { left: 1rem; }

/* Ein Abschnitt mit Trennlinie oben */
.section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; border-top: 1px solid var(--line); }
.section p { color: var(--ink-soft); max-width: 36rem; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: start; }


/* ---------- 4. Kopf ---------- */
.site-head { border-bottom: 1px solid var(--line); position: relative; }
.head { display: flex; align-items: center; gap: 1.4rem; min-height: 4.5rem; }

/* Logo: grüne LED + Schriftzug */
.logo { display: inline-flex; align-items: center; gap: .6rem; margin-right: auto; color: var(--ink); text-decoration: none;
  font: 400 1.55rem/1 "Young Serif", Georgia, serif; letter-spacing: -.01em; }
.logo:hover { color: var(--ink); }
.logo .wm { font-weight: 400; }
.logo .wm span { color: var(--steel); }
.logo i { width: .55rem; height: .55rem; border-radius: 50%; background: var(--led-ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--led-ok) 25%, transparent); }

/* Hauptmenü */
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: .25rem; }
.main-nav a { display: block; color: var(--ink); text-decoration: none; font-weight: 700; font-size: .96rem; padding: .45rem .7rem; border-radius: 6px; }
.main-nav a:hover { background: var(--panel); color: var(--ink); }
.main-nav a[aria-current="page"] { background: var(--ink); color: var(--bg); }

/* Schalter Hell/Dunkel und Menü-Knopf (Handy) */
.theme-btn, .menu-btn { font: inherit; font-size: .9rem; color: var(--ink); background: var(--panel); border: 1px solid var(--line);
  border-radius: 6px; padding: .4rem .75rem; cursor: pointer; display: inline-flex; align-items: center; gap: .4rem; }
.theme-btn svg, .menu-btn svg { width: 1.1rem; height: 1.1rem; }
.menu-btn { display: none; }


/* ---------- 5. Bausteine ---------- */

/* Knopf */
.btn { display: inline-block; background: var(--steel); color: var(--on-steel); font-weight: 700; text-decoration: none; padding: .8rem 1.25rem; border-radius: 6px; }
.btn:hover { background: var(--steel-strong); color: var(--on-steel); }

/* Einstieg oben auf der Startseite */
.hero { padding: clamp(2.5rem, 7vw, 5.5rem) 0; }
.hero-grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.lead { font-size: 1.2rem; color: var(--ink-soft); max-width: 32rem; margin: 1.3rem 0 1.8rem; }

/* Rack mit Einschüben (HE = Höheneinheit) */
.rack { background: var(--rack); border-radius: 10px; padding: 12px 26px; position: relative; box-shadow: 0 24px 50px -24px rgba(5, 15, 30, .55); }
.rack::before, .rack::after { content: ""; position: absolute; top: 12px; bottom: 12px; width: 8px;
  background: repeating-linear-gradient(to bottom, transparent 0 9px, rgba(255,255,255,.18) 9px 13px); }
.rack::before { left: 9px; }
.rack::after { right: 9px; }
.unit { display: grid; grid-template-columns: 3.2rem 1fr auto; align-items: center; gap: 1rem;
  background: var(--rack-unit); color: #DCE6F1; text-decoration: none; border-radius: 4px;
  padding: .85rem 1.1rem; margin: 7px 0; border: 1px solid rgba(255,255,255,.06); }
.unit:hover { border-color: var(--led-act); color: #DCE6F1; }
.unit .he { font: 400 .78rem "JetBrains Mono", ui-monospace, monospace; color: #8FA6BF; }
.unit strong { display: block; font: 400 1.2rem/1.2 "Young Serif", Georgia, serif; color: #fff; }
.unit .sub { font-size: .92rem; color: #A9BBCF; }
.leds { display: flex; gap: 6px; }
.leds b { width: 8px; height: 8px; border-radius: 50%; background: var(--led-ok); }
.leds b.act { background: var(--led-act); }
/* Blinken nur, wenn das Gerät Bewegung nicht reduziert haben möchte */
@media (prefers-reduced-motion: no-preference) {
  .leds b.act { animation: blink 1.6s steps(2, end) infinite; }
  .unit:nth-child(2) .leds b.act { animation-duration: 1.1s; }
  .unit:nth-child(3) .leds b.act { animation-duration: 2.3s; }
  .unit:nth-child(4) .leds b.act { animation-duration: 1.4s; }
  @keyframes blink { 50% { opacity: .25; } }
}

/* Hardware-Stichworte */
.hw-grid { grid-template-columns: 1fr 1.3fr; }
.tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .6rem; }
.tags li { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: .5rem .85rem; font-size: .98rem; }

/* Vergleichstabelle */
.compare { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; }
.compare table { width: 100%; min-width: 30rem; border-collapse: collapse; font-size: .97rem; }
.compare th, .compare td { text-align: left; padding: .8rem 1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.compare tr:last-child td { border-bottom: 0; }
.compare td:first-child { color: var(--ink-soft); width: 34%; }


/* Textseiten (Impressum, Datenschutz): ruhige Lesebreite */
.page { padding: clamp(2.5rem, 6vw, 4.5rem) 0 4rem; }
.prose { max-width: 44rem; }
.prose h1 { font-size: clamp(2.2rem, 4.5vw, 3.2rem); margin-bottom: 1.5rem; }
.prose h2 { font-size: 1.45rem; margin: 2.4rem 0 .6rem; }
.prose p, .prose li { color: var(--ink-soft); }
.prose ul { padding-left: 1.2rem; }
.prose li { margin: .25rem 0; }
.prose address { font-style: normal; color: var(--ink); line-height: 1.7; }
.prose .stand { margin-top: 3rem; font-size: .9rem; }


/* Inhaltsseiten (Privat, Firmen, Hardware ...) */
.page-intro { max-width: 44rem; }
.page-intro h1 { font-size: clamp(2.2rem, 4.8vw, 3.4rem); }
.page-intro .lead { margin-bottom: 0; }
.block { margin-top: clamp(2.5rem, 5vw, 3.5rem); }
.block > h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
.block > p { color: var(--ink-soft); max-width: 44rem; }
.block .compare { max-width: 52rem; margin-top: 1.5rem; }

/* Bildschirmfotos mit Bildunterschrift */
.shot { margin: 1.5rem 0 0; max-width: 52rem; }
.shot img { display: block; width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line); box-shadow: 0 18px 40px -24px rgba(5, 15, 30, .45); }
.shot figcaption { margin-top: .6rem; font-size: .9rem; color: var(--ink-soft); }

/* Schwerpunkte: Liste mit fettem Begriff und kurzer Erklärung, zweispaltig */
.focus { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .2rem 2.5rem; }
.focus li { border-top: 1px solid var(--line); padding: .85rem 0; color: var(--ink-soft); }
.focus strong { display: block; color: var(--ink); }

/* Ablauf in Schritten (echte Reihenfolge, daher nummeriert) */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.steps li { counter-increment: step; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 1.1rem 1.2rem 1.2rem; }
.steps li::before { content: "Schritt " counter(step); display: block; margin-bottom: .4rem;
  font: 400 .8rem "JetBrains Mono", ui-monospace, monospace; color: var(--ink-soft); }

/* Hervorgehobener Kasten */
.callout { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--steel); border-radius: 10px; padding: 1.3rem 1.5rem; max-width: 44rem; }
.callout h2 { font-size: 1.45rem; margin-bottom: .6rem; }
.callout p { margin: 0; color: var(--ink-soft); }
.cta { margin-top: clamp(2.5rem, 5vw, 3.5rem); }

/* Kontaktdaten: Bezeichnung links, Angabe rechts */
.contact dl { margin: 0; max-width: 36rem; }
.contact dl div { display: grid; grid-template-columns: 7rem 1fr; gap: 1rem; padding: .9rem 0; border-top: 1px solid var(--line); }
.contact dl div:last-child { border-bottom: 1px solid var(--line); }
.contact dt { color: var(--ink-soft); }
.contact dd { margin: 0; font-size: 1.2rem; color: var(--ink); }
.contact dd a { font-weight: 700; }
.contact > p { margin-top: 1.4rem; }
.callout ul { margin: 0; padding-left: 1.2rem; color: var(--ink-soft); }
.callout li { margin: .3rem 0; }


/* ---------- 6. Fußzeile und „Nach oben“-Knopf ---------- */
.site-foot { border-top: 1px solid var(--line); padding: 2.2rem 0; font-size: .95rem; color: var(--ink-soft); }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.2rem; }
.foot ul { list-style: none; display: flex; flex-wrap: wrap; gap: 1.3rem; margin: 0; padding: 0; }
.foot a { color: var(--ink); }
.foot a[aria-current="page"] { font-weight: 700; }
.note { margin: .9rem 0 0; font-size: .88rem; }

/* „Nach oben“-Knopf: rund, unten rechts.
   Ohne JavaScript immer sichtbar; mit JavaScript erst nach etwa einer Bildschirmhöhe (Klasse is-hidden). */
.to-top { position: fixed; right: 1.25rem; bottom: max(1.25rem, env(safe-area-inset-bottom)); z-index: 15;
  width: 2.9rem; height: 2.9rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--steel); color: var(--on-steel); box-shadow: 0 8px 20px -8px rgba(5, 15, 30, .5);
  transition: opacity .2s, transform .2s, visibility .2s; }
.to-top:hover { background: var(--steel-strong); color: var(--on-steel); }
.to-top svg { width: 1.3rem; height: 1.3rem; }
.to-top.is-hidden { opacity: 0; visibility: hidden; transform: translateY(.6rem); }


/* ---------- 7. Handy und Tablet (schmaler als 960 px) ---------- */
@media (max-width: 960px) {
  .menu-btn { display: inline-flex; }
  .main-nav { position: absolute; left: 0; right: 0; top: 100%; background: var(--bg); border-bottom: 1px solid var(--line); display: none; z-index: 10; }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; padding: .6rem 1.25rem 1rem; }
  .main-nav a { padding: .8rem .7rem; }
  .theme-btn .label { display: none; }
  .hero-grid, .two-col, .hw-grid { grid-template-columns: 1fr; }
  .two-col { gap: 1.5rem; }
  .rack { padding: 10px 22px; }
  .compare th, .compare td { padding: .65rem .7rem; }
  .compare table { min-width: 26rem; font-size: .92rem; }
  .site-foot { padding-bottom: 5rem; }
  .focus, .steps { grid-template-columns: 1fr; }   /* Platz, damit der „Nach oben“-Knopf keine Links verdeckt */
}


/* ---------- 8. Nur Handy (schmaler als 640 px) ---------- */
/* Vergleichstabelle: jede Zeile wird ein eigener Block (Merkmal oben, darunter beide Produkte).
   Die Produktnamen kommen aus dem Attribut data-label der Tabellenzellen. */
@media (max-width: 640px) {
  .compare { overflow: visible; }
  .compare table { min-width: 0; }
  .compare thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .compare tr { display: block; padding: .85rem 1rem; border-bottom: 1px solid var(--line); }
  .compare tbody tr:last-child { border-bottom: 0; }
  .compare td { display: grid; grid-template-columns: 8.5rem 1fr; gap: .6rem; padding: .15rem 0; border: 0; width: auto; }
  .compare td:first-child { display: block; width: auto; margin-bottom: .3rem; font-weight: 700; color: var(--ink); }
  .compare td[data-label]::before { content: attr(data-label); color: var(--ink-soft); }
}
