/* ==========================================================================
   Blok — Team-grid: portretkaarten (foto 4/5, naam, functie) met optioneel
   filter op rol. Mobiel 2 kolommen, tablet 3, desktop 4 (groot team vanaf
   1240px 5).
   Geen witte kaarten: het portret is het vlak, de naam staat eronder (rustiger
   bij 20+ mensen). De hele kaart is klikbaar via de naam-link.
   ========================================================================== */
.b-team-grid {
  --b-team-radius: var(--r-md);
  --b-team-foto-bg: var(--grijs);
}
.b-team-grid.band--roze { --b-team-foto-bg: var(--wit); }
.b-team-grid.band--navy { --b-team-foto-bg: var(--navy-80); }
@media (min-width: 720px) {
  .b-team-grid { --b-team-radius: var(--r-lg); }
}

/* --- Filter ----------------------------------------------------------- */
.b-team-grid__filter[hidden] { display: none; }
.b-team-grid__filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem 1.25rem;
  margin-top: calc(-1 * clamp(.75rem, .25rem + 1.25vw, 1.5rem));
  margin-bottom: clamp(2rem, 1.5rem + 1.5vw, 3rem);
}
.b-team-grid__filter-label {
  font-size: var(--fs-small);
  font-weight: var(--fw-bold);
  color: var(--tekst-zacht);
}
/* Mobiel spreken de knoppen voor zich; het label blijft voor screenreaders
   (aria-labelledby van de knoppengroep) */
