/*
 * Klarraum Kälin – gemeinsame Grundlage für alle Entwürfe.
 *
 * Jeder Entwurf (ruhe/, klarheit/, naehe/) lädt danach seine eigene style.css
 * und überschreibt dort die Design-Tokens unten. Diese Datei enthält nur:
 * Reset, Barrierefreiheit, Platzhalter-Markierung, Entwurfsleiste,
 * Video-Komponente, Demo-Dialog und Rechtstext-Seiten.
 */

/* ── Design-Tokens (Standardwerte, werden pro Entwurf überschrieben) ── */
:root {
  --c-bg: #ffffff;
  --c-surface: #f4f4f2;
  --c-text: #1c1c1a;
  --c-muted: #55554f;
  --c-line: #d9d9d4;
  --c-accent: #1c1c1a;        /* Hauptbutton-Hintergrund */
  --c-on-accent: #ffffff;     /* Text auf --c-accent */
  --c-link: #1c1c1a;
  --c-focus: #1c1c1a;
  --c-ph-bg: rgba(214, 163, 0, 0.16);
  --c-ph-line: #8a6a00;

  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: var(--font-body);

  --radius-s: 4px;
  --radius-m: 8px;
  --radius-l: 14px;
  --gutter: clamp(1rem, 5vw, 3rem);
  --measure: 36rem;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 1.5rem; }
body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul[class], ol[class] { list-style: none; padding: 0; }
img, video, svg { display: block; max-width: 100%; }
img, video { height: auto; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--c-link); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
[hidden] { display: none !important; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ── Barrierefreiheit ── */
:focus-visible {
  outline: 3px solid var(--c-focus);
  outline-offset: 3px;
}
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute;
  left: 0.75rem; top: 0.75rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--c-text);
  color: var(--c-bg);
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-s);
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }
.skip-link:focus-visible { outline: 3px solid #ffffff; outline-offset: 0; box-shadow: 0 0 0 6px var(--c-text); }

/* ── Feinsatz (von build.py gesetzt) ── */
.nobr { white-space: nowrap; }
.reg { font-size: 0.62em; line-height: 0; vertical-align: 0.55em; margin-left: 0.03em; }

/* ── Platzhalter: [eckige Klammern] aus content.toml ── */
.ph {
  background: var(--c-ph-bg);
  box-shadow: inset 0 -1px 0 var(--c-ph-line);
  border-radius: 2px;
  padding: 0 0.15em;
  font-style: normal;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* ── Entwurfsleiste (nur im Entwurfsmodus, bewusst neutral) ── */
.draft-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1rem;
  padding: 0 var(--gutter);
  background: #1e1e1c;
  color: #e9e9e4;
  font: 500 0.8125rem/1.4 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  letter-spacing: 0.01em;
}
.draft-bar a { display: inline-flex; align-items: center; min-height: 2.75rem; color: #ffffff; text-decoration: none; padding: 0 0.1rem; }
.draft-bar a:hover { text-decoration: underline; }
.draft-bar a:focus-visible { outline-color: #ffffff; outline-offset: -3px; }
.draft-bar__label { color: #b9b9b2; }
.draft-bar__list { display: flex; gap: 0.5rem; margin: 0 0 0 auto; padding: 0; list-style: none; }
.draft-bar__list a { min-width: 2.75rem; justify-content: center; padding-inline: 0.35rem; }
.draft-bar__list a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.3em; }
@media (max-width: 30rem) {
  .draft-bar__label { display: none; }
}
.in-frame .draft-bar { display: none; }   /* in den Vorschauen der Vergleichsseite ausblenden */

/* ── Vorstellungsvideo ── */
.video { margin: 0; }
.video__frame {
  position: relative;
  aspect-ratio: var(--video-ar, 16 / 9);
  overflow: hidden;
  border-radius: var(--radius-m);
  background: var(--c-surface);
}
.video--portrait .video__frame {
  width: min(100%, calc(min(78vh, 42rem) * var(--video-w, 9) / var(--video-h, 16)));
  margin-inline: auto;
}
.video__media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #111;
}
.video__play {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 3.5rem;
  padding: 0.5rem 1.35rem 0.5rem 0.5rem;
  border: 0;
  border-radius: 999px;
  background: var(--c-accent);
  color: var(--c-on-accent);
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
}
.video__play:hover { filter: brightness(1.08); }
.video__play:focus-visible { outline-color: var(--c-on-accent); box-shadow: 0 0 0 6px var(--c-accent); }
.video__play-icon {
  position: relative;
  flex: none;
  width: 2.75rem; height: 2.75rem;
  border-radius: 50%;
  background: var(--c-on-accent);
}
.video__play-icon::after {
  content: "";
  position: absolute;
  left: 54%; top: 50%;
  width: 0.95rem; height: 1.1rem;
  transform: translate(-50%, -50%);
  background: var(--c-accent);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}
.video__play-time { font-weight: 400; opacity: 0.85; }

.video__frame--placeholder {
  overflow: visible;           /* Platzhalter darf bei sehr schmalen Screens mitwachsen statt abzuschneiden */
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background:
    repeating-linear-gradient(135deg, transparent 0 14px, rgba(0, 0, 0, 0.025) 14px 15px),
    var(--c-surface);
  border: 1px dashed var(--c-line);
}
.video__placeholder {
  display: grid;
  justify-items: center;
  gap: 0.5rem;
  max-width: 22rem;
  text-align: center;
}
.video__placeholder .video__play-icon {
  width: 3.5rem; height: 3.5rem;
  background: transparent;
  border: 2px solid currentColor;
  opacity: 0.55;
  margin-bottom: 0.25rem;
}
.video__placeholder .video__play-icon::after { background: currentColor; }
.video__placeholder-title { font-weight: 700; }
.video__placeholder-text { font-size: 0.9375rem; color: var(--c-muted); }
@media (max-width: 26rem) {
  .video__placeholder-text { font-size: 0.875rem; }
  .video__placeholder .video__play-icon { width: 2.75rem; height: 2.75rem; }
}

.video__caption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.15rem 1rem;
  margin-top: 0.75rem;
  font-size: 0.9375rem;
}
.video__caption-title { font-weight: 600; }
.video__caption-meta { color: var(--c-muted); }

.transcript { margin-top: 0.5rem; font-size: 0.9375rem; }
.transcript > summary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.75rem;
  cursor: pointer;
  color: var(--c-link);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  list-style: none;
}
.transcript > summary::-webkit-details-marker { display: none; }
.transcript > summary::before {
  content: "";
  width: 0.45rem; height: 0.45rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
}
.transcript[open] > summary::before { transform: rotate(45deg); }
.transcript__body { max-width: var(--measure); padding: 0.25rem 0 0.5rem; color: var(--c-muted); }
.transcript__body p + p { margin-top: 0.6em; }

