/* ==========================================================================
   Partner Institutions — Figma "Partner institutions" (193:2729)
   Light masthead (nav colours come from body[data-header="light"]),
   filterable partner directory, partnership invitation CTA.
   ========================================================================== */
:root {
  --pi-ink: #172033;
  --pi-muted: #576477;
  --pi-line: #e4e9f0;
}

.i-search { --i: url("data:image/svg+xml,%3C%21-- %40license lucide-static v1.68.0 - ISC --%3E%3Csvg%0A  class=%22lucide lucide-search%22%0A  xmlns=%22http://www.w3.org/2000/svg%22%0A  width=%2224%22%0A  height=%2224%22%0A  viewBox=%220 0 24 24%22%0A  fill=%22none%22%0A  stroke=%22currentColor%22%0A  stroke-width=%222%22%0A  stroke-linecap=%22round%22%0A  stroke-linejoin=%22round%22%0A%3E%3Cpath d=%22m21 21-4.34-4.34%22 /%3E%3Ccircle cx=%2211%22 cy=%2211%22 r=%228%22 /%3E%3C/svg%3E") /* icon: institutions-search.svg */; }
.i-chevron-down { --i: url("data:image/svg+xml,%3C%21-- %40license lucide-static v1.68.0 - ISC --%3E%3Csvg%0A  class=%22lucide lucide-chevron-down%22%0A  xmlns=%22http://www.w3.org/2000/svg%22%0A  width=%2224%22%0A  height=%2224%22%0A  viewBox=%220 0 24 24%22%0A  fill=%22none%22%0A  stroke=%22currentColor%22%0A  stroke-width=%222%22%0A  stroke-linecap=%22round%22%0A  stroke-linejoin=%22round%22%0A%3E%3Cpath d=%22m6 9 6 6 6-6%22 /%3E%3C/svg%3E") /* icon: institutions-chevron-down.svg */; }

/* ------------------------------------------------------------ PAGE HEADER */
.page-head {
  background: var(--slate-50);
  padding: clamp(128px, 6.5rem + 6vw, 207px) 0 clamp(40px, 1.8rem + 1.6vw, 60px);
}
.page-head__inner { display: flex; flex-direction: column; gap: 14px; }
.crumbs ol { display: flex; flex-wrap: wrap; margin: 0; padding: 0; list-style: none; }
.crumbs li { font-size: var(--fs-16); color: var(--slate-400); }
.crumbs li + li::before { content: "/"; margin: 0 .3em; color: var(--slate-400); }
.crumbs a { transition: color .3s; }
.crumbs a:hover { color: var(--tb-500); }
.crumbs a[aria-current] { color: var(--tb-500); }
.page-head__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.125rem, 1.7rem + 1.9vw, 3.5rem); /* 34 → 56 */
  line-height: 1.12;
  color: var(--black);
}
.page-head__lead { font-size: var(--fs-18); line-height: 1.6; color: var(--pi-muted); }

/* ------------------------------------------------------------ DIRECTORY */
.directory { padding: clamp(40px, 2rem + 1.6vw, 64px) 0 clamp(48px, 2.4rem + 1.6vw, 74px); }
.directory__intro {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-md) var(--space-lg);
}
.directory__heading { display: flex; flex-direction: column; gap: 10px; max-width: 740px; }
.directory__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-42);
  line-height: 1.2;
  color: var(--black);
}
.directory__guide { font-size: var(--fs-16); line-height: 1.6; color: var(--pi-muted); }

.search {
  position: relative;
  flex: 0 1 386px;
  display: flex; align-items: center; gap: 12px;
  height: 56px;
  padding: 0 8px 0 18px;
  background: var(--white);
  border: 1px solid var(--pi-line);
  border-radius: 8px;
  transition: border-color .3s, box-shadow .3s;
}
.search:hover { border-color: var(--slate-300); }
.search:focus-within { border-color: var(--tb-400); box-shadow: 0 0 0 4px rgba(65, 106, 210, .14); }
.search__icon { width: 20px; height: 20px; color: var(--pi-muted); }
.search__input {
  flex: 1; min-width: 0; height: 100%;
  border: 0; outline: 0; background: transparent;
  font-size: var(--fs-14); color: var(--pi-ink);
}
.search__input::placeholder { color: var(--pi-muted); opacity: 1; }
.search__input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.search__clear {
  width: 40px; height: 40px; flex: none; border-radius: 6px;
  display: grid; place-items: center;
  font-size: 22px; line-height: 1; color: var(--pi-muted);
  transition: background .25s, color .25s;
}
.search__clear[hidden] { display: none; }
.search__clear:hover { background: var(--slate-100); color: var(--pi-ink); }

/* Category chips */
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }
.chip {
  height: 44px; padding: 0 20px;
  border-radius: 8px;
  background: var(--slate-50);
  color: var(--pi-muted);
  font-size: var(--fs-14); line-height: 20px;
  white-space: nowrap;
  transition: background .35s var(--ease-out), color .35s var(--ease-out), transform .35s var(--ease-out), box-shadow .35s var(--ease-out);
}
.chip:hover { background: var(--tb-50); color: var(--tb-500); transform: translateY(-2px); }
.chip.is-active { background: var(--tb-500); color: var(--white); box-shadow: 0 10px 24px -14px rgba(16, 46, 156, .8); }
.chip.is-active:hover { transform: none; }

