/* ---------- External font (Nunito, DSGVO-safe via bunny.net) ---------- */
@import url("https://fonts.bunny.net/css?family=nunito:400,600,700,800&display=swap");

/* ---------- Font Faces (Maybug MS, self-hosted) ---------- */

@font-face {
  font-family: "Maybug MS Decorative";
  src: url("../fonts/MaybugMSDecorative.woff2") format("woff2"),
       url("../fonts/MaybugMSDecorative.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Maybug MS Black";
  src: url("../fonts/MaybugMSBlack.woff2") format("woff2"),
       url("../fonts/MaybugMSBlack.woff") format("woff");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Maybug MS Regular";
  src: url("../fonts/MaybugMSRegular.woff2") format("woff2"),
       url("../fonts/MaybugMSRegular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Maybug MS Handwritten";
  src: url("../fonts/MaybugMSHandwritten.woff2") format("woff2"),
       url("../fonts/MaybugMSHandwritten.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ---------- Design Tokens ---------- */

:root {
  /* Brand colors (from Brandingsheet PDF) */
  --c-pfirsich: #ddab88;
  --c-orange:   #c3651d;
  --c-lila:     #c8a9ce;
  --c-gelb:     #eacb2c;
  --c-gruen:    #a1c480;
  --c-blau:     #93acd1;
  --c-sand:     #8e8070;

  /* Neutral tones - the website's background system is built from these */
  --c-ink:       #3a342c;     /* Body text */
  --c-ink-soft:  #6a6357;
  --c-bg:        #fbf6ef;     /* Warm off-white - base */
  --c-bg-cream:  #f4ebdb;     /* +1 warmth */
  --c-bg-sand:   #e7d9bf;     /* +2 warmth, light sand */
  /* --c-sand (#8e8070) from the brand palette above is reused for the deepest contrast section */

  /* Semantic */
  --c-link: var(--c-orange);
  --c-link-hover: #a2531a;
  --c-cta: var(--c-orange);
  --c-cta-ink: #ffffff;
  --c-orange-deep: #8a4513;   /* hard-shadow drop for primary button */
  --c-accent-soft: #eadfc8;   /* same family as bg-sand, 70% */

  /* Fonts */
  --font-display: "Maybug MS Decorative", "Maybug MS Black", system-ui, sans-serif;
  --font-display-black: "Maybug MS Black", system-ui, sans-serif;
  --font-hand: "Maybug MS Handwritten", cursive;
  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Spacing scale */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: 4rem;
  --s-9: 6rem;
  --s-10: 8rem;

  /* Radii */
  --r-sm: 0.5rem;
  --r-md: 1rem;
  --r-lg: 1.5rem;
  --r-pill: 999px;

  /* Layout */
  --content-max: 72rem;     /* ~1152px */
  --prose-max: 40rem;        /* ~640px */

  /* Shadow */
  --shadow-md: 0 10px 30px -10px rgba(58, 52, 44, 0.18);
  --shadow-lg: 0 25px 50px -20px rgba(58, 52, 44, 0.25);
}

/* ---------- Reset-ish ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem; /* account for sticky header */
  overflow-x: clip; /* no horizontal scroll from deco bleeding past viewport */
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--c-ink);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

img,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--c-link);
  text-decoration-color: rgba(195, 101, 29, 0.4);
  text-underline-offset: 3px;
  transition: color 120ms ease;
}
a:hover {
  color: var(--c-link-hover);
}

button {
  font: inherit;
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid var(--c-orange);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

/* ---------- Typography ---------- */

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.05;
  margin: 0 0 var(--s-4);
  color: var(--c-ink);
}

h1 {
  font-family: var(--font-display-black);
  font-size: clamp(2.5rem, 6vw, 4.75rem);
  letter-spacing: -0.01em;
}

h2 {
  font-size: clamp(2rem, 4.5vw, 3.25rem);
}

h3 {
  font-size: clamp(1.4rem, 2.5vw, 1.9rem);
}

p {
  margin: 0 0 var(--s-4);
  max-width: var(--prose-max);
}

strong, b {
  font-weight: 800;
}

.hand,
.is-style-hand {
  font-family: var(--font-hand);
  font-weight: 400;
}

.display {
  font-family: var(--font-display);
}

/* ---------- Utilities ---------- */

.container {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--s-5);
}

.eyebrow,
.is-style-eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--c-orange);
  margin-bottom: var(--s-3);
}

.prose {
  max-width: var(--prose-max);
}

.lede,
.is-style-lede {
  font-size: 1.25rem;
  line-height: 1.55;
  color: var(--c-ink);
}

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

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 0.85rem 1.5rem;
  border-radius: var(--r-pill);
  font-weight: 800;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
  border: 2px solid transparent;
}

