/* =====================================================================
   MassFinder 4 - Gestaltung aller Seiten
   Abschnitte:
     1  Schriften
     2  Farben hell und dunkel
     3  Grundlagen
     4  Kopfzeile
     5  Seitengeruest und Baum
     6  Normale Seite (Inhalt, Bilder, Tabellen, Blaettern, "On this page")
     7  Startseite
     8  Fussbereich
     9  Schmale Bildschirme (Smartphone)
   ===================================================================== */


/* ---------- 1  Schriften (selbst gehostet, SIL Open Font License) ---------- */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(../schriften/inter-latin-wght-normal.woff2) format("woff2");
}
@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url(../schriften/newsreader-latin-opsz-normal.woff2) format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url(../schriften/jetbrains-mono-latin-wght-normal.woff2) format("woff2");
}


/* ---------- 2  Farben hell und dunkel ---------- */

:root {
  --font-text:  "Inter", sans-serif;
  --font-title: "Newsreader", serif;
  --font-mono:  "JetBrains Mono", monospace;

  --bg:        #ffffff;   /* Seitenhintergrund */
  --bg2:       #f4f6f6;   /* Code, Kaesten */
  --ink:       #14181b;   /* Haupttext, Ueberschriften */
  --ink2:      #33403f;   /* Fliesstext */
  --mute:      #4f5b60;   /* kleine Labels */
  --line:      #d9dedf;   /* Linien und Rahmen */
  --accent:    #0f5c6e;   /* Links, Hervorhebungen */
  --on-accent: #ffffff;   /* Schrift auf Akzentflaeche */
  --frame:     #fafbfb;   /* Hintergrund der Bildrahmen */
  --tint:      #e6f0f2;   /* aktuelle Seite im Baum */
  --foot:      #14181b;   /* Fussbereich */
  --foot-ink:  #e9eef0;
  --foot-text: #b9c4c4;
  --foot-mute: #8da0a0;
  --foot-line: #2c3438;
  --missing:   #b52e2e;   /* Platzhalter fuer fehlende Bilder */
}

:root[data-theme="dark"] {
  --bg:        #16191b;
  --bg2:       #1c2023;
  --ink:       #eef1f2;
  --ink2:      #c2cccd;
  --mute:      #9aa8aa;
  --line:      #2f373a;
  --accent:    #6bbccf;
  --on-accent: #0e1517;
  --frame:     #e6ebec;   /* bleibt hell, damit die Screenshots lesbar sind */
  --tint:      #1f2a2d;
  --foot:      #0f1214;
  --foot-line: #262d30;
  --missing:   #e07a7a;
}


/* ---------- 3  Grundlagen ---------- */

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 16px;
  line-height: 1.7;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
button { font-family: inherit; }

/* Links im Fliesstext */
.main p a,
.main li a,
.main td a,
.main pre a {
  color: var(--accent);
  border-bottom: 1px solid var(--line);
}

