/* =========================================================================
   Domain-Parking – Frontend
   Mobile first, Dark Mode über prefers-color-scheme, WCAG 2.2 AA im Blick.
   ========================================================================= */

:root {
  --accent: #1f57e0;
  --accent-text: #ffffff;

  --bg: #ffffff;
  --surface: #f5f7fa;
  --surface-2: #eef1f6;
  --text: #14171c;
  --muted: #56606f;
  --border: #d9dee7;

  --ok-bg: #e6f4ea;   --ok-text: #14602c;   --ok-border: #a6d8b6;
  --warn-bg: #fdf3d8; --warn-text: #6b4a05; --warn-border: #e6cf8d;
  --off-bg: #eceef2;  --off-text: #4a5261;  --off-border: #cfd5e0;
  --err-bg: #fdecec;  --err-text: #8a1620;  --err-border: #f0b4b8;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 24px rgba(16, 24, 40, .06);
  --wrap: 76rem;
  --step: clamp(1rem, .6rem + 1.4vw, 1.5rem);

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent: #8fb0ff;
    --accent-text: #0d1117;

    --bg: #0f1216;
    --surface: #161a21;
    --surface-2: #1d222b;
    --text: #e9ecf1;
    --muted: #a7b0be;
    --border: #2b323d;

    --ok-bg: #12291b;   --ok-text: #8fe0ab;   --ok-border: #2f5c3f;
    --warn-bg: #2c2308; --warn-text: #f0d391; --warn-border: #5c4a15;
    --off-bg: #1f242d;  --off-text: #adb6c4;  --off-border: #39414e;
    --err-bg: #2d1416;  --err-text: #ffb0b6;  --err-border: #5e2a2f;

    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
  }
}

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

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

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

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

h1, h2, h3, h4 { line-height: 1.22; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.75rem); }
h2 { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.85rem); }
h3 { font-size: 1.15rem; }
p  { margin: 0 0 1em; }

a { color: var(--accent); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }

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

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

.wrap { width: min(100% - 2 * var(--step), var(--wrap)); margin-inline: auto; }
.wrap-narrow { max-width: 46rem; }

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

.skiplink {
  position: absolute; left: .5rem; top: -100vh;
  z-index: 100;
  background: var(--accent); color: var(--accent-text);
  padding: .7rem 1.1rem; border-radius: var(--radius-sm);
  font-weight: 600; text-decoration: none;
}
.skiplink:focus { top: .5rem; }

/* --- Kopf- und Fußbereich ----------------------------------------------- */

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky; top: 0; z-index: 20;
}

.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 4.25rem; flex-wrap: wrap;
}

.brand {
  display: inline-flex; align-items: center; gap: .6rem;
  color: var(--text); text-decoration: none; font-weight: 700;
}
.brand-mark {
  display: grid; place-items: center;
  width: 2rem; height: 2rem; border-radius: 8px;
  background: var(--accent); color: var(--accent-text);
  font-size: 1rem;
}
.brand-name { font-size: 1.05rem; }
.brand-logo { display: block; width: auto; max-height: 2.5rem; }

.nav-list {
  display: flex; align-items: center; gap: .35rem;
  list-style: none; margin: 0; padding: 0;
}
.nav-list a {
  display: inline-block; padding: .5rem .75rem;
  border-radius: var(--radius-sm);
  color: var(--text); text-decoration: none; font-weight: 600; font-size: .95rem;
}
.nav-list a:hover { background: var(--surface-2); }
.nav-list a[aria-current="page"] { color: var(--accent); text-decoration: underline; }
.lang-link { border: 1px solid var(--border); }

.site-main { min-height: 60vh; }
.site-main:focus { outline: none; }

.site-footer {
  margin-top: 4rem; padding: 2rem 0;
  border-top: 1px solid var(--border); background: var(--surface);
  color: var(--muted); font-size: .925rem;
}
.footer-inner { display: flex; flex-wrap: wrap; gap: .75rem 2rem; justify-content: space-between; }
.footer-copy { margin: 0; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 1.25rem; list-style: none; margin: 0; padding: 0; }
.footer-nav a { color: var(--muted); }

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

