/* ─── BecA Institutions Block ─────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600;700;800&display=swap');

:root {
  --beca-blue: #135AD5;
  --beca-accent: #07A5F6;
  --beca-green: #0E8A4A;
  --beca-muted: #667085;
  --beca-border: rgba(15, 23, 42, .09);
  --beca-font-family: "Open Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --beca-heading-color: #111827;
  --beca-muted-color: #667085;
  --beca-container-max: 1240px;
}

.beca-section { font-family: var(--beca-font-family); box-sizing: border-box; }
.beca-section *, .beca-section *::before, .beca-section *::after { box-sizing: inherit; }
.beca-inner { width: 100%; max-width: var(--beca-container-max, 1240px); margin: 0 auto; padding: 0; }
.beca-institutions {
  width: 100%;
  padding-left: 0;
  padding-right: 0;
  margin-left: 0;
  margin-right: 0;
}

/* Eyebrow / heading / subheading ─────────────────────────────────── */
.eyebrow {
  margin: 0 0 .65rem;
  display: inline-block;
  position: relative;
  padding-left: 15px;
  color: var(--beca-accent);
  font-size: .85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  line-height: 1.4;
}
.eyebrow::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 3px;
  height: 100%;
  border-radius: 2px;
  background: var(--beca-accent);
}
.heading {
  margin: 0 0 clamp(.55rem, 1vh, .85rem);
  color: var(--beca-heading-color);
  font-size: clamp(1.65rem, 2.65vw, 2.55rem);
  font-weight: 500;
  line-height: 1.16;
  letter-spacing: -.018em;
}
.subheading {
  width: 100%;
  max-width: var(--beca-container-max, 1240px);
  margin: 1rem auto 0;
  color: var(--beca-muted-color);
  font-size: clamp(.95rem, 1.1vw, 1.08rem);
  font-weight: 400;
  line-height: 1.62;
}

/* Section header ──────────────────────────────────────────────────── */
.beca-institutions__header { margin-bottom: 42px; }

/* Region navigation ───────────────────────────────────────────────── */
.beca-inst-controls {
  display: flex;
  align-items: center;
  margin-bottom: 30px;
  padding: 0;
  border: 0;
}

.beca-inst-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  width: 100%;
  padding: 4px;
  border: 0;
  border-radius: 12px;
  background: rgba(15, 23, 42, .045);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .025);
}

.beca-inst-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 10px 18px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #667085;
  cursor: pointer;
  font-family: var(--beca-font-family);
  font-size: .875rem;
  font-weight: 700;
  line-height: 1;
  transition: background-color .16s ease, color .16s ease, box-shadow .16s ease;
}

.beca-inst-tab:hover:not(.is-active) {
  background: rgba(255, 255, 255, .58);
  color: #344054;
}

.beca-inst-tab:focus-visible {
  outline: 3px solid rgba(7, 165, 246, .22);
  outline-offset: 2px;
}

.beca-inst-tab.is-active {
  background: #fff;
  color: var(--beca-blue);
  box-shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 5px 14px rgba(15, 23, 42, .045);
}

.beca-inst-tab__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(19, 90, 213, .08);
  color: var(--beca-blue);
  font-size: .68rem;
  font-weight: 700;
  line-height: 1;
}

.beca-inst-tab.is-active .beca-inst-tab__count {
  background: rgba(19, 90, 213, .10);
  color: var(--beca-blue);
}

/* Region panels ───────────────────────────────────────────────────── */
.beca-inst-panel { display: none; }
.beca-inst-panel.is-active { display: block; }

/* Type filter chips ───────────────────────────────────────────────── */
.beca-inst-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 28px;
}

