/* ===========================
   CSS Custom Properties
   =========================== */
:root {
  --color-green-primary: #46962b;
  --color-green-dark:    #2d6a1f;
  --color-green-light:   #e8f5e2;
  --color-text:          #1a1a1a;
  --color-text-light:    #ffffff;
  --color-bg:            #ffffff;
  --color-border:        #cccccc;
}

/* ===========================
   Reset & Base Styles
   =========================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
    Ubuntu, Cantarell, 'Helvetica Neue', Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
}

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

a {
  color: var(--color-green-primary);
  text-decoration: none;
}

a:hover,
a:focus {
  color: var(--color-green-dark);
  text-decoration: underline;
}

a:focus-visible {
  outline: 2px solid var(--color-green-primary);
  outline-offset: 2px;
}

ul, ol {
  list-style-position: inside;
}

h1, h2, h3, h4 {
  line-height: 1.3;
}

/* ===========================
   Skip-Link (Barrierefreiheit)
   =========================== */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background-color: var(--color-green-dark);
  color: var(--color-text-light);
  padding: 0.75rem 1.5rem;
  z-index: 2000;
  font-weight: 700;
  text-decoration: none;
  border-radius: 0 0 4px 0;
}

.skip-link:focus {
  top: 0;
  color: var(--color-text-light);
  outline: 2px solid var(--color-text-light);
  outline-offset: 2px;
}

/* ===========================
   Barrierefreiheit: Reduced Motion
   =========================== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ===========================
   Layout-Grundlagen (Mobile-first)
   =========================== */
.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: 1rem;
}

section {
  padding-block: 3rem;
}

/* ===========================
   Responsive Breakpoints
   =========================== */

/* Tablet: ab 600px */
@media (min-width: 600px) {
  .container {
    padding-inline: 1.5rem;
  }
}

/* Desktop: ab 960px */
@media (min-width: 960px) {
  .container {
    padding-inline: 2rem;
  }
}

/* ===========================
   Navigation
   =========================== */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: var(--color-green-primary);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 3.5rem;
}

.nav-brand {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-text-light);
  white-space: nowrap;
}

@media (max-width: 380px) {
  .nav-brand-fraktion {
    display: none;
  }
}

/* --- Nav Menu (Desktop default) --- */
.nav-menu {
  display: flex;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-menu a {
  display: block;
  padding: 0.5rem 0.75rem;
  color: var(--color-text-light);
  text-decoration: none;
  border-radius: 4px;
  transition: background-color 0.2s ease, outline-offset 0.1s ease;
}

.nav-menu a:hover {
  background-color: var(--color-green-dark);
  color: var(--color-text-light);
  text-decoration: none;
}

.nav-menu a:focus-visible {
  outline: 2px solid var(--color-text-light);
  outline-offset: 2px;
}

/* --- Hamburger Toggle --- */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  width: 2.5rem;
  height: 2.5rem;
  position: relative;
}

.nav-toggle:focus-visible {
  outline: 2px solid var(--color-text-light);
  outline-offset: 2px;
  border-radius: 4px;
}

.nav-toggle-icon,
.nav-toggle-icon::before,
.nav-toggle-icon::after {
  display: block;
  width: 1.5rem;
  height: 2px;
  background-color: var(--color-text-light);
  border-radius: 2px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle-icon {
  top: 50%;
  transform: translate(-50%, -50%);
}

.nav-toggle-icon::before {
  content: "";
  top: -7px;
  left: 0;
  transform: none;
}

.nav-toggle-icon::after {
  content: "";
  top: 7px;
  left: 0;
  transform: none;
}

/* --- Mobile Styles (< 600px) --- */
@media (max-width: 599px) {
  .nav-container {
    flex-wrap: wrap;
    position: relative;
  }

  .nav-toggle {
    display: block;
  }

  .nav-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    width: 100%;
    padding-block: 0;
    gap: 0;
    overflow: hidden;
    max-height: 0;
    background-color: var(--color-green-primary);
    z-index: 999;
    transition: max-height 0.3s ease, padding-block 0.3s ease;
  }

  .nav-menu.open {
    max-height: 20rem;
    padding-block: 0.5rem;
  }

  .nav-menu a {
    padding: 0.75rem 1rem;
    border-radius: 0;
  }

  .nav-menu a:hover {
    background-color: var(--color-green-dark);
  }

  /* Hamburger → X Animation */
  .nav-toggle[aria-expanded="true"] .nav-toggle-icon {
    background-color: transparent;
  }

  .nav-toggle[aria-expanded="true"] .nav-toggle-icon::before {
    top: 0;
    transform: rotate(45deg);
  }

  .nav-toggle[aria-expanded="true"] .nav-toggle-icon::after {
    top: 0;
    transform: rotate(-45deg);
  }
}