.hero { padding: clamp(2.5rem, 1rem + 6vw, 4.5rem) 0 1.5rem; background: var(--surface); }
.hero-title { margin-bottom: .25em; }
.hero-claim { font-size: 1.15rem; color: var(--muted); margin-bottom: .75em; }
.hero-intro { max-width: 46rem; }

.filterbar { padding: 1.75rem 0 0; }
.filter-form { display: flex; flex-wrap: wrap; gap: 1rem; align-items: end; }
.field-inline { flex: 1 1 14rem; }
.field-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

.results { padding: 1.5rem 0 3rem; }
.results-heading { font-size: 1.05rem; color: var(--muted); font-weight: 600; margin-bottom: 1rem; }

.card-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
}

.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.card-body { padding: 1.15rem 1.25rem 1.25rem; height: 100%; display: flex; flex-direction: column; }
.card-title { font-size: 1.1rem; margin-bottom: .35em; word-break: break-word; }
.card-title a { color: var(--text); text-decoration: none; }
.card-title a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.card { position: relative; }
.card-title a:hover { color: var(--accent); }
.card-teaser { color: var(--muted); font-size: .95rem; margin-bottom: 1rem; }
.card-meta {
  margin: auto 0 0; padding-top: .75rem;
  display: flex; align-items: center; justify-content: space-between;
  gap: .5rem; flex-wrap: wrap; border-top: 1px solid var(--border);
}
.card-price { font-weight: 700; font-size: .95rem; }

.badge {
  display: inline-block; margin: 0;
  padding: .18rem .6rem; border-radius: 999px;
  font-size: .8rem; font-weight: 700; line-height: 1.5;
  border: 1px solid transparent;
}
.badge-available    { background: var(--ok-bg);   color: var(--ok-text);   border-color: var(--ok-border); }
.badge-reserved     { background: var(--warn-bg); color: var(--warn-text); border-color: var(--warn-border); }
.badge-sold,
.badge-not_for_sale { background: var(--off-bg);  color: var(--off-text);  border-color: var(--off-border); }
.badge-featured     { background: var(--accent);  color: var(--accent-text); margin-bottom: .6rem; }

.empty {
  padding: 2rem; text-align: center; color: var(--muted);
  background: var(--surface); border-radius: var(--radius);
}

.pagination { margin-top: 2rem; }
.pagination ul {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  list-style: none; margin: 0; padding: 0;
}
.pagination a { font-weight: 600; }
.pagination-status { color: var(--muted); font-size: .95rem; }

/* --- Domainseite --------------------------------------------------------- */

.breadcrumb { padding: 1rem 0 0; font-size: .9rem; }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; margin: 0; padding: 0; color: var(--muted); }
.breadcrumb li + li::before { content: "/"; margin-right: .5rem; color: var(--border); }

.domain { padding: 1.5rem 0 3rem; }
.domain-header { max-width: 46rem; margin-bottom: 2.5rem; }
.domain-eyebrow { margin-bottom: .75rem; }
.domain-title { word-break: break-word; }
.domain-lead { font-size: 1.15rem; color: var(--muted); }

.domain-price {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem;
  margin: 1.5rem 0; padding: 1rem 1.25rem;
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--border);
}
.domain-price-label { color: var(--muted); }
.domain-price-value { font-size: 1.5rem; }
.domain-price-note { color: var(--muted); font-size: .85rem; width: 100%; }

.domain-grid { display: grid; gap: 2.5rem; align-items: start; }
@media (min-width: 60rem) {
  .domain-grid { grid-template-columns: minmax(0, 1fr) 24rem; gap: 3rem; }
  .domain-aside { position: sticky; top: 5.75rem; }
}

.prose { max-width: 42rem; }
.prose h2 { margin-top: 1.8em; }
.prose ul, .prose ol { padding-left: 1.35rem; }
.prose li { margin-bottom: .35em; }
.prose img { border-radius: var(--radius); }
.prose table { width: 100%; border-collapse: collapse; }
.prose th, .prose td { border: 1px solid var(--border); padding: .5rem .65rem; text-align: left; }