/* Size variants - default is md (the base rule above). */
.btn--sm {
  padding: 0.45rem 1rem;
  font-size: 0.9rem;
  gap: 0.35rem;
}
.btn--lg {
  padding: 1rem 1.8rem;
  font-size: 1.1rem;
}

@media (max-width: 520px) {
  .btn {
    padding: 0.6rem 1.15rem;
    font-size: 0.95rem;
  }
  .btn--sm {
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
  }
}

.btn--primary {
  background: var(--c-cta);
  color: var(--c-cta-ink);
  box-shadow: 0 4px 0 var(--c-orange-deep);
}
.btn--primary:hover {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--c-orange-deep);
}
.btn--primary:active {
  transform: translateY(1px);
  box-shadow: 0 2px 0 var(--c-orange-deep);
}

.btn--outline {
  background: transparent;
  color: var(--c-ink);
  border-color: var(--c-ink);
  box-shadow: 0 4px 0 var(--c-ink);
}
.btn--outline:hover {
  color: var(--c-ink);
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--c-ink);
}
.btn--outline:active {
  transform: translateY(1px);
  box-shadow: 0 2px 0 var(--c-ink);
}

/* Inverse variants - same shape + hard-shadow, but for dark / colored sections */
.btn--primary-inverse {
  background: #fff;
  color: var(--c-orange);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.25);
}
.btn--primary-inverse:hover {
  color: var(--c-orange);
  transform: translateY(-2px);
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.3);
}
.btn--primary-inverse:active {
  transform: translateY(1px);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
}

.btn--outline-inverse {
  background: transparent;
  color: #fff;
  border-color: #fff;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.25);
}
.btn--outline-inverse:hover {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.3);
}
.btn--outline-inverse:active {
  transform: translateY(1px);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
}

.btn--ghost {
  background: transparent;
  color: var(--c-orange);
  padding-inline: var(--s-2);
}
.btn--ghost:hover {
  color: var(--c-link-hover);
}

/* External / wiki link indicator */
a[data-external]::after {
  content: " ↗";
  font-weight: 700;
  color: currentColor;
}

/* Passive Datenschutz-Hinweis unter Formularen (kein Pflicht-Check) */
.form-datenschutz-note {
  margin: 0;
  font-size: 0.9rem;
  color: var(--c-ink-soft);
  line-height: 1.5;
}

/* ---------- Sections ---------- */

.section {
  position: relative;
  padding-block: clamp(3rem, 8vw, 6rem);
}

.section--tight { padding-block: clamp(2rem, 5vw, 3.5rem); }

/* Tonal section backgrounds - all flat, all in the sand/off-white family. */
.section--cream     { background: var(--c-bg-cream); }
.section--sand      { background: var(--c-bg-sand); }
.section--sand-deep {
  background: var(--c-ink);
  color: var(--c-bg);
}
.section--sand-deep h1,
.section--sand-deep h2,
.section--sand-deep h3,
.section--sand-deep h4 { color: var(--c-bg); }
.section--sand-deep p,
.section--sand-deep .lede { color: var(--c-bg); }
.section--sand-deep .eyebrow { color: var(--c-gelb); }
.section--sand-deep strong { color: inherit; }

.section__head {
  text-align: center;
  max-width: 48rem;
  margin-inline: auto;
  margin-bottom: var(--s-7);
}
.section__head p { margin-inline: auto; }

/* ---------- Cards ---------- */

.card {
  background: #ffffff;
  border-radius: var(--r-lg);
  padding: var(--s-6);
  box-shadow: var(--shadow-md);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: var(--s-5);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
  gap: var(--s-6);
}

/* ---------- Decorative pieces ---------- */

.deko {
  position: absolute;
  pointer-events: none;
  user-select: none;
  opacity: 0.95;
}

/* Mobile visibility helpers for decorative elements - on small screens we
   keep only a minimal set so the content stays the focus. */
.deko--show-mobile { display: none; }

@media (max-width: 700px) {
  .deko--hide-mobile { display: none; }
  .deko--show-mobile { display: block; }
}

/* ---------- Prose page (Kontakt, Impressum, Datenschutz) ---------- */

.prose-page {
  max-width: var(--prose-max);
  margin-inline: auto;
  padding-block: clamp(3rem, 6vw, 5rem);
}

.prose-page h2 { margin-top: var(--s-7); }
.prose-page h3 { margin-top: var(--s-6); }
.prose-page ul { padding-left: 1.25rem; }
.prose-page li { margin-bottom: var(--s-2); }

/* ---------- Reduced motion ---------- */

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

