/*
 * Project preview modal (2026-07-14) — chrome for the #np-project-modal
 * shell + .np-project-modal-content that barrioNpmProjectModal clones
 * into it on card click. Opens from _project-teaser.html.twig (row
 * cards on project_search page displays) and _spotlight-card.html.twig
 * (Whakaaweawe hero + smalls on Pātai / project-type landing pages).
 *
 * Modal-lg width per D-6 (browse-friendly not immersive). Structure
 * mirrors the researcher/person modal's layout — cover on the left,
 * eyebrow + title + kaiārahi + whare wānanga + wā rangahau on the
 * right — with description and 'View full project →' link full-width
 * below the grid.
 *
 * D-5 keeps this in its own file. Colour scheme is static neutral for
 * MVP; a follow-up polish could pull the Pātai --hue cascade into the
 * eyebrow + detail-link accent per D-4 (deferred).
 *
 * See documentation/project-modal-plan.md §8 for design rationale.
 */

.np-project-modal .modal-body {
  padding: 32px 40px 24px;
}

/* Top row — cover-left + head-right, mirroring the researcher-modal
   .np-profile-grid. Project images are typically landscape hero shots,
   so the cover column is 220px (a touch wider than the portrait-oriented
   arotahi/publication modals). Collapses to a single-column stack at
   <576px (phone). */
.np-project-modal-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 28px;
  align-items: start;
  margin-bottom: 24px;
}

/* No-image variant — projects that lack field_featured_image (and its
   field_image fallback) collapse the grid to a single column so the
   title + meta rows use the full modal width instead of squeezing into
   the 220px image column. Twig adds the modifier when
   `np_project_card.image_url` is empty. */
.np-project-modal-grid--no-image {
  grid-template-columns: 1fr;
}

.np-project-modal-image {
  margin: 0;
  border-radius: 6px;
  overflow: hidden;
  background: #f1ece1;
  aspect-ratio: 1 / 1;
}

.np-project-modal-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.np-project-modal-head {
  min-width: 0;
}

.np-project-meta-eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6c675f;
}

.np-project-modal-title {
  margin: 0 0 14px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  color: #2c2c2b;
  letter-spacing: -0.2px;
}

/* Meta rows — labelled key/value pairs mirroring the researcher modal's
   .np-profile-meta-* shape. Bilingual keys are muted, values are
   full-weight readable text. */
.np-project-meta-row {
  margin-bottom: 10px;
}

.np-project-meta-row:last-child {
  margin-bottom: 0;
}

.np-project-meta-key {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #6c675f;
  margin-bottom: 2px;
}

.np-project-meta-value {
  display: block;
  font-size: 14px;
  line-height: 1.4;
  color: #2c2c2b;
}

/* Matakitenga · Framework row — Pātai (clickable) + Pae pills. Uses
   the shared .np-dot + .np-d-patai-* / .np-d-pae-* colour system from
   patai.css. No pill background — matches the detail-rail treatment
   (list-of-dot-plus-label, no visual chip weight). Dot 8px matches the
   teaser Pae dots per projects-by-patai-theming.md §CSS · Dot widget.
   Added 2026-07-14 per project-modal-plan.md §17. */
.np-project-meta-pills {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
}

.np-project-meta-pills li,
.np-project-meta-pills a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  line-height: 1.4;
  color: #2c2c2b;
}

.np-project-meta-pills a {
  text-decoration: none;
}

.np-project-meta-pills a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.np-project-meta-pills .np-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 8px;
  /* background comes from .np-d-patai-* / .np-d-pae-* in patai.css */
}

/* Compact size variant — applied by the shared _project-meta-rows.html.twig
   partial when called with `size: 'compact'` (currently: the report-card
   tile face on /publications/landing-list + /publications/reports). Scales
   the meta block down ~90% from modal size and tightens row spacing so
   it sits comfortably alongside the tile's title + body snippet without
   competing for visual weight. Added 2026-08-04 per
   report-card-meta-on-tile-plan.md — user testing may reveal specific
   rows to drop; leave the full block visible for now. */
.np-project-meta--compact {
  margin: 6px 0 10px;
}
.np-project-meta--compact .np-project-meta-eyebrow,
.np-project-meta-eyebrow--tile {
  font-size: 10.5px;
  margin-bottom: 4px;
}
/* Tile-context eyebrow sits INLINE before the title (outside the
   compact wrapper), so `.np-project-meta--compact .np-project-meta-eyebrow`
   doesn't reach it. `--tile` modifier gets the same compact scaling. */
.np-project-meta-eyebrow--tile {
  margin-top: 4px;
}
.np-project-meta--compact .np-project-meta-row {
  margin-bottom: 6px;
}
.np-project-meta--compact .np-project-meta-key {
  font-size: 9.5px;
  margin-bottom: 1px;
}
.np-project-meta--compact .np-project-meta-value {
  font-size: 12.5px;
  line-height: 1.35;
}
.np-project-meta--compact .np-project-meta-pills {
  gap: 6px 12px;
}
.np-project-meta--compact .np-project-meta-pills li,
.np-project-meta--compact .np-project-meta-pills a {
  font-size: 11.5px;
}
.np-project-meta--compact .np-project-meta-pills .np-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
}

