/*
 * ============================================================
 *  KLARTEXT – Werkzeugkarten Design System
 *  style-karten.css · v1.0
 *
 *  Einbinden in jede Einzelkarte:
 *    <link rel="stylesheet" href="style-karten.css">
 *
 *  Schriftarten separat einbinden (einmalig pro HTML-Datei):
 *    <link rel="preconnect" href="https://fonts.googleapis.com">
 *    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
 *    <link href="https://fonts.googleapis.com/css2?family=Playfair+Display:
 *      ital,wght@0,700;1,400&family=DM+Sans:ital,wght@0,300;0,400;0,500;
 *      1,400&display=swap" rel="stylesheet">
 *
 *  Modul-Farben (als CSS-Variable pro Karte überschreiben):
 *    M0 #1B3A4B Dunkelblau  · M1 #2E5E8A Stahlblau  · M2 #3B8A68 Waldgrün
 *    M3 #B07D2A Ocker        · M4 #5D3A7A Violett    · M5 #B7500A Orange
 *    M6 #D81B60 Pink-Rot     · M7 #8B4A38 Terracotta · M8 #6B3F6B Pflaume
 *    MH #C47A00 Goldorange   · FK #C62828 Feuerwehr (eigenes Design)
 *
 *  Für Modul 3 (Standard) sind --m3-* Variablen vorbelegt.
 *  Andere Module: --m3 und --m3-* am Anfang der jeweiligen
 *  HTML-Datei in einem <style>:root{} Block überschreiben.
 * ============================================================
 */

/* ── Design Tokens ──────────────────────────────────────────────────────── */
:root {
  /* Systemfarben */
  --kt-primary:  #1B3A4B;
  --kt-accent:   #6EC6A0;
  --kt-paper:    #F5F0E8;
  --kt-ink:      #2D2D2D;
  --kt-muted:    #7A7060;
  --kt-surface:  #FFFFFF;
  --kt-border:   #DDD8CE;

  /* Modul-Akzentfarbe (Standard: Modul 3) */
  --m3:          #B07D2A;
  --m3-dark:     #7A5318;
  --m3-light:    #FBF4E8;
  --m3-border:   #E0C88A;

  /* Formen */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;

  /* Schatten */
  --shadow:    0 2px 10px rgba(27,58,75,.09);
  --shadow-lg: 0 6px 28px rgba(27,58,75,.14);

  /* Spacing (mobile-first, per Media Query überschrieben) */
  --gap-body:  1rem;
  --pad-h:     1.1rem;
  --pad-card:  clamp(.85rem, 2.5vw, 1.3rem);
}

/* ── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Base ───────────────────────────────────────────────────────────────── */
html { scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--kt-paper);
  color: var(--kt-ink);
  line-height: 1.65;
  font-size: 15px;
  -webkit-text-size-adjust: 100%;
}

/* ── Page-Header ────────────────────────────────────────────────────────── */
.kt-header {
  background: var(--kt-primary);
  padding: .9rem var(--pad-h);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-lg);
}
.kt-header-inner {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: .75rem;
}

/* Logo */
.kt-logo {
  display: flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
  flex-shrink: 0;
}
.kt-logo-mark {
  width: 36px; height: 36px;
  background: var(--kt-primary);
  border: 2px solid var(--kt-accent);
  border-radius: var(--r-sm);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 3px; padding: 5px 6px;
}
.kt-logo-mark .lm-k::before {
  content: 'K';
  font-family: 'Playfair Display', serif;
  font-size: 13px; font-weight: 700;
  color: #fff; line-height: 1;
}
.kt-logo-bars { display: flex; flex-direction: column; gap: 2px; width: 100%; }
.kt-logo-bars span { height: 2px; border-radius: 2px; background: var(--kt-accent); display: block; }
.kt-logo-bars span:nth-child(1) { width: 100%; }
.kt-logo-bars span:nth-child(2) { width: 70%; opacity: .7; }
.kt-logo-bars span:nth-child(3) { width: 85%; opacity: .5; }

