/* Kern-Stylesheet: Seitenhülle, Kopf, Fuß und die wenigen Bausteine,
   die alle Blöcke teilen. Blockeigene Stile stehen beim jeweiligen
   Block (kern/bloecke/<typ>/block.css) und kommen über /bloecke.css.

   Farben und Schriften stehen hier bewusst nirgends fest — sie kommen
   als CSS-Variablen aus dem Theme (kern/design.py). */

:root {
  --farbe-gedaempft: color-mix(in srgb, var(--farbe-text) 60%, white);
  --breite-max: 68rem;
  --rand: 1.5rem;
}

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

body {
  margin: 0;
  font-family: var(--schrift-text);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--farbe-text);
  background: var(--farbe-hintergrund);
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3, h4 {
  font-family: var(--schrift-ueberschrift);
  line-height: 1.2;
  text-wrap: balance;
}

img { max-width: 100%; }

a { color: var(--farbe-primaer); }
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--farbe-primaer);
  outline-offset: 2px;
}

code {
  padding: 0.1em 0.35em;
  border-radius: 3px;
  background: color-mix(in srgb, var(--farbe-primaer) 12%, transparent);
  font-size: 0.9em;
}

/* --- Hilfsbausteine ------------------------------------------------ */

.breite {
  width: 100%;
  max-width: var(--breite-max);
  margin-inline: auto;
  padding-inline: var(--rand);
}

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

.zum-inhalt {
  position: absolute;
  left: -9999px;
  z-index: 10;
  padding: 0.6rem 1rem;
  background: var(--farbe-primaer);
  color: #fff;
}
.zum-inhalt:focus {
  left: 0.5rem;
  top: 0.5rem;
}

.knopf {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  border: 2px solid var(--farbe-primaer);
  border-radius: 4px;
  background: var(--farbe-primaer);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.knopf:hover { background: transparent; color: var(--farbe-primaer); }

.knopf--umriss {
  background: transparent;
  border-color: currentColor;
  color: inherit;
}
.knopf--umriss:hover {
  background: #fff;
  color: var(--farbe-text);
  border-color: #fff;
}

.hinweis {
  padding: 1rem 1.25rem;
  border-left: 3px solid var(--farbe-primaer);
  background: #fff;
}

/* --- Kopf ---------------------------------------------------------- */

.kopf {
  background: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.kopf__zeile {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding-block: 1rem;
}

.kopf__marke {
  font-family: var(--schrift-ueberschrift);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--farbe-text);
  text-decoration: none;
}

.kopf__nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.kopf__nav a {
  display: inline-block;
  padding: 0.25rem 0;
  color: var(--farbe-text);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
.kopf__nav a:hover { border-bottom-color: var(--farbe-zweit); }
.kopf__nav a[aria-current="page"] {
  border-bottom-color: var(--farbe-primaer);
  font-weight: 600;
}

/* --- Blöcke: gemeinsamer Rahmen ------------------------------------ */

.bl { padding-block: 3.5rem; }
.bl-hero { padding-block: 0; }

.bl-titel {
  margin: 0 0 0.75rem;
  font-size: clamp(1.5rem, 3.5vw, 2.1rem);
}

.bl-unterzeile {
  margin: 0;
  max-width: 42rem;
  color: var(--farbe-gedaempft);
}

/* --- Fuß ----------------------------------------------------------- */

.fuss {
  margin-top: 2rem;
  padding-block: 2rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  background: #fff;
  font-size: 0.9rem;
  color: var(--farbe-gedaempft);
}
.fuss p { margin: 0.2rem 0; }

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

/* --- Thema: Efeu (Backstein + Efeu) --------------------------------
   Reine Deko, hängt an der Theme-Klasse auf <body> (siehe
   grundgeruest.html) — die anderen Themes bleiben unberührt. Kopf,
   Fuß und Hauptbereich bekommen einen Papier-Hintergrund, damit
   Blocktext immer auf hellem Grund steht statt direkt auf der
   Backstein-Textur (Kontrast/WCAG 2.2 AA). Die Efeu-Ranken sind eine
   fest eingefärbte Inline-SVG (nicht themefähig über --farbe-akzent —
   das wäre nur per mask-image lösbar, mit Kompatibilitätsrisiko für
   ein rein dekoratives Detail eines einzelnen Themes). */

body.thema-efeu {
  position: relative;
  background-color: var(--farbe-primaer);
  background-image:
    repeating-linear-gradient(
      var(--farbe-zweit) 0 3px, transparent 3px 30px
    ),
    repeating-linear-gradient(
      90deg, var(--farbe-zweit) 0 3px, transparent 3px 64px
    ),
    repeating-linear-gradient(
      90deg, var(--farbe-zweit) 0 3px, transparent 3px 64px
    );
  background-size: 100% 30px, 64px 60px, 64px 60px;
  background-position: 0 0, 0 0, 32px 30px;
}

body.thema-efeu .kopf,
body.thema-efeu .fuss,
body.thema-efeu main#inhalt {
  position: relative;
  z-index: 1;
  background: var(--farbe-hintergrund);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}
body.thema-efeu .kopf { border-bottom: none; }
body.thema-efeu .fuss { border-top: none; }
body.thema-efeu main#inhalt {
  max-width: calc(var(--breite-max) + 2 * var(--rand));
  margin: 2rem auto;
}

