/* Team-Seite: 3D-Karten, Zitat, Rollen-Banner */

body.team-page main {
  display: block !important;
  width: 100%;
}

body.team-page .section-light.team-section {
  width: min(100% - 2.5rem, 1320px);
  margin-inline: auto;
  padding: clamp(3rem, 5vw, 4.75rem) 0 clamp(3.5rem, 6vw, 5.5rem);
}

body.team-page .team-section .container {
  width: min(100%, 1240px);
  padding-inline: clamp(1.25rem, 3vw, 2.5rem);
}

.team-intro {
  text-align: center;
  max-width: 42rem;
  margin: 0 auto 3rem;
}

.team-intro p {
  color: var(--color-muted);
  margin: 0;
  font-size: clamp(1.05rem, 1.3vw, 1.15rem);
  line-height: 1.75;
}

.team-intro__quote {
  margin: 0.35rem auto 0;
  padding: 0;
  border: none;
  max-width: 100%;
}

.team-intro__quote p {
  margin: 0;
  color: #5a6a58;
  font-family: 'Poppins', sans-serif;
  font-size: clamp(0.98rem, 1.35vw, 1.12rem);
  font-weight: 400;
  font-style: italic;
  font-synthesis: style;
  line-height: 1.45;
  white-space: nowrap;
  quotes: '„' '“';
}

.team-intro__quote p::before {
  content: open-quote;
  color: var(--color-accent);
  font-weight: 700;
  font-size: 1.15em;
  margin-right: 0.12em;
}

.team-intro__quote p::after {
  content: close-quote;
  color: var(--color-accent);
  font-weight: 700;
  font-size: 1.15em;
  margin-left: 0.12em;
}

@media (max-width: 650px) {
  .team-intro__quote p {
    white-space: normal;
  }
}

#team-status {
  text-align: center;
  padding: 0.5rem 1rem 1.5rem;
  color: var(--color-muted);
}

#team-status[data-state="error"] {
  color: #8a2f1f;
}

#team-mount {
  width: 100%;
}