/* ---------- WordPress: Layout-Abstände ----------
   WP setzt in jedem Layout-Container hart
   `margin-block-start: var(--wp--style--block-gap); margin-block-end: 0`
   mit der Spezifität (0,1,0) und übersteuert damit die Element-Margins
   dieses 1:1-Ports (p/h: `margin: 0 0 var(--s-4)`).
   Deshalb steht blockGap in der theme.json auf 0 - die Sektionen stoßen
   dann wie in der Astro-Vorlage bündig aneinander - und die Abstände
   innerhalb der Blöcke kommen wieder von hier. Gleiche Spezifität, aber
   kids-ev-global-css wird nach global-styles-inline-css ausgegeben. */

:root :where(.is-layout-flow, .is-layout-constrained, .is-layout-flex, .is-layout-grid) > :where(p, h1, h2, h3, h4) {
  margin-block-end: var(--s-4);
}

/* Listen ohne eigenen Block-Style folgen wie im Original der UA-Vorgabe. */
:root :where(.is-layout-flow, .is-layout-constrained) > :where(ul, ol) {
  margin-block: 1em;
}

/* core/columns bringt aus der Block-Library `margin-bottom: 1.75em` mit -
   das Pendant .grid-2 im Original hat keinen Außenabstand. */
.wp-block-columns {
  margin-bottom: 0;
}

/* ---------- WordPress: Block-Styles & Rich-Text-Formate ----------
   Regeln mit Asset-URLs (bullet.svg, blume02.svg) liegen bewusst hier,
   damit die relativen Pfade eindeutig gegen assets/css/ aufgelöst werden. */

/* core/list Style "kids-bullets" - Port von .leitbild-list / .stelle-list */
ul.is-style-kids-bullets {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--s-5);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
/* Die Astro-Vorlage packte den Inhalt in ein <span>; Gutenberg-Listenpunkte
   haben das nicht. Bullet daher absolut setzen statt als Flex-Item - sonst
   werden <strong> und Folgetext zu zwei Flex-Items mit gap dazwischen. */
ul.is-style-kids-bullets li {
  position: relative;
  padding-left: calc(0.6rem + var(--s-3));
  line-height: 1.5;
}
ul.is-style-kids-bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  /* 0.75em = Mitte der ersten Zeile; um die halbe Bullet-Höhe versetzt */
  top: calc(0.75em - 0.3rem);
  width: 0.6rem;
  height: 0.6rem;
  background: url("../deco/bullet.svg") center / contain no-repeat;
}
ul.is-style-kids-bullets strong {
  font-weight: 800;
  color: var(--c-ink);
}

/* Rich-Text-Format kids/highlight - Port von .hero__hl--* (index.astro) */
.hero__hl--gruen,
.hero__hl--orange,
.hero__hl--blau {
  display: inline-block;
  font-family: var(--font-display-black);
  position: relative;
}
.hero__hl--gruen::after,
.hero__hl--orange::after,
.hero__hl--blau::after {
  content: "";
  position: absolute;
  inset: auto -0.15em -0.05em -0.15em;
  height: 0.35em;
  z-index: -1;
  border-radius: var(--r-pill);
}
.hero__hl--gruen  { color: var(--c-gruen); }
.hero__hl--gruen::after  { background: var(--c-gelb); }

.hero__hl--orange { color: var(--c-orange); }
.hero__hl--orange::after { background: var(--c-lila); }

.hero__hl--blau   { color: var(--c-blau); }
.hero__hl--blau::after   { background: var(--c-pfirsich); }

/* kids/pill-list - Port von .haus-features / .ei-chips / .jobs-teaser__points */
.pill-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
}
.pill-list li {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: var(--r-pill);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--c-ink);
}
.pill-list li::before {
  content: "";
  flex: 0 0 auto;
  width: 0.6rem;
  height: 0.6rem;
  background: url("../deco/bullet.svg") center / contain no-repeat;
}

.pill-list--light li {
  background: #fff;
  padding: 0.55rem 1rem;
  box-shadow: 0 2px 0 rgba(58, 52, 44, 0.08);
}

.pill-list--soft {
  gap: var(--s-2);
}
.pill-list--soft li {
  background: var(--c-bg);
  padding: 0.5rem 0.95rem;
  white-space: nowrap;
}

.pill-list--dark {
  flex-direction: column;
  align-items: flex-start;
}
.pill-list--dark li {
  gap: 0.55rem;
  padding: 0.55rem 1.1rem;
  background: color-mix(in srgb, var(--c-ink) 70%, var(--c-sand));
  color: var(--c-bg);
  font-size: 0.95rem;
  line-height: 1.2;
  white-space: nowrap;
}
.pill-list--dark li::before {
  width: 0.9rem;
  height: 0.9rem;
  background-image: url("../deco/blume02.svg");
}

/* Template-Part-Wrapper erzeugen keine eigene Box, damit der sticky Header
   direkt im Seitenfluss sitzt (wie in der Astro-Version direkt unter <body>). */
.wp-block-template-part {
  display: contents;
}

