/* hofspielgruppe.ch – Stylesheet
   Grundlage: freigegebenes Designmuster (werkstatt/design/design.css, Gate A).
   Schriften lokal, keine fremden Server. */

/* ---------- Schriften ---------- */
@font-face { font-family: "Shadows Into Light"; src: url("../fonts/shadows-into-light-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("../fonts/nunito-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("../fonts/nunito-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

/* ---------- Farben und Grundwerte ---------- */
:root {
  --oliv:          #A7A37A;  /* Seitenrahmen */
  --oliv-dunkel:   #5B5836;  /* Titel, aktiver Menüpunkt */
  --gelb:          #FAF3A2;  /* Menü / Seitenleiste */
  --creme:         #FDFAE3;  /* Inhaltsfläche */
  --grau:          #D9D5BC;  /* Menü-Hover */
  --text:          #2E2C1D;  /* Fliesstext */
  --scheunenrot:        #9A3F27; /* Links, Fokusrahmen */
  --scheunenrot-dunkel: #7F321E; /* Link-Hover */
  --wiesengruen:   #4F6B2E;  /* zweiter Akzent: Knöpfe, Hinweise */
  --linie:         #C9C49A;  /* feine Trennlinien */

  --font-hand: "Shadows Into Light", "Segoe Print", cursive;
  --font-text: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;

  --radius: 10px;
  --dauer-farbe: 200ms;
  --dauer-ruckeln: 400ms;
}

/* ---------- Grundlagen ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  background: var(--oliv); -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
  /* Platz für die Bildlaufleiste immer freihalten: Seiten ohne Laufleiste springen sonst seitwärts */
  scrollbar-gutter: stable;
}
body {
  margin: 0; background: var(--oliv);
  font-family: var(--font-text); font-size: 1.125rem; line-height: 1.65; color: var(--text);
}
img, svg, picture { max-width: 100%; }
img { height: auto; }

a { color: var(--scheunenrot); text-underline-offset: 0.18em; }
a:hover { color: var(--scheunenrot-dunkel); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--scheunenrot); outline-offset: 2px;
}

/* nur für Screenreader sichtbar */
.unsichtbar {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Sprunglink: erscheint erst beim Tabben */
.sprunglink {
  position: absolute; left: 1rem; top: -4rem; z-index: 10;
  background: var(--oliv-dunkel); color: var(--gelb); padding: 0.6rem 1rem; border-radius: var(--radius);
  text-decoration: none; font-weight: 700;
}
.sprunglink:focus { top: 1rem; color: var(--gelb); outline: 3px solid var(--scheunenrot); outline-offset: 2px; }

/* ---------- Seitenaufbau ---------- */
.seite {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  grid-template-rows: 1fr auto;
  grid-template-areas: "leiste inhalt" "leiste fuss";
  max-width: 1180px; min-height: calc(100vh - 4rem); margin: 2rem auto;
  background: var(--creme); border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 6px 24px rgba(46, 44, 29, 0.18);
}
.seitenleiste { grid-area: leiste; background: var(--gelb); border-right: 1px solid var(--linie); }
.inhalt {
  grid-area: inhalt; position: relative; min-width: 0;
  padding: 1.75rem 2.25rem 3rem;
  /* Esel-Wasserzeichen unten rechts */
  background: url("../bilder/esel-wasserzeichen.svg") no-repeat right -10px bottom -6px / 300px auto;
}
/* Auf den Galerie-Seiten kein Wasserzeichen (würde von der Galerie verdeckt) */
.inhalt:has(.galerie-rahmen) { background-image: none; }
.fuss { grid-area: fuss; }

/* ---------- Kopf: Logo und Menü-Knopf ---------- */
.kopf { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.25rem 1rem 0.25rem; }
.logo { display: block; width: 100%; max-width: 262px; margin: 0 auto; border-radius: 6px; }
.logo-bild { display: block; width: 100%; height: auto; }
.menue-knopf { display: none; }

/* Versteckte Admin-Links (Schrift in Hintergrundfarbe, wie auf der alten Seite) */
.admin-versteckt, .admin-versteckt:hover { color: var(--gelb); text-decoration: none; font-size: 0.85rem; }
.admin-oben { display: block; width: max-content; margin: 0 auto 0.6rem; line-height: 1.4; }
.admin-unten { margin: 0.75rem 0 1rem; text-align: center; line-height: 1.4; }

/* ---------- Menü ---------- */
.menue { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--linie); }
.menue li { border-bottom: 1px solid var(--linie); }
.menue a {
  display: flex; align-items: center; gap: 0.9rem;
  min-height: 3.1rem; padding: 0.35rem 1rem 0.35rem 0.85rem;
  background: var(--gelb); color: var(--text);
  font-family: var(--font-hand); font-size: 1.55rem; line-height: 1.1;
  text-decoration: none;
  transition: background-color var(--dauer-farbe) ease, color var(--dauer-farbe) ease;
}
.menue .wagen {
  flex: none; width: 2.6rem; height: 2.2rem; color: var(--oliv-dunkel);
  transform-origin: 50% 90%;
  transition: color var(--dauer-farbe) ease;
}
.menue a:hover,
.menue a:focus-visible { background: var(--grau); color: var(--text); }
.menue a:hover .wagen,
.menue a:focus-visible .wagen { animation: ruckeln var(--dauer-ruckeln) ease-in-out 1; color: var(--text); }
.menue a:focus-visible { outline: 3px solid var(--scheunenrot); outline-offset: -3px; }
/* Türe am Bauwagen (Gruppe .tuer in bauwagen.svg liest --tuer: 0 = unsichtbar, 1 = sichtbar) */
.menue a:hover .wagen,
.menue a:focus-visible .wagen,
.menue a[aria-current="page"] .wagen { --tuer: 1; }
.menue .wagen .tuer { opacity: var(--tuer, 0); transition: opacity var(--dauer-farbe) ease; }
/* aktuelle Seite */
.menue a[aria-current="page"] { background: var(--oliv-dunkel); color: var(--gelb); }
.menue a[aria-current="page"] .wagen { color: var(--gelb); }
.menue a[aria-current="page"]:focus-visible { outline-color: var(--gelb); }

@keyframes ruckeln {
  0%   { transform: translateX(0) rotate(0); }
  15%  { transform: translateX(-2px) rotate(-7deg); }
  35%  { transform: translateX(2px) rotate(5deg); }
  55%  { transform: translateX(-1px) rotate(-3deg); }
  75%  { transform: translateX(1px) rotate(1.5deg); }
  100% { transform: translateX(0) rotate(0); }
}

/* ---------- Bildbalken ---------- */
.banner { display: block; margin: 0 0 1.75rem; }
.banner img { display: block; width: 100%; height: auto; aspect-ratio: 1024 / 268; object-fit: cover; border-radius: var(--radius); background: var(--grau); }

/* ---------- Text ---------- */
.inhalt h1, .inhalt h2, .inhalt h3 {
  font-family: var(--font-hand); font-weight: 400; color: var(--oliv-dunkel); line-height: 1.15;
}
.inhalt h1 { font-size: 2.4rem; margin: 0 0 0.8rem; }
.inhalt h2 { font-size: 1.9rem; margin: 2rem 0 0.5rem; }
.inhalt h3 { font-size: 1.5rem; margin: 1.5rem 0 0.4rem; }
.inhalt p, .inhalt ul, .inhalt ol { max-width: 38em; margin: 0 0 1rem; }
.inhalt li { margin: 0.2rem 0; }
.leitsatz { font-size: 1.2rem; }
.aufruf { margin-top: 1.75rem !important; }

/* Tabellen (z.B. Zeiten / Preise) */
.inhalt table { border-collapse: collapse; margin: 0 0 1.25rem; max-width: 100%; }
.inhalt th, .inhalt td { text-align: left; vertical-align: top; padding: 0.4rem 0.75rem 0.4rem 0; border-bottom: 1px solid var(--linie); }

/* ========== Schritt 7: Inhaltsseiten (team, zeiten, links, galerie) ========== */
.zeiten caption { text-align: left; padding: 0 0 0.3rem; }
.zeiten td { padding-right: 1.5rem; white-space: nowrap; }
.preise th { font-weight: 400; padding-right: 1.5rem; }

/* Foto im Text (z.B. Gruppenfoto Team) */
.foto { display: block; margin: 0 0 1.5rem; }
.foto img { display: block; width: 100%; max-width: 820px; border-radius: var(--radius); }

/* Team: Spielgruppenleiterinnen nebeneinander, auf dem Handy untereinander */
.inhalt .team {
  list-style: none; padding: 0; max-width: none;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1.25rem 2rem;
  margin: 0 0 1.5rem;
}
.inhalt .team li { margin: 0; }
/* Foto + Namen in einem Behälter so breit wie das Foto. Ist er mindestens 600px breit,
   stehen die Namen versetzt in zwei Reihen ungefähr unter den Personen (wie auf der alten
   Seite). Die Prozentwerte sind am Foto gemessen: Angela 47,8 %, Nicole 21 %, Taina 62,7 %
   der Fotobreite. Schmaler (oder ohne Container-Queries): einfache Spalten wie oben. */
.team-bereich { max-width: 820px; container-type: inline-size; }
@container (min-width: 600px) {
  .inhalt .team {
    grid-template-columns: 21% 26.8% 14.9% minmax(0, 1fr);
    gap: 1.75rem 0;
  }
  .inhalt .team li { padding-right: 1rem; }
  .inhalt .team li:nth-child(1) { grid-area: 1 / 1 / 2 / 3; }  /* Sonja: links */
  .inhalt .team li:nth-child(2) { grid-area: 1 / 3 / 2 / 5; }  /* Angela: ab 47,8 % */
  .inhalt .team li:nth-child(3) { grid-area: 2 / 2 / 3 / 4; }  /* Nicole: ab 21 % */
  .inhalt .team li:nth-child(4) { grid-area: 2 / 4 / 3 / 5; }  /* Taina: ab 62,7 % */
}
address { font-style: normal; }

/* Linkliste (Seite links) */
.linkliste { margin: 0 0 1.5rem; max-width: 38em; }
.linkliste dt { margin-top: 0.9rem; font-weight: 700; overflow-wrap: anywhere; }
.linkliste dd { margin: 0; }

/* Eingebettete Bildergalerie (impressionen / galerie) */
.galerie-rahmen { display: block; width: 100%; height: 80vh; min-height: 30rem; border: 0; border-radius: var(--radius); background: var(--creme); }
/* ========== Ende Schritt 7 ========== */

/* ---------- Rechtstexte (Datenschutz, Impressum) ---------- */
/* Hinweiskasten «Entwurf»: entfernen, sobald die Texte geprüft sind */
.entwurf {
  max-width: 38em; margin: 0 0 1.5rem; padding: 0.8rem 1rem;
  background: #fff; border: 2px solid var(--scheunenrot); border-radius: var(--radius);
  color: var(--scheunenrot-dunkel); font-weight: 700;
}
.inhalt .entwurf p { margin: 0; }
.platzhalter { background: var(--gelb); padding: 0 0.2em; border-radius: 3px; }

/* ---------- Formulare (Grundstil) ---------- */
form { max-width: 38em; }
fieldset { border: 1px solid var(--linie); border-radius: var(--radius); padding: 1rem 1.25rem 1.25rem; margin: 0 0 1.25rem; }
legend { font-weight: 700; padding: 0 0.35rem; }
label { display: block; font-weight: 700; margin: 0.9rem 0 0.25rem; }
input, select, textarea, button { font: inherit; color: inherit; }
input[type="text"], input[type="email"], input[type="tel"], input[type="date"], input[type="number"], input[type="password"],
select, textarea {
  display: block; width: 100%; min-height: 44px; padding: 0.45rem 0.6rem;
  background: #fff; border: 1px solid var(--oliv); border-radius: 6px;
}
textarea { min-height: 8rem; resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: 1.15rem; height: 1.15rem; accent-color: var(--wiesengruen); }
.knopf, button[type="submit"] {
  display: inline-block; min-height: 44px; padding: 0.55rem 1.4rem; margin-top: 1rem;
  background: var(--wiesengruen); color: #fff; border: 0; border-radius: 999px;
  font-weight: 700; text-decoration: none; cursor: pointer;
}
.knopf:hover, button[type="submit"]:hover { background: #3E5524; color: #fff; }

/* ---------- Fuss ---------- */
.fuss {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1.5rem;
  padding: 1rem 2.25rem 1.25rem; border-top: 1px solid var(--linie);
  font-size: 0.95rem; color: var(--oliv-dunkel);
}
.fuss p { margin: 0; }
.fuss a { color: var(--oliv-dunkel); }
.fuss a:hover { color: var(--scheunenrot-dunkel); }
/* Besucherzähler: kleines, dezentes Kästchen */
.zaehler {
  font-size: 0.75rem; line-height: 1; letter-spacing: 0.08em; font-variant-numeric: tabular-nums;
  padding: 0.3rem 0.45rem; background: #fff; border: 1px solid var(--linie); border-radius: 4px; color: #5f5c45;
}

/* ---------- Schmale Bildschirme (Handy) ---------- */
@media (max-width: 780px) {
  .seite { display: block; min-height: 0; margin: 0; border-radius: 0; box-shadow: none; }
  .seitenleiste { border-right: 0; border-bottom: 1px solid var(--linie); }
  .kopf { padding: 0.6rem 1rem 0.2rem; }
  .admin-oben { margin: 0 0 0.3rem 1rem; font-size: 0.75rem; }
  .logo { width: 150px; margin: 0; }
  .js .menue-knopf {
    display: inline-flex; align-items: center; gap: 0.5rem;
    font: 400 1.6rem/1 var(--font-hand); color: var(--gelb); background: var(--oliv-dunkel);
    border: 0; border-radius: 999px; padding: 0.45rem 1rem 0.4rem; min-height: 44px; cursor: pointer;
  }
  .menue-knopf .striche { width: 18px; height: 14px; }
  .menue-knopf:focus-visible { outline: 3px solid var(--scheunenrot); outline-offset: 2px; }
  /* Mit JavaScript ist das Menü zu, bis der Knopf gedrückt wird; ohne bleibt es offen */
  .js .hauptnavigation:not(.offen) { display: none; }
  .admin-unten { margin: 0.5rem 0; }
  .inhalt { padding: 1.25rem 1rem 3rem; background-size: 180px auto; }
  .inhalt h1 { font-size: 2rem; }
  .fuss { padding: 1rem; }
}

/* ---------- Bewegung reduzieren: kein Ruckeln; Farbwechsel und Türe bleiben ---------- */
@media (prefers-reduced-motion: reduce) {
  .menue a:hover .wagen,
  .menue a:focus-visible .wagen { animation: none; }
}

/* ---------- Druck ---------- */
@media print {
  html, body, .seite, .inhalt { background: #fff !important; color: #000; }
  .seite { display: block; margin: 0; box-shadow: none; border-radius: 0; max-width: none; }
  .seitenleiste, .sprunglink, .zaehler, .admin-versteckt { display: none !important; }
  .inhalt { padding: 0; }
  .banner img { max-height: 4cm; }
  a { color: #000; }
  .inhalt a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.85em; }
  .fuss { border: 0; padding: 0.5cm 0 0; }
}

/* ========== Schritt 8: Anmeldeformular (anmeldung.php, kontakt_exec.php) ========== */
.anmeldeformular .feld { margin: 0 0 0.2rem; }
.anmeldeformular .feld-reihe { display: flex; flex-wrap: wrap; gap: 0 1rem; }
.anmeldeformular .feld-plz { flex: 0 0 7rem; }
.anmeldeformular .feld-ort { flex: 1 1 12rem; min-width: 0; }
.anmeldeformular .jahr-reihe { display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; }
.anmeldeformular .jahr-reihe input { display: inline-block; width: 3.6rem; text-align: center; }
.anmeldeformular input:user-invalid, .anmeldeformular textarea:user-invalid { border-color: var(--scheunenrot); border-width: 2px; }
.anmeldeformular .feld-einwilligung { display: flex; align-items: flex-start; gap: 0.6rem; margin: 1.25rem 0 0; }
.anmeldeformular .feld-einwilligung input { flex: none; margin: 0.3rem 0 0; }
.anmeldeformular .feld-einwilligung label { display: inline; margin: 0; font-weight: 400; }
/* Zeichenzähler unter «Nachricht» (js/zeichen.js); ab 200 Zeichen vor dem Ende in Scheunenrot */
.anmeldeformular .zeichenzaehler { margin: 0.3rem 0 0; font-size: 0.95rem; color: var(--oliv-dunkel); font-variant-numeric: tabular-nums; }
.anmeldeformular .zeichenzaehler.warnung { color: var(--scheunenrot); font-weight: 700; }
/* Spam-Falle: ausserhalb des sichtbaren Bereichs (nicht nur display:none, damit Bots es ausfüllen) */
.honigtopf { position: absolute !important; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.formular-fragen { margin-top: 1.75rem !important; }
/* Meldungen von kontakt_exec.php */
.formular-meldung { max-width: 38em; padding: 0.9rem 1.1rem; margin: 0 0 1.25rem; background: #fff; border-left: 5px solid var(--scheunenrot); border-radius: 6px; }
.formular-meldung ul { margin: 0.4rem 0 0; }
/* ========== Ende Schritt 8 ========== */
