/* =============================================================
   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;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: box-shadow .15s ease, transform .15s ease;
}
.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 {
  background: #ece7dd;
}

.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;
}

/* 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 {
  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;
}
.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); }
}
