/* =============================================================
   barrio_npm_prototype — people / role browse (/our-people, /people/<type>)

   The person listing card (researchers:page_by_person_type), the
   clustered role-tiles browse (people-tiles.html.twig — cluster
   heads, role tiles, avatar stacks) driven by --tile-hue, and the
   role browse modal (#np-browse-modal, barrioNpmRoleModal) with its
   busy spinner. The data-cluster → hue token map is in colors.css;
   the /our-people block html_list override is people-search.css.
   (Extracted from detail.css.)
   ============================================================= */

/* Person listing card (researchers:page_by_person_type; _person-card.html.twig). */
.np-person-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  height: 100%;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid #e4e0d8;
  /* Category strip (2026-08-17) — the person-card equivalent of the
     .np-tile-region-strip on publication tiles. A border rather than a strip
     element because this card is a flex ROW: a strip span would become a flex
     item and land beside the portrait, and the template is shared across the
     modal, the landing-list sections, search results and the curated lists.

     --np-card-hue is set by whatever knows the category in context: the role
     modal (js/browse-modal.js, from the clicked chip's group) and the
     landing-list cluster sections (css/people-search.css). Unset elsewhere,
     where it falls back to the same grey as the other three sides — so the
     card silhouette is identical on surfaces with no category context, and
     nothing shifts by a pixel when it gains one. */
  border-top: 3px solid var(--np-card-hue, #e4e0d8);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: box-shadow .15s ease, transform .15s ease, border-top-color .15s ease;
}
/* Uniform card height per row (2026-08-17).
   `.np-person-card { height: 100% }` above was already asking for this and
   getting nothing, because the card is not the grid item. Views renders
   `li.col-md-6.col-lg-4 > div.np-tile-region > a.np-person-card`, and the
   contextual-region wrapper — which exists to anchor the editor's edit pen —
   has only `position: relative` (css/contextual-tiles.css). Bootstrap's
   `.row` stretches the `li` to the tallest card in the line, but the wrapper
   between them stays auto-height, so `height: 100%` resolved against content
   and every card kept its own height.

   Scoped with :has() so publication and video tiles, which share
   .np-tile-region and set their own fixed heights, are untouched. :has() is
   already used in css/video-category-modal.css, so this adds no new browser
   requirement. */