/* ===========================
   Hero-Bereich (#startseite)
   =========================== */
#startseite {
  position: relative;
  min-height: 40vh;
  display: flex;
  align-items: center;
  background-image: url('assets/images/hero_480.jpg');
  background-size: cover;
  background-position: center;
  padding-block: 2.5rem;
}

@media (min-width: 481px) {
  #startseite { background-image: url('assets/images/hero_768.jpg'); }
}
@media (min-width: 769px) {
  #startseite { background-image: url('assets/images/hero_1024.jpg'); }
}
@media (min-width: 1025px) {
  #startseite { background-image: url('assets/images/hero_1440.jpg'); }
}
@media (min-width: 1441px) {
  #startseite { background-image: url('assets/images/hero_1920.jpg'); }
}

#startseite::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: var(--color-text-light);
}

.hero-content h1 {
  font-size: 2rem;
  color: var(--color-text-light);
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  margin-bottom: 1rem;
}

.hero-content p {
  color: var(--color-text-light);
  max-width: 40rem;
  margin-inline: auto;
  font-size: 1.125rem;
  line-height: 1.5;
}

/* Tablet */
@media (min-width: 600px) {
  .hero-content h1 {
    font-size: 2.5rem;
  }
}

/* Desktop */
@media (min-width: 960px) {
  .hero-content h1 {
    font-size: 3rem;
  }
}

/* ===========================
   Über-uns-Sektion (#ueber-uns)
   =========================== */
#ueber-uns {
  background-color: var(--color-green-light);
}

#ueber-uns h2 {
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
  color: var(--color-green-dark);
  border-bottom: 3px solid var(--color-green-primary);
  padding-bottom: 0.5rem;
  display: inline-block;
}

.ueber-uns-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

.ueber-uns-text p {
  margin-bottom: 1rem;
  line-height: 1.7;
}

.ueber-uns-text h3 {
  font-size: 1.25rem;
  color: var(--color-green-primary);
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.ueber-uns-text ul {
  list-style: none;
  padding-left: 1.25rem;
  margin-bottom: 1rem;
}

.ueber-uns-text ul li {
  position: relative;
  padding-left: 1rem;
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.ueber-uns-text ul li::before {
  content: "●";
  color: var(--color-green-primary);
  position: absolute;
  left: 0;
  font-size: 0.6em;
  top: 0.45em;
}

/* Tablet */
@media (min-width: 600px) {
  #ueber-uns h2 {
    font-size: 2rem;
  }
}

/* Desktop: volle Breite für Text */
@media (min-width: 960px) {
  #ueber-uns h2 {
    font-size: 2.25rem;
  }
}

/* ===========================
   Mitglieder-Sektion (#mitglieder)
   =========================== */
#mitglieder {
  background-color: var(--color-bg);
}

#mitglieder h2 {
  font-size: 1.75rem;
  margin-bottom: 1rem;
  color: var(--color-green-dark);
  border-bottom: 3px solid var(--color-green-primary);
  padding-bottom: 0.5rem;
  display: inline-block;
}

.section-intro {
  font-size: 1.1rem;
  line-height: 1.7;
  color: #444;
  max-width: 48rem;
  margin-bottom: 1.5rem;
}

.members-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.member-card {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  background-color: var(--color-bg);
}

.member-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.member-info {
  padding: 1rem 1.25rem 1.25rem;
}

.member-info h3 {
  font-size: 1.125rem;
  margin-bottom: 0.25rem;
}

.member-role {
  color: var(--color-green-primary);
  font-style: italic;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.member-bio {
  color: var(--color-text);
  line-height: 1.6;
  font-size: 0.95rem;
}

/* Tablet: 2 Spalten */
@media (min-width: 600px) {
  .members-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  #mitglieder h2 {
    font-size: 2rem;
  }
}

