/* ===================================================================
   AR Gebäudetechnik GmbH – Website
   Gestaltung: Daniel Webstudio
   Farbwelt strikt aus dem Corporate Design (Visitenkarte / Logo):
   Schwarz #111111 · Blau #0b5ed7 · Rot #e11d2e · Hellgrau #f5f6f8
   =================================================================== */

:root {
  --ink: #111111;
  --ink-800: #1a1a1a;
  --blue: #0b5ed7;
  --blue-dark: #0949a6;
  --blue-light: #5b95ee;
  --red: #e11d2e;
  --red-dark: #b71624;
  --mist: #f5f6f8;
  --line: #e4e6ea;
  --muted: #54595f;
}

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

html {
  scroll-behavior: smooth;
  /* Platz unter dem klebrigen Header beim Ankersprung */
  scroll-padding-top: 96px;
}

body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* "clip" statt "hidden": verhindert horizontales Scrollen,
     ohne position:sticky im Header zu zerstören */
  overflow-x: clip;
  /* Platz für die klebrige Mobil-Leiste */
  padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
}

@media (min-width: 768px) {
  body { padding-bottom: 0; }
}

/* Sichtbarer Fokus für Tastatur-Bedienung (Barrierefreiheit) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
  border-radius: 0;
}

/* --- Typografie -------------------------------------------------- */

.stitle {
  font-family: Barlow, system-ui, sans-serif;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.005em;
  line-height: 1.04;
  font-size: clamp(1.75rem, 1.15rem + 2.4vw, 3rem);
  color: var(--ink);
}

.stitle--light { color: #fff; }

.eyebrow {
  font-family: Barlow, system-ui, sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.8125rem;
}

/* Zweifarbiger Trennstrich – direkt von der Visitenkarte übernommen */
.rule2 {
  display: block;
  width: 92px;
  height: 4px;
  background: linear-gradient(to right, var(--blue) 0 58%, var(--red) 58% 100%);
}

.rule2--sm { width: 64px; height: 3px; }

/* Fliesstext bleibt lesbar: nie breiter als ca. 65 Zeichen */
.prose-w { max-width: 62ch; }

/* --- Buttons ----------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 48px;               /* Touch-Fläche > 44px */
  padding: 0.75rem 1.4rem;
  border-radius: 0;                /* durchgehend eckig */
  font-family: Barlow, system-ui, sans-serif;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1;
  letter-spacing: 0.005em;
  white-space: nowrap;
  transition: background-color .2s ease, color .2s ease,
              border-color .2s ease, transform .15s ease, box-shadow .25s ease;
}

.btn:active { transform: translateY(1px); }
.btn svg { flex: none; }

.btn-blue { background: var(--blue); color: #fff; }
.btn-blue:hover { background: var(--blue-dark); }

.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { background: var(--red-dark); }

.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #000; }

.btn-outline {
  background: #fff;
  color: var(--ink);
  border: 2px solid var(--line);
}
.btn-outline:hover { border-color: var(--blue); color: var(--blue); }

.btn-ghost {
  border: 2px solid rgba(255, 255, 255, .6);
  color: #fff;
}
.btn-ghost:hover { background: #fff; color: var(--ink); border-color: #fff; }

.btn-sm { min-height: 44px; padding: 0.6rem 1.05rem; font-size: 0.9375rem; }

/* --- Icon-Ring (Kreis-Icons der Visitenkarte) --------------------- */

.ring-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  border: 2px solid var(--blue);
  color: var(--ink);
  background: #fff;
  flex: none;
  transition: background-color .25s ease, color .25s ease, border-color .25s ease;
}

.ring-ico--red { border-color: var(--red); }
.ring-ico--sm { width: 44px; height: 44px; }

.card:hover .ring-ico { background: var(--blue); color: #fff; }
.card:hover .ring-ico--red { background: var(--red); }

/* --- Karten ------------------------------------------------------ */

.card {
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0;
  transition: border-color .25s ease, box-shadow .3s ease, transform .3s ease;
}

.card:hover {
  border-color: #cfd4db;
  transform: translateY(-3px);
  box-shadow: 0 16px 34px -22px rgba(17, 17, 17, .45);
}

/* Feiner blauer Akzentbalken an der Kartenoberkante */
.card--bar::before {
  content: "";
  position: absolute;
  top: -1px; left: -1px; right: -1px;
  height: 4px;
  border-radius: 0;
  background: var(--blue);
}
.card--bar-red::before { background: var(--red); }

/* --- Bilder ------------------------------------------------------ */

/* Ruhige Fläche als Grund: Fällt ein Bild aus, bleibt eine saubere
   graue Fläche stehen – nie ein kaputtes Bild oder ein Dateiname. */
.media {
  position: relative;
  overflow: hidden;
  background: #e7e9ee;
  background-image: linear-gradient(135deg, #eceef2 0%, #dfe2e8 100%);
}

.media > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s cubic-bezier(.22, .61, .36, 1);
}

img.is-missing { opacity: 0 !important; }

.group:hover .media > img { transform: scale(1.045); }

/* --- Formular ---------------------------------------------------- */

.field {
  width: 100%;
  min-height: 48px;
  padding: 0.75rem 0.9rem;
  border: 1px solid #d5d9e0;
  border-radius: 0;
  background: #fff;
  font-size: 1rem;
  color: var(--ink);
  transition: border-color .2s ease, box-shadow .2s ease;
}

.field::placeholder { color: #9aa0a8; }

.field:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(11, 94, 215, .14);
  outline: none;
}

.label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--ink);
}