/* ---------- Stellenanzeige (Pattern "Stellenanzeige") ----------
   Komposition aus kids/card + Core-Blöcken, Port von .stelle-card__* */
.stelle-grid {
  padding-top: var(--s-5);
  border-top: 1px solid var(--c-bg-sand);
}
.stelle-grid h4 {
  font-size: 1.25rem;
  margin: 0 0 var(--s-4);
}
.stelle-cta {
  margin-top: var(--s-6);
  text-align: center;
}
.stelle-hint {
  margin: var(--s-3) auto 0;
  font-size: 0.95rem;
  color: var(--c-ink-soft);
  text-align: center;
  max-width: none;
}

/* ---------- Formulare (kids/form-kennenlernen, kids/form-spenden) ----------
   Gemeinsames Feld-System, Port aus kennenlernen.astro / spenden.astro. */

/* Honeypot - für Sehende und Screenreader versteckt, Bots füllen es aus. */
.honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.kids-form {
  background: #fff;
  border-radius: var(--r-lg);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}
.kids-form h2 {
  margin-bottom: var(--s-2);
}
.kids-form__note {
  color: var(--c-ink-soft);
  font-size: 0.95rem;
  margin-bottom: var(--s-2);
}
.kids-form__actions {
  margin-top: var(--s-3);
}

.field {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}
.field label,
.field legend {
  font-weight: 700;
  color: var(--c-ink);
  font-size: 0.95rem;
}
.field input[type="text"],
.field input[type="email"],
.field input[type="number"],
.field input[type="tel"],
.field select,
.field textarea {
  font: inherit;
  padding: 0.7rem 0.9rem;
  border: 2px solid var(--c-bg-sand);
  border-radius: var(--r-md);
  background: var(--c-bg);
  color: var(--c-ink);
  transition: border-color 140ms ease;
  width: 100%;
  box-sizing: border-box;
}
.field textarea {
  resize: vertical;
  min-height: 5.5rem;
  line-height: 1.5;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--c-orange);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-4);
}
.field-row--plz {
  grid-template-columns: 1fr 2fr;
}
@media (max-width: 600px) {
  .field-row,
  .field-row--plz {
    grid-template-columns: 1fr;
  }
}

.field--group {
  border: none;
  padding: 0;
  margin: 0;
}
.field--group legend {
  margin-bottom: var(--s-2);
}
.radio-row {
  display: flex;
  gap: var(--s-4);
  flex-wrap: wrap;
}
.radio-row label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--c-ink);
  cursor: pointer;
}
.radio-row input[type="radio"] {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--c-orange);
  margin: 0;
}

/* ---------- Seiten-Kompositionen (Patterns) ----------
   Kleine Layout-Klassen für Block-Kompositionen, Ports der
   seitenspezifischen Astro-Styles. */

/* Startseite: Verein-Prosa unter den Handschrift-Zeilen */
.ei-verein {
  margin: var(--s-6) auto 0;
  max-width: 44rem;
  text-align: center;
}
.ei-verein p {
  margin: 0 auto var(--s-4);
  max-width: none;
}
.ei-verein p:last-child {
  margin-bottom: 0;
}

/* Kontakt: gedämpfte Zusatzzeile (Öffnungszeiten am Telefon) */
.kontakt-muted {
  color: var(--c-ink-soft);
  font-size: 0.9rem;
  font-weight: 400;
}

/* Spenden: Intro-Prosa und Bank-Karte */
.spenden-intro {
  max-width: 48rem;
  margin-inline: auto;
}
.spenden-intro p {
  max-width: none;
}
.bank-card {
  max-width: 52rem;
  margin-inline: auto;
}

/* Formulare mit begrenzter Breite (Spendenquittung) */
.form-narrow {
  max-width: 48rem;
  margin-inline: auto;
}

/* Jobs: Benefits-Grid aus kids/card (accent-top) */
.benefits {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: var(--s-5);
}
.benefits .kids-card h3 {
  margin: 0 0 var(--s-3);
  font-size: 1.3rem;
}
.benefits .kids-card p {
  margin: 0;
  color: var(--c-ink-soft);
}

/* Jobs: Liste der Stellen-Karten */
.stellen-list {
  display: grid;
  gap: var(--s-6);
  max-width: 60rem;
  margin-inline: auto;
}

/* Jobs: Ansprechpersonen-Karte (Bewerbung) */
.apply-name {
  margin: 0 0 var(--s-3);
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--c-ink);
}
.apply-contacts {
  margin: 0;
  line-height: 1.7;
}
.apply-contacts a {
  font-weight: 700;
  color: var(--c-ink);
  text-decoration: none;
  word-break: break-word;
}
.apply-contacts a:hover {
  color: var(--c-link);
}
.apply-hand {
  font-size: 1.3rem;
  color: var(--c-orange);
  margin-top: var(--s-4);
  margin-bottom: 0;
}
