/*
 * Grundlayout und Komponenten (docs/design/README.md §5).
 * Nur Tokens aus tokens.css – keine Farb- oder Größenwerte hier (Test: test_design_tokens).
 * Responsives Verhalten über intrinsische Layouts; Breakpoints nur in tokens.css.
 */

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

html {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 100%;
  line-height: var(--line-height-base);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--color-bg);
  font-size: var(--font-size-base);
  overflow-wrap: break-word;
  /* Deko (Pinselkanten, Blätter) darf über den Rand ragen, aber nie seitlich scrollen */
  overflow-x: clip;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--color-text);
  font-weight: var(--font-weight-extrabold);
  line-height: var(--line-height-heading);
  text-wrap: balance;
  /* Lange deutsche Wörter („Gesichtsgymnastik“) trennen statt das Layout zu sprengen */
  hyphens: auto;
}

h1 {
  font-size: var(--font-size-h1);
}

h2 {
  font-size: var(--font-size-h2);
}

h3 {
  font-size: var(--font-size-h3);
}

p,
ul,
ol {
  margin: 0;
}

p {
  max-width: var(--measure);
}

img,
svg {
  max-width: 100%;
}

a {
  color: var(--color-primary);
  text-underline-offset: var(--underline-offset);
}

a:hover {
  color: var(--color-primary-strong);
}

:focus-visible {
  outline: var(--focus-ring-width) solid var(--color-focus);
  outline-offset: var(--focus-ring-offset);
  border-radius: var(--radius-small);
}

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

.visually-hidden {
  position: absolute !important;
  width: var(--size-hairline);
  height: var(--size-hairline);
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.muted {
  color: var(--color-text-muted);
  font-size: var(--font-size-small);
}

/* --- Sprunglink ---------------------------------------------------------------- */
.skip-link {
  position: absolute;
  z-index: 10;
  inset-inline-start: var(--space-3);
  inset-block-start: var(--space-3);
  display: inline-flex;
  align-items: center;
  min-height: var(--tap-target-min);
  padding-inline: var(--space-4);
  background: var(--color-text);
  color: var(--color-bg);
  font-weight: var(--font-weight-bold);
  border-radius: var(--radius-button);
  transform: translateY(calc(-100% - var(--space-5)));
}

.skip-link:focus,
.skip-link:focus-visible {
  transform: none;
  color: var(--color-bg);
}

/* --- Seitenrahmen ---------------------------------------------------------------- */
.page-container {
  width: 100%;
  max-width: var(--page-max-width);
  margin-inline: auto;
  padding-inline: var(--page-gutter);
}

.site-header {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-block: var(--space-3);
}

.site-main {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-6);
  padding-block: var(--space-4) var(--space-6);
}

.site-main:focus {
  outline: none;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3) var(--space-5);
  padding-block: var(--space-5);
  border-top: var(--border-width) dashed var(--color-accent);
  color: var(--color-text-muted);
  font-size: var(--font-size-small);
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
}

.site-footer a,
.header-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap-target-min);
}

.header-link {
  padding-inline: var(--space-3);
  border: var(--border-width) solid var(--color-primary);
  border-radius: var(--radius-button);
  font-weight: var(--font-weight-bold);
  text-decoration: none;
}

.wordmark {
  font-family: var(--font-script);
  font-size: var(--font-size-wordmark);
  line-height: var(--line-height-script);
  color: var(--color-heading-accent);
  text-decoration: none;
}

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

/* --- Layout-Helfer --------------------------------------------------------------- */
.stack {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: var(--space-4);
}

/* Zwei (oder mehr) Spalten, die bei wenig Platz untereinander rutschen */
.columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--column-min)), 1fr));
  align-items: start;
  gap: var(--space-5);
}

.columns > *,
.stack > * {
  min-width: 0;
}

