/* Institution pages (UI-044): the index of institutions and one page per
   institution. One sheet, loaded only by a page that renders one (html.ts
   looks for data-inst-region). The institution mark is the shared .inst-logo
   box (product-detail.css); the product rows on an institution page are the
   category list's rows (product-rows.css). Sizes and colours resolve to
   tokens; the few local sizes sit in :root. */

:root {
  --inst-tap: 2.75rem;
  --inst-row-min: 21rem;
  --inst-mono: 0.82rem;
}

/* ---------- group links under the head (kinds on the index, categories on a page) ---------- */

.inst-jump { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-4) 0 0; padding: 0; list-style: none; }
.inst-jump a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-block-size: var(--inst-tap);
  padding-inline: var(--space-4);
  border: 1px solid var(--color-border-strong);
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-mono);
  font-size: var(--inst-mono);
  text-decoration: none;
  transition: background var(--duration-fast), border-color var(--duration-fast);
}
.inst-jump a:hover { background: var(--color-accent-soft); }
.inst-jump b { color: var(--color-accent-text); font-variant-numeric: tabular-nums; }

/* ---------- groups ---------- */

.inst-group { padding-block-start: var(--space-6); }
.inst-group:first-child { padding-block-start: 0; }
.inst-group-title {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  margin: 0 0 var(--space-4);
  font-family: var(--font-display);
  font-size: var(--text-heading-sm);
  font-weight: var(--weight-bold);
  line-height: var(--leading-heading);
}
.inst-group-n {
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: var(--inst-mono);
  font-weight: var(--weight-regular);
  font-variant-numeric: tabular-nums;
}

/* ---------- index rows: mark, name, products per category ---------- */

.inst-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--inst-row-min)), 1fr));
  column-gap: var(--space-6);
  margin: 0;
  padding: 0;
  list-style: none;
  border-block-start: 1px solid var(--color-border);
}
.inst-row { border-block-end: 1px solid var(--color-border); }
.inst-link {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-block-size: var(--inst-tap);
  margin-inline: calc(-1 * var(--space-3));
  padding: var(--space-4) var(--space-3);
  color: var(--color-text);
  text-decoration: none;
}
.inst-link:hover { background: var(--color-bg-subtle); }
.inst-link:focus-visible { outline: 0.1875rem solid var(--color-focus); outline-offset: calc(-1 * var(--space-1)); }
/* The shared mark pads itself by a share of its slot width, so it needs a
   slot of its own: a bare flex child would take the whole row as its slot. */
.inst-mark { flex: none; inline-size: 4.5rem; }
.inst-text { min-inline-size: 0; }
.inst-name {
  display: block;
  font-size: var(--text-body-lg);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-heading);
  overflow-wrap: anywhere;
}
.inst-link:hover .inst-name { color: var(--color-accent-text); }
.inst-cats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-3);
  margin-block-start: var(--space-1);
  color: var(--color-text-muted);
  font-size: var(--text-label);
}
.inst-cats b { color: var(--color-text); font-weight: var(--weight-semibold); font-variant-numeric: tabular-nums; }

/* ---------- institution page head: mark beside the name, then two facts ---------- */

.inst-title { display: flex; align-items: center; gap: var(--space-4); margin-block-start: var(--space-5); }
.inst-title h1 { margin: 0; }
.inst-facts {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2) var(--space-5);
  margin: var(--space-4) 0 0;
  color: var(--color-text-muted);
  font-size: var(--text-label);
}
.inst-official {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-block-size: var(--inst-tap);
  color: var(--color-accent-text);
  font-weight: var(--weight-semibold);
  text-underline-offset: 0.2em;
}
.inst-official:hover { color: var(--color-text); }
.inst-host { color: var(--color-text-muted); font-family: var(--font-mono); font-size: var(--inst-mono); font-weight: var(--weight-regular); }
.inst-reviewed time { color: var(--color-text); font-family: var(--font-mono); font-size: var(--inst-mono); }

@media (min-width: 768px) {
  .inst-title { gap: var(--space-5); }
}
