:root {
  --navy: #1e274a; /* Marineblau aus dem Vereinslogo, verbindet mit der Seite der Dorfgemeinschaft */
  --akzent: #c81e1e; /* Rot aus dem Vereinslogo, abgedunkelt für Kontrast */
  --akzent-dunkel: #9f1717;
  --papier: #faf6ee;
  --karte: #ffffff;
  --text: #2a2a26;
  --text-leise: #5f5f56;
  --linie: #e2dccd;
  --radius: 0.75rem;
  --schrift: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --schrift-titel: Georgia, 'Iowan Old Style', 'Times New Roman', serif;
  --titel: var(--navy);
}

/* Primärfarbe: Gold, Farbe des Fördervereins */
:root { /* Standard: Gold, Farbe des Fördervereins */
  --primaer: #e0b03a;
  --primaer-dunkel: #b98a1a;
  --auf-primaer: #1e274a;
  --knopf: #1e274a;
  --knopf-text: #fff;
  --knopf-hover: #323f73;
  --aktion: #1e274a;
  --aktion-dunkel: #12183a;
  --aktion-text: #fff;
  --link: #8a6710;
  --pille: #e0b03a;
  --pille-text: #1e274a;
  --pille-hover: #f0c455;
}

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

/* Das hidden-Attribut soll auch bei Elementen mit eigenem display (z. B. Formular) wirken */
[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

[id] {
  scroll-margin-top: 5.5rem;
}

body {
  margin: 0;
  background: var(--papier);
  color: var(--text);
  font-family: var(--schrift);
  font-size: 1.0625rem;
  line-height: 1.7;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--link);
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--akzent);
}

/* Fokusrahmen: Rot gilt auf hellem Grund (5,3:1). Auf Navy (Kopf, Fuß) und auf der Primärfarbe (Hero, Aufruf)
   reicht Rot nicht für 3:1, dort wird mit --fokus die Textfarbe des Bereichs verwendet. */
:focus-visible {
  outline: 3px solid var(--fokus, var(--akzent));
  outline-offset: 2px;
}

.kopf,
.fuss {
  --fokus: #fff;
}

.held,
.aufruf {
  --fokus: var(--auf-primaer);
}

h1,
h2,
h3 {
  font-family: var(--schrift-titel);
  line-height: 1.2;
  color: var(--titel);
}

h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  margin: 0 0 1rem;
}

h2 {
  font-size: 1.5rem;
  margin: 2.25rem 0 0.5rem;
}

.breite {
  width: min(100% - 2rem, 66rem);
  margin-inline: auto;
}

/* Lesespalte: gleiche linke Kante wie die Überschriften, nur schmaler für bessere Lesbarkeit */
.lesbreite {
  max-width: 44rem;
}

.text {
  width: min(100% - 2rem, 44rem);
  margin-inline: auto;
  padding-block: 3rem 4rem;
}

.schmal {
  width: min(100% - 2rem, 44rem);
  margin-inline: auto;
}

.abschnitt {
  padding-block: clamp(2.5rem, 7vw, 4.5rem);
}

.abschnitt.hell {
  background: var(--karte);
  border-block: 1px solid var(--linie);
}

.abschnitt h2 {
  margin-top: 0;
  font-size: clamp(1.6rem, 4vw, 2.1rem);
}

.mehr {
  margin-top: 1rem;
}

.mehr summary {
  display: inline-block;
  cursor: pointer;
  padding: 0.5rem 1.1rem;
  border: 2px solid var(--aktion);
  border-radius: 999px;
  font-weight: 600;
  color: var(--titel);
  list-style: none;
}

.mehr summary::-webkit-details-marker {
  display: none;
}

.mehr summary:hover {
  background: var(--aktion);
  color: var(--aktion-text);
}

.mehr[open] summary {
  margin-bottom: 1rem;
}

.mehr[open] summary::after {
  content: ' schließen';
}

.mehr-inhalt h2 {
  font-size: 1.35rem;
  margin-top: 1.75rem;
}

.aufruf {
  background: var(--primaer);
  color: var(--auf-primaer);
  text-align: center;
  padding-block: clamp(2.5rem, 7vw, 4rem);
}

.aufruf h2 {
  color: var(--auf-primaer);
  margin-top: 0;
}

.aufruf .knopf-gross {
  display: inline-block;
  padding: 0.8rem 1.6rem;
  background: var(--knopf);
  color: var(--knopf-text);
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
}

.aufruf .knopf-gross:hover {
  background: var(--knopf-hover);
  color: var(--knopf-text);
}