/* ── Porträt-Platzhalter ── */
.portrait { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius-m); }
.portrait--placeholder {
  position: relative;
  display: grid;
  place-items: center;
  padding: 1rem;
  background:
    repeating-linear-gradient(135deg, transparent 0 14px, rgba(0, 0, 0, 0.025) 14px 15px),
    var(--c-surface);
  border: 1px dashed var(--c-line);
  color: var(--c-muted);
  font-size: 0.875rem;
  text-align: center;
}

/* ── Kleines rundes Porträt (partials/avatar.html) ── */
.avatar {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 3.5rem;
  aspect-ratio: 1;
  border-radius: 50%;
  object-fit: cover;
  overflow: hidden;
}
.avatar--placeholder {
  background: var(--c-surface);
  border: 1px dashed var(--c-ph-line);
  color: var(--c-muted);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1;
}

/* ── Demo-Hinweis zur Terminbuchung ── */
.booking-demo {
  width: min(30rem, calc(100vw - 2rem));
  max-height: calc(100dvh - 2rem);
  padding: 0;
  border: 0;
  border-radius: var(--radius-l);
  background: var(--c-bg);
  color: var(--c-text);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
}
.booking-demo::backdrop { background: rgba(18, 18, 16, 0.5); }
.booking-demo__inner { display: grid; gap: 0.85rem; padding: clamp(1.25rem, 5vw, 2rem); }
.booking-demo__badge {
  justify-self: start;
  padding: 0.15rem 0.55rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.booking-demo__title { font-family: var(--font-display); font-size: 1.375rem; line-height: 1.25; }
.booking-demo__alt { color: var(--c-muted); }
.booking-demo form { margin-top: 0.4rem; }
.booking-demo__close {
  min-height: 2.75rem;
  padding: 0.6rem 1.25rem;
  border: 0;
  border-radius: var(--radius-s);
  background: var(--c-accent);
  color: var(--c-on-accent);
  font-weight: 600;
}

/* ── Rechtstext-Seiten (Impressum, Datenschutz) ── */
.legal-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem 1.5rem;
  max-width: 48rem;
  margin: 0 auto;
  padding: 1.5rem var(--gutter);
}
.legal-header__brand {
  display: inline-flex;
  align-items: center;
  column-gap: 0.3em;
  min-height: 2.75rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  text-decoration: none;
  color: var(--c-text);
}
.legal-header__back { display: inline-flex; align-items: center; min-height: 2.75rem; font-size: 0.9375rem; }
.legal { max-width: 48rem; margin: 0 auto; padding: 1rem var(--gutter) 4rem; }
.legal h1 { font-family: var(--font-display); font-size: clamp(2rem, 6vw, 2.75rem); line-height: 1.1; margin: 1.5rem 0 2rem; }
.legal h2 { font-family: var(--font-display); font-size: 1.1875rem; margin-bottom: 0.5rem; }
.legal__section { padding: 1.25rem 0; border-top: 1px solid var(--c-line); }
.legal__section p + p { margin-top: 0.6em; }
.legal__draft {
  padding: 0.9rem 1rem;
  border: 1px dashed var(--c-ph-line);
  border-radius: var(--radius-s);
  background: var(--c-ph-bg);
  font-size: 0.9375rem;
}
.legal-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
  max-width: 48rem;
  margin: 0 auto;
  padding: 1rem var(--gutter) 3rem;
  border-top: 1px solid var(--c-line);
  color: var(--c-muted);
  font-size: 0.875rem;
}
.legal-footer__links { display: flex; flex-wrap: wrap; gap: 0 1.25rem; margin: 0; padding: 0; list-style: none; }
.legal-footer__links a { display: inline-flex; align-items: center; min-height: 2.75rem; }
.legal-footer__links a[aria-current="page"] { text-decoration-thickness: 2px; }