/* --- Animation: sanft einfaden und leicht hochschieben ------------
   Die Regeln haengen bewusst an ".js": Diese Klasse setzt ein kleines
   Skript im <head>. Ist JavaScript aus oder blockiert, greifen sie gar
   nicht erst – dann ist der Inhalt sofort sichtbar statt unsichtbar.  */

.js .reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .45s cubic-bezier(.22, .61, .36, 1),
              transform .45s cubic-bezier(.22, .61, .36, 1);
  transition-delay: var(--d, 0ms);
}

.js .reveal.is-in {
  opacity: 1;
  transform: none;
}

/* --- Lightbox (Projekte) ----------------------------------------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(10, 10, 12, .975);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity .25s ease;
}

.lightbox.is-open { display: flex; }
.lightbox.is-visible { opacity: 1; }

.lightbox__img {
  max-width: min(1100px, 100%);
  max-height: 74vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 0;
  background: #1a1a1a;
}

.lightbox__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 0;
  color: #fff;
  background: rgba(255, 255, 255, .12);
  transition: background-color .2s ease;
}

.lightbox__btn:hover { background: var(--blue); }

/* --- Bewegung reduzieren: alles aus ------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }

  .group:hover .media > img { transform: none; }
  .card:hover { transform: none; }
}

/* --- Klebrige Mobil-Leiste --------------------------------------- */

.mobilebar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: grid;
  grid-template-columns: 1fr 1fr;
  box-shadow: 0 -8px 24px -16px rgba(0, 0, 0, .65);
}

.mobilebar a { transition: filter .2s ease; }
.mobilebar a:active { filter: brightness(.92); }

@media (min-width: 768px) {
  .mobilebar { display: none; }
}

/* --- Hero-Überlagerung -------------------------------------------
   Auf dem Handy dunkelt sie von unten ab, ab Tablet von links –
   so bleibt der Text lesbar und das Bild trotzdem sichtbar.        */

.hero-scrim {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    to top,
    rgba(17, 17, 17, .95) 0%,
    rgba(17, 17, 17, .80) 45%,
    rgba(17, 17, 17, .35) 100%
  );
}

@media (min-width: 768px) {
  .hero-scrim {
    background: linear-gradient(
      to right,
      rgba(17, 17, 17, .92) 0%,
      rgba(17, 17, 17, .72) 45%,
      rgba(17, 17, 17, .20) 100%
    );
  }
}

/* Sehr schmale Geräte (unter 360px): Wortmarke im Header ausblenden,
   damit Logo und Knöpfe ohne horizontales Scrollen Platz haben. */
@media (max-width: 359px) {
  .brand-text { display: none !important; }
}

/* --- Rechtsseiten (Impressum, Datenschutz) ------------------------ */

.legal { max-width: 78ch; }

.legal h2 {
  font-family: Barlow, system-ui, sans-serif;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.005em;
  line-height: 1.15;
  font-size: 1.5rem;
  color: var(--ink);
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

.legal > h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

.legal h3 {
  font-family: Barlow, system-ui, sans-serif;
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--ink);
  margin-top: 2rem;
}

.legal p,
.legal li { font-size: 1.0625rem; line-height: 1.75; }

.legal p { margin-top: 1rem; }

.legal ul { margin-top: 1rem; list-style: none; }

.legal ul > li {
  position: relative;
  padding-left: 1.5rem;
  margin-top: 0.5rem;
}

.legal ul > li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 8px;
  height: 2px;
  background: var(--blue);
}

.legal a { color: var(--blue); text-decoration: underline; text-underline-offset: 2px; }
.legal a:hover { color: var(--blue-dark); }

.legal strong { color: var(--ink); font-weight: 600; }