.beca-inst-filter {
  padding: 8px 15px;
  border: 1px solid rgba(15, 23, 42, .10);
  border-radius: 999px;
  background: rgba(255, 255, 255, .78);
  color: #667085;
  cursor: pointer;
  font-family: var(--beca-font-family);
  font-size: .75rem;
  font-weight: 700;
  line-height: 1.2;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.beca-inst-filter:hover:not(.is-active) {
  background: #f8fafc;
  border-color: rgba(19, 90, 213, .20);
  color: #344054;
}

.beca-inst-filter:focus-visible {
  outline: 3px solid rgba(7, 165, 246, .22);
  outline-offset: 2px;
}

.beca-inst-filter.is-active {
  background: var(--beca-blue);
  border-color: var(--beca-blue);
  color: #fff;
}

/* Institution cards ───────────────────────────────────────────────── */
.beca-inst-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.beca-inst-badge {
  min-width: 0;
  min-height: 112px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 20px 20px;
  border: 1px solid rgba(0, 0, 0, .07);
  border-radius: 0;
  background: #ffffff;
  box-shadow: none;
  cursor: default;
  transition: box-shadow .3s, transform .3s;
}

.beca-inst-badge:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, .1);
}

.beca-inst-badge[hidden] { display: none; }

/* Card icon ───────────────────────────────────────────────────────── */
.beca-inst-badge__icon {
  width: 48px;
  height: 48px;
  border-radius: 13px;
  flex-shrink: 0;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 19px;
}
.beca-inst-badge__icon--university { background-color:#EEF4FF; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23135AD5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='7' width='20' height='14' rx='2' ry='2'/%3E%3Cpath d='M16 21V5a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16'/%3E%3C/svg%3E"); }
.beca-inst-badge__icon--research_institute { background-color:#EDFAF4; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%230E8A4A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18'/%3E%3C/svg%3E"); }
.beca-inst-badge__icon--regional_agency { background-color:#F5F0FF; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%237C3AED' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='2' y1='12' x2='22' y2='12'/%3E%3Cpath d='M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1 4-10z'/%3E%3C/svg%3E"); }
.beca-inst-badge__icon--cgiar_centre { background-color:#FFF7ED; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23C2610F' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='22 12 18 12 15 21 9 3 6 12 2 12'/%3E%3C/svg%3E"); }
.beca-inst-badge__icon--au_body { background-color:#FFF0F0; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23DC2626' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/%3E%3Cpolyline points='9 22 9 12 15 12 15 22'/%3E%3C/svg%3E"); }
.beca-inst-badge__icon--foundation { background-color:#F0F9FF; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%230284C7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z'/%3E%3C/svg%3E"); }
.beca-inst-badge__icon--industry_player { background-color:#EEF7F3; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%230F766E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 21h18'/%3E%3Cpath d='M5 21V10l5 3V10l5 3V6h4v15'/%3E%3C/svg%3E"); }
.beca-inst-badge__icon--development_agency { background-color:#FEF9EC; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2392400E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='23 6 13.5 15.5 8.5 10.5 1 18'/%3E%3Cpolyline points='17 6 23 6 23 12'/%3E%3C/svg%3E"); }

/* Card text ───────────────────────────────────────────────────────── */
.beca-inst-badge__body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.beca-inst-badge__name {
  color: #101828;
  font-size: .94rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -.01em;
}

.beca-inst-badge__country {
  color: #667085;
  font-size: .76rem;
  font-weight: 400;
  line-height: 1.35;
}

/* Type pill ───────────────────────────────────────────────────────── */
.beca-inst-badge__type {
  align-self: center;
  padding: 5px 9px;
  border-radius: 999px;
  white-space: nowrap;
  font-size: .64rem;
  font-weight: 700;
  letter-spacing: .01em;
}
.beca-inst-badge__type--university { background:#EEF4FF; color:var(--beca-blue); }
.beca-inst-badge__type--research_institute { background:#EDFAF4; color:var(--beca-green); }
.beca-inst-badge__type--regional_agency { background:#F5F0FF; color:#7C3AED; }
.beca-inst-badge__type--cgiar_centre { background:#FFF7ED; color:#C2610F; }
.beca-inst-badge__type--au_body { background:#FFF0F0; color:#DC2626; }
.beca-inst-badge__type--foundation { background:#F0F9FF; color:#0284C7; }
.beca-inst-badge__type--development_agency { background:#FEF9EC; color:#92400E; }
.beca-inst-badge__type--industry_player { background:#EEF7F3; color:#0F766E; }

/* Empty state ─────────────────────────────────────────────────────── */
.beca-inst-empty {
  padding: 48px 0;
  color: var(--beca-muted);
  font-size: .875rem;
  font-style: italic;
}

/* Admin list builder badges ───────────────────────────────────────── */
.beca-inst-badge.beca-inst-badge--university { background:#EEF4FF; color:var(--beca-blue); }
.beca-inst-badge.beca-inst-badge--research_institute { background:#EDFAF4; color:var(--beca-green); }
.beca-inst-badge.beca-inst-badge--regional_agency { background:#F5F0FF; color:#7C3AED; }
.beca-inst-badge.beca-inst-badge--cgiar_centre { background:#FFF7ED; color:#C2610F; }
.beca-inst-badge.beca-inst-badge--au_body { background:#FFF0F0; color:#DC2626; }
.beca-inst-badge.beca-inst-badge--foundation { background:#F0F9FF; color:#0284C7; }
.beca-inst-badge.beca-inst-badge--development_agency { background:#FEF9EC; color:#92400E; }
.beca-inst-badge.beca-inst-badge--industry_player { background:#EEF7F3; color:#0F766E; }
.beca-inst-badge.beca-inst-badge--region-africa { background:#EDFAF4; color:var(--beca-green); }
.beca-inst-badge.beca-inst-badge--region-international { background:#EEF4FF; color:var(--beca-blue); }

td .beca-inst-badge {
  display: inline-block;
  min-height: 0;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: .7rem;
  font-weight: 700;
  line-height: 1.5;
  box-shadow: none;
}

td .beca-inst-badge:hover {
  transform: none;
  box-shadow: none;
}

/* Summary strip (admin list) ─────────────────────────────────────── */
.beca-inst-summary {
  margin-bottom: 16px;
  padding: 12px 16px;
  border: 1px solid rgba(19, 90, 213, .12);
  border-radius: 8px;
  background: #f0f4ff;
  color: #374151;
  font-size: .875rem;
}

/* Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 1280px) {
  .beca-inner { width: calc(100% - 40px); }
}

@media (max-width: 1020px) {
  .beca-inst-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .beca-institutions {
    padding-top: var(--beca-inst-pad-top, 5.5rem);
    padding-bottom: var(--beca-inst-pad-bottom, 6rem);
  }
  .beca-inner { width: calc(100% - 36px); padding: 0; }
 .beca-inst-controls { overflow-x: auto; padding-bottom: 16px; }
  .beca-inst-tabs { flex-shrink: 0; }
  .beca-inst-grid { grid-template-columns: 1fr; gap: 14px; }
  .beca-inst-badge { grid-template-columns: 46px minmax(0, 1fr); min-height: 104px; padding: 18px; }
  .beca-inst-badge__icon { width: 46px; height: 46px; }
  .beca-inst-badge__type { grid-column: 2; justify-self: start; align-self: start; margin-top: 2px; }
}

@media (max-width: 460px) {
  .beca-inst-tab { padding: 10px 13px; }
  .beca-inst-tab__count { min-width: 23px; height: 23px; }
  .beca-inst-badge__type { display: none; }
}


/* Secondary institution classification tabs. */
.beca-inst-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.beca-inst-filter__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 21px;
  height: 21px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, .06);
  color: inherit;
  font-size: .66rem;
  line-height: 1;
}

.beca-inst-filter.is-active .beca-inst-filter__count {
  background: rgba(255,255,255,.18);
}

.beca-inst-badge__type--subcategory-universities,
.beca-inst-badge.beca-inst-badge--subcategory-universities { background:#EEF4FF; color:#135AD5; }
.beca-inst-badge__type--subcategory-research_institutes,
.beca-inst-badge.beca-inst-badge--subcategory-research_institutes { background:#EDFAF4; color:#0E8A4A; }
.beca-inst-badge__type--subcategory-private_sector,
.beca-inst-badge.beca-inst-badge--subcategory-private_sector { background:#FFF7ED; color:#C2610F; }
.beca-inst-badge__type--subcategory-funding_partner,
.beca-inst-badge.beca-inst-badge--subcategory-funding_partner { background:#F0F9FF; color:#0369A1; }
.beca-inst-badge__type--subcategory-rd_consortium,
.beca-inst-badge.beca-inst-badge--subcategory-rd_consortium { background:#F5F0FF; color:#7C3AED; }
