/**
 * OptConnect stat bands (PR 3.15).
 *
 * One stylesheet for the family — `optconnect/stat-band` (the plain row) and
 * `optconnect/stat-band-icons` (the same row with a filled icon badge on each item).
 * `.oc-stat` has no dependency on the band around it, so it also serves the two stats
 * that sit inside 9858 `/services/fully-managed/`'s media + text split.
 *
 * **A stat is two paragraphs of text — no counter, no `data-to`, no script.** The three
 * live widgets all count up on scroll and all ship the animation's *starting* value as
 * their markup, which on `/services/semi-managed/` means the page reads `0+` where it
 * means `160+`. docs/history/phase-3.md → PR 3.15 has the measurements.
 *
 * The row lays out on flex rather than the grid `card-grid.css` uses, and that is the
 * one place this file argues with house style. Core's grid emits
 * `repeat(auto-fill, …)`, which keeps the empty track — so deleting a stat from the
 * 4-up row leaves a hole on the right. This pattern is expected to be edited after
 * insertion (`/technical-support/` has 4 stats, `/services/semi-managed/` 3), so the row
 * has to be indifferent to the count.
 *
 * Same no-margins convention as the other family stylesheets: nothing inside a
 * block-gapped group gets a `margin` declaration, because core's flow layout emits
 * `.wp-container-… > * + * { margin-block-start: … }` at one-class specificity and this
 * file loads after it. Spacing between blocks is `blockGap` in the pattern markup.
 * There are no exceptions here, and no media query — the row re-flows on `flex-basis`.
 */

/* --------------------------------------------------------------------------
 * The row
 *
 * Written at (0,2,0) to beat core's `.is-layout-flex { align-items: center }` on
 * specificity rather than on stylesheet order, the same call `testimonial.css` makes for
 * its `cite`. Centred, the numbers fall out of line the moment one label wraps to two
 * lines and its neighbour does not — `/technical-support/`'s "Average Call Length" next
 * to "Service Awards".
 *
 * The row's `justify-content: center` is a block attribute, not a rule here, so the
 * editor can see it. Keyed on the row alone, not the band: a row also sits in a
 * media + text copy column and under a section heading (the services batch, PR 6.1).
 * ---------------------------------------------------------------------- */
.oc-stat-band__items.is-layout-flex {
	align-items: stretch;
}

/* --------------------------------------------------------------------------
 * One stat
 *
 * `max-width` stops a stat left alone on the last row from stretching to the full
 * measure and reading as a different element from the ones above it — the failure mode
 * of a plain `flex: 1` here. `min-width: 0` stops a long unbroken value (`1,100,000+`)
 * from widening the item past its basis, the guard `.oc-card` carries.
 *
 * Centred, because three of the four live sections are; only `/services/semi-managed/`
 * is left-aligned.
 *
 * `justify-content: space-between` insures the type scale below. The items are equal
 * height, so if a value ever takes two lines this keeps every label pinned to the bottom
 * and the row still reads as a row.
 * ---------------------------------------------------------------------- */
.oc-stat {
	display: flex;
	min-width: 0;
	max-width: 22rem;
	flex: 1 1 14rem;
	flex-direction: column;
	justify-content: space-between;
	text-align: center;
}

/* --------------------------------------------------------------------------
 * The number
 *
 * Live this is 32px, 35px and 50px across the three sections — one role, three sizes,
 * all of them Open Sans 600, a font this theme does not load. Unified on Nunito 700. The
 * colour is the live one in every case: the Elementor kit's `primary`, i.e. `accent-1`.
 *
 * **The clamp ceiling is set by the longest value in the family, not by taste.** Four
 * stats at the 1140px content width are 234px each, and "60 Seconds" measures 193px at
 * 2.25rem and 236px at 2.75rem. Raise the ceiling and the value wraps — putting the unit
 * back on its own line, which is the bug these patterns exist to fix. Re-measure the
 * longest string against the narrowest track before changing it.
 *
 * `line-height: 1.1` rather than the site's 1.6: at 40px the inherited leading opens a
 * gap under the number that reads as a missing element.
 *
 * There is no `.oc-stat__unit`: the unit is part of this paragraph's own text
 * ("60 Seconds", "90%", "1,100,000+"). Live it is a sibling element, and a block-level
 * one, which is what breaks the line.
 * ---------------------------------------------------------------------- */
.oc-stat__value {
	color: var(--wp--preset--color--accent-1, #0081c2);
	font-family: var(--wp--preset--font-family--nunito, sans-serif);
	font-size: clamp(1.75rem, 3vw, 2.5rem);
	font-weight: 700;
	line-height: 1.1;
}

/* Body face and body weight: the label captions the number above it and is not a
   heading, however many `<h2>`s and `<h4>`s the live widgets emit here. `contrast` is
   `/technical-support/`'s own `#1D2C38`, the only title colour any of the three sections
   sets. */
.oc-stat__label {
	color: var(--wp--preset--color--contrast, #1d2c38);
	font-size: 1rem;
	line-height: 1.4;
}

/* --------------------------------------------------------------------------
 * The icon variant
 *
 * **The reference for this shape is `.success-item.style-six` in
 * `../restly/assets/css/theme.css`, not the rendered page.** The widget emits Bootstrap
 * grid classes and an icon-font `<i>`, and neither Restly's stylesheet nor its icon font
 * loads under a block theme — so `/services/our-approach/` renders it today as unstyled
 * body text with three empty icon slots.
 *
 * The border is `accent-5` rather than Restly's `#e7e7e9`, one of the demo greys with no
 * `theme.json` token — the same collapse every stray grey has taken since PR 3.1, and it
 * is the colour the plain pattern's band fills with, so both shapes draw from one value.
 *
 * Deliberately *not* `.oc-card`: that surface lifts and deepens its shadow on `:hover` /
 * `:focus-within` because everything wearing it is a link target. A stat is not
 * clickable, and an element that reacts to the pointer without doing anything is a
 * promise the page cannot keep. Same reasoning `testimonial.css` gives for declining it.
 * The 12px radius is shared, so a stat band between two rebuilt sections is cut the way
 * they are.
 * ---------------------------------------------------------------------- */
.oc-stat--icon {
	flex-basis: 18rem;
	flex-direction: row;
	align-items: center;
	justify-content: flex-start;
	border: 1px solid var(--wp--preset--color--accent-5, #eff2f8);
	border-radius: 12px;
	text-align: start;
}

/* `.oc-card__icon`'s badge repeated rather than reused: sharing the class across
   families would make `card-grid.css`'s selectors lie about what they style, and the
   fill differs, so this file would have had to override it anyway. */
.oc-stat__icon {
	display: flex;
	width: 72px;
	height: 72px;
	flex: none;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background-color: var(--wp--preset--color--accent-1, #0081c2);
}

/* The glyph arrives through an `<img src>`, so `currentColor` has nothing to inherit and
   the SVG renders the OC blue `tools/sync-icons.sh` bakes in (PR 3.1 explains why it is
   literal). `brightness(0)` flattens that to black and `invert(1)` turns it white, so
   one set of icon files serves both a pale badge and a filled one — the same trick
   `card-grid.css` uses. */
.oc-stat__icon img {
	filter: brightness(0) invert(1);
}

/* The badge is `flex: none`, so without `min-width: 0` the number pushes the whole box
   wider than its basis. */
.oc-stat__text {
	min-width: 0;
	flex: 1;
}
