/* ==========================================================================
   KOMMtakt - Stylesheet
   Basiert auf design-spec.md (designer). Selbst gehostete Schrift "Inter",
   keine externen Ressourcen (C-10).
   ========================================================================== */

@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Markenfarbe (unveraendert, B-2) */
  --color-brand: #019894;
  /* Textvariante (dunkler, WCAG-AA-Kontrast fuer Fliesstext) */
  --color-brand-text: #017d7a;
  --color-brand-hover: #016560;
  --tint-10: #e3f5f4;
  --tint-20: #c7ecea;

  --bg: #ffffff;
  --bg-alt: #f7f9f9;
  --text-heading: #1f2a2a;
  --text-body: #2b3838;
  --text-muted: #5c6666;
  --border: #dde3e3;
  --bg-input: #f1f4f4;

  --error: #b3261e;
  --error-bg: #fbeae8;
  --success: #2e7d32;
  --success-bg: #eaf4ea;

  --radius: 8px;
  --radius-sm: 6px;
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
  --font-body: "Inter", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --max-width: 1200px;
  --space-page-x: clamp(16px, 4vw, 64px);
}

/* ---------- Reset / Basis ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-body);
  background: var(--bg);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-brand-text);
}

h1,
h2,
h3,
h4 {
  color: var(--text-heading);
  font-weight: 600;
  line-height: 1.25;
  margin: 0 0 0.6em;
}

h1 {
  font-size: 28px;
}

h2 {
  font-size: 24px;
}

h3 {
  font-size: 20px;
}

h4 {
  font-size: 18px;
}

@media (min-width: 640px) {
  h1 {
    font-size: 40px;
  }
  h2 {
    font-size: 32px;
  }
  h3 {
    font-size: 24px;
  }
  h4 {
    font-size: 20px;
  }
}

p {
  margin: 0 0 1em;
}

ul,
ol {
  margin: 0 0 1em;
  padding-left: 1.3em;
}

button,
input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
}

/* Sichtbarer Fokusring - nie entfernen (WCAG-Pflicht, Abschnitt 3.4) */
:focus-visible {
  outline: 2px solid var(--color-brand-text);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(1, 152, 148, 0.2);
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-brand-text);
  color: #fff;
  padding: 12px 20px;
  z-index: 1000;
  border-radius: 0 0 6px 0;
}

.skip-link:focus {
  left: 0;
}

/* ---------- Layout-Hilfsklassen ---------- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-page-x);
}

.section {
  padding: 48px 0;
}

.section--alt {
  background: var(--bg-alt);
}

.text-measure {
  max-width: 720px;
}

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

/* ---------- Kopfzeile ---------- */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  gap: 16px;
}

@media (min-width: 900px) {
  .header-inner {
    min-height: 72px;
  }
}

.logo {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  text-decoration: none;
  font-size: 22px;
  font-weight: 600;
  white-space: nowrap;
}

.logo-komm {
  color: var(--text-heading);
}

.logo-takt {
  color: var(--color-brand);
  font-style: italic;
}

/* Navigation - funktioniert komplett ohne JavaScript ueber <details>/<summary> */
.site-nav {
  position: relative;
}

.nav-toggle {
  min-width: 44px;
  min-height: 44px;
}

.nav-toggle > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  min-height: 44px;
  color: var(--text-heading);
  font-weight: 600;
}

.nav-toggle > summary::-webkit-details-marker {
  display: none;
}

.nav-toggle > summary:hover {
  background: var(--tint-10);
}

.hamburger {
  display: inline-block;
  width: 22px;
  height: 2px;
  background: var(--text-heading);
  position: relative;
}

.hamburger::before,
.hamburger::after {
  content: "";
  position: absolute;
  left: 0;
  width: 22px;
  height: 2px;
  background: var(--text-heading);
}

.hamburger::before {
  top: -7px;
}

.hamburger::after {
  top: 7px;
}

/* Gemeinsame Basis fuer die mobile Liste (im Hamburger-<details>) und die
   Desktop-Liste (.nav-list-desktop, eigenstaendiger Block ausserhalb jedes
   <details>) - Item-Stile werden nur einmal gepflegt. */
.nav-list,
.nav-list-desktop {
  list-style: none;
}

.nav-list > li > a,
.nav-list-desktop > li > a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  text-decoration: none;
  color: var(--text-heading);
  font-weight: 600;
  border-radius: var(--radius-sm);
}

.nav-list > li > a:hover,
.nav-list-desktop > li > a:hover {
  background: var(--tint-10);
}

