/**
 * IC Office patterns: shared rules (design system 2026-11-05).
 * Every value is an ico token (--ico-*), a theme.json preset/role (--wp--*), or a layout token (--wp--custom--layout--*).
 * Selectors are tt5c-ic-* only: nothing here can reach the 300 NLS / Plaza / SCD sections.
 */

/* Section shell: vertical rhythm and page rails. */
.tt5c-ic-section {
	padding-block: var(--wp--custom--layout--section-y);
	padding-inline: var(--wp--custom--layout--gutter);
}
/* Stacked sections butt together (MTP-866, 2026-11-06). The page's blockGap (spacing 27 = 26px) otherwise put a
 * strip of page background between full-bleed sections, which shows whenever two coloured grounds meet.
 * Each section owns its own section-y padding. Only top-level IC sections in post content are affected. */
.wp-block-post-content > .tt5c-ic-section,
.entry-content > .tt5c-ic-section {
	margin-block-start: 0;
}
.tt5c-ic-section.has-primary-background-color,
:is(.tt5c-ic-on-dark, .is-style-ic-on-dark) {
	color: var(--ico-color-on-dark);
}
:is(.tt5c-ic-on-dark, .is-style-ic-on-dark) :where(h1, h2, h3, h4, p, a:not(.wp-element-button)) {
	color: inherit;
}
/* The IC On Dark style (Ocean 1) beats a section's preset background (2.1.17). IC Pull Quote (Secondary) and IC
 * Footer: Legal (Surface) ship with one, and core prints .has-*-background-color with !important, so the style's own
 * background (theme.json section style, :root :where()) lost: picking IC On Dark gave white text on Warm White.
 * Only the block style class, on Groups: the tt5c-ic-on-dark helper class stays as it was. */
.wp-block-group.is-style-ic-on-dark.has-background:not(.has-primary-background-color) {
	background-color: var(--wp--preset--color--primary) !important;
}

/* Type roles as classes (the spec's names). Headings default to the theme.json roles; these are the extra roles. */
.tt5c-ic-eyebrow {
	font-family: var(--ico-type-eyebrow-default-family);
	font-size: var(--ico-type-eyebrow-default-size);
	font-weight: var(--ico-type-eyebrow-default-weight);
	line-height: var(--ico-type-eyebrow-default-lh);
	letter-spacing: var(--ico-type-eyebrow-default-ls);
	text-transform: var(--ico-type-eyebrow-default-case);
	margin: 0;
}
.tt5c-ic-title-serif {
	font-family: var(--ico-type-headline-section-serif-family);
	font-size: var(--ico-type-headline-section-serif-size);
	font-weight: var(--ico-type-headline-section-serif-weight);
	line-height: var(--ico-type-headline-section-serif-lh);
	letter-spacing: var(--ico-type-headline-section-serif-ls);
	text-transform: var(--ico-type-headline-section-serif-case);
}
.tt5c-ic-title-card {
	font-family: var(--ico-type-headline-card-family);
	font-size: var(--ico-type-headline-card-size);
	font-weight: var(--ico-type-headline-card-weight);
	line-height: var(--ico-type-headline-card-lh);
	letter-spacing: var(--ico-type-headline-card-ls);
	text-transform: var(--ico-type-headline-card-case);
}
.tt5c-ic-body-small {
	font-size: var(--ico-type-body-small-size);
	line-height: var(--ico-type-body-small-lh);
	letter-spacing: var(--ico-type-body-small-ls);
}
.tt5c-ic-legal {
	font-size: var(--ico-type-legal-default-size);
	line-height: var(--ico-type-legal-default-lh);
	letter-spacing: var(--ico-type-legal-default-ls);
}

/* Readable measure for copy blocks. */
.tt5c-ic-measure { max-width: var(--wp--custom--layout--measure); }

/* Keyboard focus for links and controls inside IC sections (ico has no non-button ring yet: gap request #7, so the button ring is reused). */
:where([class*="tt5c-ic-"]) :is(a, button, [tabindex]):focus-visible {
	outline: var(--ico-btn-focus-ring-width) solid var(--ico-btn-focus-ring-color);
	outline-offset: var(--ico-btn-focus-ring-offset);
}
:is(.tt5c-ic-on-dark, .is-style-ic-on-dark) :is(a, button, [tabindex]):focus-visible,
.has-primary-background-color :is(a, button, [tabindex]):focus-visible {
	outline-color: var(--ico-color-on-dark);
}

/* Design-system page titles (Styleguide, Pattern Library): the landing template has no header, so the H1 brings its own rails. */
.tt5c-ds-title {
	margin: 0 min(0px, calc(var(--wp--custom--layout--gutter) - var(--wp--style--root--padding-left, 0px)));
	/* The post content already insets by the root padding; top the title up to the IC gutter so it lines up with full-width IC sections. */
	padding: var(--wp--custom--layout--section-y) max(0px, calc(var(--wp--custom--layout--gutter) - var(--wp--style--root--padding-left, 0px))) var(--wp--preset--spacing--30);
}