@media (max-width: 639.98px) {
  .b-team-grid__filter-label {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}
.b-team-grid__knoppen {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.b-team-grid__knop {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  min-height: 44px;
  padding: .5rem .6rem .5rem 1.05rem;
  border: 1.5px solid var(--lijn);
  border-radius: var(--r-pill);
  background: var(--wit);
  color: var(--navy);
  font-size: var(--fs-small);
  font-weight: var(--fw-bold);
  line-height: 1.2;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.b-team-grid__knop:hover { border-color: var(--navy); }
.b-team-grid__knop[aria-pressed="true"] {
  border-color: var(--navy);
  background: var(--navy);
  color: var(--wit);
}
.b-team-grid__aantal {
  display: inline-grid;
  place-items: center;
  min-width: 1.75rem;
  height: 1.75rem;
  padding-inline: .45rem;
  border-radius: var(--r-pill);
  background: var(--grijs-licht);
  color: var(--tekst-zacht);
  font-size: var(--fs-xs);
  font-variant-numeric: tabular-nums;
}
.b-team-grid__knop[aria-pressed="true"] .b-team-grid__aantal { background: var(--roze); color: var(--navy); }

/* Op navy: transparante knoppen met lichte rand, gekozen knop wit */
.b-team-grid.band--navy .b-team-grid__knop {
  border-color: rgba(255, 255, 255, .3);
  background: transparent;
  color: var(--wit);
}
.b-team-grid.band--navy .b-team-grid__knop:hover { border-color: var(--wit); }
.b-team-grid.band--navy .b-team-grid__knop[aria-pressed="true"] { border-color: var(--wit); background: var(--wit); color: var(--navy); }
.b-team-grid.band--navy .b-team-grid__aantal { background: rgba(255, 255, 255, .12); color: var(--wit); }
.b-team-grid.band--navy .b-team-grid__knop[aria-pressed="true"] .b-team-grid__aantal { background: var(--roze); color: var(--navy); }

/* --- Grid ------------------------------------------------------------- */
.b-team-grid__lijst {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.75rem, 1.25rem + 1.5vw, 2.75rem) clamp(.875rem, .5rem + 1.2vw, 1.75rem);
  margin: 0;
}
@media (min-width: 720px) {
  .b-team-grid__lijst { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  /* Selectie van 4 of 8: vier kolommen, geen losse portretten */
  .b-team-grid--vier .b-team-grid__lijst { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .b-team-grid__lijst { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
/* Groot team (meer dan 12): vijf kolommen vanaf 1240px */
@media (min-width: 1240px) {
  .b-team-grid--veel .b-team-grid__lijst { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
.b-team-grid__item { display: flex; }
.b-team-grid__item[hidden] { display: none; }

/* --- Kaart ------------------------------------------------------------ */
/* Naam en functie staan in de broncode vóór de foto (screenreaders horen
   eerst wie het is); visueel staat de foto bovenaan. */
.b-team-grid__lid {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  border-radius: var(--b-team-radius);
}

.b-team-grid__foto {
  order: -1;
  position: relative;
  aspect-ratio: 4 / 5;
  margin-bottom: clamp(.85rem, .7rem + .5vw, 1.15rem);
  overflow: hidden;
  border-radius: var(--b-team-radius);
  background: var(--b-team-foto-bg);
  isolation: isolate;
}
.b-team-grid__foto img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 35%;
  transition: transform .6s var(--ease);
}

/* Zonder portret: initialen op een zacht vlak */
.b-team-grid__foto--leeg {
  display: grid;
  place-items: center;
  background: var(--roze-licht);
}
.b-team-grid__initialen {
  font-size: clamp(2rem, 1.4rem + 2.4vw, 3.4rem);
  font-weight: var(--fw-display);
  letter-spacing: .02em;
  color: var(--navy);
}
.b-team-grid.band--roze .b-team-grid__foto--leeg { background: var(--wit); }
.b-team-grid.band--navy .b-team-grid__foto--leeg { background: var(--navy-80); }
.b-team-grid.band--navy .b-team-grid__initialen { color: var(--wit); }

.b-team-grid__naam {
  font-size: var(--fs-h4);
  font-weight: var(--fw-bold);
  line-height: 1.3;
  letter-spacing: 0;
}
.b-team-grid__naam a {
  color: inherit;
  text-decoration: none;
  text-decoration-thickness: 1px;
  text-underline-offset: .2em;
}
/* Hele kaart klikbaar via de naam */
.b-team-grid__naam a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: var(--b-team-radius);
}

.b-team-grid__functie {
  margin-top: .3rem;
  font-size: var(--fs-small);
  line-height: 1.4;
  color: var(--tekst-zacht);
}

/* Pijl-cirkel rechtsonder op de foto: verschijnt bij hover en focus */
.b-team-grid__pijl {
  position: absolute;
  right: clamp(.6rem, .4rem + .5vw, .9rem);
  bottom: clamp(.6rem, .4rem + .5vw, .9rem);
  z-index: 1;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: var(--navy);
  color: var(--wit);
  box-shadow: var(--shadow-sm);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.b-team-grid__pijl-icoon { width: 1.1rem; height: 1.1rem; transition: transform var(--dur) var(--ease); }
.b-team-grid.band--navy .b-team-grid__pijl { background: var(--wit); color: var(--navy); }

.b-team-grid__lid:hover .b-team-grid__foto img { transform: scale(1.04); }
.b-team-grid__lid:hover .b-team-grid__naam a { text-decoration-line: underline; }
.b-team-grid__lid:is(:hover, :focus-within) .b-team-grid__pijl { opacity: 1; transform: none; }
.b-team-grid__lid:is(:hover, :focus-within) .b-team-grid__pijl-icoon { transform: translateX(2px); }

/* Focusring om de hele kaart, met wat lucht rond naam en functie; zonder
   :has() blijft hij op de link */
@supports selector(:has(a)) {
  .b-team-grid__naam a:focus-visible { box-shadow: none; }
  .b-team-grid__lid:has(a:focus-visible)::before {
    content: "";
    position: absolute;
    inset: -.5rem;
    border-radius: calc(var(--b-team-radius) + .5rem);
    box-shadow: var(--focus);
    outline: 2px solid transparent; /* zichtbaar in forced-colors */
    pointer-events: none;
  }
}

/* Smalle kolommen (mobiel, en vier kolommen op tablet): kleinere pijl,
   compactere naam */
@media (min-width: 720px) and (max-width: 1023.98px) {
  .b-team-grid--vier .b-team-grid__naam { font-size: 1.0625rem; }
  .b-team-grid--vier .b-team-grid__functie { font-size: var(--fs-xs); }
}
@media (max-width: 479.98px) {
  .b-team-grid__naam { font-size: 1.0625rem; }
  .b-team-grid__functie { font-size: var(--fs-xs); }
  .b-team-grid__pijl { width: 2.25rem; height: 2.25rem; }
  .b-team-grid__pijl-icoon { width: .95rem; height: .95rem; }
}

@media (forced-colors: active) {
  .b-team-grid__knop[aria-pressed="true"] { outline: 3px solid CanvasText; outline-offset: 2px; }
}
