/* =============================================================
   barrio_npm_prototype — Pātai landing cluster
   Ported from prototypes/research-by-patai-landing.html.
   Selectors are .np-* prefixed; hue + dark-hue come from
   css/colors.css tokens. Owns: cluster heading, two legends,
   the 2×2 Pātai panel grid, panel header/body/foot, per-row
   featured-project markup, Pae chip, and the framework-explainer
   grid. Does NOT duplicate the secondary "browse by project type"
   tiles — those are rendered by the existing landing-submenu
   cluster (templates/navigation/menu--main--landing.html.twig).
   ============================================================= */

/* ---------- cluster heading + legends ---------- */
.np-patai-cluster { margin: 32px 0 50px; }
.np-patai-cluster-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  flex-wrap: wrap; gap: 14px; padding-bottom: 13px; margin-bottom: 22px;
  border-bottom: 2px solid #2c2c2b;
}
.np-patai-cluster-head h2 {
  font-weight: 600; font-size: 22px; letter-spacing: -.2px;
  line-height: 1.15; margin: 0;
}
.np-patai-cluster-head h2 .np-en { font-weight: 400; color: #6c675f; }
.np-patai-cluster-head .np-lede {
  font-size: 14px; color: #6c675f; max-width: 520px; margin: 5px 0 0;
}
.np-patai-cluster-head .np-head-aside {
  display: flex; flex-direction: column; align-items: flex-end; gap: 10px;
}
.np-patai-cluster-head .np-see-all {
  font-size: 13px; font-weight: 700; color: #356a66;
  text-decoration: none; white-space: nowrap;
}
.np-patai-cluster-head .np-see-all:hover { text-decoration: underline; }

.np-legend {
  display: flex; align-items: center; gap: 15px; flex-wrap: wrap;
  font-size: 12.5px; color: #6c675f;
}
.np-legend .np-lbl {
  font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  font-size: 11px;
}
.np-legend .np-k { display: inline-flex; align-items: center; gap: 6px; }
.np-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }

/* Pātai dots */
.np-d-patai-puawai { background: var(--np-patai-puawai); }
.np-d-patai-mauri  { background: var(--np-patai-mauri); }
.np-d-patai-whanau { background: var(--np-patai-whanau); }
.np-d-patai-teao   { background: var(--np-patai-teao); }
/* Pae dots */
.np-d-pae-auaha   { background: var(--np-pae-auaha); }
.np-d-pae-tawhiti { background: var(--np-pae-tawhiti); }
.np-d-pae-ora     { background: var(--np-pae-ora); }
.np-d-pae-ahurei  { background: var(--np-pae-ahurei); }
/* Rautaki dots — appear under the Pae legend by design (see template). */
.np-d-rautaki-kounga      { background: var(--np-rautaki-kounga); }
.np-d-rautaki-whakaaweawe { background: var(--np-rautaki-whakaaweawe); }

/* ---------- the 2×2 panel grid ---------- */
.np-patai-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px;
}

.np-patai-panel {
  display: flex; flex-direction: column;
  background: #fff;
  border: 1px solid #e4e0d8;
  border-top: 6px solid var(--hue);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(40,40,40,.05), 0 6px 18px rgba(40,40,40,.06);
  --hue: #6c675f;
  --hue-dk: #2c2c2b;
}
/* PLACEHOLDER PHOTOS — picsum.photos seeds matching the prototype at
   prototypes/research-by-patai-landing.html. These are throwaway stock
   images for the internal test audience; they require an internet
   connection at render time and risk culturally mismatched imagery.
   REPLACE BEFORE PRODUCTION by uploading a real photo to each Pātai
   term's field_patai_image — the inline --bg emitted by
   templates/content/patai-landing.html.twig will override these defaults.
   Track: swap planned for the week of 2026-06-30 once curated photos
   land. See prototypes/research-by-patai-landing.html lines 439/474/509/544. */
