/* ==================================================================
   Mobile-Fix — Lohnhelden
   ------------------------------------------------------------------
   NACH assets/style.css einbinden, sonst greifen die Overrides nicht.
   Alle Regeln sind additiv — es wird nichts gelöscht.

   Gemessene Ausgangslage: von 27.305 Zeichen CSS entfielen 868 auf
   Bildschirme unter 720 px. Navigation, Schriftgrößen, Buttons und
   Touch-Targets waren dort gar nicht berücksichtigt.
   ================================================================== */


/* ------------------------------------------------------------------
   1. KONTRASTE — alle Werte nachgerechnet (WCAG AA)
   ------------------------------------------------------------------ */

/* Der schlimmste Fall: „4,8/5" stand in rgb(22,24,29) auf dem dunklen
   Hero-Hintergrund rgb(20,27,45) — Kontrast 1,04:1, praktisch unsichtbar.
   Weiß ergibt 17,15:1. */
.chip.stars b,
.chip.stars strong,
.trust-chips .chip b,
.trust-chips .chip strong {
  color: #fff;
}

/* Falls derselbe Chip auf hellem Grund wiederverwendet wird, greift
   diese Regel und stellt die dunkle Schrift wieder her. */
.section .chip.stars b,
.section .trust-chips .chip b {
  color: #16181d;
}

/* Rechner-Hilfstexte: waren rgb(160,164,174) auf #f7f7f9 = 2,33:1.
   rgb(110,114,124) ergibt exakt 4,5:1. */
.calc-tier,
.calc-note,
.calc-scale span {
  color: rgb(110, 114, 124);
}

/* Kleintexte allgemein: waren rgb(138,143,154) auf Weiß = 3,24:1.
   rgb(113,118,129) ergibt 4,55:1. */
.calc-result small,
.calc-row small,
small {
  color: rgb(113, 118, 129);
}

/* Magenta auf grauen Flächen: rgb(230,0,126) auf #f6f6f9 = 4,17:1,
   knapp unter der Anforderung. rgb(190,0,105) ergibt 5,74:1 auf Grau
   und 6,19:1 auf Weiß und bleibt als Markenfarbe klar erkennbar.
   Gilt nur für Text — Flächen und Buttons behalten das Original-Magenta. */
.section.soft a:not(.btn),
.section.soft .eyebrow,
.section.soft .label,
.soft a:not(.btn),
.soft .eyebrow,
.soft .label,
.toc a,
.toc b {
  color: rgb(190, 0, 105);
}

/* Sterne sind Dekoration. Im Markup zusätzlich aria-hidden="true"
   setzen, dann muss ihr Kontrast nicht bewertet werden. */
.chip.stars .st,
.stars-inline {
  color: rgb(224, 158, 0);
}


/* ------------------------------------------------------------------
   2. MOBILMENÜ
   ------------------------------------------------------------------
   Im bestehenden CSS liegt bereits ein vollständiges Mobilmenü — aber
   für .nav-menu / .nav.nav-open. Das HTML benutzt nav.top / .navlinks,
   deshalb greift es nie. Diese Regeln setzen dasselbe Verhalten für die
   tatsächlich verwendeten Klassen um, ohne das HTML umzubenennen.

   --navh setzt mobilmenu.js auf die echte Kopfhöhe (gemessen 77 px,
   nicht die im Alt-CSS angenommenen 84 px).
   ------------------------------------------------------------------ */

.navburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid var(--line, #e3e3e8);
  border-radius: 12px;
  background: #fff;
  color: #16181d;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.navburger:focus-visible {
  outline: 2px solid rgb(190, 0, 105);
  outline-offset: 2px;
}