/* --- Schreibschrift (Caveat Brush): nur kurze Deko-Zeilen ------------------------- */
.script {
  font-family: var(--font-script);
  font-weight: var(--font-weight-regular);
  font-size: var(--font-size-script);
  line-height: var(--line-height-script);
  color: var(--color-heading-accent);
}

.script--hero {
  font-size: var(--font-size-script-hero);
}

/* Überschrift auf Pinsel-Unterlegung */
.wash-heading {
  justify-self: start;
  padding: var(--space-1) var(--space-5) var(--space-2) var(--space-4);
  background: var(--color-wash);
  font-family: var(--font-script);
  font-weight: var(--font-weight-regular);
  font-size: var(--font-size-script);
  line-height: var(--line-height-heading);
  color: var(--color-text);
  transform: rotate(var(--wash-tilt));
  clip-path: polygon(2% 12%, 30% 0, 70% 6%, 99% 0, 100% 80%, 96% 100%, 50% 92%, 0 100%, 3% 55%);
}

/* Pinsel-Unterstreichung unter Überschriften */
.brush-underline {
  display: block;
  width: 100%;
  max-width: var(--column-min);
  height: var(--space-4);
}

.brush-underline path {
  fill: none;
  stroke: var(--color-accent);
  stroke-width: var(--border-width-strong);
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

/* --- Pinsel-Button ------------------------------------------------------------------ */
.btn-brush {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--button-min-height);
  padding: var(--space-2) var(--space-5);
  border: 0;
  border-radius: var(--radius-button);
  /* Hintergrund liegt auf ::after – so bleibt die Pinselkante (::before) sicher dahinter
     und hellt die Pille nicht auf (Kontrast Weiß auf primary 5,3 : 1). */
  background: transparent;
  color: var(--color-on-primary);
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-extrabold);
  line-height: var(--line-height-heading);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

/* Pinselkante in decor, läuft hinter der Pille aus */
.btn-brush::before {
  content: "";
  position: absolute;
  z-index: -2;
  inset: calc(-1 * var(--button-brush-bleed-y)) calc(-1 * var(--button-brush-bleed-x));
  border-radius: 40% 55% 45% 60% / 60% 45% 55% 40%;
  background: var(--color-decor);
  opacity: var(--decor-opacity);
  transform: rotate(var(--button-brush-tilt));
}

/* Die Pille selbst */
.btn-brush::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  border-radius: var(--radius-button);
  background: var(--color-primary);
  transition: background-color 0.15s ease;
}

.btn-brush:hover,
.btn-brush:focus-visible {
  color: var(--color-on-primary);
}

.btn-brush:hover::after,
.btn-brush:focus-visible::after {
  background: var(--color-primary-strong);
}

.btn-brush:focus-visible {
  outline-offset: calc(var(--button-brush-bleed-y) + var(--focus-ring-offset));
  border-radius: var(--radius-button);
}

.btn-brush--large {
  --button-brush-tilt: var(--button-brush-tilt-large);
  width: 100%;
  min-height: var(--button-min-height-large);
  font-size: var(--font-size-h3);
}

.btn-brush svg {
  flex: none;
  width: var(--icon-inline-size);
  height: var(--icon-inline-size);
}