.np-tile-region:has(> .np-person-card) {
  height: 100%;
}
.np-person-card:hover {
  box-shadow: 0 6px 18px rgba(0, 0, 0, .08);
  transform: translateY(-2px);
}
.np-person-card:focus-visible {
  outline: 3px solid var(--hue, #6c675f);
  outline-offset: 2px;
}

.np-person-card-photo {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  background: #f1ece1;
  border: 1px solid #e4e0d8;
}
.np-person-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* .np-person-card-photo--placeholder retired 2026-08-06 — migrated
   to template-level `<img>` with a silhouette SVG fallback src (see
   _person-card.html.twig). Uniform DOM shape gives consistent
   right-click "Open image in new tab" + alt-text a11y across real
   portraits and placeholders; SVG file is editable in normal tooling
   instead of an inline data-URI blob. */

.np-person-card-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.np-person-card-name {
  font-weight: 700;
  font-size: 15px;
  line-height: 1.25;
  color: #2c2c2b;
}
.np-person-card-meta {
  font-size: 12.5px;
  line-height: 1.35;
  color: #6c675f;
}
.np-person-card-body {
  margin-top: 2px;
  font-size: 12.5px;
  line-height: 1.4;
  color: #6c675f;
}

/* Portrait-less variant per card-display-preset-refactor-plan.md.
   Flex-gap only applies between siblings so hiding the .np-person-card-photo
   collapses cleanly, but the text column benefits from filling the width
   fully so the card doesn't read as an empty photo well + short text. */
.np-person-card--no-portrait .np-person-card-text {
  flex: 1 1 auto;
  width: 100%;
}

/* Border-accent modifiers per card-visual-modifiers-plan.md. Colours flow
   from the current page's --np-cpl-* cascade tokens set by
   [data-collection] blocks in curated-people-list.css (MAI editorial:
   --np-cpl-accent = gold, AlterNative editorial: --np-cpl-accent =
   burgundy). Any list without a [data-collection] cascade gets the
   fallback greys defined here. Border position is left — common
   "accent strip" pattern that reads as a visual anchor without changing
   card geometry. */
.np-person-card--border-accent {
  border-left: 3px solid var(--np-cpl-accent, #999);
}
.np-person-card--border-primary {
  border-left: 3px solid var(--np-cpl-primary, #333);
}

/* Clustered-tiles people browse (/our-people; people-tiles.html.twig). */
.np-tile-group {
  margin: 44px 0 40px;
  padding-top: 36px;
  border-top: 1px solid #e4e0d8;
}
.np-tile-group-title {
  margin: 0 0 26px;
  font-weight: 700;
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1.15;
  color: #2c2c2b;
}

/* .np-cluster / .np-tile-grid are the retired role-tile sections from
   /people/landing (replaced by the cluster map 2026-08-17). Kept because the
   .np-role-tile* component below is shared with _tile-group.html.twig
   (publications); these two wrappers are now unused and can go in a cleanup
   pass once nothing else claims them. */
.np-cluster {
  margin: 0 0 38px;
}
.np-cluster-head {
  margin: 0 0 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--tile-hue, #6c675f);
}
.np-cluster-title {
  margin: 0;
  font-weight: 600;
  font-size: 21px;
  letter-spacing: -.2px;
  color: #2c2c2b;
}

.np-tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.np-role-tile {
  display: flex;
  overflow: hidden;
  background: #fff;
  border: 1px solid #e4e0d8;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: box-shadow .15s ease, transform .15s ease;
}
.np-role-tile:hover {
  box-shadow: 0 8px 20px rgba(0, 0, 0, .09);
  transform: translateY(-3px);
}
.np-role-tile:focus-visible {
  outline: 3px solid var(--tile-hue, #6c675f);
  outline-offset: 2px;
}
.np-role-tile-strip {
  flex: 0 0 auto;
  width: 6px;
  background: var(--tile-hue, #6c675f);
}
.np-role-tile-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 15px 17px 16px;
}
.np-role-tile-name {
  font-weight: 600;
  font-size: 16px;
  line-height: 1.25;
  color: #2c2c2b;
}
/* Avatar preview — an overlapping stack of round portraits of the role's
   people (up to PREVIEW, newest first) + a "+N" overflow chip. Decorative
   (aria-hidden in the template); the tint on placeholders / the chip picks
   up the cluster's --tile-hue. */
.np-role-tile-avatars {
  display: flex;
  align-items: center;
}
.np-role-avatar {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  margin-left: -10px;
  border-radius: 50%;
  overflow: hidden;
  background: #ece7dd;
  border: 2px solid #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .12);
  display: flex;
  align-items: center;
  justify-content: center;
}
.np-role-avatar:first-child {
  margin-left: 0;
}
.np-role-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.np-role-avatar--placeholder {
  background: var(--tile-hue, #6c675f);
}
.np-role-avatar-initial {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
}
.np-role-avatar--more {
  background: var(--tile-hue, #6c675f);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -.02em;
}

.np-role-tile-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 11px;
  border-top: 1px solid #ece7dd;
  font-size: 12.5px;
}
.np-role-tile-count {
  font-weight: 600;
  color: #2c2c2b;
}
.np-role-tile-go {
  font-weight: 700;
  color: var(--tile-hue-dk, #6c675f);
}

/* ---------- Role modal (people browse) ----------
   #np-browse-modal is filled on demand by barrioNpmRoleModal with a role's
   /people/<slug> listing (its .np-listing-title + person cards + pager). The
   injected .np-person-card grid + .np-listing-title styles are shared with the
   standalone page; this only frames the modal, scrolls the body, and shows a
   busy spinner while the fetch is in flight. */
.np-browse-modal .modal-content {
  display: flex;
  flex-direction: column;
  max-height: 86vh;
  padding: 26px 30px 28px;
  border: 0;
  border-radius: 12px;
  overflow: hidden;
}
.np-browse-modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  z-index: 2;
}
/* Shell-level modal title — populated by browse-modal.js on show
   from the trigger's data-modal-title. Sits in modal chrome (not
   the injected slot content) so it survives the ?embed=1 chrome-
   strip and stays visible even when the fetched page carries no
   .np-listing-title h1. Padding-right clears the absolute-positioned
   close button. Weight/size mirrors the retired injected-h1
   .np-browse-modal-slot .np-listing-title rule below. */
.np-browse-modal-title {
  margin: 0 0 12px;
  padding-right: 34px;
  font-size: 22px;
  font-weight: 700;
  color: #2c2c2b;
  line-height: 1.25;
}
.np-browse-modal-title[hidden] {
  display: none;
}
.np-browse-modal-slot {
  flex: 1 1 auto;
  min-height: 120px;
  overflow-y: auto;
}
.np-browse-modal-foot {
  flex: 0 0 auto;
  padding: 12px 20px;
  border-top: 1px solid #e7e2d8;
  text-align: center;
}
.np-browse-modal-viewall {
  font-size: 15px;
  font-weight: 700;
  color: #2c2c2b;
}
.np-browse-modal-viewall:hover {
  color: var(--hue, #6c675f);
}
.np-browse-modal-slot .np-listing-title {
  margin-top: 0;
  padding-right: 34px; /* clear the close button */
}
/* Busy spinner while fetching — the slot is emptied + aria-busy set true. */
.np-browse-modal-slot[aria-busy="true"] {
  display: flex;
  align-items: center;
  justify-content: center;
}
.np-browse-modal-slot[aria-busy="true"]::after {
  content: "";
  width: 34px;
  height: 34px;
  border: 3px solid #e4e0d8;
  border-top-color: #6c675f;
  border-radius: 50%;
  animation: np-spin .7s linear infinite;
}
@keyframes np-spin {
  to { transform: rotate(360deg); }
}

/* ── Cluster filter pill row on /people/landing (2026-08-14) ─────────────
   Client-side filter over the already-rendered tile sections — see
   js/people-tile-filter.js. Reuses the .np-people-tab* classes from
   css/people-search.css so the two people landings share one pill look;
   only the spacing below is specific to sitting above a tile grid. */
.np-tile-filter {
  margin: 0 0 1.5rem;
}
.np-tile-filter .np-people-tab { cursor: pointer; }
/* The active pill is driven by .is-active here rather than by
   aria-current alone, because the filter is JS state, not page state. */
.np-tile-filter .np-people-tab.is-active {
  border-color: var(--hue, #35667a);
  font-weight: 600 !important;
}
