/* ── Logo cards ── */
.member-logo-card {
  position: relative;
  width: 100%;
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease;
}

.member-logo-card:hover {
  border-color: color-mix(in oklab, var(--primary) 35%, var(--border));
  box-shadow: var(--shadow-soft);
}

.member-logo-card:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.member-logo-card.is-active {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

.member-logo-card__toggle {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted-foreground);
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1;
  pointer-events: none;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.member-logo-card.is-active .member-logo-card__toggle {
  color: var(--primary);
  border-color: color-mix(in oklab, var(--primary) 30%, var(--border));
  background: color-mix(in oklab, var(--primary) 8%, white);
}

/* ── Detail panel (full-width grid row) ── */
.member-detail-panel {
  grid-column: 1 / -1;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transform: translateY(-6px);
  transition:
    max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.3s ease,
    transform 0.3s ease,
    margin 0.3s ease;
  margin-top: 0;
  pointer-events: none;
}

.member-detail-panel.is-open {
  max-height: 600px; /* large enough for content; JS can refine on open */
  opacity: 1;
  transform: translateY(0);
  margin-top: 0.25rem;
  pointer-events: auto;
}

.member-detail-panel__shell {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--card);
  box-shadow: var(--shadow-soft);
  padding: 1.25rem;
}

/* Caret pointing up to active logo */
.member-detail-panel__caret {
  position: absolute;
  top: -0.55rem;
  left: var(--caret-left, 50%);
  width: 1rem;
  height: 1rem;
  background: var(--card);
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
  transform: translateX(-50%) rotate(45deg);
  transition: left 0.25s ease;
}

.member-detail-panel__inner {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .member-detail-panel__inner {
    grid-template-columns: minmax(140px, 220px) 1fr;
    align-items: start;
    gap: 2rem;
  }
}

.member-detail-panel__logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 7rem;
  padding: 1.25rem;
  border-radius: 0.875rem;
  border: 1px dashed color-mix(in oklab, var(--border) 80%, var(--primary));
  background: var(--mist);
}

.member-detail-panel__logo {
  max-height: 4.5rem;
  max-width: 100%;
  object-fit: contain;
}

.member-detail-panel__body {
  position: relative;
  padding-right: 2rem;
}

.member-detail-panel__close {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted-foreground);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.member-detail-panel__close:hover {
  color: var(--primary);
  border-color: color-mix(in oklab, var(--primary) 25%, var(--border));
  background: color-mix(in oklab, var(--primary) 6%, white);
}

.member-detail-panel__close:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.member-detail-panel__title {
  font-size: clamp(1.35rem, 2vw, 1.75rem);
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
}

.member-detail-panel__assets {
  display: inline-block;
  max-width: 100%;
  margin-top: 0.85rem;
  padding: 0.45rem 1rem 0.45rem 0.85rem;
  border-left: 3px solid var(--secondary);
  /* border-radius: 0.55rem; */
  background: linear-gradient(90deg,
      color-mix(in oklab, var(--secondary) 14%, white) 0%,
      color-mix(in oklab, var(--secondary) 7%, white) 55%,
      transparent 100%);
  color: var(--secondary);
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.member-detail-panel__assets[hidden] {
  display: none;
}

.member-detail-panel__text {
  margin-top: 0.75rem;
  font-size: 0.975rem;
  line-height: 1.65;
  color: var(--muted-foreground);
}

.member-detail-panel__link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 1.25rem;
  font-size: 0.925rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.member-detail-panel__link:hover {
  color: var(--secondary);
}

.member-detail-panel__link::after {
  content: "→";
  transition: transform 0.2s ease;
}

.member-detail-panel__link:hover::after {
  transform: translateX(3px);
}

/* Mobile: hide caret (columns shift too much) */
@media (max-width: 767px) {
  .member-detail-panel__caret {
    display: none;
  }

  .member-detail-panel__body {
    padding-right: 0;
    padding-top: 0.25rem;
  }

  .member-detail-panel__close {
    top: -0.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .member-logo-card,
  .member-detail-panel,
  .member-detail-panel__caret,
  .member-detail-panel__link::after {
    transition: none !important;
  }
}

.member-detail-panel__text {
  white-space: pre-line;
}

/* Member portfolio table: keep all six columns readable on narrow screens. */
.members-aum__title {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  line-height: 1.2;
}

.members-aum__hint {
  margin-top: 0.75rem;
  color: var(--muted-foreground);
  font-size: 0.875rem;
  line-height: 1.5;
}

.members-aum__scroll {
  max-width: 100%;
  margin-top: 2rem;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--card);
  -webkit-overflow-scrolling: touch;
}

.members-aum__scroll:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 4px;
}

.members-aum__table {
  width: 100%;
  min-width: 1100px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--foreground);
  font-size: 0.875rem;
  line-height: 1.65;
  text-align: left;
}

.members-aum__caption {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.members-aum__investors { width: 24%; }
.members-aum__office { width: 12%; }
.members-aum__value { width: 7%; }
.members-aum__platform { width: 16%; }
.members-aum__managers { width: 27%; }
.members-aum__assets { width: 14%; }

.members-aum__table th,
.members-aum__table td {
  padding: 1rem;
  vertical-align: top;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.members-aum__table thead th {
  background: var(--primary);
  color: var(--primary-foreground);
  font-weight: 700;
  border-right-color: rgb(255 255 255 / 20%);
  border-bottom: 3px solid var(--secondary);
}

.members-aum__table tbody th {
  font-weight: 500;
}

.members-aum__table tbody tr:nth-child(odd) {
  background: color-mix(in srgb, var(--secondary) 8%, var(--card));
}

.members-aum__table tbody td:nth-child(2) {
  background: color-mix(in srgb, var(--secondary) 14%, var(--card));
  color: var(--primary);
  font-weight: 600;
}

.members-aum__table tbody td:nth-child(3) {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.members-aum__table tr > :last-child {
  border-right: 0;
}

.members-aum__table tbody tr:last-child > * {
  border-bottom: 0;
}

/* Scale down to a readable 12px minimum, then retain horizontal scrolling. */
@media (max-width: 1100px) {
  .members-aum__table {
    min-width: 760px;
    font-size: clamp(0.75rem, 1.27vw, 0.875rem);
  }

  .members-aum__table th,
  .members-aum__table td {
    padding: clamp(0.625rem, 1.1vw, 0.875rem);
  }
}

@media (max-width: 767px) {
  .members-aum__scroll {
    margin-top: 1.5rem;
  }

  .members-aum__title {
    font-size: clamp(1.5rem, 4vw, 1.75rem);
  }

  .members-aum__hint {
    font-size: 0.75rem;
  }

  .members-aum .eyebrow {
    font-size: 0.625rem;
  }
}