/* Desktop: 3 Spalten */
@media (min-width: 960px) {
  .members-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  #mitglieder h2 {
    font-size: 2.25rem;
  }
}

/* ===========================
   Kontakt-Sektion (#kontakt)
   =========================== */
#kontakt {
  background-color: var(--color-green-light);
}

#kontakt h2 {
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
  color: var(--color-green-dark);
  border-bottom: 3px solid var(--color-green-primary);
  padding-bottom: 0.5rem;
  display: inline-block;
}

.kontakt-content {
  line-height: 1.7;
}

.kontakt-info {
  margin-top: 1.5rem;
}

.kontakt-info p {
  margin-bottom: 0.75rem;
}

.kontakt-hinweis {
  color: #555;
  font-size: 0.9rem;
}

/* Tablet */
@media (min-width: 600px) {
  #kontakt h2 {
    font-size: 2rem;
  }
}

/* Desktop */
@media (min-width: 960px) {
  #kontakt h2 {
    font-size: 2.25rem;
  }
}

/* ===========================
   Footer
   =========================== */
footer {
  background-color: var(--color-green-dark);
  color: var(--color-text-light);
  padding-block: 2rem;
}

footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-copyright {
  color: var(--color-text-light);
  font-size: 0.875rem;
}

.footer-nav {
  display: flex;
  gap: 1.5rem;
}

.footer-nav a {
  color: var(--color-text-light);
  text-decoration: none;
}

.footer-nav a:hover {
  text-decoration: underline;
  color: var(--color-text-light);
}

.footer-nav a:focus-visible {
  outline: 2px solid var(--color-text-light);
  outline-offset: 2px;
}

/* ===========================
   Active Navigation Link
   =========================== */
.nav-menu a.active {
  background-color: var(--color-green-dark);
  border-bottom: 2px solid var(--color-text-light);
}

.nav-menu a[aria-current="true"] {
  background-color: var(--color-green-dark);
  border-bottom: 2px solid var(--color-text-light);
}

@media (max-width: 599px) {
  .nav-menu a.active,
  .nav-menu a[aria-current="true"] {
    border-bottom: none;
    border-left: 3px solid var(--color-text-light);
  }
}

/* ===========================
   Impressum / Datenschutz
   =========================== */
.legal-page {
  background-color: var(--color-bg);
}

.legal-page h1 {
  font-size: 2rem;
  color: var(--color-green-dark);
  margin-bottom: 2rem;
  border-bottom: 3px solid var(--color-green-primary);
  padding-bottom: 0.5rem;
  display: inline-block;
}

.legal-page h2 {
  font-size: 1.125rem;
  color: var(--color-green-primary);
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
}

.legal-page p,
.legal-page ul {
  line-height: 1.7;
  margin-bottom: 0.75rem;
}

.legal-page ul {
  padding-left: 1.5rem;
  list-style: disc;
}

.nav-brand {
  text-decoration: none;
  color: var(--color-text-light);
}

/* ===========================
   Mitglieder Collapse
   =========================== */
.members-collapse {
  position: relative;
}

.members-grid-wrapper {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.members-grid-wrapper.is-open {
  max-height: 4000px;
  transition: max-height 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.members-fade {
  position: relative;
  height: 0;
  pointer-events: none;
}

.members-fade::before {
  content: "";
  display: block;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4rem;
  background: linear-gradient(to top, var(--color-bg), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Show fade only when collapsed and has content peek */
.members-grid-wrapper:not(.is-open) ~ .members-fade::before {
  opacity: 0;
}

.members-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  margin-top: 1rem;
  padding: 0.875rem 1.5rem;
  background: none;
  border: 2px solid var(--color-green-primary);
  border-radius: 50px;
  color: var(--color-green-primary);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

.members-toggle-btn:hover {
  background-color: var(--color-green-primary);
  color: var(--color-text-light);
  box-shadow: 0 4px 12px rgba(70, 150, 43, 0.3);
}

.members-toggle-btn:focus-visible {
  outline: 2px solid var(--color-green-primary);
  outline-offset: 3px;
}

.members-toggle-chevron {
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.members-toggle-btn[aria-expanded="true"] .members-toggle-chevron {
  transform: rotate(180deg);
}