/* Definitionsliste für die Firmenangaben im Impressum */
.legal dl {
  margin-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.legal dl > div {
  display: grid;
  gap: 0.25rem 1.5rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
}

@media (min-width: 640px) {
  .legal dl > div { grid-template-columns: 15rem 1fr; }
}

.legal dt {
  font-family: Barlow, system-ui, sans-serif;
  font-weight: 700;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  padding-top: 0.15rem;
}

.legal dd { font-size: 1.0625rem; line-height: 1.6; color: var(--ink); }

/* Hinweiskasten */
.note {
  border-left: 4px solid var(--blue);
  background: var(--mist);
  padding: 1.25rem 1.35rem;
  margin-top: 1.5rem;
}

.note--red { border-left-color: var(--red); }
.note p { margin-top: .5rem; }
.note > p:first-child { margin-top: 0; }

/* Inhaltsverzeichnis */
.toc { border: 1px solid var(--line); background: var(--mist); padding: 1.5rem; }
.toc ol { counter-reset: toc; list-style: none; }
.toc li { counter-increment: toc; margin-top: .35rem; }
.toc li::before {
  content: counter(toc) ".";
  display: inline-block;
  width: 1.9rem;
  font-family: Barlow, system-ui, sans-serif;
  font-weight: 700;
  color: var(--blue);
}
.toc a { color: var(--ink); text-decoration: none; }
.toc a:hover { color: var(--blue); text-decoration: underline; }

/* --- Einwilligungs-Banner ----------------------------------------- */

.consent {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  z-index: 70;
  background: #fff;
  border-top: 4px solid var(--blue);
  box-shadow: 0 -14px 40px -24px rgba(17, 17, 17, .75);
}

.consent::before {
  content: "";
  position: absolute;
  top: -4px;
  right: 0;
  width: 42%;
  height: 4px;
  background: var(--red);
}

@media (min-width: 768px) {
  .consent { bottom: 0; }
}

.consent__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem;
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 640px) { .consent__inner { padding: 1.5rem; } }

@media (min-width: 1024px) {
  .consent__inner {
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 2.5rem;
    padding: 1.5rem 2rem;
  }
}

.consent__buttons { display: grid; gap: .65rem; }

@media (min-width: 360px) {
  .consent__buttons { grid-auto-flow: column; grid-auto-columns: 1fr; }
  .consent__buttons .btn { padding-left: .75rem; padding-right: .75rem; font-size: .9375rem; }
}

/* --- Karten-Gate (Google Maps erst nach Einwilligung) -------------- */

.map-gate {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  padding: 1.5rem;
  text-align: center;
  background: linear-gradient(135deg, #eceef2 0%, #dde0e6 100%);
}

.map-gate p { max-width: 42ch; }

/* --- Häufige Fragen ----------------------------------------------- */

.faq { border-top: 1px solid var(--line); }

.faq details { border-bottom: 1px solid var(--line); }

.faq summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
  min-height: 56px;
  padding: 1.15rem 0;
  cursor: pointer;
  list-style: none;
  font-family: Barlow, system-ui, sans-serif;
  font-weight: 700;
  font-size: 1.0625rem;
  line-height: 1.4;
  color: var(--ink);
  transition: color .2s ease;
}

.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: var(--blue); }

.faq__ico {
  position: relative;
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: .25rem;
}

.faq__ico::before,
.faq__ico::after {
  content: "";
  position: absolute;
  background: var(--blue);
  transition: transform .25s ease, opacity .25s ease;
}

.faq__ico::before { left: 0; top: 8px; width: 18px; height: 2px; }
.faq__ico::after { left: 8px; top: 0; width: 2px; height: 18px; }

.faq details[open] .faq__ico::after { transform: scaleY(0); opacity: 0; }
.faq details[open] summary { color: var(--blue); }

.faq__answer { padding: 0 0 1.5rem; max-width: 68ch; }
.faq__answer p { margin-top: .75rem; }
.faq__answer > p:first-child { margin-top: 0; }
.faq__answer a { color: var(--blue); text-decoration: underline; text-underline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .faq__ico::before, .faq__ico::after { transition: none; }
}


/* --- Leistungskarten: ganze Karte ist der Schalter -----------------
   Die Karte selbst ist ein <details>, die <summary> umfasst Icon,
   Titel und Einleitung. Ein Klick irgendwo auf die Karte klappt die
   Detailliste auf. Reines HTML, kein JavaScript noetig.
   Der Plus-Schalter sitzt fest oben rechts – dadurch stehen alle
   Schalter im Raster automatisch auf gleicher Hoehe.               */

/* Rasterzelle darf schmaler werden als der laengste Titel */
.svc-item { min-width: 0; }

.svc-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
}

/* Lange Woerter wie "Wasseraufbereitung" sauber trennen statt ueberlaufen */
.svc-card h3 { hyphens: auto; overflow-wrap: break-word; }

