/* =============================================================
   barrio_npm — page-level baseline.
   Hero band + landing-submenu cluster pattern.
   Navbar styles live in css/menu.css.
   ============================================================= */

/* ---------- Hero band ----------
   Replaces barrio_white's Front-template .bg-img-hero-center. Static
   inline background-image on the wrapper; CSS controls sizing/repeat. */

.np-hero {
  background-color: rgba(217, 202, 166, 0.15);
  min-height: 120px;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center center;
}

.np-hero h1 {
  margin: 0;
  font-size: clamp(1.75rem, 3.5vw, 3rem);
  font-weight: 600;
  color: #1a1a1a;
}

/* =============================================================
   Landing submenu — depth-2 parent cards with depth-3 children
   nested inside each card. Cluster colouring comes from the menu
   tree shape: each parent sets --cluster-hue via :nth-child, and
   children inherit it through CSS variable cascade.
   ============================================================= */

.np-landing-submenu {
  margin: 2rem 0;
}

.np-landing-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
  gap: 1rem;
}

/* Per-cluster hue. Add 3n+1 / 3n+2 / 3n rules to extend to a third hue. */
.np-landing-item--parent:nth-child(odd)  { --cluster-hue: var(--npm-blue); }
.np-landing-item--parent:nth-child(even) { --cluster-hue: var(--npm-beige); }

.np-landing-item--parent {
  background: color-mix(in srgb, var(--cluster-hue) 22%, white);
  border: 1px solid color-mix(in srgb, var(--cluster-hue) 35%, white);
  border-radius: 8px;
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.np-landing-item--parent:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

.np-landing-link {
  display: block;
  padding: 1rem 1.25rem;
  text-decoration: none;
  color: #1a1a1a;
}

.np-landing-item--parent > .np-landing-link .np-landing-title {
  font-size: 1.15rem;
  font-weight: 600;
}

.np-landing-title {
  display: block;
  line-height: 1.25;
  margin-bottom: 0.2rem;
}

.np-landing-desc {
  display: block;
  font-size: 0.85rem;
  line-height: 1.35;
  color: rgba(0, 0, 0, 0.65);
}

/* Children nested inside the parent card — same hue, paler tint, subordinate scale. */
.np-landing-children {
  list-style: none;
  padding: 0;
  margin: 0;
  background: color-mix(in srgb, var(--cluster-hue) 10%, white);
  border-top: 1px solid color-mix(in srgb, var(--cluster-hue) 28%, white);
}

.np-landing-item--child + .np-landing-item--child {
  border-top: 1px solid color-mix(in srgb, var(--cluster-hue) 22%, white);
}

.np-landing-item--child > .np-landing-link {
  padding: 0.6rem 1.25rem 0.6rem 1.75rem;
}

.np-landing-item--child .np-landing-title {
  font-size: 0.95rem;
  font-weight: 500;
}

.np-landing-item--child .np-landing-desc {
  font-size: 0.78rem;
}

/* Active trail — darker variant of the parent's hue. */
.np-landing-item--parent.is-active-trail {
  background: color-mix(in srgb, var(--cluster-hue) 45%, white);
  border-color: color-mix(in srgb, var(--cluster-hue), black 12%);
}

.np-landing-item--child.is-active-trail > .np-landing-link {
  background: color-mix(in srgb, var(--cluster-hue) 28%, white);
  font-weight: 500;
}

.np-landing-item.is-active-trail > .np-landing-link {
  font-weight: 500;
}

/* ---------- Desktop: hide inline children ----------
   L3 discovery on desktop happens entirely through .np-landing-active-row
   below the L2 grid. The inline .np-landing-children <ul> exists for the
   mobile fallback only — hidden here. */

@media (min-width: 992px) {
  .np-landing-children { display: none; }
}

/* ---------- Active L2's children — full-width row below the L2 grid ----------
   Renders only when one L2 is in the active trail and has children. The
   active L2's cluster-hue is mirrored via the parity class (odd/even matches
   the active L2's loop.index parity in the template).

   The .np-landing-item--child styling already defined above (background,
   border, hover transition, active-trail variant) applies inside this grid
   unchanged — only the container layout is new. */

.np-landing-active-row {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.75rem;
}

.np-landing-active-row--odd  { --cluster-hue: var(--npm-blue); }
.np-landing-active-row--even { --cluster-hue: var(--npm-beige); }

/* Combined mode — depth-1 landing page case. Each L3 carries its parent L2's
   cluster hue via per-item parity class, so the row visually echoes the L2
   grid above (children of odd-positioned parents → blue; even → beige). */
.np-landing-item--child--odd  { --cluster-hue: var(--npm-blue); }
.np-landing-item--child--even { --cluster-hue: var(--npm-beige); }

/* Card chrome for L3s inside the active-row (both specific-section and
   combined modes). The popup .np-landing-children keeps its single
   continuous-list look via its own background rule; active-row items
   need card chrome of their own because their wrapping <ul>
   (.np-landing-active-row) doesn't carry a background. */
.np-landing-active-row .np-landing-item--child {
  background: color-mix(in srgb, var(--cluster-hue) 12%, white);
  border: 1px solid color-mix(in srgb, var(--cluster-hue) 25%, white);
  border-radius: 6px;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.np-landing-active-row .np-landing-item--child:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.10);
  transform: translateY(-1px);
}

/* Active-trail L3 in the active-row: paint the whole <li> so the entire
   stretched grid cell shows the darker variant. The popup's stacked layout
   doesn't have this issue (cells are content-height), so the existing
   `.np-landing-item--child.is-active-trail > .np-landing-link` rule on the
   <a> is left in place — both rules apply, both at 28% color-mix, so the
   card paints uniformly. */
.np-landing-active-row .np-landing-item--child.is-active-trail {
  background: color-mix(in srgb, var(--cluster-hue) 28%, white);
}

@media (max-width: 991.98px) {
  .np-landing-submenu {
    margin: 1rem 0;
  }
  .np-landing-list {
    grid-template-columns: 1fr;
  }
  /* The active row is redundant on mobile — the L2 cards already render
     their children inline at this breakpoint via .np-landing-children,
     which is only hidden on desktop. */
  .np-landing-active-row {
    display: none;
  }
}
