/*
 * about-firms.css — Toro Legal Marketing
 *
 * /about/ — "The firms we work with" section. Cream surface.
 * Built from Figma node 513:6864 (practice-area pill grid).
 *
 *   1. Centred title + intro.
 *   2. Practice-area grid: 4-up rounded pill cards, each a circular
 *      grey icon chip (Carbon glyph) + label. Figma border is the
 *      card-border alpha (0.24). 2-up tablet, 1-up mobile.
 *   3. Fit / not-fit lists: two columns, check vs cross markers.
 *      No Figma frame for these — built to match the system; copy
 *      is canonical.
 *
 * Section bg, title, and body type match the Figma; all values
 * mapped to tokens (cream, navy, grey-100 chip, border-card hairline,
 * radius-pill, the type scale and spacing scale).
 */

.tlm-about-firms {
  background: var(--color-cream);
  padding-block: var(--space-3xl);
}

.tlm-about-firms__inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xl);
}

/* --- 1. Intro --- */

.tlm-about-firms__intro {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  max-width: 880px;
  margin-inline: auto;
  text-align: center;
}

.tlm-about-firms__heading {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: var(--weight-regular);
  font-size: var(--text-h2-mobile);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-display);
  color: var(--color-navy);
  text-wrap: balance;
}

.tlm-about-firms__lead {
  color: var(--color-navy-muted);
}

.tlm-about-firms__lead p {
  margin: 0 0 var(--space-sm);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
}

.tlm-about-firms__lead p:last-child {
  margin-bottom: 0;
}

/* --- 2. Practice-area pill grid / mobile carousel --- */

.tlm-about-firms__carousel {
  /* Pull the block up toward the intro: the __inner flex gap (60/80) is
     too large between "practising in:" and the first row. Negative top
     margin tightens only this seam; the grid→fit-lists gap is untouched. */
  margin-top: calc(-1 * var(--space-lg));
}

/* Mobile: slides sit in a horizontal scroll-snap track, one slide of 6
   pills per view; dots below. Desktop (>=768) flattens this back to the
   standard pill grid — the track stops scrolling, slides stack, and each
   slide renders as the normal multi-column grid. */
.tlm-about-firms__track {
  display: flex;
  gap: var(--space-md);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.tlm-about-firms__track::-webkit-scrollbar {
  display: none;
}

.tlm-about-firms__areas {
  flex: 0 0 100%;
  scroll-snap-align: start;
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

.tlm-about-firms__dots {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

.tlm-about-firms__dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--color-border-card);
  cursor: pointer;
  transition: background-color 150ms ease, width 150ms ease;
}

.tlm-about-firms__dot.is-active {
  width: 22px;
  background: var(--color-navy);
}

.tlm-about-firms__area {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm);
  border: 1px solid var(--color-border-card);
  border-radius: var(--radius-pill);
}

.tlm-about-firms__area-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-pill);
  background: var(--color-grey-100);
  color: var(--color-navy);
}

.tlm-about-firms__area-icon svg {
  width: 24px;
  height: 24px;
}

.tlm-about-firms__area-label {
  margin: 0;
  min-width: 0;
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-navy);
}

/* --- 3. Fit / not-fit lists --- */

.tlm-about-firms__fit {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
}

.tlm-about-firms__fit-heading {
  margin: 0 0 var(--space-md);
  font-family: var(--font-serif);
  font-weight: var(--weight-regular);
  font-size: var(--text-h3-mobile);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-display);
  color: var(--color-navy);
}

.tlm-about-firms__fit-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.tlm-about-firms__fit-item {
  display: flex;
  align-items: start;
  gap: var(--space-sm);
  color: var(--color-navy);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
}

.tlm-about-firms__fit-marker {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.tlm-about-firms__fit-marker svg {
  width: 24px;
  height: 24px;
}

.tlm-about-firms__fit-item--yes .tlm-about-firms__fit-marker {
  color: var(--color-navy);
}

.tlm-about-firms__fit-item--no .tlm-about-firms__fit-marker {
  color: var(--color-navy-subtle);
}

/* --- Tablet --- */

@media (min-width: 768px) {
  .tlm-about-firms__lead p {
    font-size: var(--text-lg);
  }

  /* Flatten the carousel into ONE continuous pill grid. The track becomes
     the grid; each slide <ul> dissolves (display:contents) so all 24 pills
     flow as direct grid items — otherwise each slide is its own grid and
     the 6-per-slide chunks render as ragged stacked blocks. Desktop only,
     so the iOS display:contents margin bug doesn't apply here. */
  .tlm-about-firms__track {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
    overflow: visible;
  }

  .tlm-about-firms__areas {
    display: contents;
  }

  .tlm-about-firms__dots {
    display: none;
  }

  .tlm-about-firms__fit {
    grid-template-columns: repeat(2, 1fr);
  }

  .tlm-about-firms__fit-item {
    font-size: var(--text-lg);
    line-height: var(--leading-relaxed);
  }
}

/* --- Desktop --- */

@media (min-width: 1024px) {
  .tlm-about-firms {
    padding-block: var(--space-4xl);
  }

  .tlm-about-firms__inner {
    gap: var(--space-4xl);
  }

  .tlm-about-firms__heading {
    font-size: var(--text-h2);
  }

  .tlm-about-firms__track {
    grid-template-columns: repeat(4, 1fr);
  }

  .tlm-about-firms__fit-heading {
    font-size: var(--text-h3);
  }
}
