/* AK-Estrich – Stylesheet
   Mobile-first. Keine externen Ressourcen, kein JavaScript. */

/* ---------- Design-Tokens ---------- */
:root {
  --c-ink: #1d2125;
  --c-muted: #4b5563;
  --c-bg: #ffffff;
  --c-surface: #f4f2ee;
  --c-line: #dcd8d0;
  --c-accent: #b84700;       /* Text/Buttons: Kontrast >= 5:1 auf Weiß */
  --c-accent-dark: #8f3700;
  --c-accent-bright: #e8650a; /* nur dekorativ */
  --c-dark: #1d2125;
  --c-on-dark: #f4f2ee;
  --c-on-dark-muted: #c4c0b8;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: 4.5rem;

  --radius: 0.5rem;
  --maxw: 72rem;
  --measure: 68ch;
  --gutter: clamp(1rem, 4vw, 2rem);
  --header-h: 4rem;

  color-scheme: light;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + var(--s-4));
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--c-ink);
  background: var(--c-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

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

h1, h2, h3 {
  line-height: 1.2;
  margin: 0 0 var(--s-4);
  letter-spacing: -0.015em;
  text-wrap: balance;
}
h1 { font-size: clamp(2rem, 1.4rem + 3vw, 3.25rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.5vw, 2.125rem); font-weight: 750; }
h3 { font-size: 1.25rem; font-weight: 700; }

p, ul, ol, dl, figure, table { margin: 0 0 var(--s-4); }

a { color: var(--c-accent); text-underline-offset: 0.2em; }
a:hover { color: var(--c-accent-dark); }

:focus-visible {
  outline: 3px solid var(--c-accent-bright);
  outline-offset: 3px;
  border-radius: 2px;
}

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

.skip-link {
  position: absolute;
  left: var(--s-4);
  top: -4rem;
  z-index: 100;
  background: var(--c-dark);
  color: #fff;
  padding: var(--s-3) var(--s-4);
  border-radius: var(--radius);
}
.skip-link:focus { top: var(--s-3); }

/* ---------- Layout ---------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--s-7); }
.section--tint { background: var(--c-surface); }
.section--tight { padding-block: var(--s-6); }

.section__head { max-width: var(--measure); margin-bottom: var(--s-6); }
.section__head > :last-child { margin-bottom: 0; }

.eyebrow {
  display: block;
  margin-bottom: var(--s-2);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-accent);
}

.lead { font-size: 1.1875rem; color: var(--c-muted); max-width: var(--measure); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 2.75rem;
  padding: 0.6rem 1.25rem;
  font: inherit;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  color: #fff;
  background: var(--c-accent);
  border: 2px solid var(--c-accent);
  border-radius: var(--radius);
  cursor: pointer;
}
.btn:hover { background: var(--c-accent-dark); border-color: var(--c-accent-dark); color: #fff; }
.btn--ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.8); }
.btn--ghost:hover { background: #fff; color: var(--c-ink); border-color: #fff; }
.btn--outline { background: transparent; color: var(--c-accent); }
.btn--outline:hover { background: var(--c-accent); color: #fff; }

.btn-row { display: flex; flex-wrap: wrap; gap: var(--s-3); }

/* ---------- Kopfbereich ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid var(--c-line);
}
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2) var(--s-4);
  min-height: var(--header-h);
  padding-block: var(--s-2);
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35em;
  color: var(--c-ink);
  text-decoration: none;
  font-weight: 800;
  font-size: 1.125rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
}
.brand:hover { color: var(--c-ink); }
.brand__mark {
  display: inline-block;
  padding: 0.12em 0.45em 0.12em 0.35em;
  color: #fff;
  background: var(--c-accent);
  transform: skewX(-12deg);
}
.brand__mark > span { display: inline-block; transform: skewX(12deg); }

.site-nav ul {
  display: flex;
  align-items: center;
  gap: var(--s-1) var(--s-2);
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav a:not(.btn) {
  display: inline-block;
  padding: var(--s-2) var(--s-1);
  color: var(--c-ink);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 3px solid transparent;
}
.site-nav a:not(.btn):hover { border-bottom-color: var(--c-line); }
.site-nav a[aria-current="page"],
.site-nav a.is-active { border-bottom-color: var(--c-accent); }

.call-long { display: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-end;
  min-height: clamp(26rem, 78vh, 40rem);
  color: #fff;
  background: var(--c-dark);
}
.hero__img {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to top, rgba(20, 22, 25, 0.88) 0%, rgba(20, 22, 25, 0.55) 55%, rgba(20, 22, 25, 0.25) 100%);
}
.hero .wrap { padding-block: var(--s-7); }
.hero h1 { max-width: 18ch; color: #fff; }
.hero p { max-width: 46ch; font-size: 1.1875rem; color: #fff; }
.hero .eyebrow { color: #ffb27a; }

/* ---------- Seitenkopf (Unterseiten) ---------- */
.page-head { padding-block: var(--s-6) var(--s-7); background: var(--c-surface); }
.page-head__grid { display: grid; gap: var(--s-6); align-items: center; }
.page-head h1 { margin-bottom: var(--s-4); }
.page-head .lead { margin-bottom: 0; }
.page-head__media img { border-radius: var(--radius); width: 100%; }

.breadcrumb { margin-bottom: var(--s-5); font-size: 0.9375rem; }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-2); list-style: none; margin: 0; padding: 0; color: var(--c-muted); }
.breadcrumb li + li::before { content: "/"; margin-right: var(--s-2); color: var(--c-line); }
.breadcrumb a { color: var(--c-muted); }
.breadcrumb a:hover { color: var(--c-accent); }

