/* ==========================================================================
   1. Team Hero Header
   ========================================================================== */
.team-hero {
  position: relative;
  width: 100%;
  /* Gleiches Format auf allen Geräten (passend zu 1920 × 800 px).
     Nur sehr breite Bildschirme (> 1920 px) schneiden oben/unten etwas ab. */
  aspect-ratio: 12 / 5;
  max-height: 800px;
  background-color: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.team-hero-img-wrap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.team-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  display: block;
}

.team-hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.3) 0%,
    rgba(0, 0, 0, 0.68) 100%
  );
}

.team-hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: #ffffff;
  padding: 0 1.5rem;
}

.team-hero-title {
  font-size: 3.2rem;
  font-weight: 850;
  letter-spacing: -0.5px;
  margin: 0;
  text-shadow: 0 2px 15px rgba(0, 0, 0, 0.5);
}

/* ==========================================================================
   2. Sticky Schnellnavigation / Gremien-Filter
   ========================================================================== */
.team-nav-bar {
  position: sticky;
  top: var(--header-height);
  background-color: #ffffff;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.05);
  z-index: 900;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  transition: top 0.3s ease;
}

.site-header.scrolled + .site-main .team-nav-bar {
  top: var(--header-height-scrolled);
}

.team-nav-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
  display: flex;
  gap: 0.5rem;
  /* Wie im Original: Leiste lässt sich in sich wischen – die Seite selbst scrollt nicht seitlich */
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.team-nav-container::-webkit-scrollbar {
  display: none;
}

.team-nav-link {
  display: inline-block;
  padding: 1.1rem 1.1rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-light);
  text-decoration: none;
  position: relative;
  transition: color 0.2s ease;
}

.team-nav-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 1.1rem;
  right: 1.1rem;
  height: 3px;
  background-color: var(--primary-color);
  border-radius: 2px 2px 0 0;
  opacity: 0;
  transform: scaleX(0);
  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
}

.team-nav-link:hover,
.team-nav-link.active {
  color: var(--text-color);
}

.team-nav-link.active::after,
.team-nav-link:hover::after {
  opacity: 1;
  transform: scaleX(1);
}

/* ==========================================================================
   3. Gremien Abschnitte & Titel
   ========================================================================== */
.team-sections-wrapper {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 4.5rem var(--container-pad);
}

.team-section {
  margin-bottom: 5.5rem;
  scroll-margin-top: 150px;
}

.team-section-header {
  margin-bottom: 2.2rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.team-section-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-color);
  letter-spacing: -0.3px;
  margin-bottom: 0.4rem;
}

.title-accent {
  width: 50px;
  height: 4px;
  background-color: var(--primary-color);
  border-radius: 2px;
}

/* ==========================================================================
   3b. Gruppenfoto je Gremium
   ========================================================================== */
.group-photo {
  position: relative;
  margin: 0 0 2.4rem 0;
  max-width: 1100px;
}

.group-photo-frame {
  position: relative;
  background-color: #ffffff;
  padding: 10px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

/* Gelbe Facetten-Ecke oben rechts (im Stil von Header & Footer) */
.group-photo-frame::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 90px;
  height: 90px;
  background: linear-gradient(
    225deg,
    var(--geo-yellow-5) 0%,
    var(--geo-yellow-4) 45%,
    var(--geo-yellow-3) 100%
  );
  clip-path: polygon(0 0, 100% 0, 100% 100%);
  z-index: 2;
  pointer-events: none;
}

.group-photo-img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 7;
  object-fit: cover;
  object-position: center 35%;
  border-radius: 3px;
}

.group-photo-badge {
  position: absolute;
  left: 22px;
  bottom: 22px;
  z-index: 3;
  background-color: var(--accent-yellow);
  color: var(--accent-on-yellow);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 0.35rem 0.8rem;
  clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 0 100%);
}

