/**
 * Team page (JBC-21, christiane-mayer). Fork-local, same "own file, own
 * class prefix" convention as bausteine/index.php's inline demo styles and
 * site/contact/index.php's own <style> block (framework.md "Content/Design
 * layer"). Longhand padding throughout (framework.md shorthand-clobber
 * warning): every rule below that touches padding sets individual sides,
 * never a shorthand, so a future component class landing on the same
 * element (e.g. inside site/data/team.json-driven markup) cannot silently
 * clobber one side.
 *
 * Data source: site/data/team.json (16 entries from
 * content/import/team-members.json). Updating a flyer or a photo later
 * ("bitte aktualisier bei Stefanie Schmedding den Flyer", C-05) means:
 *   1. drop the new file under site/assets/media/img/team/<slug>.jpg (photo)
 *      or site/assets/media/downloads/flyer-<slug>.<ext> (flyer),
 *   2. update that member's "photo"/"flyer" path in site/data/team.json,
 *   3. re-run bin/render-static.sh.
 * No PHP edit needed for a photo/flyer swap; the page renders every card
 * straight from the JSON array, see site/team/index.php's own docblock.
 */

/* CIQ-09 redesign: green full-bleed hero (shared mv-hero component), a soft
 * coloured band with waves behind a wide 4-column card grid, compact cards
 * whose long bios collapse behind "Mehr lesen". */

.team-wrap {
  max-width: 1360px;
  margin-inline: auto;
  padding-top: 0;
  padding-bottom: 0;
  padding-left: 24px;
  padding-right: 24px;
}
.team-wrap--eindruecke {
  max-width: 1040px;
  padding-top: 8px;
  padding-bottom: 80px;
}

.team-hero-sys .mv-hero__media img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center 35%;
}
.team-hero-sys .mv-hero__copy { gap: 14px; }

.team-band { margin-bottom: 0; }
.team-wrap--eindruecke .team-eindruecke { margin-top: 24px; }

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 24px;
  align-items: stretch;
}
/* Equal row heights while everything is collapsed; once a card is opened only
 * that card grows. */
@supports selector(:has(a)) {
  .team-grid:has(details[open]) { align-items: start; }
}

.team-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-1);
}

.team-card-photo {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--surface-2);
}
.team-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  display: block;
  border-radius: 0;
}

.team-card-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 10px;
  padding-top: 16px;
  padding-bottom: 12px;
  padding-left: 18px;
  padding-right: 18px;
}

.team-card-name {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 1.15rem;
}
.team-card-location {
  color: var(--text-2);
  font-size: 15px;
  margin: -6px 0 0;
}

.team-card-text { display: flex; flex-direction: column; gap: 8px; }
.team-card-bio {
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  margin: 0;
  text-wrap: pretty;
}

/* Collapse: the first paragraph is clamped to four lines while the rest lives
 * in a real <details>. :has() only lifts the clamp when the details opens;
 * without :has() support the first paragraph simply stays fully visible. */
.team-card-text { font-size: 15px; }
@supports selector(:has(a)) {
  .team-card-text:not(.is-full) { min-height: calc(4 * 1.55em); }
  .team-card-text:not(.is-full) > .team-card-bio {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .team-card-body:has(details[open]) .team-card-text { min-height: 0; }
  .team-card-body:has(details[open]) .team-card-text > .team-card-bio {
    display: block;
    overflow: visible;
  }
}
.team-card-rest { display: flex; flex-direction: column; gap: 8px; padding-bottom: 8px; }

.team-card-more { margin: 0; }
.team-card-more summary {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--accent-text);
  font-weight: 600;
  font-size: 15px;
  list-style: none;
}
.team-card-more summary::-webkit-details-marker { display: none; }
.team-card-more summary::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  margin-top: -3px;
  transition: transform .15s ease;
}
.team-card-more[open] summary::after { transform: rotate(-135deg); margin-top: 3px; }
.team-card-more summary:hover { text-decoration: underline; }
.team-card-more summary:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; border-radius: 2px; }
.team-card-more .less { display: none; }
.team-card-more[open] .more { display: none; }
.team-card-more[open] .less { display: inline; }

.team-card-actions {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 16px;
  row-gap: 0;
  border-top: 1px solid var(--line-soft);
  padding-top: 4px;
}

.team-card-instagram,
.team-card-flyer {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  color: var(--accent-text);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}
.team-card-instagram svg { width: 22px; height: 22px; flex: none; }
.team-card-instagram:hover,
.team-card-flyer:hover { text-decoration: underline; }
/* download tray glyph (open box), distinct from the expand chevron */
.team-card-flyer::before {
  content: "";
  width: 12px;
  height: 8px;
  border-bottom: 2px solid currentColor;
  border-left: 2px solid currentColor;
  border-right: 2px solid currentColor;
  box-sizing: border-box;
  margin-right: 2px;
}

.team-card-flyer-pending {
  color: var(--text-2);
  font-size: 15px;
  font-style: italic;
}

/* --- team-eindruecke (JBC-25, CMQ-02) ---------------------------------
   Link cards to the three activity pages (video + gallery live there now).
   Longhand padding, same shorthand-clobber reasoning as the file header. */
.team-eindruecke {
  margin-top: 56px;
  padding-top: 40px;
  border-top: 1px solid var(--line-soft);
}
.team-eindruecke h2 { margin: 0 0 8px; }
.team-eindruecke-intro { color: var(--text-2); margin: 0 0 28px; }
.team-eindruecke-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
}
.team-eindruecke-link {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  text-decoration: none;
  color: var(--text);
}
.team-eindruecke-link img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}
.team-eindruecke-link-title { font-family: var(--font-heading); font-size: 1.1rem; }
.team-eindruecke-link-more { color: var(--accent-text); font-weight: 700; }
.team-eindruecke-link:hover .team-eindruecke-link-more,
.team-eindruecke-link:focus-visible .team-eindruecke-link-more { text-decoration: underline; }
.team-eindruecke-link:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 4px; }