/* Zwei Nägel, die den Hauptbereich an der Wand halten — rein
   dekorativ, deshalb reicht ein radialer Verlauf statt eines Bildes. */
body.thema-efeu main#inhalt::before,
body.thema-efeu main#inhalt::after {
  content: "";
  position: absolute;
  top: -0.5rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #777 0%, #222 70%, #0a0a0a 100%);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.35);
  z-index: 2;
}
body.thema-efeu main#inhalt::before { left: 2rem; transform: rotate(14deg); }
body.thema-efeu main#inhalt::after { right: 2rem; transform: rotate(-18deg); }

@keyframes efeu-wiegen-links {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(1.2deg) translateY(2px); }
}
@keyframes efeu-wiegen-rechts {
  0%, 100% { transform: scaleX(-1) rotate(0deg); }
  50% { transform: scaleX(-1) rotate(-1.2deg) translateY(2px); }
}

body.thema-efeu::before,
body.thema-efeu::after {
  content: "";
  position: absolute;
  top: 0;
  width: 90px;
  height: 260px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 90 260'%3E%3Cpath d='M8 0 C 30 25, 10 55, 32 80 C 50 100, 15 130, 35 155 C 52 175, 18 200, 38 225 C 48 238, 55 248, 50 260' fill='none' stroke='%234C7A3D' stroke-width='3' stroke-linecap='round'/%3E%3Cpath d='M24 28 C 40 18, 52 30, 44 44 C 38 54, 24 52, 20 40 C 18 34, 20 30, 24 28 Z' fill='%234C7A3D'/%3E%3Cpath d='M12 75 C -4 68, -10 84, 2 94 C 12 102, 24 94, 22 82 C 21 78, 17 76, 12 75 Z' fill='%234C7A3D'/%3E%3Cpath d='M40 118 C 56 108, 68 122, 58 136 C 52 144, 38 140, 36 128 C 35 124, 37 120, 40 118 Z' fill='%234C7A3D'/%3E%3Cpath d='M14 172 C -2 166, -8 182, 4 190 C 14 198, 26 190, 22 178 C 21 174, 18 172, 14 172 Z' fill='%234C7A3D'/%3E%3Cpath d='M42 215 C 58 206, 70 220, 60 232 C 54 240, 40 236, 38 224 C 37 220, 39 217, 42 215 Z' fill='%234C7A3D'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
  pointer-events: none;
  z-index: 0;
  opacity: 0.9;
}
body.thema-efeu::before {
  left: 0.5rem;
  transform-origin: top left;
  animation: efeu-wiegen-links 6s ease-in-out infinite;
}
body.thema-efeu::after {
  right: 0.5rem;
  transform: scaleX(-1);
  transform-origin: top right;
  animation: efeu-wiegen-rechts 8s ease-in-out infinite;
}

/* Dritte, kleinere Ranke unten rechts am Fuß — bewusst ohne Wiegen,
   wie schon die beiden oberen wirkt das nur unruhig zu dritt. */
body.thema-efeu .fuss::before {
  content: "";
  position: absolute;
  bottom: 0;
  right: 1rem;
  width: 50px;
  height: 130px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 90 260'%3E%3Cpath d='M8 0 C 30 25, 10 55, 32 80 C 50 100, 15 130, 35 155 C 52 175, 18 200, 38 225 C 48 238, 55 248, 50 260' fill='none' stroke='%234C7A3D' stroke-width='3' stroke-linecap='round'/%3E%3Cpath d='M24 28 C 40 18, 52 30, 44 44 C 38 54, 24 52, 20 40 C 18 34, 20 30, 24 28 Z' fill='%234C7A3D'/%3E%3Cpath d='M12 75 C -4 68, -10 84, 2 94 C 12 102, 24 94, 22 82 C 21 78, 17 76, 12 75 Z' fill='%234C7A3D'/%3E%3Cpath d='M40 118 C 56 108, 68 122, 58 136 C 52 144, 38 140, 36 128 C 35 124, 37 120, 40 118 Z' fill='%234C7A3D'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
  transform: scaleX(-1) rotate(180deg);
  pointer-events: none;
  opacity: 0.85;
}

@media (max-width: 640px) {
  body.thema-efeu::before,
  body.thema-efeu::after,
  body.thema-efeu .fuss::before { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  body.thema-efeu::before,
  body.thema-efeu::after { animation: none; }
}