.np-patai-panel[data-patai="puawai"] {
  --hue: var(--np-patai-puawai);  --hue-dk: var(--np-patai-puawai-dk);
  --bg: url('https://picsum.photos/seed/npm-puawai/640/360');
}
.np-patai-panel[data-patai="mauri"] {
  --hue: var(--np-patai-mauri);   --hue-dk: var(--np-patai-mauri-dk);
  --bg: url('https://picsum.photos/seed/npm-mauri/640/360');
}
.np-patai-panel[data-patai="whanau"] {
  --hue: var(--np-patai-whanau);  --hue-dk: var(--np-patai-whanau-dk);
  --bg: url('https://picsum.photos/seed/npm-whanau/640/360');
}
.np-patai-panel[data-patai="teao"] {
  --hue: var(--np-patai-teao);    --hue-dk: var(--np-patai-teao-dk);
  --bg: url('https://picsum.photos/seed/npm-teao/640/360');
}

/* ---------- panel header — photo behind a scrim ----------
   --bg is supplied per-panel as an inline custom property. When the term
   has no field_patai_image, the URL falls back to the niho pattern via
   the template, so the gradient still has something to layer over. */
.np-patai-head {
  position: relative; min-height: 152px;
  padding: 18px 20px 16px;
  display: flex; flex-direction: column;
  align-items: flex-start; justify-content: flex-end;
  background-image:
    linear-gradient(to top,
      rgba(20,18,16,.80) 0%,
      rgba(20,18,16,.42) 52%,
      rgba(20,18,16,.30) 100%),
    var(--bg, none);
  background-size: cover; background-position: center; background-repeat: no-repeat;
}
.np-patai-name {
  align-self: flex-start; display: inline-block;
  background: var(--hue); color: #fff;
  font-weight: 700; font-size: 19px; letter-spacing: -.2px; line-height: 1.15;
  padding: 7px 14px; border-radius: 6px;
  margin: 0 0 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.28);
}
.np-patai-q {
  font-size: 14px; line-height: 1.45;
  color: rgba(255,255,255,.96);
  margin: 0; max-width: 46ch;
  text-shadow: 0 1px 2px rgba(0,0,0,.45);
}