h2.h-small { font-size: 1.25rem; letter-spacing: 0; }

/* ---------- Karten ---------- */
.cards {
  display: grid;
  gap: var(--s-4);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  list-style: none;
  padding: 0;
}
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: var(--s-5);
  background: var(--c-bg);
  border: 1px solid var(--c-line);
  border-top: 4px solid var(--c-accent-bright);
  border-radius: var(--radius);
}
.card h3 { margin-bottom: var(--s-2); }
.card p { color: var(--c-muted); }
.card p:not(.tag):not(.more) { flex: 1; }
.card .tag {
  margin-bottom: var(--s-2);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-muted);
}
/* gesamte Karte klickbar, Link bleibt der Titel */
.card a { color: var(--c-ink); text-decoration: none; }
.card a::after { content: ""; position: absolute; inset: 0; }
.card:hover { border-color: var(--c-accent); box-shadow: 0 6px 20px rgba(29, 33, 37, 0.1); }
.card:hover a { color: var(--c-accent); }
.card .more { margin: var(--s-3) 0 0; font-weight: 700; color: var(--c-accent); }
.card:focus-within { outline: 3px solid var(--c-accent-bright); outline-offset: 3px; }
.card a:focus-visible { outline: none; }

/* ---------- Zweispalter Text/Bild ---------- */
.split { display: grid; gap: var(--s-6); align-items: center; }
.split img { border-radius: var(--radius); width: 100%; }
.split > div > :last-child { margin-bottom: 0; }

/* ---------- Ablauf ---------- */
.steps { display: grid; gap: var(--s-5); list-style: none; padding: 0; counter-reset: step; }
.steps li { position: relative; padding-top: 3.25rem; counter-increment: step; }
.steps li::before {
  content: counter(step);
  position: absolute;
  top: 0; left: 0;
  display: grid;
  place-items: center;
  width: 2.5rem; height: 2.5rem;
  color: #fff;
  background: var(--c-accent);
  border-radius: 50%;
  font-weight: 800;
}
.steps h3 { margin-bottom: var(--s-2); }
.steps p { color: var(--c-muted); margin: 0; }

/* ---------- Galerie ---------- */
.gallery {
  display: grid;
  gap: var(--s-3);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
  list-style: none;
  padding: 0;
}
.gallery img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--c-surface);
}

/* ---------- Textseiten ---------- */
.prose { max-width: var(--measure); }
.prose h2 { margin-top: var(--s-7); }
.prose > h2:first-child { margin-top: 0; }
.prose h3 { margin-top: var(--s-6); }
.prose ul, .prose ol { padding-left: 1.25rem; }
.prose li { margin-bottom: var(--s-2); }
.prose li::marker { color: var(--c-accent); font-weight: 700; }

.content-grid { display: grid; gap: var(--s-6); }
.content-grid > * { min-width: 0; }

/* Kurzfakten */
.facts {
  padding: var(--s-5);
  background: var(--c-surface);
  border-left: 4px solid var(--c-accent-bright);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.facts h2 { font-size: 1.125rem; margin-bottom: var(--s-3); letter-spacing: 0; }
.facts dl { margin: 0; }
.facts dt { font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--c-muted); }
.facts dd { margin: 0 0 var(--s-4); }
.facts dd:last-child { margin-bottom: 0; }

/* Normbezeichnung */
.example {
  margin: var(--s-5) 0;
  padding: var(--s-5);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  background: var(--c-bg);
}
.example__label { margin-bottom: var(--s-2); font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--c-muted); }
.example code {
  display: block;
  margin-bottom: var(--s-4);
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.example dl { display: grid; gap: var(--s-1) var(--s-4); grid-template-columns: max-content 1fr; margin: 0; }
.example dt { font-family: var(--font-mono); font-weight: 700; color: var(--c-accent); }
.example dd { margin: 0; }

.note {
  padding: var(--s-4) var(--s-5);
  background: var(--c-surface);
  border-radius: var(--radius);
}

/* Vergleichstabelle (mobil als gestapelte Zeilen) */
.compare { width: 100%; border-collapse: collapse; }
.compare caption { text-align: left; padding-bottom: var(--s-3); color: var(--c-muted); }
.compare thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.compare tr { display: block; padding: var(--s-4) 0; border-bottom: 1px solid var(--c-line); }
.compare th, .compare td { display: block; padding: var(--s-1) 0; text-align: left; font-weight: 400; }
.compare th[scope="row"] { font-size: 1.125rem; font-weight: 700; }
.compare td::before {
  content: attr(data-label);
  display: block;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-muted);
}