.svc-card > summary {
  display: block;
  flex: 1 1 auto;
  padding: 1.75rem 4.25rem 1.75rem 1.75rem;
  cursor: pointer;
  list-style: none;
}

.svc-card > summary::-webkit-details-marker { display: none; }

/* Plus oben rechts, wird beim Oeffnen zum Minus */
.svc-card__toggle {
  position: absolute;
  top: 1.75rem;
  right: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 2px solid var(--line);
  color: var(--blue);
  background: #fff;
  transition: border-color .25s ease, background-color .25s ease, color .25s ease;
}

.svc-card:hover .svc-card__toggle,
.svc-card > summary:focus-visible .svc-card__toggle {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.svc-card--red .svc-card__toggle { color: var(--red); }

.svc-card--red:hover .svc-card__toggle,
.svc-card--red > summary:focus-visible .svc-card__toggle {
  border-color: var(--red);
  background: var(--red);
}

.svc-ico {
  position: relative;
  flex: none;
  width: 14px;
  height: 14px;
}

.svc-ico::before,
.svc-ico::after {
  content: "";
  position: absolute;
  background: currentColor;
  transition: transform .25s ease, opacity .25s ease;
}

.svc-ico::before { left: 0; top: 6px; width: 14px; height: 2px; }
.svc-ico::after { left: 6px; top: 0; width: 2px; height: 14px; }

.svc-card[open] .svc-ico::after { transform: scaleY(0); opacity: 0; }

/* Detailbereich unterhalb der Einleitung */
.svc-detail {
  padding: 0 1.75rem 1.75rem;
  border-top: 1px solid var(--line);
  margin: 0 1.75rem;
  padding-left: 0;
  padding-right: 0;
}

.svc-detail__title {
  margin-top: 1.15rem;
  font-family: Barlow, system-ui, sans-serif;
  font-weight: 700;
  font-size: 1.0625rem;
  color: var(--ink);
}

.svc-detail__lead {
  margin-top: 0.4rem;
  font-size: 0.9375rem;
  line-height: 1.6;
}

.svc-list { margin-top: 1.15rem; list-style: none; }
.svc-detail__title + .svc-detail__lead + .svc-list,
.svc-detail__lead + .svc-list { margin-top: 0.85rem; }

.svc-list > li {
  position: relative;
  padding-left: 1.25rem;
  margin-top: 0.5rem;
  font-size: 0.9375rem;
  line-height: 1.55;
}

.svc-list > li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 8px;
  height: 2px;
  background: var(--blue);
}

.svc-card--red .svc-list > li::before { background: var(--red); }

@media (prefers-reduced-motion: reduce) {
  .svc-ico::before, .svc-ico::after { transition: none; }
}

/* --- Ergaenzungen ohne Tailwind ------------------------------------
   Bewusst eigene Klassen statt Tailwind-Utilities: tailwind.css ist
   erzeugter Code, der nur die bereits verwendeten Klassen enthaelt.
   So bleibt eine Neuerzeugung unnoetig.                             */

/* Breiterer Hauptknopf im Header */
.btn-wide { padding-left: 1.5rem; padding-right: 1.5rem; }

/* Vorspann im Hero ueber dem Fliesstext */
.hero-lead { font-size: 1.125rem; }

@media (min-width: 640px) {
  .hero-lead { font-size: 1.25rem; }
}

/* Auf sehr schmalen Geraeten die Karten-Innenabstaende verkleinern */
@media (max-width: 400px) {
  .svc-card > summary { padding: 1.5rem 3.5rem 1.5rem 1.5rem; }
  .svc-card__toggle { top: 1.5rem; right: 1.5rem; width: 32px; height: 32px; }
  .svc-detail { margin: 0 1.5rem; padding-bottom: 1.5rem; }
}

/* --- Spamfalle: fuer Menschen unsichtbar, Bots fuellen sie aus ----- */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* --- Cloudflare Turnstile ----------------------------------------- */
/* Das Widget wird erst nach der ersten Eingabe nachgeladen. Wer die
   Seite nur liest, loest damit weiterhin keine externe Anfrage aus. */
.ts-host:empty { display: none; }
.ts-host { min-height: 65px; }

/* --- Statusmeldung des Formulars ---------------------------------- */
.formnote {
  border-left: 4px solid var(--line);
  background: var(--mist);
  padding: 1rem;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
}

.formnote[data-state="info"]  { border-left-color: var(--blue); }
.formnote[data-state="ok"]    { border-left-color: #157347; }
.formnote[data-state="error"] { border-left-color: var(--red); }

.btn[disabled] {
  opacity: .55;
  cursor: not-allowed;
  pointer-events: none;
}