.nav-list > li > a[aria-current="page"],
.nav-list-desktop > li > a[aria-current="page"] {
  color: var(--color-brand-text);
  box-shadow: inset 0 -2px 0 var(--color-brand);
}

/* Mobil: vertikale Liste, sichtbar nur wenn das umschliessende
   <details class="nav-toggle"> geoeffnet ist (natives Verhalten). */
.nav-list {
  margin: 8px 0 16px;
  padding: 8px 0 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-top: 1px solid var(--border);
}

/* Desktop: eigenstaendiger Block im normalen Dokumentfluss, kein <details>.
   Per Default ausgeblendet, wird erst ab 900px eingeblendet (R-1-Fix: siehe
   Media Query unten). */
.nav-list-desktop {
  display: none;
  margin: 0;
  padding: 0;
}

/* Untermenue "Nichterreichbarkeit" */
.nav-submenu {
  border-radius: var(--radius-sm);
}

.nav-submenu > summary {
  list-style: none;
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-weight: 600;
  color: var(--text-heading);
  border-radius: var(--radius-sm);
}

.nav-submenu > summary::-webkit-details-marker {
  display: none;
}

.nav-submenu > summary:hover {
  background: var(--tint-10);
}

.nav-submenu > summary::after {
  content: "▾";
  margin-left: 6px;
  font-size: 12px;
}

.nav-submenu[open] > summary::after {
  content: "▴";
}

.nav-submenu ul {
  list-style: none;
  margin: 0 0 0 12px;
  padding: 4px 0 4px 12px;
  border-left: 2px solid var(--tint-20);
}

.nav-submenu ul li a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  text-decoration: none;
  color: var(--text-body);
  border-radius: var(--radius-sm);
}

.nav-submenu ul li a:hover {
  background: var(--tint-10);
}

.nav-submenu ul li a[aria-current="page"] {
  color: var(--color-brand-text);
  font-weight: 600;
}

/* Ab 900px: horizontale Textnavigation statt Hamburger-Menue.
   R-1-Fix: Der komplette mobile Hamburger-Block (details.nav-toggle) wird
   ausgeblendet, unabhaengig von seinem [open]-Zustand - kein Verlass mehr
   darauf, dass Browser den Inhalt eines geschlossenen <details> per
   Autoren-CSS trotzdem sichtbar rendern (tut Chromium hier nachweislich
   nicht). Stattdessen wird der eigenstaendige .nav-list-desktop-Block
   eingeblendet, der nie in einem <details> steckt und daher nicht vom
   Aufklapp-Zustand abhaengt. */
@media (min-width: 900px) {
  .nav-toggle {
    display: none;
  }

  .nav-list-desktop {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
  }

  .nav-submenu {
    position: relative;
  }

  .nav-submenu ul {
    display: none;
  }

  .nav-submenu[open] ul {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-card);
    min-width: 200px;
    margin: 4px 0 0;
    padding: 8px;
    z-index: 10;
  }
}

/* ---------- Fusszeile ---------- */
.site-footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  padding: 32px 0;
  font-size: 14px;
}

@media (min-width: 900px) {
  .site-footer {
    padding: 48px 0;
  }
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 32px;
  justify-content: space-between;
  align-items: center;
}

.footer-links {
  display: flex;
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: underline;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  cursor: pointer;
  border: 1.5px solid transparent;
}

.btn-primary {
  background: var(--color-brand-text);
  color: #fff;
}

.btn-primary:hover {
  background: var(--color-brand-hover);
}

.btn-secondary {
  background: transparent;
  border-color: var(--color-brand-text);
  color: var(--color-brand-text);
}

.btn-secondary:hover {
  background: var(--tint-10);
}

.btn:disabled {
  background: var(--bg-input);
  color: var(--text-muted);
  border-color: transparent;
  cursor: not-allowed;
}

/* ---------- Content-Karte ---------- */
.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 24px;
}

.card--accent {
  border-top: 4px solid var(--color-brand);
}

@media (min-width: 900px) {
  .card {
    padding: 32px;
  }
}

/* ---------- Hero (Startseite) ---------- */
.hero {
  display: grid;
  gap: 32px;
  align-items: center;
}

@media (min-width: 900px) {
  .hero {
    grid-template-columns: 45% 1fr;
    gap: 48px;
  }
}

.hero img {
  margin: 0 auto;
}

.hero-text h1 {
  color: var(--color-brand-text);
}

.quicklinks {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 16px;
}

