/* =============================================================
   barrio_npm_prototype — project-teaser card
   Used by the projects view's page_by_patai + page_by_type displays
   (the filtered listings at /research/projects/patai/<slug> and
   /research/projects/<type-slug>). Per-row template at
   templates/views/_project-teaser.html.twig.

   The view's html_list style wraps each card in
   <li class="col-md-4 col-lg-4 ...">, so the 3-column grid is provided
   by Bootstrap. This file styles the card chrome only — no grid layout
   here.
   ============================================================= */

.np-teaser {
  background: #fff;
  border: 1px solid #e4e0d8;
  border-radius: 8px;
  overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 1px 2px rgba(40,40,40,.05), 0 6px 18px rgba(40,40,40,.06);
  text-decoration: none; color: inherit;
  transition: transform .18s, box-shadow .18s;
  height: 100%;
}
.np-teaser:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 10px rgba(40,40,40,.09), 0 16px 44px rgba(40,40,40,.10);
  color: inherit;
}

/* Coloured top strip — keyed off data-t. Matches the project-type tile
   colour cascade in css/project-type-tiles.css and the type tokens in
   css/colors.css. 'other' has no rule → strip stays the default border
   colour (effectively invisible). */
.np-teaser-strip { height: 6px; }
.np-teaser[data-t="full"]       .np-teaser-strip { background: var(--np-pt-full); }
.np-teaser[data-t="scoping"]    .np-teaser-strip { background: var(--np-pt-scoping); }
.np-teaser[data-t="doctoral"]   .np-teaser-strip { background: var(--np-pt-doctoral); }
.np-teaser[data-t="internship"] .np-teaser-strip { background: var(--np-pt-internship); }

/* Image area — 16:9 photo or Pae-coloured gradient placeholder. */
.np-teaser-image {
  width: 100%;
  aspect-ratio: 16 / 0; /* hiding this until we have images for project teasers then 16 /9 aspect-ratio */
  background-size: cover;
  background-position: center;
  background-color: #e4e0d8;
}
.np-teaser-image--placeholder {
  background: linear-gradient(135deg, #b8b0a5, #d4ccbf);
  position: relative;
}
.np-teaser-image--placeholder::before {
  content: '';
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.06) 0 12px, transparent 12px 24px);
}
/* Pae-tinted placeholders — overrides the neutral default when the card
   carries a Pae chip but no image. */
.np-teaser-image.np-pae-tint-auaha   { background: linear-gradient(135deg, var(--np-pae-auaha), #6f9dc4); }
.np-teaser-image.np-pae-tint-tawhiti { background: linear-gradient(135deg, var(--np-pae-tawhiti), #b178a0); }
.np-teaser-image.np-pae-tint-ora     { background: linear-gradient(135deg, var(--np-pae-ora), #d99066); }
.np-teaser-image.np-pae-tint-ahurei  { background: linear-gradient(135deg, var(--np-pae-ahurei), #5a9d97); }

/* Body — title, badge, Pae chips, summary, CTA. */
.np-teaser-body {
  padding: 14px 16px 16px;
  display: flex; flex-direction: column; gap: 8px;
  flex: 1;
}
.np-teaser-badge {
  align-self: flex-start;
  font-size: 10px; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase;
  padding: 4px 9px; border-radius: 5px;
  color: #fff;
  background: #6c675f;  /* fallback */
}
.np-teaser[data-t="full"]       .np-teaser-badge { background: var(--np-pt-full); }
.np-teaser[data-t="scoping"]    .np-teaser-badge { background: var(--np-pt-scoping-dk); }
.np-teaser[data-t="doctoral"]   .np-teaser-badge { background: var(--np-pt-doctoral); }
.np-teaser[data-t="internship"] .np-teaser-badge { background: var(--np-pt-internship); }

.np-teaser h3 {
  font-weight: 600; font-size: 15px;
  line-height: 1.25; margin: 0;
  color: #2c2c2b;
}

/* Pae chip — reuses the same .np-dot widget elsewhere. */
.np-teaser .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;
  align-self: flex-start;
}
.np-teaser .np-pae-tag .np-dot { width: 8px; height: 8px; }

.np-teaser-summary {
  font-size: 12.5px; line-height: 1.45;
  color: #6c675f;
  /* Clamp to keep teaser cards uniform (bodySummary() caps the text ~360). */
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.np-teaser-summary p { margin: 0; }
.np-teaser-summary p + p { margin-top: 6px; }

.np-teaser-cta {
  margin-top: auto;
  font-weight: 700; font-size: 12.5px;
  color: var(--np-pt-full-dk);
}
.np-teaser[data-t="scoping"]    .np-teaser-cta { color: var(--np-pt-scoping-dk); }
.np-teaser[data-t="doctoral"]   .np-teaser-cta { color: var(--np-pt-doctoral); }
.np-teaser[data-t="internship"] .np-teaser-cta { color: var(--np-pt-internship); }

/* The view's <li> wrapper has bootstrap_barrio's bottom-margin classes
   (mb-12 / mb-3 / pt-5 / px-5) — reduce excessive padding for our
   teaser layout. */
.view-projects.view-display-id-page_by_patai .views-row,
.view-projects.view-display-id-page_by_type .views-row {
  padding: 0 8px !important;
  margin-bottom: 16px !important;
  padding-top: 0 !important;
}
