/*
 * Basis: Design-Tokens, Grundtypografie, Knöpfe, Logo, Polaroid, Flächen-Rhythmus und Übergang.
 * Aus dem freigegebenen Grobkonzept (prototyp/css/tokens.css, base.css, uebergaenge.css), angepasst an das Block-Markup von WordPress.
 * Farbpalette „Porzellan“, Schriftpalette „Prägung“ (Marcellus + Albert Sans + North Wave). Schriften lädt theme.json (lokal).
 */

/* ================= Tokens ================= */
:root {
  --flaeche-1-grund: oklch(0.972 0.008 95);  --flaeche-1-text: oklch(0.28 0.02 70);  --flaeche-1-leise: oklch(0.48 0.022 70);  --flaeche-1-linie: oklch(0.872 0.014 95);  --flaeche-1-akzent: oklch(0.46 0.045 70);  --flaeche-1-akzent-text: oklch(0.975 0.012 92);
  --flaeche-2-grund: oklch(0.928 0.016 90);  --flaeche-2-text: oklch(0.28 0.02 70);  --flaeche-2-leise: oklch(0.48 0.022 70);  --flaeche-2-linie: oklch(0.828 0.022 90);  --flaeche-2-akzent: oklch(0.44 0.045 70);  --flaeche-2-akzent-text: oklch(0.975 0.012 92);
  --flaeche-3-grund: oklch(0.862 0.024 82);  --flaeche-3-text: oklch(0.28 0.02 70);  --flaeche-3-leise: oklch(0.442 0.022 70);  --flaeche-3-linie: oklch(0.762 0.03 82);  --flaeche-3-akzent: oklch(0.42 0.045 70);  --flaeche-3-akzent-text: oklch(0.975 0.012 92);
  --header-grund: var(--flaeche-1-grund);  --header-text: var(--flaeche-1-text);  --header-linie: var(--flaeche-1-linie);
  --farbe-akzent: oklch(0.44 0.045 70);  --farbe-akzent-text: oklch(0.975 0.012 92);  --farbe-sterne: oklch(0.44 0.045 70);
  --badge-grund: var(--flaeche-3-grund);  --badge-text: var(--flaeche-3-text);  --badge-akzent: var(--flaeche-3-akzent);
  --schatten-farbe: oklch(0.45 0.03 70 / 0.2);  --logo-farbe: oklch(0.28 0.02 70);
  --dunkel-logo: oklch(0.28 0.02 70);  --dunkel-logo-innen: transparent;  --hero-dunkel: oklch(0.24 0.02 95);
  --dunkel-grund: var(--flaeche-3-grund);  --dunkel-text: var(--flaeche-3-text);  --dunkel-leise: var(--flaeche-3-leise);  --dunkel-linie: var(--flaeche-3-linie);  --dunkel-akzent: var(--flaeche-3-akzent);  --dunkel-akzent-text: var(--flaeche-3-akzent-text);

  --schrift-display: "Marcellus", "Trajan Pro", Georgia, serif;
  --schrift-text: "Albert Sans", "Helvetica Neue", Arial, sans-serif;
  --schrift-hand: "North Wave", "WindSong", "Snell Roundhand", cursive;
  --display-gewicht: 400;
  --radius: 0.75rem;  --radius-gross: 1.25rem;  --radius-pille: 999px;  --linie-staerke: 1px;  --radius-stapel: 1.75rem;
  --hand-skala: 1;

  --logo-hell: oklch(0.985 0.004 85);  --logo-hell-innen: oklch(0.33 0.014 285);
  --foto-hell: oklch(0.97 0.004 285);  --foto-dunkel: oklch(0.2 0.012 285);  --foto-schatten: oklch(0.18 0.015 60);

  --text-xs: clamp(0.78rem, 0.76rem + 0.1vw, 0.83rem);
  --text-s: clamp(0.9rem, 0.87rem + 0.15vw, 0.97rem);
  --text-m: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  --text-l: clamp(1.25rem, 1.1rem + 0.6vw, 1.6rem);
  --text-xl: clamp(1.7rem, 1.35rem + 1.5vw, 2.6rem);
  --text-2xl: clamp(2.3rem, 1.6rem + 3vw, 4.2rem);
  --text-3xl: clamp(2.8rem, 1.8rem + 4.5vw, 6rem);
  --abstand-xs: 0.5rem;
  --abstand-s: clamp(0.75rem, 0.6rem + 0.5vw, 1rem);
  --abstand-m: clamp(1.25rem, 1rem + 1vw, 2rem);
  --abstand-l: clamp(2.5rem, 1.8rem + 3vw, 5rem);
  --abstand-xl: clamp(4rem, 2.5rem + 6vw, 9rem);
  --rand: clamp(1rem, 0.5rem + 2.5vw, 3rem);
  --inhalt-breit: 82rem;
  --inhalt-text: 68ch;
  --dauer-kurz: 160ms;  --dauer: 260ms;  --dauer-lang: 520ms;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

  --maske-logo: url("../img/logo-maske.webp");
  --maske-logo-y: url("../img/logo-y-maske.webp");
  --icon-telefon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 4h3l1.5 4-2 1.5a11 11 0 0 0 7 7l1.5-2 4 1.5v3a2 2 0 0 1-2 2A15 15 0 0 1 3 6a2 2 0 0 1 2-2z'/%3E%3C/svg%3E");
  --icon-kalender: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.5' y='5' width='17' height='15.5' rx='2'/%3E%3Cpath d='M3.5 9.5h17M8 3v4M16 3v4'/%3E%3C/svg%3E");
  --icon-pfeil: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E");
  --icon-extern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17 17 7M9 7h8v8'/%3E%3C/svg%3E");
  --icon-pfeil-runter: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

/* ================= Grund ================= */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-hoehe, 5rem) + var(--wp-admin--admin-bar--height, 0px)); }
body {
  margin: 0; background: var(--flaeche-1-grund); color: var(--flaeche-1-text);
  font-family: var(--schrift-text); font-size: var(--text-m); line-height: 1.6; text-rendering: optimizeLegibility;
}
img, video, svg { display: block; max-width: 100%; height: auto; }
h1, h2, h3, h4 {
  margin: 0; font-family: var(--schrift-display); line-height: 1.1; text-wrap: balance;
  font-weight: var(--display-gewicht); letter-spacing: 0.01em;
}
h1, h2 { overflow-wrap: break-word; hyphens: auto; hyphenate-limit-chars: 12 5 5; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
[hidden]:not([hidden="until-found"]) { display: none !important; }
[inert] { pointer-events: none; }

/* WordPress-Abstände: Die Abschnitte bestimmen ihre Abstände selbst (wie im Grobkonzept).
   Die automatischen Block-Abstände (blockGap) gelten nur in Fließtext-Bereichen (.fs-text). */
.wp-site-blocks > *, .wp-site-blocks > * + * { margin-block: 0; }
:where(.is-layout-flow, .is-layout-constrained) > * { margin-block: 0; }
:where(.wp-block-group, .wp-block-image, .wp-block-gallery, .wp-block-buttons, .wp-block-quote, .wp-block-list, .wp-block-details) { margin: 0; }
figure { margin: 0; }
.wp-block-image img { height: auto; }
.wp-element-caption { margin: 0; }

.rahmen { width: min(100% - 2 * var(--rand), var(--inhalt-breit)); margin-inline: auto !important; }
.visually-hidden, .screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip-link.screen-reader-text:focus { clip: auto; clip-path: none; width: auto; height: auto; top: 1rem; left: 1rem; z-index: 100; padding: 0.6rem 1rem; background: var(--flaeche-1-text); color: var(--flaeche-1-grund); }

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

/* ================= Flächen-Rhythmus =================
   Abschnitte (.abschnitt) bekommen ihre Fläche automatisch im Wechsel 2-1 (Hero, hell, dunkel, hell …), auch wenn
   Abschnitte umsortiert werden. Varianten nutzen nur --abschnitt-*. */
.abschnitt { position: relative; background: var(--abschnitt-grund); color: var(--abschnitt-text); isolation: isolate; }
.abschnitt, .fs-inhalt > .abschnitt:nth-child(even) {
  --abschnitt-grund: var(--flaeche-1-grund); --abschnitt-text: var(--flaeche-1-text); --abschnitt-leise: var(--flaeche-1-leise);
  --abschnitt-linie: var(--flaeche-1-linie); --abschnitt-akzent: var(--flaeche-1-akzent); --abschnitt-akzent-text: var(--flaeche-1-akzent-text);
}
.fs-inhalt > .abschnitt:nth-child(odd) {
  --abschnitt-grund: var(--flaeche-2-grund); --abschnitt-text: var(--flaeche-2-text); --abschnitt-leise: var(--flaeche-2-leise);
  --abschnitt-linie: var(--flaeche-2-linie); --abschnitt-akzent: var(--flaeche-2-akzent); --abschnitt-akzent-text: var(--flaeche-2-akzent-text);
}
/* Übergang „Tonale Stufe“: zwei schmale Streifen der eigenen Fläche über der Kante */
.fs-inhalt > .abschnitt + .abschnitt::before {
  content: ""; position: absolute; z-index: 1; left: 0; right: 0; bottom: 100%; height: 1.5rem; pointer-events: none;
  background:
    linear-gradient(var(--abschnitt-grund), var(--abschnitt-grund)) 0 100% / 100% 50% no-repeat,
    linear-gradient(var(--abschnitt-grund), var(--abschnitt-grund)) 0 0 / 100% 50% no-repeat;
  -webkit-mask: linear-gradient(to bottom, rgb(0 0 0 / 0.35) 0 50%, rgb(0 0 0 / 0.7) 50% 100%);
          mask: linear-gradient(to bottom, rgb(0 0 0 / 0.35) 0 50%, rgb(0 0 0 / 0.7) 50% 100%);
}

/* ================= Logo (einfarbige Maske, bis die Vektordatei da ist) ================= */
.logo { position: relative; display: block; aspect-ratio: 1011 / 613; width: var(--logo-breite, 9rem); }
.logo::before, .logo::after { content: ""; position: absolute; inset: 0; }
.logo::before {
  background-color: var(--logo-farbe-hier, var(--logo-farbe, currentColor));
  -webkit-mask: var(--maske-logo) center / contain no-repeat; mask: var(--maske-logo) center / contain no-repeat;
  transition: background-color var(--dauer) var(--ease-out);
}
.logo::after {
  background-color: var(--logo-innen, transparent);
  -webkit-mask: var(--maske-logo-y) center / contain no-repeat; mask: var(--maske-logo-y) center / contain no-repeat;
  transition: background-color var(--dauer) var(--ease-out);
}
.logo--hell { --logo-farbe-hier: var(--logo-hell); --logo-innen: var(--logo-hell-innen); }
.logo-link { display: inline-block; color: inherit; text-decoration: none; border-radius: var(--radius); }

/* ================= Knöpfe =================
   Alle Knöpfe (Block „Buttons“) wie im Grobkonzept: Pille, Farbe aus der Fläche. Stile: Standard, „Umriss“ (is-style-outline),
   „Hell auf Foto“ (is-style-hell). Symbol über die Zusatzklasse ist-kalender / ist-telefon am Button. */
.wp-block-buttons { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.wp-block-button { margin: 0; }
.wp-block-button__link, .knopf {
  --k-grund: var(--abschnitt-akzent, var(--farbe-akzent));
  --k-text: var(--abschnitt-akzent-text, var(--farbe-akzent-text));
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55em;
  min-height: 3rem; padding: 0.7em 1.35em;
  border: var(--linie-staerke) solid var(--k-grund); border-radius: var(--radius-pille);
  background: var(--k-grund); color: var(--k-text);
  font: 600 var(--text-s) / 1.2 var(--schrift-text); letter-spacing: 0.01em;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform var(--dauer-kurz) var(--ease-out), background-color var(--dauer) var(--ease-out), color var(--dauer) var(--ease-out), box-shadow var(--dauer) var(--ease-out);
}
.wp-block-button__link:hover, .knopf:hover { box-shadow: 0 0.5rem 1.5rem -0.75rem var(--schatten-farbe); background: color-mix(in oklch, var(--k-grund) 88%, var(--k-text)); color: var(--k-text); }
.wp-block-button__link:active, .knopf:active { transform: translateY(1px) scale(0.985); }
.wp-block-button__link:focus-visible, .knopf:focus-visible { outline: 2px solid var(--k-grund); outline-offset: 3px; }
.is-style-outline > .wp-block-button__link, .knopf--linie { background: transparent; color: inherit; border-color: currentColor; }
.is-style-outline > .wp-block-button__link:hover, .knopf--linie:hover { background: color-mix(in oklch, currentColor 10%, transparent); color: inherit; box-shadow: none; }
.is-style-hell > .wp-block-button__link { --k-grund: var(--foto-hell); --k-text: var(--foto-dunkel); }
.wp-block-button[class*="ist-"] > .wp-block-button__link::before {
  content: ""; width: 1.15em; height: 1.15em; flex: none; background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat;
}
.wp-block-button.ist-kalender { --icon: var(--icon-kalender); }
.wp-block-button.ist-telefon { --icon: var(--icon-telefon); }
.wp-block-button.ist-extern > .wp-block-button__link::before { order: 2; }
.wp-block-button.ist-extern { --icon: var(--icon-extern); }
.wp-block-button.ist-gross > .wp-block-button__link { min-height: 3.3rem; padding-inline: 1.5em; font-size: var(--text-m); }

/* ================= Schreibschrift, Textlink, Sterne ================= */
.handschrift {
  display: block; font-family: var(--schrift-hand); font-weight: 400; font-style: normal;
  letter-spacing: 0; text-transform: none; line-height: 1; color: var(--abschnitt-akzent, var(--farbe-akzent));
  font-size: calc(var(--handschrift-groesse, clamp(2.2rem, 1.6rem + 2.4vw, 3.6rem)) * var(--hand-skala, 1));
}
.textlink a, a.textlink { display: inline-block; padding-block: 0.55rem; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.22em; transition: text-decoration-thickness var(--dauer-kurz) var(--ease-out); }
.textlink a:hover, a.textlink:hover { text-decoration-thickness: 2px; }
.sterne { display: inline-flex; gap: 0.1em; color: var(--abschnitt-akzent, var(--farbe-sterne)); }
.sterne svg { width: 1em; height: 1em; fill: currentColor; }
.sterne-wert { position: relative; display: inline-block; line-height: 0; color: var(--abschnitt-akzent, var(--farbe-sterne)); }
.sterne-wert > span { display: inline-flex; gap: 0.12em; }
.sterne-wert svg { width: 1em; height: 1em; flex: none; }
.sterne-wert__leer svg { fill: none; stroke: currentColor; stroke-width: 1.4; opacity: 0.5; }
.sterne-wert__voll { position: absolute; inset: 0; overflow: hidden; width: calc(var(--wert, 5) / 5 * 100%); }
.sterne-wert__voll svg { fill: currentColor; }
.foto, .wp-block-image.foto-fuellt img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* ================= Polaroid (Bild-Block mit Bildunterschrift + Klasse „polaroid“) ================= */
.polaroid {
  --polaroid-papier: oklch(0.985 0.005 85);
  --polaroid-tinte: oklch(0.3 0.025 60);
  position: relative; container-type: inline-size; padding: 6% 6% 0 !important;
  background: var(--polaroid-papier); border-radius: 3px;
  box-shadow: 0 1px 2px oklch(0.25 0.02 60 / 0.16), 0 1.5rem 2.5rem -1.5rem oklch(0.25 0.02 60 / 0.4);
  rotate: var(--polaroid-drehung, -2deg);
  transition: rotate var(--dauer-lang) var(--ease-out), box-shadow var(--dauer-lang) var(--ease-out);
}
.polaroid img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; object-position: 50% 18%; border-radius: 0; }
.polaroid figcaption, .polaroid .wp-element-caption {
  display: grid; place-items: center; height: 22cqi; margin: 0; color: var(--polaroid-tinte);
  font-family: var(--schrift-hand); font-size: calc(14cqi * var(--hand-skala, 1)); line-height: 1; rotate: -2deg; text-align: center;
}
@media (hover: hover) { .polaroid:hover { rotate: 0deg; box-shadow: 0 1px 2px oklch(0.25 0.02 60 / 0.16), 0 2rem 3rem -1.5rem oklch(0.25 0.02 60 / 0.45); } }

/* ================= Formularfelder ================= */
.feld { display: grid; gap: 0.4rem; }
.feld label { font-size: var(--text-s); font-weight: 600; }
.feld input, .feld select, .feld textarea {
  width: 100%; min-height: 3rem; padding: 0.7rem 0.9rem; font: inherit; color: inherit;
  background: color-mix(in oklch, var(--abschnitt-grund) 92%, var(--abschnitt-text));
  border: var(--linie-staerke) solid color-mix(in oklch, var(--abschnitt-text) 45%, transparent);
  border-radius: var(--radius);
  transition: border-color var(--dauer-kurz) var(--ease-out), box-shadow var(--dauer-kurz) var(--ease-out);
}
.feld textarea { min-height: 7rem; resize: vertical; }
.feld input:focus-visible, .feld select:focus-visible, .feld textarea:focus-visible { outline: none; border-color: var(--abschnitt-akzent); box-shadow: 0 0 0 3px color-mix(in oklch, var(--abschnitt-akzent) 35%, transparent); }

/* ================= Fließtext (Impressum, Datenschutz, Beiträge, längere Texte) ================= */
.fs-text { max-width: var(--inhalt-text); }
.fs-text > * + * { margin-block-start: 1em !important; }
.fs-text > :is(h2, h3) { margin-block-start: 1.8em !important; }
.fs-text h2 { font-size: var(--text-xl); }
.fs-text h3 { font-size: var(--text-l); }
.fs-text ul, .fs-text ol { padding-left: 1.2em; }
.fs-text a { text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.fs-text .wp-block-image img { border-radius: var(--radius); }