.team-grid {
  display: grid;
  gap: clamp(1.75rem, 2.8vw, 2.4rem);
  width: 100%;
  align-items: stretch;
  justify-content: center;
  /* 4+ Mitarbeiter: volle Breite */
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.team-grid[data-count="1"] {
  grid-template-columns: minmax(16rem, 22rem);
}

.team-grid[data-count="2"] {
  grid-template-columns: repeat(2, minmax(15rem, 21rem));
}

.team-grid[data-count="3"] {
  grid-template-columns: repeat(3, minmax(14rem, 20rem));
}

.team-card {
  --team-card-pad-x: 1.35rem;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  height: 100%;
  overflow: visible;
  background:
    linear-gradient(165deg, #ffffff 0%, #f4fbf2 48%, #eef7eb 100%);
  border: 2px solid rgba(47, 123, 70, 0.28);
  border-radius: 1.4rem;
  padding: 2rem var(--team-card-pad-x) 1.85rem;
  box-shadow:
    0 2px 0 rgba(255, 255, 255, 0.9) inset,
    0 -10px 24px rgba(47, 123, 70, 0.05) inset,
    0 14px 28px rgba(40, 53, 35, 0.1),
    0 28px 55px rgba(40, 53, 35, 0.12),
    0 4px 0 rgba(47, 123, 70, 0.12);
  transform: translateY(0);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.team-card::before {
  content: '';
  position: absolute;
  inset: 0.55rem;
  border-radius: 1.05rem;
  border: 1px solid rgba(204, 138, 63, 0.28);
  pointer-events: none;
}

.team-card:hover {
  transform: translateY(-4px);
  box-shadow:
    0 2px 0 rgba(255, 255, 255, 0.95) inset,
    0 -10px 24px rgba(47, 123, 70, 0.06) inset,
    0 18px 34px rgba(40, 53, 35, 0.12),
    0 34px 64px rgba(40, 53, 35, 0.14),
    0 5px 0 rgba(47, 123, 70, 0.16);
}

.team-card--featured {
  border-color: rgba(47, 123, 70, 0.48);
  background:
    linear-gradient(165deg, #ffffff 0%, #ecf7e9 55%, #e3f2df 100%);
  box-shadow:
    0 2px 0 rgba(255, 255, 255, 0.95) inset,
    0 -12px 28px rgba(47, 123, 70, 0.08) inset,
    0 16px 32px rgba(47, 123, 70, 0.12),
    0 32px 60px rgba(40, 53, 35, 0.14),
    0 5px 0 rgba(204, 138, 63, 0.35);
}

.team-card__photo {
  position: relative;
  z-index: 1;
  width: clamp(8.25rem, 11vw, 10.25rem);
  height: clamp(8.25rem, 11vw, 10.25rem);
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid #fff;
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
  background: linear-gradient(145deg, #dcead8, #c5dcc0);
  margin-bottom: 1.2rem;
  flex-shrink: 0;
  box-shadow:
    0 10px 22px rgba(40, 53, 35, 0.18),
    0 0 0 6px rgba(204, 138, 63, 0.18);
}

.team-card--featured .team-card__photo {
  width: clamp(9rem, 12vw, 11rem);
  height: clamp(9rem, 12vw, 11rem);
  outline-color: #246338;
  box-shadow:
    0 12px 26px rgba(40, 53, 35, 0.2),
    0 0 0 6px rgba(204, 138, 63, 0.28);
}

.team-card__photo img,
.team-card__photo-fallback {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

.team-card__photo-fallback {
  background: linear-gradient(145deg, #cfe3cb, #a9c9a4);
}

.team-card__name {
  position: relative;
  z-index: 1;
  margin: 0 0 0.85rem;
  font-family: 'Montserrat', 'Poppins', sans-serif;
  font-size: clamp(1.05rem, 1.3vw, 1.2rem);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.25;
}

.team-card__quote {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 0 0.35rem;
  border: none;
  max-width: 100%;
  flex: 1 1 auto;
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.team-card__quote p {
  margin: 0;
  color: #5a6a58;
  font-family: 'Poppins', sans-serif;
  font-size: 0.88rem;
  font-weight: 400;
  line-height: 1.55;
  font-style: italic;
  font-synthesis: style;
  quotes: '„' '“';
}

.team-card__quote p::before {
  content: open-quote;
  color: var(--color-accent);
  font-weight: 700;
  font-size: 1.15em;
  margin-right: 0.1em;
}

.team-card__quote p::after {
  content: close-quote;
  color: var(--color-accent);
  font-weight: 700;
  font-size: 1.15em;
  margin-left: 0.1em;
}

/* Rollen-Banner: immer gleiche Höhe in der Kartenreihe */
.team-card__role-wrap {
  position: relative;
  z-index: 2;
  width: calc(100% + (var(--team-card-pad-x) * 2) + 1.4rem);
  margin: 0 calc(-1 * var(--team-card-pad-x) - 0.7rem) 0.35rem;
  margin-top: auto;
  padding-top: 1.85rem;
  flex-shrink: 0;
}

.team-card__role {
  position: relative;
  margin: 0;
  padding: 0.55rem 1rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: #fff;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  box-shadow:
    0 8px 18px rgba(57, 45, 33, 0.22),
    0 2px 0 rgba(255, 255, 255, 0.18) inset;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
}

.team-card__role::before,
.team-card__role::after {
  content: '';
  position: absolute;
  bottom: -8px;
  border-style: solid;
  border-width: 8px 8px 0 0;
}

.team-card__role::before {
  left: 0;
  border-color: #246338 transparent transparent transparent;
}

.team-card__role::after {
  right: 0;
  border-width: 8px 0 0 8px;
  border-color: #a66e32 transparent transparent transparent;
}

.team-card--featured .team-card__role {
  font-size: 0.78rem;
  letter-spacing: 0.09em;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  box-shadow:
    0 10px 22px rgba(57, 45, 33, 0.26),
    0 0 0 2px rgba(255, 255, 255, 0.55),
    0 2px 0 rgba(255, 255, 255, 0.22) inset;
}

.team-card--featured .team-card__role::before {
  border-color: #246338 transparent transparent transparent;
}

.team-card--featured .team-card__role::after {
  border-color: #a66e32 transparent transparent transparent;
}

.team-card__social {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.65rem;
  margin-top: 1.25rem;
  min-height: 2.2rem;
  flex-shrink: 0;
}

.team-card__social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  color: #234028;
  background: linear-gradient(180deg, #fff, #e8f3e6);
  border: 1px solid rgba(118, 152, 117, 0.35);
  box-shadow: 0 6px 14px rgba(40, 53, 35, 0.1);
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.team-card__social-link svg {
  width: 1.05rem;
  height: 1.05rem;
  display: block;
}

.team-card__social-link:hover {
  background: linear-gradient(180deg, #3a9154, #2f7b46);
  color: #fff;
  transform: translateY(-2px);
}

@media (max-width: 1100px) {
  .team-grid {
    grid-template-columns: repeat(2, minmax(0, min(21rem, 100%)));
  }

  .team-grid[data-count="1"] {
    grid-template-columns: minmax(16rem, 22rem);
  }
}

@media (max-width: 640px) {
  body.team-page .section-light.team-section {
    width: min(100% - 1.25rem, 1320px);
  }

  .team-grid,
  .team-grid[data-count] {
    grid-template-columns: minmax(0, 1fr);
    max-width: 380px;
    margin-inline: auto;
  }

  .team-card {
    --team-card-pad-x: 1.2rem;
    padding: 1.75rem var(--team-card-pad-x) 1.6rem;
  }
}