.kt-logo-text { color: #fff; }
.kt-logo-text .wort  { font-family: 'Playfair Display', serif; font-size: 1.2rem; font-weight: 700; letter-spacing: .06em; line-height: 1; display: block; }
.kt-logo-text .claim { font-size: .72rem; color: var(--kt-accent); letter-spacing: .14em; display: block; margin-top: 2px; }

/* Home-Button */
.kt-home-btn {
  display: flex;
  align-items: center;
  gap: .4rem;
  background: rgba(110,198,160,.15);
  border: 1.5px solid rgba(110,198,160,.4);
  border-radius: var(--r-sm);
  color: var(--kt-accent);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .06em;
  padding: .3rem .65rem;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s, border-color .15s;
}
.kt-home-btn:hover { background: rgba(110,198,160,.25); border-color: var(--kt-accent); }
.kt-home-btn svg { width: 13px; height: 13px; fill: currentColor; flex-shrink: 0; }

/* Zurück-Button */
.kt-back-btn {
  display: flex;
  align-items: center;
  gap: .35rem;
  background: rgba(110,198,160,.12);
  border: 1.5px solid rgba(110,198,160,.35);
  border-radius: var(--r-sm);
  color: var(--kt-accent);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .05em;
  padding: .3rem .6rem;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background .15s, border-color .15s;
}
.kt-back-btn:hover { background: rgba(110,198,160,.25); border-color: var(--kt-accent); }
.kt-back-btn svg   { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Logo immer zentriert – drückt Zurück links, Dashboard rechts */
.kt-header-inner .kt-logo { margin: 0 auto; }

/* Home-Button: kein eigenes margin-left nötig, Logo übernimmt das Spacing */
.kt-home-btn { margin-left: 0; }

/* ── Modul-Kontext-Zeile ────────────────────────────────────────────────── */
.kt-context {
  background: var(--m3);
  padding: .35rem var(--pad-h);
  font-size: .68rem;
  color: rgba(255,255,255,.7);
  letter-spacing: .12em;
  text-align: center;
}

/* ── Haupt-Container ────────────────────────────────────────────────────── */
main {
  max-width: 680px;
  margin: 0 auto;
  padding: 1.25rem var(--pad-h) 4rem;
}

/* ── Karte (Wrapper) ────────────────────────────────────────────────────── */
.karte {
  background: var(--kt-surface);
  border: 1.5px solid var(--m3-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.karte-stripe {
  height: 4px;
  background: var(--m3);
}

/* ── Karte: Header ──────────────────────────────────────────────────────── */
.karte-header {
  background: var(--m3);
  padding: var(--pad-card) var(--pad-card) .9rem;
  display: flex;
  gap: .8rem;
  align-items: flex-start;
}
.karte-meta-wrap { flex: 1; min-width: 0; }

.modul-tag {
  display: inline-block;
  font-size: .6rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  padding: .1rem .42rem;
  border-radius: 3px;
  background: rgba(255,255,255,.2);
  color: #fff;
  margin-bottom: .22rem;
}

.karte-nr {
  font-size: .62rem;
  letter-spacing: .2em; text-transform: uppercase;
  color: rgba(255,255,255,.6);
  font-weight: 500;
  margin-bottom: .18rem;
}

/* Untertitel-Logik: .karte-untertitel blendet sich aus, wenn leer */
.karte-untertitel {
  font-size: .62rem;
  letter-spacing: .18em; text-transform: uppercase;
  color: rgba(255,255,255,.45);
  font-weight: 400;
  margin-top: .1rem;
}
.karte-untertitel:empty { display: none; }

.karte-titel {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.1rem, 3.5vw, 1.35rem);
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.karte-icon-wrap {
  width: 44px; height: 44px;
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
  background: rgba(255,255,255,.15);
  overflow: hidden;
}
.karte-icon-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: var(--r-sm);
}

/* ── Karte: Lead ────────────────────────────────────────────────────────── */
.karte-lead {
  font-size: .9rem;
  color: var(--m3-dark);
  line-height: 1.6;
  background: var(--m3-light);
  border-bottom: 1.5px solid var(--m3-border);
  padding: .75rem var(--pad-card);
  font-weight: 500;
}

/* ── Karte: Body ────────────────────────────────────────────────────────── */
.karte-body {
  padding: var(--pad-card);
  display: flex;
  flex-direction: column;
  gap: var(--gap-body);
}

/* Abschnitt */
.ab-titel {
  font-size: .62rem;
  letter-spacing: .2em; text-transform: uppercase;
  font-weight: 600; color: var(--m3);
  margin-bottom: .42rem;
  padding-bottom: .28rem;
  border-bottom: 1px solid var(--m3-border);
}
.ab p {
  font-size: .9rem;
  line-height: 1.62;
  color: var(--kt-muted);
}
.ab ul {
  margin-top: .25rem;
  padding-left: 1.1rem;
  list-style: disc;
}
.ab ul li {
  font-size: .9rem;
  line-height: 1.65;
  color: #222;
  margin-bottom: 1px;
}

/* Trennlinie */
.divider { border: none; border-top: 1px solid var(--m3-border); }

/* ── Hinweis-Boxen ──────────────────────────────────────────────────────── */
.box {
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  padding: .65rem .9rem;
  font-size: .88rem;
  line-height: 1.58;
  border-left: 4px solid transparent;
}
.box-label {
  font-weight: 500;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .8px;
  margin-bottom: .25rem;
}
.box-gruen { background: #e8f5e9; border-color: #2e7d32; color: #1a4d2e; }
.box-gruen .box-label { color: #2e7d32; }
.box-blau  { background: #e3f2fd; border-color: #1565c0; color: #0d3c6e; }
.box-blau  .box-label { color: #1565c0; }
.box-rot   { background: #ffebee; border-color: #c62828; color: #7f0000; }
.box-rot   .box-label { color: #c62828; }
.box-gold  { background: var(--m3-light); border-color: var(--m3); color: var(--m3-dark); }
.box-gold  .box-label { color: var(--m3); }

/* ── Zwei-Spalten ───────────────────────────────────────────────────────── */
.zwei-spalten {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem 1rem;
}
.zwei-spalten-block h4 {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .6px;
  color: var(--m3); border-bottom: 1.5px solid var(--m3-border);
  padding-bottom: 3px; margin-bottom: 5px; font-weight: 500;
}
.zwei-spalten-block ul { padding-left: 1rem; list-style: disc; }
.zwei-spalten-block ul li { font-size: .88rem; line-height: 1.62; color: #222; }

/* ── Vier-Icon-Grid ─────────────────────────────────────────────────────── */
.vier-icon-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .65rem;
}
.icon-card {
  border: 1.5px solid var(--m3-border);
  border-radius: var(--r-md);
  padding: .65rem .75rem;
  background: #FDF8F0;
}
.icon-symbol { font-size: 1.35rem; margin-bottom: .22rem; display: block; }
.icon-titel  { font-weight: 500; font-size: .8rem; color: var(--m3-dark); margin-bottom: 3px; }
.icon-text   { font-size: .84rem; color: #333; line-height: 1.5; }

/* ── Ablauf (Schritt-für-Schritt) ───────────────────────────────────────── */
.ablauf         { display: flex; flex-direction: column; gap: 0; }
.ablauf-schritt { display: flex; align-items: flex-start; gap: .65rem; }
.ablauf-pfeil   { display: flex; flex-direction: column; align-items: center; flex-shrink: 0; width: 26px; }
.ablauf-kreis {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--m3); color: #fff;
  font-size: .74rem; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ablauf-linie  { width: 2px; height: 14px; background: var(--m3-border); margin: 2px 0; }
.ablauf-inhalt { padding-top: 3px; padding-bottom: 10px; }
.ablauf-inhalt strong { font-weight: 500; font-size: .83rem; color: var(--m3-dark); display: block; margin-bottom: 1px; }
.ablauf-inhalt span   { font-size: .85rem; color: #333; line-height: 1.5; }

/* ── Brainy-Block ───────────────────────────────────────────────────────── */
.brainy-block {
  display: flex;
  align-items: center;
  gap: .75rem;
  background: var(--m3-light);
  border: 1.5px solid var(--m3-border);
  border-radius: var(--r-md);
  padding: .7rem .9rem;
}
.brainy-block img {
  width: 44px; height: 44px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: var(--r-sm);
}
.brainy-block-text { font-size: .87rem; color: var(--m3-dark); line-height: 1.5; }
.brainy-block-text strong {
  font-weight: 500; display: block; margin-bottom: 2px;
  color: var(--m3); font-size: .78rem;
  text-transform: uppercase; letter-spacing: .06em;
}

/* ── Karte: Footer ──────────────────────────────────────────────────────── */
.karte-footer {
  background: var(--m3-light);
  border-top: 1.5px solid var(--m3-border);
  padding: .5rem var(--pad-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .3rem;
}
.footer-links { font-weight: 500; font-size: .68rem; color: var(--m3); opacity: .8; }
.footer-nr    { font-size: .68rem; color: #aaa; }

/* ── Seiten-Footer ──────────────────────────────────────────────────────── */
footer {
  background: var(--kt-primary);
  color: rgba(255,255,255,.55);
  text-align: center;
  padding: 1.5rem 1rem;
  font-size: .75rem;
  margin-top: 1.5rem;
  line-height: 1.9;
}
footer strong { color: var(--kt-accent); }
footer .footer-copy { font-size: .65rem; opacity: .4; margin-top: .6rem; display: block; }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  :root {
    --pad-h:    .75rem;
    --pad-card: .9rem;
    --gap-body: .85rem;
  }
  .zwei-spalten   { grid-template-columns: 1fr; }
  .vier-icon-grid { grid-template-columns: 1fr; }
  .karte-icon-wrap { display: none; }
  .kt-home-btn span { display: none; }
}
@media (min-width: 600px) {
  :root {
    --pad-card: 1.3rem;
    --gap-body: 1.1rem;
  }
}

/* ── Floating Action Buttons ─────────────────────────────────────────────── */
.kt-fab-group {
  position: fixed;
  bottom: 1.25rem;
  right: 1rem;
  display: flex;
  flex-direction: column;
  gap: .55rem;
  z-index: 9999;
  /* Safari iOS fix */
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}
.kt-fab {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--kt-primary);
  border: 2px solid var(--kt-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(27,58,75,.35);
  transition: background .15s, transform .15s;
  /* Safari tap highlight */
  -webkit-tap-highlight-color: transparent;
}
.kt-fab:hover, .kt-fab:active {
  background: var(--m3);
  transform: scale(1.07);
}
.kt-fab svg {
  width: 20px;
  height: 20px;
  stroke: var(--kt-accent);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.kt-fab--home svg {
  fill: var(--kt-accent);
  stroke: none;
}
/* Desktop: etwas kleiner und transparenter */
@media (min-width: 681px) {
  .kt-fab-group { opacity: 0.6; }
  .kt-fab-group:hover { opacity: 1; }
  .kt-fab { width: 40px; height: 40px; }
}

/* ── Karten-Navigation (Pfeil, dezent) ─────────────────────────────────── */
.karte-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .35rem var(--pad-card);
  border-top: 1px solid var(--m3-border);
  background: var(--m3-light);
}
.karte-nav a {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .72rem;
  font-weight: 600;
  color: var(--m3);
  text-decoration: none;
  opacity: .7;
  transition: opacity .15s;
  padding: .2rem .4rem;
  border-radius: 4px;
}
.karte-nav a:hover { opacity: 1; background: rgba(0,0,0,.04); }
.karte-nav .nav-prev svg { transform: rotate(180deg); }
.karte-nav .spacer { flex: 1; }
