/*
  Bio — Website Refresh 2026 1e (Figma), "Team" frame, "Bio"
  component (Size=Third, State=Default/Hover/Open), plus the grid
  composition seen on the Company/Meet page.
  Component: https://www.figma.com/design/2W6CyIAW3cKDEqdv26CeE2/Website-Refresh-2026-1e?node-id=6032-44728
  Page usage: https://www.figma.com/design/2W6CyIAW3cKDEqdv26CeE2/Website-Refresh-2026-1e?node-id=6031-42584

  Requires tokens.css and typography.css to be loaded first. Pair
  with js/bio.js for the click-to-expand behaviour.

  Same aria-expanded-as-source-of-truth pattern as the Accordion: the
  whole card is a <button> (matches Figma's own Hover/Open states,
  which export as <button> — Default exports as a plain <div>, but
  that's just because Figma's code-gen picks a tag per state rather
  than a meaningful semantic difference; using <button> throughout is
  the correct choice for a click target).

  Hover and Open share the exact same background colour
  (Brand/Neutral/200) — Figma has no separate "Open + Hover" variant,
  so a single `:hover, [aria-expanded="true"]` rule covers both
  without needing to special-case hovering an already-open card.

  Row height is content-driven (CSS Grid's default auto-sizing) —
  opening a card's bio naturally grows its row and pushes subsequent
  rows down with no extra layout code needed for that part.
  align-items: start on the grid is what makes that safe: without it,
  grid's default "stretch" makes every OTHER card in that row grow to
  match the tall one too (empty space, no content) — each card must
  size to its own content regardless of a taller sibling.

  Only one bio open at a time (js/bio.js closes any other open card
  when one is clicked) — enforced in JS, not CSS, since CSS alone
  can't express "close every other element with this attribute."

  ANIMATION: .rs-bio__text-wrap uses the CSS grid-template-rows
  0fr -> 1fr technique to animate open/closed smoothly (200ms
  ease-out, matching Figma's Smart Animate settings) without
  measuring content height in JS — the inner .rs-bio__text needs
  overflow:hidden + min-height:0 for the row track to actually be
  able to collapse to zero. The 16px gap before the bio text is also
  animated (as this wrapper's margin-top, not the card's flex gap) so
  a closed card doesn't carry 16px of dead space it shouldn't have.
*/

.rs-bio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-48);
  align-items: start;
}

.rs-bio {
  display: flex;
  align-items: flex-start;
  width: 100%;
  min-width: 0;
  border: none;
  border-radius: var(--space-16);
  background-color: var(--color-neutral-100);
  cursor: pointer;
  text-align: left;
  transition: background-color 0.15s ease;
}
.rs-bio:hover,
.rs-bio[aria-expanded="true"] {
  background-color: var(--color-neutral-200);
}

.rs-bio__card {
  display: flex;
  flex-direction: column;
  flex: 1 1 0%;
  min-width: 0;
  padding: var(--space-16);
}

.rs-bio__content {
  display: flex;
  align-items: center;
  gap: var(--space-16);
  width: 100%;
}

.rs-bio__photo {
  flex-shrink: 0;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
}
.rs-bio__photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rs-bio__detail {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  flex: 1 1 0%;
  min-width: 0;
}

.rs-bio__name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: -0.5px;
  color: var(--color-neutral-900);
}

.rs-bio__role {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.4;
  color: var(--color-neutral-900);
}

.rs-bio__text-wrap {
  display: grid;
  grid-template-rows: 0fr;
  margin-top: 0;
  transition: grid-template-rows 200ms ease-out, margin-top 200ms ease-out;
}
.rs-bio[aria-expanded="true"] .rs-bio__text-wrap {
  grid-template-rows: 1fr;
  margin-top: var(--space-16);
}

.rs-bio__text {
  overflow: hidden;
  min-height: 0;
  /* browser default <p> margin isn't clippable by this element's own
     overflow:hidden (margin sits outside its box) — left in place it
     leaks through the 0fr collapse above and shows up as dead space
     on a closed card */
  margin: 0;
  width: 100%;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.4;
  color: var(--color-neutral-900);
}

@media (max-width: 768px) {
  .rs-bio-grid {
    grid-template-columns: 1fr;
  }
}