@media (min-width: 640px) {
  .quicklinks {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .quicklinks {
    grid-template-columns: repeat(4, 1fr);
  }
}

.quicklink {
  display: block;
  text-decoration: none;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 20px;
  color: var(--text-heading);
  border-top: 4px solid var(--color-brand);
}

.quicklink:hover {
  background: var(--tint-10);
}

.quicklink strong {
  display: block;
  margin-bottom: 4px;
  color: var(--color-brand-text);
}

/* ---------- Karten-Raster (Hoerbeispiele / Zeitkarten) ---------- */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 640px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.sound-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.sound-card__accent {
  height: 4px;
  background: var(--color-brand);
}

.sound-card__body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.sound-card__media {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-input);
}

.sound-card__icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--tint-10);
  color: var(--color-brand);
}

.sound-card__icon svg {
  width: 32px;
  height: 32px;
}

.sound-card__name {
  font-weight: 600;
  color: var(--text-heading);
  margin: 0;
}

.sound-card audio {
  width: 100%;
  margin-top: auto;
}

/* ---------- Formular (Kontakt) ---------- */
.contact-layout {
  display: grid;
  gap: 32px;
}

@media (min-width: 900px) {
  .contact-layout {
    grid-template-columns: 35% 1fr;
    gap: 48px;
  }
  .contact-layout--form-first {
    grid-template-columns: 1fr 35%;
  }
  .contact-layout--form-first .contact-form-col {
    order: 1;
  }
  .contact-layout--form-first .contact-info-col {
    order: 2;
  }
}

.form-row {
  margin-bottom: 20px;
}

.form-row--two {
  display: grid;
  gap: 20px;
}

@media (min-width: 640px) {
  .form-row--two {
    grid-template-columns: 1fr 1fr;
  }
}

.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-heading);
}

.form-hint {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 14px;
}

.form-control {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  color: var(--text-body);
}

.form-control:focus {
  border-color: var(--color-brand-text);
  background: #fff;
}

textarea.form-control {
  min-height: 140px;
  resize: vertical;
}

.form-row.has-error .form-control {
  border-color: var(--error);
  border-width: 2px;
  background: #fff;
}

.field-error {
  color: var(--error);
  font-size: 14px;
  margin-top: 6px;
}

.form-alert {
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 24px;
  border: 1px solid;
}

.form-alert--error {
  background: var(--error-bg);
  border-color: var(--error);
  color: var(--error);
}

.form-alert--success {
  background: var(--success-bg);
  border-color: var(--success);
  color: var(--success);
}

/* Neutraler Hinweis (E-3/D-9b): kein Fehler, kein Erfolg - z.B. Zeit-Falle
   bittet um erneutes Absenden, ohne den genauen Ablehnungsgrund zu nennen
   und ohne die Signalfarben von Fehler/Erfolg zu verwenden. */
.form-alert--info {
  background: var(--bg-alt);
  border-color: var(--border);
  color: var(--text-body);
}

.form-alert h2,
.form-alert p {
  margin: 0 0 8px;
  color: inherit;
}

.form-alert ul {
  margin: 0;
  padding-left: 1.2em;
}

.form-alert a {
  color: inherit;
  text-decoration: underline;
}

/* Honeypot-Feld: fuer Menschen unsichtbar, aber nicht per display:none
   (D-9) - ausserhalb des sichtbaren Bereichs positioniert. */
.hp-field {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- Referenzen: alphabetische Gesamtliste (E-2) ----------
   Ersetzt die vormalige Ortsgruppierung: Von 110 Kunden liessen sich nur
   4 eindeutig einem Ort zuordnen, 106 landeten in "Weitere Kunden" - das
   wirkte wie ein Fehler statt wie Ordnung (Nutzerentscheidung 2026-09-05).
   Direkt sichtbar, ohne <details>/Akkordeon, ohne 900px-Override. */
.ref-list {
  columns: 2;
  column-gap: 32px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 900px) {
  .ref-list {
    columns: 3;
  }
}

.ref-list li {
  break-inside: avoid;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}

/* ---------- Ablauf-Diagramme (z.B. avm.html) ---------- */
.flow-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 640px) {
  .flow-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.flow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-top: 16px;
}

.flow-step {
  width: 100%;
  text-align: center;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg-alt);
  color: var(--text-heading);
  font-weight: 600;
}

.flow-step--brand {
  background: var(--tint-10);
  color: var(--color-brand-text);
}

.flow-arrow {
  color: var(--color-brand);
  font-size: 20px;
  line-height: 1;
}

/* ---------- Diverses ---------- */
.badge {
  display: inline-block;
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 400;
}

.lead {
  font-size: 18px;
  color: var(--text-heading);
}

table.legal-table {
  border-collapse: collapse;
}

table.legal-table td {
  padding: 4px 12px 4px 0;
  vertical-align: top;
}
