/* =============================================================================
   Market data — Dental Acquisitions
   -----------------------------------------------------------------------------
   Only what is specific to this page. The shared vocabulary (.da-sec, .da-h1/2/3,
   .da-body, .da-rule, .da-btn, .da-note) lives in marketing/pages.css.

   Rebuilt 2026-09-04 from the pre-rebrand page, which used the v2 blocks
   (.page-hero, .feat-row, .mstat, .comp, .page-cta). None of that survives here.

   Scoped without a page-root class: marketing_page_stylesheet_tag loads
   marketing/pages/<action>.css, so this file is only ever on the market-data page
   and a bare .md-* selector is page-local by construction.

   Reads var(--da-*) / var(--da-sec-*) only. Colour literals belong in
   colors_and_type.css. See docs/marketing-design-system.md.
   ============================================================================= */

/* ═══ HEADLINE METRIC TILES ════════════════════════════════════════════════
   Four across on ink. Tiles rather than a .da-cols column set, because each one
   carries a chart and a hairline-separated text column would put a sparkline
   against a vertical rule. */
.md-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--sp-4);
  margin-top: var(--sp-12);
}

.md-stat {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: var(--sp-6);
  border: var(--border-hairline) solid var(--da-sec-hairline);
  border-radius: var(--radius-card);
  /* A tint of the band's own ink, so the tile reads as raised on bone AND on ink
     without either value being hardcoded to one band. */
  background: color-mix(in srgb, var(--da-sec-ink) 5%, transparent);
}

.md-stat__label {
  margin: 0;
  font-family: var(--font-brand);
  font-size: var(--da-eyebrow);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tk-eyebrow);
  text-transform: uppercase;
  color: var(--da-sec-accent);
}

.md-stat__value {
  margin: var(--sp-4) 0 0;
  font-family: var(--font-brand);
  font-size: var(--da-h2);
  font-weight: var(--fw-bold);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--da-sec-ink);
}

/* The YoY delta. Direction is carried by the trending_up / trending_down glyph,
   not by colour and not by a bare arrow character: "down 4 days to LOI" is GOOD
   news and "up 6pp DSO share" is neutral, so tinting one green and the other red
   would assert a judgment the data does not support. The pre-rebrand page painted
   every delta with --status-success-text for exactly that reason and got it
   wrong on two of the four tiles. */
.md-stat__delta {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin: var(--sp-2) 0 0;
  font-family: var(--font-brand);
  font-size: var(--e-meta);
  font-weight: var(--fw-semibold);
  color: var(--da-sec-muted);
}
.md-stat__delta .ico { --ico: 16px; flex: 0 0 auto; }

/* margin-top: auto pins the chart to the bottom of the tile, so the four
   sparklines share a baseline however long a label wraps.

   vector-effect keeps the 2px stroke at 2px: the viewBox is 100x30 with
   preserveAspectRatio="none", so the horizontal scale is roughly 4x the vertical
   one and a plain stroke would render as a wedge, thick on the verticals and
   thin on the horizontals.

   overflow: visible because the polyline touches y=6 and y=24 in a 30-unit box
   and half the stroke would otherwise be clipped at the extremes. */
.md-stat__spark {
  display: block;
  width: 100%;
  height: 34px;
  margin-top: auto;
  padding-top: var(--sp-5);
  overflow: visible;
  color: var(--da-sec-accent);
}
.md-stat__spark polyline {
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

/* ═══ DATA TABLES ══════════════════════════════════════════════════════════
   Both tables on this page use this block. They stay tables at every width and
   scroll inside their own container; the page body must never scroll
   horizontally, and a table that becomes stacked cards on a phone stops being
   comparable, which is the only reason to read one.

   -webkit-overflow-scrolling for momentum in the iOS webview the native app
   renders these pages in. */
.md-table-wrap {
  margin-top: var(--sp-10);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: var(--border-hairline) solid var(--da-sec-hairline);
  border-radius: var(--radius-card);
}

.md-table {
  width: 100%;
  /* Six columns. Below this the metro names wrap to three lines and the numeric
     columns collide, so the container scrolls instead. */
  min-width: 760px;
  border-collapse: collapse;
  font-family: var(--font-brand);
}

/* The caption names the scroll region for anyone arriving by screen reader.
   Visually the section heading already says it, so it is clipped rather than
   displayed. Not `display: none`: that would remove it from the accessibility
   tree, which is the opposite of the point. */
.md-table__caption {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.md-table thead th {
  padding: var(--sp-5) var(--sp-5);
  text-align: left;
  font-size: var(--da-eyebrow);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tk-eyebrow);
  text-transform: uppercase;
  color: var(--da-sec-accent);
  border-bottom: var(--border-hairline) solid var(--da-sec-hairline);
  white-space: nowrap;
}

.md-table tbody th {
  padding: var(--sp-4) var(--sp-5);
  text-align: left;
  font-size: var(--e-body-sm);
  font-weight: var(--fw-semibold);
  color: var(--da-sec-ink);
  white-space: nowrap;
}

.md-table tbody td {
  padding: var(--sp-4) var(--sp-5);
  font-size: var(--e-body-sm);
  color: var(--da-sec-body);
}

.md-table tbody tr + tr th,
.md-table tbody tr + tr td {
  border-top: var(--border-hairline) solid var(--da-sec-hairline);
}

/* Numeric columns are right-aligned so the digits stack, and `tnum` in the
   markup makes the figures the same width per glyph. Together that is what lets
   a reader scan a column rather than read it. */
.md-table__n { text-align: right; white-space: nowrap; }
.md-table thead .md-table__n { text-align: right; }

/* The trend cell keeps its glyph next to its figure, right-aligned with the
   rest of the numeric columns. Direction comes from the icon, per the note on
   .md-stat__delta above: no red, no green. */
.md-table__trend > * { vertical-align: middle; }
.md-table__trend .ico {
  --ico: 16px;
  margin-right: var(--sp-2);
  color: var(--da-sec-accent);
}

/* ═══ CLOSING ══════════════════════════════════════════════════════════════ */
.md-cta .da-body { margin-top: var(--sp-5); }
.md-cta__tagline {
  margin: var(--sp-10) 0 0;
  padding-top: var(--sp-8);
  border-top: var(--border-hairline) solid var(--da-sec-hairline);
  font-family: var(--font-brand);
  font-size: var(--e-card-title-sm);
  font-weight: var(--fw-medium);
  letter-spacing: 0.02em;
  color: var(--da-sec-accent);
}

/* ═══ RESPONSIVE ═══════════════════════════════════════════════════════════
   Matches the shared breakpoints in pages.css (1099 / 899 / 639) rather than
   inventing new ones, so a band and its contents change together. */
@media (max-width: 1099px) {
  .md-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md-stat { padding: var(--sp-5); }
}

@media (max-width: 639px) {
  /* One up. Two 150px tiles side by side put a 40px figure next to a wrapped
     three-line label, and the sparkline gets 60px of width to draw nine points
     in. */
  .md-stats { grid-template-columns: minmax(0, 1fr); gap: var(--sp-3); }
  .md-stat__value { font-size: var(--da-h3); }
  .md-table-wrap { margin-top: var(--sp-8); }
  .md-cta__tagline { padding-top: var(--sp-6); margin-top: var(--sp-8); }
}
