/* =============================================================
   barrio_npm_prototype — Researcher profile modal (#np-researcher-modal)
   Shared chrome — rail researcher cards (project + person pages).
   JS: js/detail-modals.js (barrioNpmResearcherModal).
   (Extracted from project-detail.css.)
   ============================================================= */

/* ---------- Researcher profile modal ----------
   Click-to-expand modal for the rail's researcher cards. JS in
   js/detail-modals.js (barrioNpmResearcherModal behaviour) clones the
   per-card <template> content into .np-researcher-modal-slot on
   show.bs.modal. Layout is portrait-left + content-right at desktop;
   stacks image-on-top + content-below at <576px. */
.np-researcher-modal .modal-content {
  background: #fff;
  border: 0;
  border-top: 4px solid var(--hue);
  border-radius: 8px;
  padding: 28px 32px 24px;
  position: relative;
}
.np-researcher-modal .np-researcher-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  opacity: .7;
}
.np-researcher-modal .np-researcher-close:hover {
  opacity: 1;
}

/* Top section — image + heading group. CSS Grid keeps the image at
   a fixed 220px column at desktop; collapses to a single-column stack
   at <576px so the portrait sits above the name on phone. */
.np-profile-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  align-items: start;
  margin-bottom: 20px;
}
.np-profile-image {
  border-radius: 8px;
  overflow: hidden;
  background: #f1ece1;
  aspect-ratio: 1 / 1;
}
.np-profile-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* .np-profile-image--placeholder retired 2026-08-06 — migrated to
   template-level `<img>` fallback src in researcher-profile.html.twig. */
.np-profile-head {
  min-width: 0;
}
.np-profile-name {
  font-weight: 700;
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: -.2px;
  margin: 0 0 14px;
  color: #2c2c2b;
}

/* Meta rows — labelled groups under the name. Mirror the rail's
   key/value pattern but tuned for the modal's wider space. */
.np-profile-meta-row {
  margin-bottom: 10px;
}
.np-profile-meta-row:last-child {
  margin-bottom: 0;
}
.np-profile-meta-key {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: #6c675f;
  margin-bottom: 2px;
}
.np-profile-meta-value {
  display: block;
  font-size: 14px;
  line-height: 1.4;
  color: #2c2c2b;
}

/* Body — full HTML rendered through check_markup. Reuses the same
   typography rhythm as .np-project-body but at a more compact size
   that fits the modal's reading width. */
.np-profile-body {
  font-size: 14.5px;
  line-height: 1.6;
  color: #2c2c2b;
  margin-bottom: 18px;
  padding-top: 18px;
  border-top: 1px solid #e4e0d8;
}
.np-profile-body p {
  margin: 0 0 12px;
}
.np-profile-body p:last-child {
  margin-bottom: 0;
}
.np-profile-body a {
  color: var(--hue-dk);
}
.np-profile-body a:hover {
  text-decoration: underline;
}
.np-profile-body ul,
.np-profile-body ol {
  margin: 0 0 12px;
  padding-left: 22px;
}

/* View-full-profile link at the modal bottom — Pātai-hued anchor
   underneath the body. Acts as the modal's primary CTA. */
.np-profile-link {
  margin: 0;
  padding-top: 12px;
  border-top: 1px solid #e4e0d8;
}
.np-profile-link a {
  font-weight: 700;
  color: var(--hue-dk);
  text-decoration: none;
}
.np-profile-link a:hover {
  text-decoration: underline;
}

@media (max-width: 575.98px) {
  /* Stack image-on-top, content-below at phone width. Image shrinks
     to match the column width but stays square via aspect-ratio. */
  .np-researcher-modal .modal-content {
    padding: 22px 22px 18px;
  }
  .np-profile-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .np-profile-image {
    max-width: 200px;
  }
  .np-profile-name {
    font-size: 20px;
  }
}

/* ---------- Related projects — compact list at the modal tail ----------
   Added 2026-08-19 per person-detail-theming.md §12. Each link navigates
   direct to the project's canonical page (no modal trigger — avoids
   modal-in-modal from the person preview). Restores the pre-§11 compact
   style that used to render in the person canonical rail (was
   .np-related-project* — retired when the canonical adopted the
   report-tile grid); scoped to .np-profile-related-* to keep the modal
   surface isolated. */
.np-profile-related-projects {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #e4e0d8;
}
.np-profile-related-projects-head {
  margin: 0 0 12px;
  font-size: 13px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  color: #6c675f;
}
.np-profile-related-projects-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column;
}
.np-profile-related-project {
  border-top: 1px solid #e4e0d8;
  padding-top: 10px;
  margin-top: 10px;
}
.np-profile-related-project:first-child {
  border-top: 0; padding-top: 0; margin-top: 0;
}
.np-profile-related-project-link {
  display: flex; gap: 10px; align-items: flex-start;
  text-decoration: none; color: #2c2c2b;
  transition: color .15s;
}
.np-profile-related-project-link:hover .np-profile-related-project-title {
  text-decoration: underline;
}
.np-profile-related-project-img {
  flex: none;
  width: 56px; height: 56px;
  border-radius: 6px; overflow: hidden;
  background: #f1ece1;
}
.np-profile-related-project-img img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.np-profile-related-project-text {
  flex: 1;
  display: flex; flex-direction: column; gap: 3px;
  min-width: 0;
}
.np-profile-related-project-title {
  font-size: 14px; line-height: 1.35; font-weight: 600;
}
.np-profile-related-project-meta {
  font-size: 12px; line-height: 1.35; font-weight: 600;
  color: #6c675f;
}
/* Matakitenga framework chips on the modal's related-project rows.
   Deliberately quieter than the report tile's pills — the modal is a
   preview surface, so these read as a colour-coded tag run rather than a
   labelled meta row. No "Matakitenga · Framework" key either: the dots
   carry the identity and the key would cost a line on every row.
   Sparse (19 of 118 person-linked projects have a Pae, 15 a Pātai), so
   most rows never show this at all. */
.np-profile-related-project-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
  margin-top: 1px;
}
.np-profile-related-project-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  line-height: 1.35;
  color: #6c675f;
  white-space: nowrap;
}
/* The global .np-dot sizing is tuned for tile scale; step it down here so
   the dot reads as a marker beside 11px text rather than a bullet. */
.np-profile-related-project-chip .np-dot {
  width: 7px;
  height: 7px;
  flex: none;
}

.np-profile-related-project-body {
  font-size: 12px; line-height: 1.4; color: #6c675f;
}
