/*
  Alle Services – Servicefinder (/alle-services.html) – Auftrag "TARIFCHAOS
  v2.0 – CLAUDE CODE UMSETZUNG 01 – Seite „Alle Services“ – Interaktiver
  Servicefinder", 19. Oktober 2026.

  Ausschließlich seitenbezogene Regeln unter `.page-alle-services`; wird nur
  von /alle-services.html geladen (buildAlleServicesPage() in
  scripts/build.mjs). Keine Änderung globaler Styles. Farben, Radien,
  Abstände und Schrift aus tokens.css und den bestehenden Design-Master-v2-
  Werten (wohngebaeude-v2.css: Karte 18px Radius, Rahmen --color-border,
  .v2-section/.v2-soft, .v2-button, Eyebrow-Schrift; kontakt.css:
  kompakter Seitenkopf ohne Hero, Feldrahmen aus --color-ink abgeleitet, weil
  --color-border für Eingabefelder den Nicht-Text-Kontrast von 3:1 nicht
  erreicht). Keine neuen Hexwerte, keine Bildassets, keine Icons.

  Breakpoints wie im Projekt: Mobil bis 767px (eine Ergebnisspalte), ab
  768px zwei Ergebnisspalten (Tablet und Desktop).
*/

.page-alle-services {
  --as-feldrahmen: color-mix(in srgb, var(--color-ink) 55%, var(--color-surface));
}

/* Kompakter Seitenkopf (kein Hero) mit Suche und Filtern */
.page-alle-services .as-kopf {
  padding-block: var(--space-4) var(--space-6);
}

.page-alle-services .as-kopf__titel {
  font-size: clamp(1.9rem, 3.2vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 0 0 var(--space-3);
  overflow-wrap: break-word;
}

.page-alle-services .as-kopf__text {
  max-width: 62ch;
  font-size: 1.0625rem;
  margin: 0;
}

.page-alle-services .as-suche {
  max-width: 760px;
  margin-top: 28px;
}

.page-alle-services .as-suche__feld {
  display: block;
  width: 100%;
  min-height: 64px;
  margin: 0;
  padding: 16px 20px;
  font: inherit;
  font-size: 1.125rem; /* mind. 16px: verhindert automatisches Zoomen auf iOS */
  line-height: 1.4;
  color: var(--color-ink);
  background-color: var(--color-surface);
  border: 2px solid var(--as-feldrahmen);
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(30, 25, 15, 0.06);
  -webkit-appearance: none;
  appearance: none;
}

.page-alle-services .as-suche__feld::placeholder {
  color: color-mix(in srgb, var(--color-ink) 68%, var(--color-surface));
  opacity: 1;
}

.page-alle-services .as-suche__feld:focus {
  border-color: var(--color-ink);
}

/* Kategoriefilter: umbrechende Schaltflächen, kein horizontaler Scrollbereich */
.page-alle-services .as-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.page-alle-services .as-filter__button {
  min-height: 44px;
  margin: 0;
  padding: 10px 18px;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-ink);
  background-color: var(--color-surface);
  border: 1px solid var(--as-feldrahmen);
  border-radius: 999px;
  cursor: pointer;
}

.page-alle-services .as-filter__button:hover {
  border-color: var(--color-ink);
}

/* Aktive Kategorie: gefüllt (nicht nur Farbe), für Screenreader über aria-pressed */
.page-alle-services .as-filter__button[aria-pressed="true"] {
  color: var(--color-surface);
  background-color: var(--color-brand-dark);
  border-color: var(--color-brand-dark);
  box-shadow: inset 0 -3px 0 var(--color-brand-gold);
}

/* Ergebnisse */
.page-alle-services .as-ergebnisse__kopf {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 24px;
}

.page-alle-services .as-ergebnisse__titel {
  font-size: clamp(1.45rem, 2vw, 1.9rem);
  line-height: 1.2;
  letter-spacing: -0.03em;
  margin: 0;
}

.page-alle-services .as-ergebnisse__anzahl {
  margin: 0;
  padding: 4px 14px;
  font-size: 0.95rem;
  font-weight: 700;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 999px;
}

/* Mobil zuerst: eine Spalte; zwei Spalten erst ab 768px (siehe unten). So
   gibt es auch bei gebrochenen Viewportbreiten zwischen 767 und 768px
   (gemessen in Firefox) keinen Zwischenzustand mit zwei Spalten. */
.page-alle-services .as-liste {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

@media (min-width: 768px) {
  .page-alle-services .as-liste {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }
}

/* Korrektur 02 (19. Oktober 2026): Kategoriegruppen der Standardansicht.
   Dezente Zwischenüberschrift ohne Icons oder Dekoration, Trennung über
   Abstand; Kacheln unverändert. */
.page-alle-services .as-gruppe + .as-gruppe {
  margin-top: 48px;
}

.page-alle-services .as-gruppe__titel {
  margin: 0 0 16px;
  font-size: 1.2rem;
  line-height: 1.3;
  letter-spacing: -0.015em;
}

.page-alle-services .as-gruppen[hidden],
.page-alle-services .as-gruppe[hidden],
.page-alle-services .as-liste[hidden],
.page-alle-services .as-eintrag[hidden],
.page-alle-services .as-leer[hidden] {
  display: none;
}

.page-alle-services .as-eintrag {
  display: flex;
  min-width: 0;
}

/* Die ganze Kachel ist ein Link (keine verschachtelten Links) */
.page-alle-services .as-karte {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  padding: 24px 26px;
  color: var(--color-ink);
  text-decoration: none;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 18px;
  box-shadow: 0 8px 28px rgba(30, 25, 15, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.page-alle-services .as-karte:hover {
  border-color: var(--color-gold);
  box-shadow: var(--shadow-md);
}

.page-alle-services .as-karte__name {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.015em;
  overflow-wrap: break-word;
  hyphens: auto;
}

.page-alle-services .as-karte__kategorie {
  margin: 6px 0 18px; /* Mindestabstand zur Linkzeile (diese steht per margin-top: auto unten) */
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.page-alle-services .as-karte__link {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
  font-size: 0.9rem;
  font-weight: 700;
}

.page-alle-services .as-karte:hover .as-karte__link {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Leerzustand */
.page-alle-services .as-leer {
  padding: 32px;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-top: 3px solid var(--color-brand-gold);
  border-radius: 18px;
}

.page-alle-services .as-leer__titel {
  margin: 0 0 8px;
  font-size: 1.15rem;
  font-weight: 700;
}

.page-alle-services .as-leer__text {
  margin: 0 0 20px;
}

@media (max-width: 767px) {
  .page-alle-services .as-kopf {
    padding-block: var(--space-3) var(--space-5);
  }

  .page-alle-services .as-suche {
    margin-top: 22px;
  }

  .page-alle-services .as-suche__feld {
    min-height: 56px;
    padding: 14px 16px;
  }

  .page-alle-services .as-karte {
    padding: 20px;
  }

  .page-alle-services .as-gruppe + .as-gruppe {
    margin-top: 36px;
  }

  .page-alle-services .as-gruppe__titel {
    margin-bottom: 14px;
  }

  .page-alle-services .as-leer {
    padding: 24px 20px;
  }
}