/* ---------- panel body (featured projects list) ---------- */
.np-patai-body {
  display: flex; flex-direction: column; flex: 1;
  padding: 6px 6px 0;
}
.np-patai-feat-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: #6c675f;
  padding: 14px 16px 4px;
}
.np-patai-projects { list-style: none; margin: 0; padding: 0; }
.np-patai-projects li { border-top: 1px solid #e4e0d8; }
.np-patai-projects li:first-child { border-top: 0; }

.np-feat {
  display: flex; gap: 13px; align-items: flex-start;
  padding: 13px 16px;
  text-decoration: none; color: inherit;
  transition: background .16s;
}
.np-feat:hover { background: #faf8f3; color: inherit; }
.np-feat .np-swatch {
  flex: none; width: 8px; align-self: stretch; border-radius: 4px;
  background: var(--hue); min-height: 38px;
}
.np-feat .np-ftx { flex: 1; }
.np-feat h4 {
  font-weight: 600; font-size: 14.5px; line-height: 1.25;
  margin: 0 0 3px; color: #2c2c2b;
}
.np-feat p {
  font-size: 12.5px; color: #6c675f; margin: 0; line-height: 1.4;
}
.np-feat .np-fmeta {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 4px;
}
.np-feat .np-ftype {
  font-size: 10px; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; color: var(--hue-dk);
}
.np-feat .np-pae-tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: #6c675f;
}
.np-feat .np-pae-tag .np-dot { width: 9px; height: 9px; }
.np-feat .np-farw {
  flex: none; align-self: center; color: var(--hue-dk); font-weight: 700;
}

/* Editorial "Featured" promotion chip on a row that carries the Featured
   project term. Sits in .np-fmeta alongside the type label and Pae chip.
   Solid panel hue so it matches the page's colour-coded language. */
.np-feat-badge {
  display: inline-block;
  font-size: 9.5px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase;
  padding: 2px 7px; border-radius: 4px;
  background: var(--hue); color: #fff;
  line-height: 1.4;
}

/* ---------- panel footer (count + browse-all) ---------- */
.np-patai-foot {
  margin-top: auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px;
  border-top: 1px solid #e4e0d8;
  background: #fcfbf8;
}
.np-patai-count { font-size: 13px; color: #2c2c2b; }
.np-patai-count strong { color: var(--hue-dk); }
.np-patai-browse {
  font-size: 13px; font-weight: 700; color: var(--hue-dk);
  text-decoration: none; white-space: nowrap;
}
.np-patai-browse:hover { text-decoration: underline; }

/* =============================================================
   Pae & Pātai framework explainer — third cluster on the
   Research landing. Driven by content_menu_block:block_pae_patai;
   per-cell markup in views-view-fields--content-menu-block--block-pae-patai.html.twig.
   ============================================================= */
.np-matakitenga {
  background: #faf8f3;
  border: 1px solid #e4e0d8;
  border-radius: 8px;
  padding: 24px;
  margin: 0 0 50px;
}
.np-matakitenga h3 {
  margin: 0 0 14px;
  font-weight: 600; font-size: 16px;
  text-transform: uppercase; letter-spacing: .04em;
  color: #6c675f;
}
.np-mt-legends {
  display: flex; flex-wrap: wrap; gap: 14px 28px;
  margin: 0 0 18px;
}

/* Grid container — .np-grid-mt holds .np-mt-cell children directly
   (no Views wrapper because this cluster is preprocess-driven, not a
   drupal_view() embed). */
.np-grid-mt {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
}

/* Cell — coloured top border keyed off data-patai / data-pae attribute. */
.np-mt-cell {
  background: #fff;
  border: 1px solid #e4e0d8;
  border-radius: 8px;
  padding: 14px 15px;
  border-top: 4px solid #6c675f;
}
.np-mt-cell.np-cat-patai[data-patai="puawai"] { border-top-color: var(--np-patai-puawai); }
.np-mt-cell.np-cat-patai[data-patai="mauri"]  { border-top-color: var(--np-patai-mauri); }
.np-mt-cell.np-cat-patai[data-patai="whanau"] { border-top-color: var(--np-patai-whanau); }
.np-mt-cell.np-cat-patai[data-patai="teao"]   { border-top-color: var(--np-patai-teao); }
.np-mt-cell.np-cat-pae[data-pae="auaha"]   { border-top-color: var(--np-pae-auaha); }
.np-mt-cell.np-cat-pae[data-pae="tawhiti"] { border-top-color: var(--np-pae-tawhiti); }
.np-mt-cell.np-cat-pae[data-pae="ora"]     { border-top-color: var(--np-pae-ora); }
.np-mt-cell.np-cat-pae[data-pae="ahurei"]  { border-top-color: var(--np-pae-ahurei); }
/* Rautaki — third row of the grid. Each cell is one column wide; the
   row is centred by starting the first Rautaki cell at column 2. The
   second cell flows naturally into column 3, leaving columns 1 and 4
   empty. The .np-cat-rautaki--first class is added in the template via
   {% if loop.first %}. */
.np-mt-cell.np-cat-rautaki--first                      { grid-column-start: 2; }
.np-mt-cell.np-cat-rautaki[data-rautaki="kounga"]      { border-top-color: var(--np-rautaki-kounga); }
.np-mt-cell.np-cat-rautaki[data-rautaki="whakaaweawe"] { border-top-color: var(--np-rautaki-whakaaweawe); }

.np-mt-cell .np-mt-tag {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  color: #6c675f;
}
.np-mt-cell h4 {
  font-weight: 600; font-size: 14.5px;
  margin: 4px 0 6px;
}
.np-mt-cell h4 em {
  font-style: italic; font-weight: 400; color: #6c675f;
}
/* Description body — .np-mt-desc is a <div> wrapper around the rendered
   body HTML (which usually contains <p>s from filter_autop). Style any
   block-level descendants here. */
.np-mt-cell .np-mt-desc,
.np-mt-cell .np-mt-desc p {
  margin: 0;
  font-size: 12.5px;
  color: #6c675f;
  line-height: 1.45;
}
.np-mt-cell .np-mt-desc p + p { margin-top: 6px; }
.np-mt-cell .np-mt-desc a { color: inherit; text-decoration: underline; }
.np-mt-cell .np-mt-desc strong { color: #2c2c2b; }

/* ---------- responsive ---------- */
@media (max-width: 880px) {
  .np-patai-grid { grid-template-columns: 1fr; }
  .np-grid-mt { grid-template-columns: repeat(2, 1fr); }
  /* In a 2-column grid the Rautaki row already fills naturally — drop
     the column-2 start so the two cells sit side by side, not in col 2. */
  .np-mt-cell.np-cat-rautaki--first { grid-column-start: auto; }
}
@media (max-width: 560px) {
  .np-grid-mt { grid-template-columns: 1fr; }
}
