/* =============================================================
   barrio_npm_prototype — /about/npm-affiliates tile grid + modal

   Reskin of the npm_affiliates view (page_1 display) as a 3-col
   responsive tile grid, mirroring the shipped partners chassis. Each
   tile is a modal-opening anchor (barrioNpmAffiliateModal, family-1
   template-clone modal registered in ModalRegistry).

   Sibling of partners.css — same rules with .np-partner-* →
   .np-affiliate-* class swap and --np-affiliate* colour tokens instead
   of --np-partner*. Kept as a separate file per D-1 (a) in
   affiliates-tile-grid-plan.md — future divergence between the two
   pages is easier when each owns its own CSS.

   Ships alongside AffiliateRowBuilder + row/grid/modal templates + the
   MODALS['affiliate'] registry entry.
   ============================================================= */

/* ---------- responsive grid ---------- */
.np-affiliate-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin: 24px 0 40px;
}
@media (max-width: 880px) {
  .np-affiliate-grid { grid-template-columns: repeat(2, 1fr); gap: 18px; }
}
@media (max-width: 560px) {
  .np-affiliate-grid { grid-template-columns: 1fr; }
}
.np-affiliate-grid-item { display: flex; }

/* Contextual-region pen wrapper (added by
   views-view-fields--npm-affiliates--page-1.html.twig for the per-node
   edit pen) sits between .np-affiliate-grid-item (flex parent) and
   .np-affiliate-card (flex-column child that needs width:100%). Passes
   the flex-fill through so the tile still stretches to the grid cell. */
.np-affiliate-grid-item > .np-affiliate-tile-region {
  display: flex;
  width: 100%;
}

/* ---------- tile ---------- */
.np-affiliate-card {
  display: flex; flex-direction: column;
  width: 100%;
  background: #fff;
  border: 1px solid #e4e0d8;
  border-top: 6px solid var(--np-affiliate);
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none; color: inherit;
  box-shadow: 0 1px 2px rgba(40,40,40,.05), 0 6px 18px rgba(40,40,40,.06);
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.np-affiliate-card:hover {
  transform: translateY(-3px);
  color: inherit;
  border-top-color: var(--np-affiliate-dk);
  box-shadow: 0 4px 10px rgba(40,40,40,.09), 0 16px 44px rgba(40,40,40,.10);
}
.np-affiliate-strip { /* top strip is the border-top above; kept as a
                       semantic hook for future per-affiliate-hue variants. */ }
.np-affiliate-body {
  display: flex; flex-direction: column;
  padding: 18px 20px 20px;
  gap: 12px;
  flex: 1;
}

/* Logo — object-fit contain against transparent bg so affiliate logos
   (which come in every conceivable aspect ratio + on white/dark bg)
   sit consistently. Max-height caps runaway tall logos. */
.np-affiliate-logo {
  display: flex; align-items: center; justify-content: flex-start;
  height: 64px;
}
.np-affiliate-logo img {
  max-height: 64px;
  max-width: 180px;
  object-fit: contain;
  object-position: left center;
}

.np-affiliate-tx {
  display: flex; flex-direction: column;
  gap: 6px;
  flex: 1;
}
.np-affiliate-name {
  font-weight: 600; font-size: 16px; line-height: 1.25;
  color: var(--np-affiliate-dk);
  margin: 0;
}
.np-affiliate-body-teaser {
  font-size: 13px; color: #6c675f; line-height: 1.4;
  margin: 0;
}

/* =============================================================
   Modal — shared #np-affiliate-modal body (populated on show via
   template-clone by barrioNpmAffiliateModal). Simpler than partner
   (no attached-files slot).
   ============================================================= */
.np-affiliate-modal-content { color: #2c2c2b; }

/* Top band — image on an affiliate-hued backdrop (--np-ph classes come
   from patai-spotlight.css / grants-spotlight.css). Fallback text is
   the "AFFILIATE" cover word when no image. */
.np-affiliate-modal-ph {
  min-height: 130px;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 8px 8px 0 0;
  margin: -1rem -1rem 0;
}
.np-affiliate-modal-ph.np-ph--cover {
  display: flex; align-items: center; justify-content: center;
}

.np-affiliate-modal-kicker {
  display: block;
  font-size: 10.5px; font-weight: 700;
  letter-spacing: .07em; text-transform: uppercase;
  color: var(--np-affiliate-dk);
  margin: 16px 0 6px;
}
.np-affiliate-modal-title {
  font-weight: 600; font-size: clamp(22px, 2.6vw, 28px);
  letter-spacing: -.2px; line-height: 1.15;
  margin: 0 0 12px; color: #2c2c2b;
}

.np-affiliate-modal-cta-row { margin: 14px 0 18px; }
.np-affiliate-modal-cta {
  display: inline-block;
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--np-affiliate);
  color: #fff; font-weight: 600; font-size: 14px;
  text-decoration: none;
  transition: background .15s;
}
.np-affiliate-modal-cta:hover {
  background: var(--np-affiliate-dk);
  color: #fff;
}

.np-affiliate-modal-body {
  font-size: 14.5px; color: #2c2c2b; line-height: 1.5;
}
.np-affiliate-modal-body p { margin: 0 0 12px; }
.np-affiliate-modal-body p:last-child { margin-bottom: 0; }
.np-affiliate-modal-body a { color: var(--np-affiliate-dk); text-decoration: underline; }

/* ---------- Related researchers list (inside #np-affiliate-modal) ----
   Small round portrait + name per row. Whole row is a click target
   that opens #np-researcher-modal via BS5 data-api → Family-1 → Family-1
   handoff (affiliate modal auto-hides). See modal-handling.md §7.4 +
   affiliates-tile-grid-plan.md §6.
   ------------------------------------------------------------------- */
.np-affiliate-researchers-section { margin-top: 24px; }
.np-affiliate-researchers-head {
  /* !important defeats typography.css h1..h6 hairline weight override
     (memory project_theme_hook_invocation_gotcha — same pattern the
     rest of the theme uses for chassis section heads). */
  font-size: 13px !important;
  font-weight: 700 !important;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: #4a4a4a;
  margin: 0 0 10px;
}
.np-affiliate-researchers {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.np-affiliate-researcher {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px;
  border-radius: 6px;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .12s ease;
}
.np-affiliate-researcher:hover,
.np-affiliate-researcher:focus-visible {
  background: rgba(0, 0, 0, .04);
  color: inherit;
  text-decoration: none;
}
.np-affiliate-researcher-portrait {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: #e8e5df;   /* placeholder tint behind silhouette SVG */
  flex-shrink: 0;
}
.np-affiliate-researcher-name {
  font-size: 15px;
  font-weight: 600 !important;
  line-height: 1.3;
}