@media (max-width: 1120px) {

  .navburger { display: flex; }

  /* Reihenfolge im Kopf: Logo — Burger — CTA */
  nav.top .navburger { order: 2; margin-left: auto; }
  nav.top .navcta    { order: 3; margin-left: 10px; }

  nav.top .navlinks {
    display: none;
    position: fixed;
    top: var(--navh, 77px);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 22px 22px;
    background: #fff;
    border-bottom: 1px solid var(--line, #e3e3e8);
    box-shadow: 0 18px 30px -18px rgba(0, 0, 0, .35);
    max-height: calc(100vh - var(--navh, 77px));
    overflow-y: auto;
    overscroll-behavior: contain;
    z-index: 90;
  }

  /* Überschreibt ein evtl. spezifischeres display:none aus style.css */
  nav.top.nav-open .navlinks { display: flex !important; }

  nav.top .navlinks > a {
    display: block;
    width: 100%;
    padding: 15px 2px;
    min-height: 48px;
    font-size: 17px;
    border-bottom: 1px solid var(--line, #f0f0f3);
  }

  nav.top .navlinks > a:last-child { border-bottom: 0; }

  /* Hintergrund sperren, solange das Menü offen ist */
  body.nav-locked { overflow: hidden; }
}

/* Kopfzeile: Logo (135 px) + Burger + CTA passten bei 390 px nicht in
   die Zeile — der CTA lief 19 px über den Rand. Ursachen waren 32 px
   Wrap-Padding, ein zu großes Logo und ein von Flex auf 17 px
   gestauchter Burger. Diese Werte sind bei 390 px und 320 px getestet. */
@media (max-width: 700px) {
  nav.top .wrap {
    padding-left: 16px;
    padding-right: 16px;
    gap: 8px;
  }
  nav.top .logo { font-size: 22px; }
  nav.top .navburger {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
  }
  nav.top .navcta {
    flex: 0 1 auto;
    min-width: 0;
  }
  nav.top .navcta .btn {
    padding: 11px 14px;
    font-size: 13px;
    white-space: nowrap;
  }
  nav.top .navphone { display: none; }
}

/* Unter 420 px wird es eng: Dort kürzt mobilmenu.js zusätzlich den
   Button-Text auf „Angebot". Ohne diese Kombination lief die Seite
   auf einem iPhone SE (320 px) um 39 px über. */
@media (max-width: 420px) {
  nav.top .wrap {
    padding-left: 14px;
    padding-right: 14px;
    gap: 6px;
  }
  nav.top .logo { font-size: 19px; }
  nav.top .navcta .btn { padding: 10px 12px; }
}


/* ------------------------------------------------------------------
   3. TYPOGRAFIE
   ------------------------------------------------------------------
   Die letzte Anpassung der Überschriften greift bei 900 px, darunter
   passiert nichts mehr. Die H1 hatte 34 px bei 35,7 px Zeilenabstand,
   also 1,05 — die Zeilen kleben aneinander.
   ------------------------------------------------------------------ */

@media (max-width: 700px) {
  .hero h1,
  .hero-home h1,
  main h1 {
    font-size: 30px;
    line-height: 1.18;
    letter-spacing: -.01em;
  }
  .section h2,
  main h2 {
    font-size: 25px;
    line-height: 1.24;
  }
  main h3 { font-size: 19px; line-height: 1.3; }
  .lead   { font-size: 17px; line-height: 1.6; }
}

@media (max-width: 560px) {
  .hero h1,
  .hero-home h1,
  main h1 { font-size: 27px; }

  .section h2,
  main h2 { font-size: 23px; }

  /* Keine Schrift unter 14 px — gemessen waren 11, 12 und 13 px */
  small,
  .calc-note,
  .calc-tier,
  .calc-scale span,
  .price-note,
  .eyebrow,
  .label { font-size: 14px; }
}

/* Sehr schmale Geräte (iPhone SE, 320 px) */
@media (max-width: 360px) {
  .hero h1,
  .hero-home h1,
  main h1 { font-size: 24px; }
  .section h2, main h2 { font-size: 21px; }
  .wrap { padding: 0 16px; }
  nav.top .navcta .btn { padding: 11px 12px; font-size: 13px; }
}


/* ------------------------------------------------------------------
   4. TOUCH-TARGETS
   ------------------------------------------------------------------
   Gemessen: 8 Elemente unter 44 px. Inhaltsverzeichnis-Links 37 px,
   Footer-Link „Baulohn" nur 18 px hoch.
   ------------------------------------------------------------------ */

@media (max-width: 1120px) {
  .toc a,
  .toc ol > li > a {
    display: block;
    min-height: 44px;
    padding: 11px 4px;
    line-height: 1.35;
  }

  footer.site a,
  .footer-grid a {
    display: inline-block;
    min-height: 44px;
    padding: 11px 0;
    line-height: 1.35;
  }

  .sticky-m a,
  .sticky-cta a { min-height: 48px; }
}


/* ------------------------------------------------------------------
   5. KLEINIGKEITEN
   ------------------------------------------------------------------ */

/* Anker-Sprünge dürfen nicht unter dem klebenden Kopf landen */
[id] { scroll-margin-top: calc(var(--navh, 77px) + 12px); }

/* Flex-/Grid-Kinder mit min-width:auto schrumpfen nicht unter ihre
   Inhaltsbreite. Das Inhaltsverzeichnis war dadurch bei 320 px
   321 px breit, obwohl der Container nur 256 px hatte. */
@media (max-width: 1120px) {
  .toc,
  .deep,
  .deepbody { min-width: 0; }

  .toc a,
  .toc b,
  main p,
  main li,
  main h1,
  main h2,
  main h3 { overflow-wrap: anywhere; }
}

/* Tabellen: der visuelle Hinweis auf horizontales Scrollen fehlte */
@media (max-width: 720px) {
  table.cmp-table {
    background:
      linear-gradient(to right, #fff 30%, rgba(255,255,255,0)),
      linear-gradient(to right, rgba(255,255,255,0), #fff 70%) 100% 0,
      radial-gradient(farthest-side at 0 50%, rgba(0,0,0,.18), transparent),
      radial-gradient(farthest-side at 100% 50%, rgba(0,0,0,.18), transparent) 100% 0;
    background-repeat: no-repeat;
    background-size: 40px 100%, 40px 100%, 14px 100%, 14px 100%;
    background-attachment: local, local, scroll, scroll;
  }
}

@media (prefers-reduced-motion: reduce) {
  nav.top .navlinks { transition: none !important; }
}