/* Count + sort row */
.dir-meta {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-top: 32px;
  padding: 8px 0 16px;
  border-bottom: 1px solid var(--pi-line);
  font-size: var(--fs-14);
  color: var(--pi-muted);
}
.dir-meta__sort {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; margin: -12px 0;
  color: var(--pi-muted);
  transition: color .3s;
}
.dir-meta__sort:hover { color: var(--tb-500); }
.dir-meta__chev { width: 16px; height: 16px; transition: transform .45s var(--ease-out); }
.dir-meta__sort[data-order="desc"] .dir-meta__chev { transform: rotate(180deg); }

/* Grid */
.inst-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  margin: 32px 0 0; padding: 0; list-style: none;
}
.inst-card {
  position: relative;
  display: flex; flex-direction: column; gap: 20px;
  min-height: 252px;
  padding: 24px;
  background: var(--white);
  border: 1px solid var(--pi-line);
  border-radius: var(--radius);
  transition: transform .5s var(--ease-out), box-shadow .5s var(--ease-out), border-color .4s;
}
.inst-card[hidden] { display: none; }
.inst-card:hover {
  transform: translateY(-6px);
  border-color: var(--tb-200);
  box-shadow: 0 22px 40px -24px rgba(16, 46, 156, .38);
}
.inst-card__logo {
  height: 106px;
  display: grid; place-items: center;
}
.inst-card__logo img {
  width: min(236px, 100%); height: 96px; object-fit: contain;
  transition: transform .6s var(--ease-out);
}
.inst-card:hover .inst-card__logo img { transform: scale(1.04); }
.inst-card__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-18);
  line-height: 1.3;
  color: var(--pi-ink);
}
.inst-card__name mark { background: var(--tb-100); color: inherit; border-radius: 3px; padding: 0 1px; }

.dir-empty {
  margin-top: 32px;
  padding: clamp(32px, 2rem + 2vw, 64px) 24px;
  border: 1px dashed var(--slate-300);
  border-radius: var(--radius);
  background: var(--slate-50);
  text-align: center;
  display: grid; justify-items: center; gap: 8px;
}
.dir-empty[hidden] { display: none; }
.dir-empty__title { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-22); color: var(--pi-ink); }
.dir-empty__text { color: var(--pi-muted); margin-bottom: 12px; }

/* ------------------------------------------------------------ INVITATION */
.invite { padding: clamp(16px, 1rem + .8vw, 32px) 0 clamp(48px, 2.4rem + 2.4vw, 80px); }
.invite__stack { display: flex; flex-direction: column; align-items: center; gap: clamp(28px, 1.4rem + 1.2vw, 42px); }
.invite__quote {
  margin: 0;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.375rem, 1.2rem + .75vw, 1.875rem); /* 22 → 30 */
  line-height: 1.4;
  color: var(--tb-700);
}
.cta {
  position: relative;
  width: min(1294px, 100%);
  min-height: clamp(340px, 18rem + 4vw, 377px);
  background: var(--tb-600);
  border-radius: var(--radius);
  overflow: hidden;
  color: #fff;
  display: flex; align-items: center;
}
.cta__deco { position: absolute; right: 0; bottom: 0; width: clamp(280px, 44vw, 572px); height: auto; pointer-events: none; }
.cta__content {
  position: relative;
  display: flex; flex-direction: column; align-items: flex-start; gap: 18px;
  padding: clamp(32px, 1.5rem + 2vw, 52px) clamp(20px, 1rem + 2.6vw, 60px);
  max-width: 787px;
}
.cta__title { max-width: 627px; }
.cta__text { font-size: var(--fs-18); line-height: 1.5; }

/* ------------------------------------------------------------ RESPONSIVE */
@media (max-width: 1180px) {
  .inst-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .directory__intro { flex-direction: column; align-items: stretch; }
  .search { flex-basis: auto; }
  .inst-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .cta { align-items: flex-start; padding-bottom: clamp(140px, 30vw, 220px); }
  .cta__deco { width: clamp(260px, 70vw, 480px); }
}
@media (max-width: 640px) {
  .chips {
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
    margin-inline: calc(-1 * var(--gutter)); padding: 2px var(--gutter) 6px;
    scroll-padding-inline: var(--gutter);
  }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
  .inst-grid { gap: 12px; }
  .inst-card { min-height: 0; padding: 14px; gap: 12px; }
  .inst-card__logo { height: 72px; }
  .inst-card__logo img { height: 64px; }
  .inst-card__name { font-size: var(--fs-16); }
}
@media (max-width: 380px) {
  .dir-meta { flex-wrap: wrap; row-gap: 4px; }
}

/* ---- API-driven directory states ---- */
.inst-card__link { display: contents; color: inherit; }
.inst-card__initials {
  display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%;
  background: var(--tb-50); color: var(--tb-500); font-weight: 600; font-size: var(--fs-20); letter-spacing: .02em;
}
.inst-card--skeleton .inst-card__logo,
.inst-card--skeleton .inst-card__name {
  background: linear-gradient(90deg, var(--slate-100) 0%, #e8eef6 40%, var(--slate-100) 80%);
  background-size: 200% 100%;
  animation: inst-shimmer 1.3s ease-in-out infinite;
  border-radius: 8px; color: transparent;
}
.inst-card--skeleton .inst-card__name { width: 70%; min-height: 1.2em; }
@keyframes inst-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