.group-photo-caption {
  margin-top: 0.75rem;
  padding-left: 0.75rem;
  border-left: 3px solid var(--accent-yellow);
  font-size: 0.92rem;
  color: var(--text-light);
  line-height: 1.5;
}

/* ==========================================================================
   4. Personenkarten & Raster
   ========================================================================== */
.members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
  gap: 1.8rem;
}

.trio-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 320px));
}

.duo-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 320px));
}

.member-card {
  background-color: #ffffff;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition:
    transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.25s ease,
    border-color 0.25s ease;
}

.member-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  border-color: var(--accent-yellow);
}

.member-img-wrap {
  width: 100%;
  aspect-ratio: 4 / 4.6;
  background-color: #e9ecef;
  position: relative;
  overflow: hidden;
}

.member-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  transition: transform 0.4s ease;
}

.member-card:hover .member-img {
  transform: scale(1.03);
}

.member-info {
  padding: 1.25rem 1.25rem 1.4rem 1.25rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.member-name {
  font-size: 1.15rem;
  font-weight: 750;
  color: var(--text-color);
  margin-bottom: 0.2rem;
}

/* Schlichter gelber Strich links unter dem Namen */
.member-name::after {
  content: "";
  display: block;
  width: 28px;
  height: 3px;
  margin: 0.55rem 0 0.5rem;
  background-color: var(--accent-yellow);
  border-radius: 2px;
}

.member-role {
  font-size: 0.82rem;
  font-weight: 500;
  color: #80868b; /* heller Grauton – dem Namen untergeordnet */
  margin-bottom: 1rem;
  line-height: 1.4;
}

.member-contact {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.member-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  color: var(--text-light);
  text-decoration: none;
  transition:
    color 0.2s ease,
    transform 0.2s ease;
  min-width: 0;
  overflow-wrap: anywhere;
}

.member-link span {
  min-width: 0;
}

.member-link svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
  flex-shrink: 0;
  opacity: 0.75;
}

.member-link:hover {
  color: var(--primary-hover);
  transform: translateX(3px);
}

.member-link:hover svg {
  opacity: 1;
}

/* ==========================================================================
   5. Regionalgruppen (2 Regionalgruppen nebeneinander)
   ========================================================================== */
.regions-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem;
}

.region-block {
  background-color: #ffffff;
  padding: 1.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
}

.region-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-color);
  margin-bottom: 1.4rem;
  padding-left: 0.75rem;
  border-left: 4px solid var(--primary-color);
  line-height: 1.2;
}

/* Die 2 Leiter innerhalb einer Regionalgruppe direkt nebeneinander */
.region-members-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.2rem;
  margin-top: auto;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 1200px) {
  .regions-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 960px) {
  .team-hero-title {
    font-size: clamp(1.5rem, 7vw, 2.4rem);
  }

  .team-sections-wrapper {
    padding: 3rem 1.25rem;
  }

  .team-section {
    margin-bottom: 4rem;
  }

  .team-section-title {
    font-size: 1.7rem;
  }

  .region-block {
    padding: 1.25rem;
  }

  .region-members-grid {
    grid-template-columns: 1fr;
  }

  /* Trio, Lehrlingsunion & LSV am Handy/Tablet genauso breit wie alle anderen Gremien */
  .trio-grid,
  .duo-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
  }

  .team-nav-link {
    padding: 1rem 0.85rem;
    font-size: 0.88rem;
  }

  .team-nav-link::after {
    left: 0.85rem;
    right: 0.85rem;
  }

  .team-section {
    /* Header + Gremien-Leiste + etwas Luft */
    scroll-margin-top: calc(var(--header-height-scrolled) + 4.5rem);
  }

  .group-photo {
    margin-bottom: 1.8rem;
  }

  .group-photo-frame {
    padding: 6px;
  }

  .group-photo-frame::before {
    width: 55px;
    height: 55px;
  }

  .group-photo-badge {
    left: 12px;
    bottom: 12px;
    font-size: 0.6rem;
    padding: 0.25rem 0.55rem;
  }
}