.btn-brush svg path {
  fill: none;
  stroke: currentColor;
  stroke-width: var(--border-width);
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

/* --- Häkchen-Liste ------------------------------------------------------------------- */
.checklist {
  display: grid;
  gap: var(--space-3);
  padding: 0;
  list-style: none;
}

.checklist li {
  display: grid;
  grid-template-columns: var(--check-size) minmax(0, 1fr);
  align-items: start;
  gap: var(--space-3);
}

/* Gelber Kreis, braunes Häkchen (nie Weiß auf Gelb) */
.checklist__mark {
  display: grid;
  place-items: center;
  width: var(--check-size);
  height: var(--check-size);
  margin-top: var(--space-1);
  border-radius: var(--radius-round);
  background: var(--color-accent);
}

.checklist__mark svg {
  width: var(--check-icon-size);
  height: var(--check-icon-size);
}

.checklist__mark path {
  fill: none;
  stroke: var(--color-text);
  stroke-width: var(--border-width-strong);
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

/* --- Info-Karte ------------------------------------------------------------------------ */
.info-card {
  display: grid;
  align-self: start;
  margin: 0;
  list-style: none;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-card);
  background: var(--color-wash);
}

.info-card__row {
  display: grid;
  grid-template-columns: var(--icon-circle-size) minmax(0, 1fr);
  align-items: center;
  gap: var(--space-3);
  padding-block: var(--space-3);
}

.info-card__row + .info-card__row {
  border-top: var(--border-width) solid var(--color-accent);
}

.info-card__icon {
  display: grid;
  place-items: center;
  width: var(--icon-circle-size);
  height: var(--icon-circle-size);
  border-radius: var(--radius-round);
  background: var(--color-decor);
}

.info-card__icon svg {
  width: var(--icon-size);
  height: var(--icon-size);
}

.info-card__icon :is(path, rect, circle) {
  fill: none;
  stroke: var(--color-on-primary);
  stroke-width: var(--border-width);
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.info-card__label {
  display: block;
  color: var(--color-primary);
  font-size: var(--font-size-small);
  font-weight: var(--font-weight-extrabold);
  letter-spacing: var(--letter-spacing-label);
  line-height: var(--line-height-heading);
  text-transform: uppercase;
}

.info-card__value {
  display: block;
  margin: 0;
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-heading);
}

/* --- Hinweis-Box ----------------------------------------------------------------------- */
.note {
  display: grid;
  grid-template-columns: var(--icon-size) minmax(0, 1fr);
  align-items: start;
  gap: var(--space-3);
  max-width: var(--measure);
  padding: var(--space-3) var(--space-4);
  border: var(--border-width) dashed var(--color-sage);
  border-radius: var(--radius-card);
  background: var(--color-surface);
}

.note svg {
  width: var(--icon-size);
  height: var(--icon-size);
}

.note :is(path, circle) {
  fill: none;
  stroke: var(--color-sage);
  stroke-width: var(--border-width);
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

/* --- Deko: Blätter, nie hinter Text ---------------------------------------------------- */
.leaf {
  display: block;
  width: var(--leaf-width);
  pointer-events: none;
}

.leaf ellipse {
  fill: var(--color-sage);
}

.leaf path {
  fill: none;
  stroke: var(--color-sage);
  stroke-width: var(--border-width);
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

/* --- Fließtext aus dem Editor ------------------------------------------------------------ */
.rich-text {
  max-width: var(--measure);
}

.rich-text > * + * {
  margin-top: var(--space-3);
}

.rich-text :is(ul, ol) {
  padding-inline-start: var(--space-4);
}

/* --- Polaroid-Foto: heller Rahmen, leicht gedreht -------------------------------------- */
.polaroid {
  justify-self: start;
  max-width: var(--polaroid-max-width);
  margin: 0;
  padding: var(--space-3) var(--space-3) var(--space-4);
  background: var(--color-surface);
  box-shadow: var(--shadow-photo);
  transform: rotate(var(--polaroid-tilt));
}

.polaroid__image {
  display: block;
  width: 100%;
  height: auto;
}

.polaroid__caption {
  margin-top: var(--space-2);
  font-family: var(--font-script);
  font-size: var(--font-size-h3);
  line-height: var(--line-height-script);
  text-align: center;
}

/* --- Kursseite: Terminliste in der Info-Karte, Buchungszustand ------------------------- */
.info-card__row:has(.session-list) {
  align-items: start;
}

.session-list {
  display: grid;
  gap: var(--space-2);
  margin: var(--space-1) 0 0;
  padding: 0;
  list-style: none;
}

.session-list li {
  display: grid;
}

.booking-soon {
  font-size: var(--font-size-h3);
  font-weight: var(--font-weight-extrabold);
}