.sprung {
  position: absolute;
  left: -999px;
  background: var(--karte);
  padding: 0.5rem 1rem;
  z-index: 10;
}

.sprung:focus {
  left: 1rem;
  top: 1rem;
}

/* Kopfbereich */
.kopf {
  background: var(--navy);
  border-bottom: 4px solid var(--primaer);
  position: sticky;
  top: 0;
  z-index: 5;
}

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

.marke {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  line-height: 1.15;
}

.marke-logo {
  width: 3.5rem;
  height: 3.5rem;
  padding: 2px;
  border-radius: 50%;
  background: #fff; /* Das Logo hat blaue Schrift und braucht hellen Grund */
}

.marke-text {
  display: flex;
  flex-direction: column;
}

.marke-name {
  font-family: var(--schrift-titel);
  font-weight: 700;
  font-size: 1.15rem;
  color: #fff;
}

.marke-zusatz {
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #c9d1ef;
}

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

.navigation a {
  display: block;
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  text-decoration: none;
  color: #fff;
  font-weight: 500;
}

.navigation a:hover,
.navigation a.aktiv {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.navigation a.knopf {
  background: var(--pille);
  color: var(--pille-text);
}

.navigation a.knopf:hover {
  background: var(--pille-hover);
  color: var(--pille-text);
}

.menue-schalter,
.menue-knopf {
  display: none;
}

@media (max-width: 60rem) {
  /* Kompakter Kopf: Logo und Name links, Hamburger rechts in derselben Zeile */
  .kopf-innen {
    gap: 0.5rem 0.75rem;
    padding-block: 0.5rem;
  }

  .marke {
    flex: 1;
    min-width: 0;
    gap: 0.6rem;
  }

  .marke-logo {
    width: 2.75rem;
    height: 2.75rem;
  }

  .marke-name {
    font-size: 1rem;
  }

  .marke-zusatz {
    font-size: 0.7rem;
  }

  .menue-knopf {
    display: block;
    flex: none;
    width: 2.75rem;
    height: 2.75rem;
    border: 2px solid rgba(255, 255, 255, 0.7);
    border-radius: 0.7rem;
    font-size: 0; /* Beschriftung nur für Hilfstechnik, sichtbar sind die drei Striche */
    color: transparent;
    cursor: pointer;
    background:
      linear-gradient(#fff, #fff) center 30% / 1.2rem 3px no-repeat,
      linear-gradient(#fff, #fff) center 50% / 1.2rem 3px no-repeat,
      linear-gradient(#fff, #fff) center 70% / 1.2rem 3px no-repeat;
  }

  .menue-schalter:checked + .menue-knopf {
    background-color: rgba(255, 255, 255, 0.16);
  }

  .menue-schalter:focus-visible + .menue-knopf {
    outline: 3px solid var(--fokus, var(--akzent));
    outline-offset: 2px;
  }

  .navigation {
    display: none;
    flex-basis: 100%;
    width: 100%;
  }

  .menue-schalter:checked ~ .navigation {
    display: block;
    padding-bottom: 0.5rem;
  }

  .navigation ul {
    flex-direction: column;
  }

  .navigation a {
    padding: 0.75rem 1rem;
  }
}

/* Fuß */
.fuss {
  background: var(--navy);
  color: #e8efe9;
  padding-block: 1.5rem;
  font-size: 0.95rem;
}

.fuss-innen {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1.5rem 2rem;
}

.fuss p,
.fuss address {
  margin: 0;
  font-style: normal;
}

.fuss h2 {
  margin: 0 0 0.4rem;
  font-family: var(--schrift);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #c9d1ef;
}

.fuss ul {
  list-style: none;
  display: grid;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
}

.fuss a {
  color: #fff;
}

.fuss-klein {
  grid-column: 1 / -1;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 0.85rem;
  color: #c9d1ef;
}

/* Startseite */
.held {
  background: linear-gradient(135deg, var(--primaer) 0%, var(--primaer-dunkel) 100%);
  color: var(--auf-primaer);
  padding-block: clamp(3rem, 9vw, 6rem) clamp(5rem, 11vw, 8rem);
}

.held-innen {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.held-logo {
  flex: none;
  width: 160px;
  height: 160px;
  padding: 5px;
  border-radius: 50%;
  background: #fff; /* Das Logo hat blaue Schrift und braucht hellen Grund */
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

@media (max-width: 46rem) {
  .held-logo {
    display: none;
  }
}

.held h1 {
  color: var(--auf-primaer);
  max-width: 22ch;
}

.held p {
  max-width: 40rem;
  font-size: 1.2rem;
}

.held .knopf-gross {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.8rem 1.6rem;
  background: var(--knopf);
  color: var(--knopf-text);
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
}

.held .knopf-gross:hover {
  background: var(--knopf-hover);
  color: var(--knopf-text);
}

.kacheln {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1rem;
  margin-top: -3.5rem; /* überlappt den Hero */
  margin-bottom: 3rem;
  position: relative;
}

.kachel {
  background: var(--karte);
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 8px 24px rgba(30, 39, 74, 0.1);
}

.kachel h2 {
  margin-top: 0;
  font-size: 1.25rem;
}

.kachel p {
  margin: 0;
  color: var(--text-leise);
}

/* Projekte */
.projekte {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 1.25rem;
  margin-top: 1.75rem;
}

.projekt {
  background: var(--papier);
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.projekt-foto {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

.projekt-inhalt {
  padding: 1.25rem;
}

.projekt-inhalt h3 {
  margin: 0.25rem 0 0.5rem;
  font-size: 1.25rem;
}

.projekt-inhalt p {
  margin: 0;
}

.projekt-inhalt .projekt-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.6rem;
  align-items: center;
  font-size: 0.85rem;
}

.projekt-jahr {
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--link);
}

.projekt-betrag {
  padding: 0.05rem 0.6rem;
  border-radius: 999px;
  background: var(--primaer);
  color: var(--auf-primaer);
  font-weight: 600;
}

.projekt-platzhalter {
  padding: 0.05rem 0.6rem;
  border-radius: 999px;
  background: #fbe9e5;
  color: #8f2a1c;
  font-weight: 600;
}

.mehr + .projekte,
.mehr .projekte {
  margin-top: 1.25rem;
}

/* Vorstand */
.gruppenfoto {
  display: block;
  width: 100%;
  margin-top: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--linie);
}

.personen {
  list-style: none;
  padding: 0;
  margin: 2rem 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  grid-auto-rows: 1fr; /* alle Karten gleich hoch, auch über mehrere Zeilen */
  gap: 1rem;
}

.person {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background: var(--karte);
  border: 1px solid var(--linie);
  border-top: 4px solid var(--primaer);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.person-funktion {
  display: block;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--link);
}

.person-name {
  font-family: var(--schrift-titel);
  font-size: 1.3rem;
  line-height: 1.3;
  color: var(--titel);
  text-wrap: balance;
}

/* Formulare */
.formular {
  display: grid;
  gap: 1rem;
  margin-top: 2rem;
}

.formular fieldset {
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  background: var(--karte);
  padding: 1.25rem;
  margin: 0;
  display: grid;
  gap: 1rem;
}

.formular legend {
  font-family: var(--schrift-titel);
  font-weight: 700;
  font-size: 1.2rem;
  padding-inline: 0.5rem;
  color: var(--titel);
}

/* Schrittanzeige im Beitrittsformular (nur mit JavaScript sichtbar) */
.schritte {
  display: flex;
  gap: 0.75rem;
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
}

.schritte[hidden],
.schritt[hidden] {
  display: none;
}

.schritte li {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.8rem;
  border-bottom: 4px solid var(--linie);
  color: var(--text-leise);
  font-weight: 600;
}

.schritte li::before {
  content: attr(data-nr);
  flex: none;
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  border: 2px solid currentColor;
  font-size: 0.95rem;
}

/* Der aktuelle Schritt ist nicht nur an der Primärfarbe zu erkennen (Gold hat auf Papier nur 1,9:1):
   dunkler Strich und dunkler Rand um den gefüllten Kreis */
.schritte li.aktiv {
  color: var(--titel);
  border-bottom-color: var(--titel);
}

.schritte li.aktiv::before {
  background: var(--primaer);
  border-color: var(--titel);
  color: var(--auf-primaer);
}

.schritte li.fertig {
  color: var(--titel);
  border-bottom-color: var(--titel);
}

.schritte li.fertig::before {
  content: '✓';
  background: var(--titel);
  border-color: var(--titel);
  color: #fff;
}

.auswahl {
  gap: 0.5rem;
}

.kuendigung {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--linie);
}

.kuendigung .knopf-zweit {
  display: inline-block;
  text-decoration: none;
}

.dank-hinweis {
  font-size: 0.95rem;
  color: var(--text-leise);
}

.schritt {
  display: grid;
  gap: 1rem;
}

.knopfzeile {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.knopf-zweit {
  font: inherit;
  font-weight: 600;
  padding: 0.8rem 1.6rem;
  background: transparent;
  color: var(--titel);
  border: 2px solid var(--aktion);
  border-radius: 999px;
  cursor: pointer;
}

.knopf-zweit:hover {
  background: var(--aktion);
  color: var(--aktion-text);
}

@media (max-width: 34rem) {
  .schritte li {
    padding-inline: 0.2rem;
    font-size: 0.9rem;
  }
}

.feld {
  display: grid;
  gap: 0.25rem;
}

/* Zwei Felder nebeneinander (Vor-/Nachname, PLZ/Ort), auf dem Handy untereinander. PLZ bleibt schmal und daneben. */
.feld-reihe {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1rem;
}

.feld-plz {
  grid-template-columns: minmax(6rem, 9rem) 1fr;
}

.feld label {
  font-weight: 600;
}

.feld input[type='text'],
.feld input[type='email'],
.feld input[type='date'],
.feld select,
.feld textarea {
  font: inherit;
  padding: 0.65rem 0.8rem;
  border: 1px solid #8a8470; /* 3,7:1 auf Weiß (WCAG 1.4.11) */
  border-radius: 0.5rem;
  background: #fff;
  width: 100%;
}

.feld textarea {
  min-height: 9rem;
}

.hinweis {
  font-size: 0.95rem;
  color: var(--text-leise);
}

.haken {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
}

.haken input {
  margin-top: 0.45rem;
  width: 1.1rem;
  height: 1.1rem;
  flex: none;
}

.knopf-senden {
  justify-self: start;
  font: inherit;
  font-weight: 600;
  padding: 0.8rem 1.8rem;
  background: var(--aktion);
  color: var(--aktion-text);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}

.knopf-senden:hover {
  background: var(--aktion-dunkel);
}

.knopf-senden[disabled] {
  opacity: 0.6;
  cursor: progress;
}

.falle {
  position: absolute;
  left: -9999px;
  height: 0;
  overflow: hidden;
}

/* Große Dankesmeldung nach dem Absenden der Beitrittserklärung */
.dank {
  margin-top: 2rem;
  padding: clamp(2rem, 7vw, 3.5rem) clamp(1.25rem, 5vw, 3rem);
  background: var(--karte);
  border: 1px solid var(--linie);
  border-top: 6px solid var(--primaer);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(30, 39, 74, 0.1);
  text-align: center;
}

.dank:focus {
  outline: none;
}

.dank-haken {
  width: 5rem;
  height: 5rem;
  margin-bottom: 1rem;
}

.dank-haken circle {
  fill: var(--primaer);
}

.dank-haken path {
  fill: none;
  stroke: var(--auf-primaer);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dank h2 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.75rem, 6vw, 2.5rem);
}

.dank p {
  margin: 0 auto 1.5rem;
  max-width: 32rem;
  font-size: 1.2rem;
}

.dank-knopf {
  display: inline-block;
  padding: 0.8rem 1.8rem;
  background: var(--aktion);
  color: var(--aktion-text);
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
}

.dank-knopf:hover {
  background: var(--aktion-dunkel);
  color: var(--aktion-text);
}

.meldung {
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid;
}

.meldung.ok {
  background: #e7f2ea;
  border-color: #9cc4a8;
}

.meldung.fehler {
  background: #fbe9e5;
  border-color: #e0a89e;
}

.downloads {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.downloads a {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  border: 2px solid var(--aktion);
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
}

.downloads a:hover {
  background: var(--aktion);
  color: var(--aktion-text);
}

/* Admin: Bild oder Datei wählen */
.dateiwahl img {
  display: block;
  max-height: 8rem;
  max-width: 100%;
  border-radius: 0.4rem;
  border: 1px solid var(--linie);
}

.datei-titel {
  margin: 0.4rem 0 0.25rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.datei-aktuell.ersetzt img,
.datei-aktuell.entfernt img {
  opacity: 0.3;
}

.datei-aktuell.ersetzt .datei-titel::after {
  content: ' (wird ersetzt)';
  font-weight: 400;
}

.datei-aktuell.entfernt .datei-titel::after {
  content: ' (wird entfernt)';
  font-weight: 400;
}

.datei-neu {
  margin-top: 0.5rem;
  padding: 0.6rem 0.8rem;
  border: 2px solid #2c7a3f;
  border-radius: 0.5rem;
  background: #eef7f0;
}

.datei-neu .hinweis {
  margin: 0.4rem 0 0;
}
