:root {
  --navy: #1e274a; /* Marineblau aus dem Vereinslogo, verbindet mit der Seite der Dorfgemeinschaft */
  --accent: #c81e1e; /* Rot aus dem Vereinslogo, abgedunkelt für Kontrast */
  --accent-dark: #9f1717;
  --paper: #faf6ee;
  --card: #ffffff;
  --text: #2a2a26;
  --text-muted: #5f5f56;
  --line: #e2dccd;
  --radius: 0.75rem;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-title: Georgia, 'Iowan Old Style', 'Times New Roman', serif;
  --title: var(--navy);
}

/* Primärfarbe: Gold, Farbe des Fördervereins */
:root { /* Standard: Gold, Farbe des Fördervereins */
  --primary: #e0b03a;
  --primary-dark: #b98a1a;
  --on-primary: #1e274a;
  --button: #1e274a;
  --button-text: #fff;
  --button-hover: #323f73;
  --action: #1e274a;
  --action-dark: #12183a;
  --action-text: #fff;
  --link: #8a6710;
  --pill: #e0b03a;
  --pill-text: #1e274a;
  --pill-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(--paper);
  color: var(--text);
  font-family: var(--font);
  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(--accent);
}

/* 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 --focus die Textfarbe des Bereichs verwendet. */
:focus-visible {
  outline: 3px solid var(--focus, var(--accent));
  outline-offset: 2px;
}

.header,
.footer {
  --focus: #fff;
}

.hero,
.call-to-action {
  --focus: var(--on-primary);
}

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

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

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

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

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

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

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

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

.section.light {
  background: var(--card);
  border-block: 1px solid var(--line);
}

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

.more {
  margin-top: 1rem;
}

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

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

.more summary:hover {
  background: var(--action);
  color: var(--action-text);
}

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

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

.more-content h2 {
  font-size: 1.35rem;
  margin-top: 1.75rem;
}

.call-to-action {
  background: var(--primary);
  color: var(--on-primary);
  text-align: center;
  padding-block: clamp(2.5rem, 7vw, 4rem);
}

.call-to-action h2 {
  color: var(--on-primary);
  margin-top: 0;
}

.call-to-action .button-large {
  display: inline-block;
  padding: 0.8rem 1.6rem;
  background: var(--button);
  color: var(--button-text);
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
}

.call-to-action .button-large:hover {
  background: var(--button-hover);
  color: var(--button-text);
}

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

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

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

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

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

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

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

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

.brand-tagline {
  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.active {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.navigation a.button {
  background: var(--pill);
  color: var(--pill-text);
}

.navigation a.button:hover {
  background: var(--pill-hover);
  color: var(--pill-text);
}

.menu-toggle,
.menu-button {
  display: none;
}

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

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

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

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

  .brand-tagline {
    font-size: 0.7rem;
  }

  .menu-button {
    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;
  }

  .menu-toggle:checked + .menu-button {
    background-color: rgba(255, 255, 255, 0.16);
  }

  .menu-toggle:focus-visible + .menu-button {
    outline: 3px solid var(--focus, var(--accent));
    outline-offset: 2px;
  }

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

  .menu-toggle:checked ~ .navigation {
    display: block;
    padding-bottom: 0.5rem;
  }

  .navigation ul {
    flex-direction: column;
  }

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

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

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

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

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

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

.footer a {
  color: #fff;
}

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

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

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

.hero-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) {
  .hero-logo {
    display: none;
  }
}

.hero h1 {
  color: var(--on-primary);
  max-width: 22ch;
}

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

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

.hero .button-large:hover {
  background: var(--button-hover);
  color: var(--button-text);
}

.tiles {
  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;
}

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

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

.tile p {
  margin: 0;
  color: var(--text-muted);
}

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

.project {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

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

.project-content {
  padding: 1.25rem;
}

.project-content h3 {
  margin: 0.25rem 0 0.5rem;
  font-size: 1.25rem;
}

.project-content p {
  margin: 0;
}

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

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

.project-amount {
  padding: 0.05rem 0.6rem;
  border-radius: 999px;
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 600;
}

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

.more + .projects,
.more .projects {
  margin-top: 1.25rem;
}

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

.people {
  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(--card);
  border: 1px solid var(--line);
  border-top: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: 1.25rem;
}

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

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

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

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

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

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

.steps[hidden],
.step[hidden] {
  display: none;
}

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

.steps 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 */
.steps li.active {
  color: var(--title);
  border-bottom-color: var(--title);
}

.steps li.active::before {
  background: var(--primary);
  border-color: var(--title);
  color: var(--on-primary);
}

.steps li.done {
  color: var(--title);
  border-bottom-color: var(--title);
}

.steps li.done::before {
  content: '✓';
  background: var(--title);
  border-color: var(--title);
  color: #fff;
}

.choice {
  gap: 0.5rem;
}

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

.cancellation .button-secondary {
  display: inline-block;
  text-decoration: none;
}

.thank-you-note {
  font-size: 0.95rem;
  color: var(--text-muted);
}

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

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

.button-secondary {
  font: inherit;
  font-weight: 600;
  padding: 0.8rem 1.6rem;
  background: transparent;
  color: var(--title);
  border: 2px solid var(--action);
  border-radius: 999px;
  cursor: pointer;
}

.button-secondary:hover {
  background: var(--action);
  color: var(--action-text);
}

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

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

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

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

.field label {
  font-weight: 600;
}

.field input[type='text'],
.field input[type='email'],
.field input[type='date'],
.field select,
.field 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%;
}

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

.hint {
  font-size: 0.95rem;
  color: var(--text-muted);
}

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

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

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

.button-submit:hover {
  background: var(--action-dark);
}

.button-submit[disabled] {
  opacity: 0.6;
  cursor: progress;
}

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

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

.thank-you:focus {
  outline: none;
}

.thank-you-check {
  width: 5rem;
  height: 5rem;
  margin-bottom: 1rem;
}

.thank-you-check circle {
  fill: var(--primary);
}

.thank-you-check path {
  fill: none;
  stroke: var(--on-primary);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

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

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

.thank-you-button:hover {
  background: var(--action-dark);
  color: var(--action-text);
}

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

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

.message.error {
  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(--action);
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
}

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

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

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

.file-current.replaced img,
.file-current.removed img {
  opacity: 0.3;
}

.file-current.replaced .file-title::after {
  content: ' (wird ersetzt)';
  font-weight: 400;
}

.file-current.removed .file-title::after {
  content: ' (wird entfernt)';
  font-weight: 400;
}

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

.file-new .hint {
  margin: 0.4rem 0 0;
}