/* Body — the project's summary paragraph via
   ProjectFieldExtractor::bodySummary(). Reuses the reading rhythm the
   researcher-modal body uses so descriptions in one modal are visually
   consistent with the other. */
.np-project-modal-body {
  margin: 20px 0;
  font-size: 14.5px;
  line-height: 1.6;
  color: #2c2c2b;
  padding-top: 18px;
  border-top: 1px solid #e4e0d8;
}

.np-project-modal-body p {
  margin: 0 0 12px;
}

.np-project-modal-body p:last-child {
  margin-bottom: 0;
}

.np-project-modal-detail-link {
  margin: 24px 0 0;
  padding-top: 16px;
  border-top: 1px solid #e7e2d8;
  text-align: right;
}

.np-project-modal-detail-link a {
  font-size: 14px;
  font-weight: 700;
  color: #2c2c2b;
  text-decoration: none;
}

.np-project-modal-detail-link a:hover {
  text-decoration: underline;
}

/* Close button — parallels the publication + arotahi + newsletter
   modal close styling. */
.np-project-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  padding: 8px;
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
}

@media (max-width: 575.98px) {
  /* Stack cover-on-top, head-below at phone width. Cover shrinks to a
     centred thumbnail. */
  .np-project-modal .modal-body {
    padding: 24px 22px 18px;
  }
  .np-project-modal-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .np-project-modal-image {
    max-width: 220px;
    margin: 0 auto;
  }
  .np-project-modal-title {
    font-size: 20px;
  }
}

/* -------------------------------------------------------------------
   Related researchers section — flat list at the bottom of the modal
   (above the "View full project →" link). Direct adaptation of
   .np-mai-modal-people from css/mai-groups.css — same 40x40 round
   portrait + name row layout, same editor-only edit pen at row end,
   same silhouette-SVG fallback. Sibling of .np-partner-researchers
   in css/partners.css (which added the same section to the partner
   modal in Aug 2026).
   Section shipped 2026-09-10 per project-modal-researchers-plan.md.
   ------------------------------------------------------------------- */
.np-project-modal-people { margin-top: 24px; }
.np-project-modal-people-head {
  /* !important defeats typography.css h1..h6 hairline weight override
     — same pattern .np-partner-researchers-head + .np-mai-modal-people-
     head use. */
  font-size: 13px !important;
  font-weight: 700 !important;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: #4a4a4a;
  margin: 0 0 12px;
}
.np-project-modal-people-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
/* Each <li> is a row: person anchor (left, flex-grow) + edit pen
   (right, fixed width). Editor-only pen renders only when
   person.edit_url is populated (access-gated in PHP). */
.np-project-modal-people-list li {
  display: flex;
  align-items: center;
  gap: 4px;
}
.np-project-modal-person {
  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;
  flex: 1 1 auto;
  min-width: 0;
}
.np-project-modal-person:hover,
.np-project-modal-person:focus-visible {
  background: rgba(0, 0, 0, .04);
  color: inherit;
  text-decoration: none;
}
.np-project-modal-person-portrait {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: #e8e5df;   /* placeholder tint behind silhouette SVG */
  flex-shrink: 0;
}
.np-project-modal-person-name {
  font-size: 15px;
  font-weight: 600 !important;
  line-height: 1.3;
}
/* Per-person edit pen — editor-only (twig renders only when
   person.edit_url is set). Subtle by default so it doesn't compete
   with the main click target; brightens on hover. Right-aligned via
   parent <li>'s flex layout. Mirrors .np-mai-modal-person-edit. */
.np-project-modal-person-edit {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #6a6a6a;
  text-decoration: none;
  opacity: .55;
  transition: opacity .12s ease, background-color .12s ease, color .12s ease;
}
.np-project-modal-person-edit:hover,
.np-project-modal-person-edit:focus-visible {
  background: rgba(0, 0, 0, .06);
  color: #2c2c2b;
  opacity: 1;
  text-decoration: none;
}

/* Meta-row lead pen — inline pen next to the lead-researcher name in
   the meta row (Kaiārahi · Project lead). Small, subtle. Rendered
   only when card.modal.lead_details.edit_url is set (editor-only). */
.np-project-meta-lead-edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: #6a6a6a;
  text-decoration: none;
  opacity: .55;
  transition: opacity .12s ease, background-color .12s ease, color .12s ease;
  vertical-align: middle;
  font-size: 12px;
}
.np-project-meta-lead-edit:hover,
.np-project-meta-lead-edit:focus-visible {
  background: rgba(0, 0, 0, .06);
  color: #2c2c2b;
  opacity: 1;
  text-decoration: none;
}