/* Kleines Label in Grossbuchstaben (ueber Titeln, "On this page", "Start here") */
.eyebrow,
.section-label {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.7;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.page-body { flex: 1 1 auto; }


/* ---------- 4  Kopfzeile ---------- */

.site-header {
  position: relative;
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: 1328px;
  margin: 0 auto;
  padding: 24px 56px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo { display: block; line-height: 0; }
.logo img { height: 48px; width: auto; }
.logo-for-dark { display: none; }
:root[data-theme="dark"] .logo-for-light { display: none; }
:root[data-theme="dark"] .logo-for-dark  { display: block; }

.theme-switch {
  margin-left: auto;
  min-height: 44px;
  padding: 6px 14px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
}
.theme-switch[hidden] { display: none; }

/* Menueknopf fuer das Smartphone (funktioniert ohne JavaScript) */
.mobile-menu { display: none; }
.mobile-menu summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  cursor: pointer;
}
.mobile-menu summary::-webkit-details-marker { display: none; }


/* ---------- 5  Seitengeruest und Baum ---------- */

.shell {
  max-width: 1328px;
  margin: 0 auto;
  padding: 40px 56px 96px;
  display: flex;
  gap: 48px;
  align-items: flex-start;
}
.tree { flex: 0 0 240px; min-width: 0; }
.main { flex: 1 1 0; min-width: 0; }

@media (min-width: 1001px) and (min-height: 950px) {
  .tree { position: sticky; top: 24px; }
}

.tree-list,
.tree-list ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.tree-list a {
  display: block;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 15px;
  line-height: 1.35;
}
.tree-list > li > a {
  margin-top: 4px;
  font-weight: 500;
}
.tree-list ul {
  margin: 2px 0 8px 12px;
  padding-left: 4px;
  border-left: 1px solid var(--line);
}
.tree-list ul a {
  font-size: 14.5px;
  font-weight: 400;
  color: var(--ink2);
}
.tree-list a[aria-current="page"] {
  background: var(--tint);
  color: var(--accent);
  font-weight: 500;
}


/* ---------- 6  Normale Seite ---------- */

.doc-row {
  display: flex;
  gap: 48px;
  align-items: flex-start;
}
.doc {
  flex: 1 1 0;
  min-width: 0;
  max-width: 760px;
}
.doc .eyebrow {
  margin: 0 0 20px;
  color: var(--accent);
}
.doc h1 {
  margin: 0 0 28px;
  font-family: var(--font-title);
  font-weight: 300;
  font-size: 60px;
  line-height: 1.02;
  letter-spacing: -0.025em;
  hyphens: auto;
}
.doc .lead {
  margin: 0 0 40px;
  font-size: 19px;
  line-height: 1.65;
}
.doc h2 {
  margin: 48px 0 16px;
  font-family: var(--font-title);
  font-weight: 400;
  font-size: 32px;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.doc .lead + h2 { margin-top: 0; padding-top: 8px; }
.doc h3 {
  margin: 32px 0 12px;
  font-family: var(--font-title);
  font-weight: 400;
  font-size: 24px;
  line-height: 1.2;
}
.doc h4 {
  margin: 24px 0 8px;
  font-size: 16px;
  font-weight: 600;
}
.doc p,
.doc ul,
.doc ol {
  margin: 0 0 16px;
  color: var(--ink2);
}
.doc ul,
.doc ol { padding-left: 22px; }
.doc li { margin-bottom: 6px; }
.doc b,
.doc strong { font-weight: 600; }
.doc small { font-size: 14px; }
.doc p.small {                 /* kleiner Absatz, z. B. "Stand: ..." */
  margin-top: 32px;
  font-size: 14px;
  color: var(--mute);
}
.doc code {
  font-family: var(--font-mono);
  font-size: 14px;
  background: var(--bg2);
  padding: 2px 6px;
  border-radius: 4px;
}
.doc pre {
  margin: 0 0 20px;
  padding: 16px 20px;
  overflow-x: auto;
  background: var(--bg2);
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink2);
}

/* Hervorgehobene Kaesten: class="note" (wichtig) und class="summary" (Zusammenfassung).
   Vorerst sehen beide gleich aus, wie der Kasten der Musterseite. */
.note,
.summary {
  clear: both;
  margin: 8px 0 40px;
  padding: 24px 28px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.doc .note p,
.doc .summary p { margin: 0 0 12px; color: var(--ink); }
.doc .note p:last-child,
.doc .summary p:last-child { margin-bottom: 0; }
.doc .note .note-title,
.doc .summary .note-title {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

/* Bilder mit Rahmen */
.figure { margin: 0 0 20px; }
.figure img,
.frame {
  display: block;
  box-sizing: content-box;
  max-width: calc(100% - 26px);
  height: auto;
  padding: 12px;
  background: var(--frame);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.float-right { float: right; clear: right; margin: 4px 0 16px 24px; }
.float-left  { float: left;  clear: left;  margin: 4px 24px 16px 0; }
.doc h2,
.pager { clear: both; }
.doc p img { vertical-align: middle; }   /* kleine Knopfbilder im Text */

/* Platzhalter fuer fehlende Bilder */
.missing-image {
  display: inline-block;
  margin: 0 0 20px;
  padding: 10px 14px;
  border: 1px dashed var(--missing);
  border-radius: 8px;
  color: var(--missing);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.4;
}
p .missing-image { margin: 0 6px 0 0; vertical-align: middle; }

/* Tabellen */
.table-wrap { margin: 0 0 24px; overflow-x: auto; }
.doc table {
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink2);
}
.doc th,
.doc td {
  padding: 6px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.doc th {
  color: var(--ink);
  font-weight: 600;
  border-bottom-color: var(--ink2);
}

/* Sortierbare Tabellen: Spaltenkoepfe werden per Skript zu Knoepfen */
.doc table.sortable th button {
  padding: 0;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.doc table.sortable th button::after {
  content: " \2195";              /* Doppelpfeil: sortierbar */
  color: var(--mute);
  font-family: var(--font-mono);
  font-size: 12px;
}
.doc table.sortable th[aria-sort="ascending"] button::after  { content: " \2191"; color: var(--accent); }
.doc table.sortable th[aria-sort="descending"] button::after { content: " \2193"; color: var(--accent); }
.doc table.sortable th button:hover { color: var(--accent); }
.doc table.sortable th button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Filterfeld ueber einer Tabelle (wird per Skript eingesetzt) */
.table-filter:not(:empty) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 0 0 16px;
  font-size: 15px;
  color: var(--ink2);
}
.table-filter input {
  width: 16em;
  max-width: 100%;
  padding: 6px 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  font: inherit;
}
.table-filter input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.table-filter-count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--mute);
}

/* Blaettern (Tutorial und Manual) */
.pager {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}
.pager a {
  flex: 1 1 260px;
  display: block;
  padding: 20px 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.pager .pager-next { text-align: right; }
.pager-label {
  display: block;
  margin-bottom: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--mute);
}
.pager-title {
  display: block;
  font-family: var(--font-title);
  font-size: 21px;
  line-height: 1.2;
}

/* "On this page" rechts */
.toc {
  flex: 0 0 200px;
  min-width: 0;
  position: sticky;
  top: 24px;
  font-size: 14px;
  line-height: 1.4;
}
.toc .section-label {
  margin: 0 0 14px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--mute);
}
.main .toc a {
  color: inherit;
  border-bottom: 0;
}
.main .toc a:hover { color: var(--accent); }
.toc ul {
  list-style: none;
  margin: 0;
  padding: 0 0 0 16px;
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
@media (max-width: 1359px) {
  .toc { display: none; }
}


/* ---------- 7  Startseite ---------- */

/* Aufmacher */
.hero {
  max-width: 1328px;
  margin: 0 auto;
  padding: 72px 56px 64px;
  display: flex;
  flex-wrap: wrap;
  gap: 48px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.hero-text,
.hero-figure { flex: 1 1 400px; min-width: 0; }
.hero .eyebrow {
  margin: 0 0 24px;
  color: var(--accent);
}
.hero h1 {
  margin: 0 0 28px;
  font-family: var(--font-title);
  font-weight: 300;
  font-size: clamp(40px, 6.2vw, 92px);
  line-height: 1;
  letter-spacing: -0.025em;
  white-space: nowrap;
}
.hero-lead {
  max-width: 560px;
  margin: 0 0 36px;
  font-size: 19px;
  line-height: 1.6;
  color: var(--ink2);
}
.hero-action { margin: 0; }
.button {
  display: inline-block;
  padding: 15px 28px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.7;
}
.button:hover { color: var(--on-accent); }
.hero-figure {
  box-sizing: border-box;
  padding: 16px;
  background: var(--frame);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.hero-figure img {
  display: block;
  width: 100%;
  max-width: 520px;
  height: auto;
  margin: 0 auto;
  border-radius: 3px;
}

.home .shell { padding-top: 48px; }

/* Einleitung unter dem Aufmacher */
.home .intro {
  max-width: 700px;
  margin: 0 0 64px;
  font-size: 19px;
  line-height: 1.65;
  color: var(--ink2);
}

/* Kacheln "Important features" */
.features .section-label {
  margin: 0 0 36px;
  color: var(--mute);
}
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 44px 40px;
}
.feature-number {
  display: block;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
}
.feature h3 {
  margin: 10px 0 12px;
  font-family: var(--font-title);
  font-weight: 400;
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.feature p {
  margin: 0;
  line-height: 1.6;
  color: var(--ink2);
}

/* Weitere Abschnitte der Startseite */
.home-section {
  margin-top: 72px;
  padding-top: 56px;
  border-top: 1px solid var(--line);
}
.home-section > h2 {
  margin: 0 0 32px;
  font-family: var(--font-title);
  font-weight: 300;
  font-size: clamp(30px, 3.4vw, 42px);
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.home-section > h2:has(+ .home-list) { margin-bottom: 28px; }
.home-section > h2:has(+ .demo)      { margin-bottom: 48px; }
.home-list {
  max-width: 700px;
  margin: 0;
  padding-left: 20px;
  line-height: 1.65;
  color: var(--ink2);
}
.home-list li { margin-bottom: 12px; }
.home-list li:last-child { margin-bottom: 0; }

/* Text links, Bilder rechts */
.demo + .demo { margin-top: 56px; }
.demo h3 {
  margin: 0 0 20px;
  font-family: var(--font-title);
  font-weight: 400;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.demo-row {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 40px;
  align-items: flex-start;
}
.demo-text,
.demo-figures { flex: 1 1 320px; min-width: 0; }
.demo-text-only { max-width: 640px; }
.demo-text ul {
  margin: 0;
  padding-left: 20px;
  line-height: 1.65;
  color: var(--ink2);
}
.demo-text li { margin-bottom: 12px; }
.demo-figures .frame { margin-bottom: 16px; }

/* Direktspruenge, nur auf dem Smartphone */
.start-here { display: none; }
.start-here .section-label {
  margin: 0 0 12px;
  color: var(--mute);
}
.start-here ul {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--ink);
}
.main .start-here a {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  color: inherit;
  font-family: var(--font-title);
  font-size: 21px;
  line-height: 1.2;
}
.start-here-arrow {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
}


/* ---------- 8  Fussbereich ---------- */

.site-footer {
  background: var(--foot);
  color: var(--foot-ink);
}
.footer-main,
.footer-bottom {
  max-width: 1328px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
}
.footer-main {
  padding: 80px 56px 48px;
  gap: 48px 64px;
}
.footer-intro { flex: 2 1 420px; min-width: 0; }
.footer-intro h2 {
  margin: 0 0 20px;
  font-family: var(--font-title);
  font-weight: 300;
  font-size: clamp(34px, 4vw, 50px);
  line-height: 1.08;
  letter-spacing: -0.02em;
}
.footer-intro p {
  max-width: 520px;
  margin: 0;
  line-height: 1.6;
  color: var(--foot-text);
}
.footer-contact {
  flex: 1 1 260px;
  font-size: 15px;
  line-height: 1.8;
}
.footer-contact h3 {
  margin: 0 0 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--foot-mute);
}
.footer-contact p { margin: 0; }
.site-footer a { text-decoration: underline; text-underline-offset: 3px; }
.site-footer a:hover { color: var(--foot-ink); }
.footer-bottom {
  padding: 24px 56px 40px;
  border-top: 1px solid var(--foot-line);
  justify-content: space-between;
  gap: 12px 32px;
  font-size: 13px;
  color: var(--foot-mute);
}
.footer-bottom p { margin: 0; }
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}


/* ---------- 9  Schmale Bildschirme (Smartphone) ---------- */

@media (max-width: 1000px) {
  .header-inner { padding: 16px 20px; gap: 8px; }
  .logo img { height: 40px; }
  .theme-switch { padding: 6px 10px; }

  /* Baum: statt der Spalte das aufklappbare Menue */
  .tree { display: none; }
  .mobile-menu { display: block; }
  .mobile-menu nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 10;
    padding: 12px 20px 20px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
  }

  .shell { flex-direction: column; gap: 24px; padding: 24px 20px 64px; }
  .main { width: 100%; }
  .doc h1 { font-size: clamp(36px, 10vw, 60px); }
  .float-right,
  .float-left { float: none; margin: 0 0 20px; }

  .hero { padding: 40px 20px; }
  .start-here {
    display: block;
    margin-top: 56px;
    padding-top: 40px;
    border-top: 1px solid var(--line);
  }

  .footer-main,
  .footer-bottom { padding-left: 20px; padding-right: 20px; }
}
