/* ==========================================================================
   Clever House Info — Marktanalyse-Stylesheet
   Mobile-first, systemschrift-basiert, ohne externe Ressourcen.
   ========================================================================== */

:root {
  --primary: #0e4f3b;
  --primary-deep: #0a3a2c;
  --secondary: #232b28;
  --accent: #3fd69f;
  --accent-gold: #d9a827;
  --link: #0c6a4e;
  --bg: #f3f7f5;
  --surface: #ffffff;
  --surface-alt: #e8f1ec;
  --text: #202925;
  --muted: #54655e;
  --border: #d7e2dc;
  --row-alt: #eef5f1;
  --success: #177a4c;
  --danger: #b23a2e;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(16, 34, 27, 0.06), 0 4px 14px rgba(16, 34, 27, 0.06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Basis ---------- */

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

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}

::selection {
  background: var(--accent);
  color: var(--primary-deep);
}

h1,
h2,
h3,
h4 {
  line-height: 1.25;
  color: var(--primary-deep);
  margin: 2.2em 0 0.6em;
  font-weight: 700;
  letter-spacing: -0.01em;
}

h1 {
  font-size: 1.8rem;
  margin-top: 0;
}

h2 {
  font-size: 1.4rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--border);
}

h3 {
  font-size: 1.15rem;
}

h4 {
  font-size: 1rem;
}

[id] {
  scroll-margin-top: 1.5rem;
}

p {
  margin: 0 0 1.1em;
}

ul,
ol {
  margin: 0 0 1.25em;
  padding-left: 1.4rem;
}

li {
  margin-bottom: 0.4em;
}

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--primary-deep);
  text-decoration-thickness: 2px;
}

a:focus-visible,
summary:focus-visible,
button:focus-visible {
  outline: 3px solid var(--link);
  outline-offset: 2px;
  border-radius: 2px;
}

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

strong {
  color: var(--primary-deep);
}

nav {
  font-size: 0.95rem;
}

blockquote {
  margin: 1.5rem 0;
  padding: 0.9rem 1.2rem;
  background: var(--surface-alt);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--secondary);
}

blockquote p:last-child {
  margin-bottom: 0;
}

figure {
  margin: 1.75rem 0;
}

figcaption {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.6rem;
  text-align: center;
}

/* ---------- Layout ---------- */

.container {
  width: 100%;
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 1rem;
}

main {
  padding: 1.5rem 0 3rem;
}

main .container {
  max-width: 820px;
}

/* ---------- Header ---------- */

header.site {
  background: var(--primary-deep);
  border-bottom: 3px solid var(--accent);
}

header.site .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 1.25rem;
  padding-top: 0.7rem;
  padding-bottom: 0.7rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: #ffffff;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
}

.brand:hover {
  color: var(--accent);
}

.brand img {
  height: 44px;
  width: auto;
  object-fit: contain;
  display: block;
}

nav.primary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
}

nav.primary a {
  color: #cfe3da;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.42rem 0.65rem;
  border-radius: var(--radius);
  transition: background 0.15s ease, color 0.15s ease;
}

nav.primary a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

header.site a:focus-visible {
  outline-color: var(--accent);
}

/* ---------- Hero ---------- */

.hero {
  background: linear-gradient(145deg, var(--primary-deep) 0%, var(--primary) 55%, #1d2b26 100%);
  color: #eef6f1;
  padding: 2.5rem 0 2.75rem;
}

.hero h1 {
  color: #ffffff;
  margin-bottom: 0.5rem;
}

.byline {
  color: #a9c9ba;
  font-size: 0.88rem;
  margin-bottom: 1.4rem;
}

.byline strong {
  color: var(--accent);
}

.lede {
  background: rgba(255, 255, 255, 0.07);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1rem 1.2rem;
  max-width: 64ch;
  font-size: 1.05rem;
}

.lede p:last-child {
  margin-bottom: 0;
}

.hero a {
  color: var(--accent);
}

.hero a:focus-visible {
  outline-color: var(--accent);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.cta {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  border: 2px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.cta-primary {
  background: var(--accent);
  color: var(--primary-deep);
}

.cta-primary:hover {
  background: #63e2b4;
  color: var(--primary-deep);
}

.cta-secondary {
  border-color: rgba(255, 255, 255, 0.55);
  color: #ffffff;
}

.cta-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: #ffffff;
  color: #ffffff;
}

/* ---------- Inhaltsverzeichnis ---------- */

.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.4rem;
  margin: 1.75rem 0 2.25rem;
}

.toc-title {
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  margin: 0 0 0.75rem;
}

.toc ol {
  margin: 0;
  padding-left: 1.3rem;
}

.toc li {
  margin-bottom: 0.35em;
  font-size: 0.94rem;
}

.toc a {
  text-decoration: none;
  font-weight: 500;
}

.toc a:hover {
  text-decoration: underline;
}

/* ---------- Tabellen & Vergleich ---------- */

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 1.75rem 0;
}

