/* ===== Service-page "Features" module =====
   Reusable feature-grid for the service-page template.
   Figma node 396:2210. Mobile-first.

   Layout owned here: intro stack, the wrapping feature grid, the
   icon chip. Section horizontal padding + container cap come from
   .tlm-section / .tlm-container (layout.css). */

.tlm-service-page-features {
  /* Mobile: 40/40 — tighter stacked-section rhythm. Desktop bumps to
     120 in the @media block below. (Previously this module had no
     mobile override, so it sat at 120 on phones too.) */
  padding-block: var(--space-section-y-mobile);
  background-color: var(--color-navy-wash);
}

/* Cream-background variant — opt-in per page. */
.tlm-service-page-features--cream {
  background-color: var(--color-cream);
}

/* Plain white variant — opt-in per page. The module default is the
   navy-wash tint, so a page wanting a true white section adds this. */
.tlm-service-page-features--white {
  background-color: var(--color-white);
}

.tlm-service-page-features__inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);              /* 48 — intro → grid */
}

/* --- Intro: heading + optional lede, stacked left --- */

.tlm-service-page-features__intro {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  max-width: 720px;
}

.tlm-service-page-features__title {
  font-family: var(--font-serif);
  font-size: var(--text-h2-mobile);
  font-weight: var(--weight-regular);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--color-text-on-light);
}

.tlm-service-page-features__lead {
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--color-navy-muted);
}

/* --- Feature grid --- */

.tlm-service-page-features__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);              /* 24 mobile — tighter stack; bumps to 48 at desktop */
  /* Cards hug their own content height. Without this, grid's default
     align-items:stretch makes both cards in a row match the taller
     one, leaving uneven trailing whitespace under the shorter card. */
  align-items: start;
  padding: 0;
  margin: 0;
  list-style: none;
}

.tlm-service-page-features__item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* Icon chip — solid navy fill with a white glyph, a strong accent
   against the navy-wash section background. (The why-module chip uses
   grey-100 on its white section; this module diverges deliberately.)
   The inline SVG inherits `color` via currentColor.
   Within-item rhythm is set with explicit margins (not a flex gap) so
   it can absorb the line-height leading: chip and title sit close, the
   bigger gap lives BETWEEN items so each one reads as a single unit. */
.tlm-service-page-features__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: var(--space-xl);            /* 48 circle */
  height: var(--space-xl);
  margin-bottom: var(--space-xs);    /* 8 chip → title — tight, binds the unit */
  border-radius: var(--radius-pill);
  background-color: var(--color-navy);
  color: var(--color-white);
}

.tlm-service-page-features__icon svg {
  display: block;
}

.tlm-service-page-features__item-title {
  margin: 0;                         /* Gap-driven by the sibling rules below (+12 to list, +4 to body), NOT by the heading's old UA margin. The __item parent is a gapless flex column, so without this the UA 1em would dominate. */
  font-family: var(--font-serif);
  font-size: var(--text-2xl);        /* 24 — H5 level */
  font-weight: var(--weight-regular);
  line-height: var(--leading-tight); /* 1.25 — titles run 1-2 lines, no need for 1.5 leading */
  letter-spacing: var(--tracking-tight);
  color: var(--color-text-on-light);
}

.tlm-service-page-features__item-title + .tlm-service-page-features__item-body {
  margin-top: var(--space-2xs);      /* 4 title → body — tight, binds the pair */
}

.tlm-service-page-features__item-body {
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--color-navy-muted);
}

/* --- List-card variant ---
   A feature item can carry a bulleted list (__item-list) instead of a
   single body paragraph — used by capability pages' "What we do"
   sections, where each card is a headed group of points. */
.tlm-service-page-features__item-title + .tlm-service-page-features__item-list {
  margin-top: 12px;                    /* H3 → list. Off-scale (8/16 jump): unified H3-to-text gap, matches engagements __copy. */
}

.tlm-service-page-features__item-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);                /* 8 between points — halved from 16 for tighter, scannable lists */
}

.tlm-service-page-features__item-list li {
  position: relative;
  padding-left: var(--space-md);       /* 24 — room for the marker */
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--color-navy-muted);
}

/* Custom marker — a small navy dot, aligned to the first line. */
.tlm-service-page-features__item-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 6px;
  height: 6px;
  border-radius: var(--radius-pill);
  background-color: var(--color-navy);
}

/* --- Tablet: 2 columns --- */

@media (min-width: 768px) {
  .tlm-service-page-features__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-xl);              /* 48 — multi-column grid wants the wider gutter */
  }
}

/* --- Desktop: 4 columns --- */

@media (min-width: 1024px) {
  .tlm-service-page-features {
    padding-block: var(--space-5xl);   /* 120 top + bottom — matches Figma frame */
  }

  .tlm-service-page-features__title {
    font-size: var(--text-h2);
  }

  .tlm-service-page-features__grid {
    grid-template-columns: repeat(4, 1fr);
  }

  /* List-card grid stays at 2 columns — tall headed lists don't suit
     a 4-up row. */
  .tlm-service-page-features__grid--lists {
    grid-template-columns: repeat(2, 1fr);
  }
}