.facts { margin-top: 2.5rem; }
.fact-list { display: grid; gap: 0; margin: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.fact { display: flex; flex-wrap: wrap; gap: .25rem 1rem; padding: .75rem 1rem; border-bottom: 1px solid var(--border); }
.fact:last-child { border-bottom: 0; }
.fact:nth-child(odd) { background: var(--surface); }
.fact dt { flex: 0 0 12rem; color: var(--muted); margin: 0; }
.fact dd { margin: 0; font-weight: 600; word-break: break-word; }

.related { padding: 3rem 0; background: var(--surface); border-top: 1px solid var(--border); }
.related .card { background: var(--bg); }
.related-more { margin-top: 1.75rem; }

.static-page { padding: 2rem 0 3rem; }
.errorpage { padding: 4rem 0; text-align: center; }
.errorpage .lead { color: var(--muted); font-size: 1.1rem; }

/* --- Formulare ----------------------------------------------------------- */

.form-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem;
}
.form-intro, .form-hint, .form-privacy { font-size: .925rem; color: var(--muted); }
.form-hint { margin-bottom: 1.25rem; }

fieldset { border: 0; margin: 0 0 1rem; padding: 0; }
legend { font-weight: 700; padding: 0; margin-bottom: .75rem; font-size: 1rem; }

.field { margin-bottom: 1.1rem; }
.field label { display: block; font-weight: 600; font-size: .95rem; margin-bottom: .35rem; }
.req { color: var(--err-text); }
.opt { font-weight: 400; color: var(--muted); }

input[type="text"], input[type="email"], input[type="tel"],
input[type="search"], input[type="password"], input[type="url"],
input[type="number"], input[type="date"], select, textarea {
  width: 100%;
  padding: .65rem .75rem;
  font: inherit; font-size: 1rem;
  color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
textarea { resize: vertical; min-height: 7rem; }

input[aria-invalid="true"], textarea[aria-invalid="true"] {
  border-color: var(--err-text); border-width: 2px;
}

.field-check { display: grid; grid-template-columns: auto 1fr; gap: .6rem; align-items: start; }
.field-check input { width: 1.25rem; height: 1.25rem; margin-top: .2rem; accent-color: var(--accent); }
.field-check label { font-weight: 400; font-size: .925rem; margin: 0; }
.field-check .field-error { grid-column: 1 / -1; }

.field-error { color: var(--err-text); font-size: .9rem; font-weight: 600; margin: .35rem 0 0; }

/* Honeypot – für Screenreader ausgeblendet, für Bots sichtbar im DOM */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.alert { padding: 1rem 1.15rem; border-radius: var(--radius-sm); border: 1px solid; margin-bottom: 1.25rem; }
.alert h3 { font-size: 1rem; margin-bottom: .4em; }
.alert p:last-child, .alert ul:last-child { margin-bottom: 0; }
.alert ul { margin: 0; padding-left: 1.15rem; }
.alert-error { background: var(--err-bg); color: var(--err-text); border-color: var(--err-border); }
.alert-error a { color: inherit; }
.alert-success { background: var(--ok-bg); color: var(--ok-text); border-color: var(--ok-border); }

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

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .65rem 1.15rem; min-height: 2.75rem;
  font: inherit; font-size: 1rem; font-weight: 600;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  text-decoration: none; cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}
.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-primary:hover { filter: brightness(.92); }
.btn-quiet { background: transparent; color: var(--text); border-color: var(--border); }
.btn-quiet:hover { background: var(--surface-2); }
.btn-lg { padding: .85rem 1.5rem; font-size: 1.05rem; min-height: 3rem; }
.btn-block { width: 100%; }

/* --- Kontrastvorgaben des Systems respektieren --------------------------- */

@media (forced-colors: active) {
  .card, .btn, .form-card, .badge { border: 1px solid CanvasText; }
  .btn-primary { background: ButtonFace; color: ButtonText; }
}