table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 0.92rem;
  background: var(--surface);
}

thead th {
  background: var(--primary);
  color: #ffffff;
  text-align: left;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.75rem 0.9rem;
  white-space: nowrap;
}

td {
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

tbody tr:nth-child(even) {
  background: var(--row-alt);
}

tbody tr:hover {
  background: var(--surface-alt);
}

tbody tr:last-child td {
  border-bottom: none;
}

td:first-child {
  font-weight: 600;
  color: var(--primary-deep);
}

/* ---------- Abbildungen ---------- */

.illustration {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
  margin: 2rem 0;
}

.illustration img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: calc(var(--radius) - 2px);
}

/* ---------- FAQ ---------- */

.faq {
  margin: 1.5rem 0 2rem;
}

details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow);
  overflow: hidden;
}

summary {
  font-weight: 700;
  font-size: 1.08rem;
  line-height: 1.4;
  cursor: pointer;
  padding: 0.95rem 1.1rem;
  color: var(--primary-deep);
  transition: background 0.15s ease;
}

summary::marker {
  color: var(--accent-gold);
}

summary:hover {
  background: var(--surface-alt);
}

details[open] summary {
  border-bottom: 2px solid var(--border);
  background: var(--surface-alt);
}

details p {
  margin: 0.9rem 1.1rem;
  color: var(--secondary);
}

/* ---------- Autorin ---------- */

.author-box {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.4rem;
  margin: 2.5rem 0 1.5rem;
}

.author-box img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--surface-alt);
}

.author-box div {
  flex: 1;
  min-width: 220px;
}

.author-name {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--primary-deep);
  margin: 0;
}

.author-role {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--success);
  margin: 0.1rem 0 0.6rem;
}

.author-bio {
  font-size: 0.92rem;
  color: var(--muted);
  margin: 0;
}

/* ---------- Hinweisboxen ---------- */

.callout {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent-gold);
  border-radius: var(--radius);
  padding: 1.1rem 1.3rem;
  margin: 1.75rem 0;
}

.callout p:last-child {
  margin-bottom: 0;
}

/* ---------- Listenvarianten ---------- */

.steps {
  list-style: none;
  counter-reset: schritt;
  padding-left: 0;
  margin: 1.5rem 0 2rem;
}

.steps li {
  counter-increment: schritt;
  position: relative;
  padding: 0.15rem 0 0.15rem 3rem;
  margin-bottom: 1rem;
}

.steps li::before {
  content: counter(schritt);
  position: absolute;
  left: 0;
  top: 0;
  width: 2.1rem;
  height: 2.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: 50%;
}

.arrow {
  list-style: none;
  padding-left: 0;
  margin: 1.25rem 0 1.75rem;
}

.arrow li {
  position: relative;
  padding-left: 1.6rem;
  margin-bottom: 0.55rem;
}

.arrow li::before {
  content: "\2192";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--success);
  font-weight: 700;
}

/* ---------- Footer ---------- */

footer.site {
  background: var(--secondary);
  color: #c6d3cd;
  padding: 2.5rem 0 1.5rem;
  margin-top: 2rem;
  font-size: 0.92rem;
}

footer.site h4 {
  color: #ffffff;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 0.8rem;
}

footer.site ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

footer.site li {
  margin: 0 0 0.45rem;
}

footer.site a {
  color: #9fd8bd;
  text-decoration: none;
}

footer.site a:hover {
  color: #ffffff;
  text-decoration: underline;
}

footer.site a:focus-visible {
  outline-color: var(--accent);
}

.cols {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
}

.copy {
  margin: 2rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 0.8rem;
  color: #9cada4;
}

/* ---------- Breakpoint 700px ---------- */

@media (min-width: 700px) {
  .container {
    padding: 0 1.5rem;
  }

  h1 {
    font-size: 2.25rem;
  }

  h2 {
    font-size: 1.55rem;
  }

  .hero {
    padding: 3.25rem 0 3.5rem;
  }

  nav.primary a {
    font-size: 0.92rem;
  }

  .toc ol {
    column-count: 2;
    column-gap: 2.5rem;
  }

  .cols {
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 2rem;
  }

  table {
    font-size: 0.95rem;
  }
}

/* ---------- Breakpoint 960px ---------- */

@media (min-width: 960px) {
  body {
    font-size: 1.0625rem;
  }

  h1 {
    font-size: 2.6rem;
  }

  .hero {
    padding: 4rem 0 4.25rem;
  }

  .lede {
    font-size: 1.1rem;
  }

  summary {
    font-size: 1.15rem;
  }

  main {
    padding: 2rem 0 4rem;
  }
}