/* ---------- Kontakt ---------- */
.contact-cards { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }
.contact-card { padding: var(--s-5); background: var(--c-surface); border-radius: var(--radius); }
.contact-card h2 { font-size: 1.125rem; margin-bottom: var(--s-3); letter-spacing: 0; }
.contact-card p { margin: 0; }
.contact-card address { font-style: normal; }
.contact-card a { font-weight: 600; }

.form { display: grid; gap: var(--s-4); max-width: 40rem; }
.form label { display: block; margin-bottom: var(--s-1); font-weight: 600; }
.form input, .form textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  font: inherit;
  color: var(--c-ink);
  background: #fff;
  border: 2px solid #8a8f96;
  border-radius: var(--radius);
}
.form input:focus-visible, .form textarea:focus-visible { outline: 3px solid var(--c-accent-bright); outline-offset: 1px; border-color: var(--c-ink); }
.form textarea { min-height: 10rem; resize: vertical; }
.form .hint { margin: var(--s-1) 0 0; font-size: 0.9375rem; color: var(--c-muted); }

/* ---------- CTA-Band ---------- */
.cta { color: var(--c-on-dark); background: var(--c-dark); }
.cta h2 { color: #fff; }
.cta p { color: var(--c-on-dark-muted); max-width: var(--measure); }
.cta .wrap { display: grid; gap: var(--s-5); align-items: center; }
.cta a:not(.btn) { color: #ffb27a; }
.cta a:not(.btn):hover { color: #fff; }

/* ---------- Weitere Leistungen ---------- */
.pills { display: flex; flex-wrap: wrap; gap: var(--s-2); list-style: none; padding: 0; margin: 0; }
.pills a {
  display: inline-block;
  padding: 0.5rem 1rem;
  color: var(--c-ink);
  text-decoration: none;
  font-weight: 600;
  border: 1px solid var(--c-line);
  border-radius: 999px;
  background: var(--c-bg);
}
.pills a:hover { border-color: var(--c-accent); color: var(--c-accent); }

/* ---------- Fußbereich ---------- */
.site-footer { color: var(--c-on-dark-muted); background: #14171a; font-size: 0.9688rem; }
.site-footer .wrap { padding-block: var(--s-7) var(--s-5); }
.footer-grid { display: grid; gap: var(--s-6); margin-bottom: var(--s-6); }
.site-footer h2 { margin-bottom: var(--s-3); font-size: 0.8125rem; letter-spacing: 0.12em; text-transform: uppercase; color: #fff; }
.site-footer a { color: var(--c-on-dark); }
.site-footer a:hover { color: #ffb27a; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: var(--s-2); }
.site-footer address { font-style: normal; }
.site-footer .brand { color: #fff; margin-bottom: var(--s-3); }
.site-footer .brand:hover { color: #fff; }
.copyright { margin: 0; padding-top: var(--s-4); border-top: 1px solid #2d3238; font-size: 0.875rem; }

/* ---------- Ab Tablet ---------- */
@media (min-width: 40em) {
  .brand { font-size: 1.375rem; }
  .section { padding-block: var(--s-8); }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .call-short { display: none; }
  .call-long { display: inline; }

  /* Tabelle: echte Tabellendarstellung */
  .compare tr { display: table-row; padding: 0; }
  .compare thead { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
  .compare th, .compare td { display: table-cell; padding: var(--s-4) var(--s-3); vertical-align: top; border-bottom: 1px solid var(--c-line); }
  .compare thead th { font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--c-muted); border-bottom: 2px solid var(--c-ink); }
  .compare td::before { display: none; }
  .compare th[scope="row"] { font-size: 1rem; }
}

/* ---------- Ab Desktop ---------- */
@media (min-width: 60em) {
  :root { --header-h: 4.5rem; }
  .brand { font-size: 1.5rem; }
  .site-nav ul { gap: var(--s-1) var(--s-4); }
  .site-nav ul { gap: var(--s-1) var(--s-5); }
  .page-head__grid { grid-template-columns: 1.1fr 1fr; gap: var(--s-7); }
  .split { grid-template-columns: 1fr 1fr; gap: var(--s-7); }
  .split--reverse > :first-child { order: 2; }
  .content-grid { grid-template-columns: minmax(0, 1fr) 20rem; gap: var(--s-7); align-items: start; }
  .content-grid .facts { position: sticky; top: calc(var(--header-h) + var(--s-5)); }
  .cta .wrap { grid-template-columns: 1fr auto; gap: var(--s-7); }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
}

/* ---------- Präferenzen ---------- */
@media (prefers-reduced-motion: no-preference) {
  .btn, .card, .pills a, .site-nav a { transition: background-color 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s; }
}

@media (forced-colors: active) {
  .btn { border: 2px solid ButtonText; }
  .card { border-top-width: 4px; }
}

@media print {
  .site-header, .site-footer, .cta, .skip-link { display: none; }
  body { font-size: 11pt; }
}
