/*
 * ColigoMed 2026 theme styles.
 *
 * Brand colors, font and text sizes are defined in theme.json and arrive here
 * as CSS variables: --wp--preset--color--<name> for the palette and
 * --wp--custom--color--<name> for one-off design colors. Use those variables,
 * not new hex values.
 *
 * Sections follow the page from top to bottom. Every animation is inside the
 * "Motion" block at the end, so visitors who ask for reduced motion get none.
 */

/* ---------- Base and layout ---------- */

/* Sections set their own spacing, so remove WordPress's default gaps between blocks. */
body .wp-site-blocks > *,
body .cm-main > * {
	margin-block: 0;
}

body :is(.cm-section, .cm-proof, .cm-site-header, .cm-site-footer) * {
	margin-block: 0;
}

.cm-container {
	box-sizing: border-box;
	width: 100%;
	max-width: 1240px;
	margin-inline: auto;
	padding-inline: 32px;
}

.cm-container--narrow {
	max-width: 900px;
}

@media (max-width: 600px) {
	.cm-container {
		padding-inline: 16px;
	}
}

.cm-section {
	background: var(--wp--preset--color--white);
}

.cm-section > .cm-container {
	padding-block: clamp(64px, 8vw, 96px);
}

.cm-section--navy,
.cm-section--deep {
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--text);
}

.cm-section--surface {
	background: var(--wp--preset--color--surface);
}

/* Keyboard focus ring. */
:where(a, button, input, select, summary, [tabindex]):focus-visible {
	outline: 2px solid var(--wp--preset--color--teal);
	outline-offset: 3px;
}

/* ---------- Shared components ---------- */

/* Small uppercase label above a heading. */
.cm-eyebrow {
	font-size: var(--wp--preset--font-size--eyebrow);
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--wp--preset--color--teal);
}

/* Section intro: eyebrow, heading and short paragraph. */
.cm-intro {
	display: flex;
	flex-direction: column;
	gap: 14px;
	max-width: 760px;
}

.cm-intro__text {
	font-size: 18px;
	line-height: 1.6;
	color: var(--wp--preset--color--text-2);
}

:is(.cm-section--navy, .cm-section--deep) .cm-intro__text {
	color: var(--wp--preset--color--on-dark);
}

.cm-lead {
	max-width: 560px;
	font-size: var(--wp--preset--font-size--lead);
	line-height: 1.55;
	color: var(--wp--preset--color--on-dark);
}

/* Heading size variants used by a few sections. */
.cm-h2-sm {
	font-size: clamp(30px, 3.2vw, 44px);
	line-height: 1.1;
}

.cm-h2-lg {
	font-size: clamp(32px, 3.6vw, 52px);
	line-height: 1.12;
}

/* Text link with an arrow, for "Explore ..." and "Read ..." links. */
.cm-arrow-link,
.cm-arrow-link a {
	font-size: 17px;
	font-weight: 700;
}

/* Buttons: theme.json sets the mint pill. These add the ghost and smaller sizes. */
.wp-block-buttons {
	gap: 14px;
}

.wp-block-button.is-style-outline-dark .wp-block-button__link {
	padding: 15px 24px;
	border: 1px solid var(--wp--custom--color--ghost-border);
	background: transparent;
	color: var(--wp--preset--color--navy-deep);
	font-weight: 600;
}

.cm-btn-md .wp-block-button__link {
	padding: 14px 22px;
	font-size: 16px;
}

.cm-btn-sm .wp-block-button__link {
	padding: 12px 20px;
	font-size: 15px;
}

/* Horizontal list with a separator between items (trust row, EMR strip, badges). */
.cm-inline-list {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 22px;
	padding: 0;
	list-style: none;
}

/* Flex keeps the separator on the same line in the editor, where the item text is its own element. */
.cm-inline-list li {
	display: flex;
	align-items: baseline;
}

.cm-inline-list li:not(:first-child)::before {
	content: "·" / "";
	margin-right: 22px;
}

.cm-inline-list--slash {
	gap: 12px 24px;
}

.cm-inline-list--slash li:not(:first-child)::before {
	content: "/" / "";
	margin-right: 24px;
	color: var(--wp--custom--color--separator);
}

.cm-inline-list--plain li::before {
	content: none !important;
}

/* Cards. */
.cm-card {
	display: flex;
	flex-direction: column;
	gap: 14px;
	padding: 30px;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 20px;
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--text);
	font-size: 16px;
	line-height: 1.55;
}

.cm-card__eyebrow {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.1em;
	color: var(--wp--preset--color--teal);
}

.cm-card__title {
	font-size: var(--wp--preset--font-size--heading-3);
	font-weight: 700;
	letter-spacing: 0;
}

.cm-card__title a {
	color: var(--wp--preset--color--navy-deep);
}

/* Whole card is clickable through the title link. */
.cm-card--link {
	position: relative;
}

.cm-card--link .cm-card__title a::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
}

.cm-card--link:hover {
	border-color: var(--wp--preset--color--teal);
}

.cm-card--dark {
	gap: 16px;
	padding: 32px;
	border-color: var(--wp--preset--color--panel-border);
	border-radius: 22px;
	background: var(--wp--preset--color--panel);
	color: var(--wp--preset--color--on-dark);
}

/* Pill tags. */
.cm-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	padding: 0;
	list-style: none;
}

.cm-pill {
	padding: 10px 14px;
	border-radius: 999px;
	background: var(--wp--preset--color--pill);
	color: var(--wp--preset--color--pill-ink);
	font-size: 15px;
	font-weight: 600;
}

/* Pulsing status dot (hero timeline and agent cards). */
.cm-live {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 12px;
	color: var(--wp--preset--color--teal);
}

.cm-live__dot {
	display: inline-block;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--wp--preset--color--mint);
}

/* ---------- Site header ---------- */

.cm-site-header {
	border-bottom: 1px solid var(--wp--preset--color--line);
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--navy-deep);
}

.cm-site-header__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	padding-block: 18px;
}

.cm-logo img {
	display: block;
	width: auto;
	height: 30px;
}

.cm-nav {
	font-size: 15px;
	font-weight: 500;
}

.cm-nav .wp-block-navigation__container {
	gap: 28px;
}

/* Core navigation styles set link color to "inherit" with a doubled class, so match it plus body. */
body .cm-nav .wp-block-navigation-item__content.wp-block-navigation-item__content,
.cm-site-header__signin a {
	color: var(--wp--preset--color--on-dark-2);
}

body .cm-nav .wp-block-navigation-item__content.wp-block-navigation-item__content:hover,
.cm-site-header__signin a:hover {
	color: var(--wp--preset--color--teal);
}

/* Dropdown menus: each top item is a button that opens a white panel of links. */
.cm-nav .wp-block-navigation-submenu__toggle {
	padding-block: 12px;
	font-weight: 600;
	cursor: pointer;
}

.cm-nav .wp-block-navigation-submenu__toggle[aria-expanded="true"] {
	color: var(--wp--preset--color--teal);
}

body .cm-nav .wp-block-navigation__submenu-container.wp-block-navigation__submenu-container {
	min-width: 220px;
	padding: 10px;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 14px;
	background: var(--wp--preset--color--white);
	box-shadow: var(--wp--custom--shadow--card);
}

body .cm-nav .wp-block-navigation__submenu-container .wp-block-navigation-item__content.wp-block-navigation-item__content {
	padding: 10px 12px;
	border-radius: 8px;
	color: var(--wp--preset--color--navy-deep);
	white-space: nowrap;
}

body .cm-nav .wp-block-navigation__submenu-container .wp-block-navigation-item__content.wp-block-navigation-item__content:hover {
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--teal);
}

/* The last dropdown (Company) opens toward the left, so it never runs past the right edge on tablets. */
body .cm-nav .wp-block-navigation__container > .has-child:last-child > .wp-block-navigation__submenu-container.wp-block-navigation__submenu-container {
	right: 0;
	left: auto;
}

/* Phone menu: the dropdowns show as plain lists under each heading. */
body .cm-nav .is-menu-open .wp-block-navigation__submenu-container.wp-block-navigation__submenu-container {
	min-width: 0;
	padding: 4px 0 12px 12px;
	border: 0;
	box-shadow: none;
}

body .cm-nav .is-menu-open .wp-block-navigation__submenu-container .wp-block-navigation-item__content.wp-block-navigation-item__content {
	white-space: normal;
}

.cm-site-header__actions {
	display: flex;
	align-items: center;
	gap: 12px;
}

.cm-site-header__signin a {
	display: inline-block;
	padding: 12px 8px;
	font-size: 15px;
	font-weight: 500;
}

/* Phones: logo and menu button on the first row, Sign in and Book a demo below. */
@media (max-width: 599px) {
	.cm-site-header__inner {
		gap: 12px 16px;
	}

	.cm-nav {
		order: 2;
	}

	.cm-site-header__actions {
		order: 3;
		width: 100%;
	}
}

/* ---------- Home: hero ---------- */

.cm-hero {
	overflow: hidden;
}

.cm-section > .cm-hero__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 64px;
	padding-block: clamp(56px, 7vw, 88px) clamp(64px, 8vw, 104px);
}

.cm-hero__copy {
	display: flex;
	flex: 1 1 520px;
	flex-direction: column;
	gap: 28px;
	min-width: 0;
}

.cm-hero__trust {
	padding-top: 8px;
	font-size: 14px;
	color: var(--wp--preset--color--on-dark-muted);
}

/* Home hero picture: the before/during/after loop. */
.cm-hero__visual {
	flex: 1 1 480px;
	min-width: 0;
	max-width: 620px;
	margin-inline: auto;
}

.cm-hero__visual img {
	display: block;
	width: 100%;
	height: auto;
}

/* Animated timeline card (Agentic AI hero). */
.cm-timeline {
	flex: 1 1 440px;
	min-width: 0;
	max-width: 520px;
	margin-inline: auto;
}

.cm-timeline__card {
	padding: 22px;
	border: 1px solid var(--wp--preset--color--panel-border);
	border-radius: 22px;
	background: var(--wp--preset--color--panel);
	box-shadow: var(--wp--custom--shadow--card);
}

.cm-timeline__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding-bottom: 16px;
	border-bottom: 1px solid var(--wp--preset--color--panel-border);
}

.cm-timeline__head > div {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.cm-timeline__title {
	font-size: 16px;
	font-weight: 700;
	color: var(--wp--preset--color--navy-deep);
}

.cm-timeline__sub {
	font-size: 13px;
	color: var(--wp--preset--color--on-dark-muted);
}

.cm-timeline__list {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 18px 0 0;
	list-style: none;
}

.cm-timeline__event {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	padding: 12px 14px;
	border: 1px solid var(--wp--preset--color--panel-border);
	border-radius: 14px;
	background: var(--wp--custom--color--event);
}

.cm-timeline__time {
	min-width: 44px;
	padding-top: 2px;
	font-size: 12px;
	color: var(--wp--preset--color--on-dark-muted);
}

.cm-timeline__body {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
}

.cm-timeline__tag {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.1em;
	color: var(--wp--preset--color--teal);
}

.cm-timeline__name {
	font-size: 15px;
	font-weight: 600;
	color: var(--wp--preset--color--navy-deep);
}

.cm-timeline__detail {
	font-size: 13px;
	color: var(--wp--preset--color--on-dark-muted);
}

.cm-tone--blue .cm-timeline__tag {
	color: var(--wp--custom--color--event-blue);
}

.cm-tone--amber {
	border-color: var(--wp--custom--color--event-amber-border);
	background: var(--wp--custom--color--event-amber-bg);
}

.cm-tone--amber .cm-timeline__tag {
	color: var(--wp--custom--color--event-amber);
}

/* ---------- Home: proof band ---------- */

.cm-proof {
	border-bottom: 1px solid var(--wp--preset--color--border-2);
	background: var(--wp--preset--color--white);
}

.cm-proof__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
	gap: 32px;
	padding-block: 56px;
}

.cm-stat {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.cm-stat__value {
	font-size: 48px;
	font-weight: 700;
	line-height: 1.1;
	letter-spacing: -0.01em;
	color: var(--wp--preset--color--navy-deep);
}

.cm-stat__label {
	font-size: 16px;
	line-height: 1.5;
	color: var(--wp--preset--color--text-2);
}

.cm-footnote {
	padding-bottom: 28px;
	font-size: 12px;
	color: var(--wp--preset--color--muted);
}

/* ---------- Home: journey tabs ---------- */

.cm-journey__inner,
.cm-tabs {
	display: flex;
	flex-direction: column;
	gap: 40px;
}

.cm-tabs__list {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

/* Without JavaScript the tab buttons do nothing, so hide them and show every panel. */
.cm-tabs:not(.is-ready) .cm-tabs__list {
	display: none;
}

.cm-tabs__tab {
	min-height: 48px;
	padding: 14px 22px;
	border: 1px solid var(--wp--custom--color--tab-border);
	border-radius: 999px;
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--navy-deep);
	font-family: inherit;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
}

.cm-tabs__tab[aria-selected="true"] {
	border-color: var(--wp--preset--color--navy-deep);
	background: var(--wp--preset--color--navy-deep);
	color: var(--wp--preset--color--white);
}

.cm-tabs__panel {
	display: flex;
	flex-wrap: wrap;
	align-items: stretch;
	gap: 40px;
}

.cm-tabs__panel[hidden] {
	display: none;
}

.cm-tabs__copy {
	display: flex;
	flex: 1 1 420px;
	flex-direction: column;
	gap: 20px;
	min-width: 0;
}

.cm-tabs__copy h3 {
	font-size: 30px;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: 0;
}

.cm-tabs__copy ul {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding-left: 20px;
	font-size: 17px;
	line-height: 1.55;
	color: var(--wp--preset--color--text-2);
}

.cm-sample {
	display: flex;
	flex: 1 1 420px;
	flex-direction: column;
	gap: 14px;
	min-width: 0;
	padding: 28px;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 20px;
	background: var(--wp--preset--color--white);
}

.cm-sample__label {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.1em;
	color: var(--wp--preset--color--muted);
}

.cm-sample__row {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	padding: 12px 0;
	border-bottom: 1px solid var(--wp--preset--color--border-2);
	font-size: 16px;
}

.cm-sample__row:last-child {
	border-bottom: 0;
}

.cm-sample__row dd {
	margin-inline-start: 0;
	font-weight: 700;
	text-align: right;
	color: var(--wp--preset--color--navy-deep);
}

.cm-sample__row dd.is-success {
	color: var(--wp--preset--color--success);
}

.cm-sample__row dd.is-warning {
	color: var(--wp--preset--color--warning);
}

.cm-sample__foot {
	font-size: 12px;
	color: var(--wp--preset--color--muted);
}

.cm-sample__note {
	padding-top: 6px;
	font-size: 16px;
	line-height: 1.55;
	color: var(--wp--preset--color--text-2);
}

/* ---------- Home: agents ---------- */

.cm-agents__inner {
	display: flex;
	flex-direction: column;
	gap: 44px;
}

.cm-agents__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
	gap: 16px;
	padding: 0;
	list-style: none;
}

.cm-agent {
	display: flex;
	flex-direction: column;
	gap: 14px;
	padding: 22px;
	border: 1px solid var(--wp--preset--color--panel-border);
	border-radius: 18px;
	background: var(--wp--preset--color--panel);
}

.cm-agent__state {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.1em;
	color: var(--wp--preset--color--teal);
}

.cm-section .cm-agent__name {
	font-size: 20px;
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: 0;
}

.cm-agent__job {
	font-size: 15px;
	line-height: 1.5;
	color: var(--wp--preset--color--on-dark);
}

.cm-agent__bar {
	height: 4px;
	overflow: hidden;
	border-radius: 4px;
	background: var(--wp--preset--color--line);
}

.cm-agent__bar span {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 4px;
	background: var(--wp--preset--color--mint);
}

.cm-agent__status {
	font-size: 12px;
	color: var(--wp--preset--color--on-dark-muted);
}

.cm-emr-strip {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 24px;
	padding: 22px 26px;
	border: 1px solid var(--wp--preset--color--panel-border);
	border-radius: 18px;
	font-size: 15px;
	color: var(--wp--preset--color--on-dark-2);
}

.cm-emr-strip__label {
	font-weight: 700;
	color: var(--wp--preset--color--teal);
}

/* ---------- Home: nurse story ---------- */

.cm-section > .cm-story__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 64px;
	padding-block: clamp(64px, 8vw, 104px);
}

.cm-story__copy {
	display: flex;
	flex: 1 1 460px;
	flex-direction: column;
	gap: 22px;
	min-width: 0;
}

.cm-story__text {
	font-size: 18px;
	line-height: 1.65;
	color: var(--wp--preset--color--text-2);
}

.cm-story__byline {
	font-size: 15px;
	color: var(--wp--preset--color--muted);
}

/* Numbered steps: the number comes from a CSS counter, the title is the bold text. */
.cm-steps {
	flex: 1 1 420px;
	min-width: 0;
	padding: 0;
	list-style: none;
	counter-reset: cm-step;
}

.cm-steps li {
	display: grid;
	grid-template-columns: 40px 1fr;
	gap: 4px 18px;
	padding: 22px 0;
	border-bottom: 1px solid var(--wp--preset--color--border-2);
	font-size: 16px;
	line-height: 1.55;
	color: var(--wp--preset--color--text-2);
	counter-increment: cm-step;
}

.cm-steps li:last-child {
	border-bottom: 0;
}

.cm-steps li::before {
	content: counter(cm-step, decimal-leading-zero);
	grid-row: span 2;
	font-size: 28px;
	font-weight: 700;
	line-height: 1.1;
	color: var(--wp--preset--color--teal);
}

.cm-steps strong {
	font-size: 18px;
	font-weight: 700;
	color: var(--wp--preset--color--navy-deep);
}

/* ---------- Home: who we serve and testimonials ---------- */

.cm-serve__inner,
.cm-testimonials__inner {
	display: flex;
	flex-direction: column;
	gap: 40px;
}

.cm-card-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 20px;
}

.cm-quote-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
	gap: 20px;
}

.cm-quote.wp-block-quote {
	display: flex;
	flex-direction: column;
	gap: 18px;
	padding: 30px;
	border: 0;
	border-radius: 20px;
	background: var(--wp--preset--color--surface);
}

.cm-quote p {
	font-size: 17px;
	line-height: 1.6;
	color: var(--wp--preset--color--text);
}

.cm-quote cite {
	font-size: 14px;
	font-style: normal;
	font-weight: 600;
	color: var(--wp--preset--color--muted);
}

/* ---------- Home: why now and ROI card ---------- */

.cm-section > .cm-why-now__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 48px;
	padding-block: clamp(64px, 8vw, 88px);
}

.cm-why-now__copy {
	display: flex;
	flex: 1 1 480px;
	flex-direction: column;
	gap: 18px;
	min-width: 0;
}

.cm-why-now .cm-arrow-link a {
	color: var(--wp--preset--color--teal);
}

.cm-roi-card {
	flex: 1 1 380px;
	min-width: 0;
}

.cm-section .cm-roi-card__title {
	font-size: var(--wp--preset--font-size--heading-3);
	font-weight: 700;
	letter-spacing: 0;
}

/* ---------- Home: FAQ ---------- */

.cm-faq__inner {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

body .cm-faq h2 {
	margin-bottom: 16px;
	font-size: clamp(30px, 3.2vw, 42px);
}

.cm-faq__item {
	padding: 20px 24px;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 16px;
	background: var(--wp--preset--color--white);
}

.cm-faq__item summary {
	font-size: 18px;
	font-weight: 700;
	color: var(--wp--preset--color--navy-deep);
	cursor: pointer;
}

body .cm-faq__item p {
	margin-top: 12px;
	font-size: 16px;
	line-height: 1.6;
	color: var(--wp--preset--color--text-2);
}

/* ---------- Home: demo request ---------- */

.cm-section > .cm-demo__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 48px;
	padding-block: clamp(64px, 8vw, 104px);
}

.cm-demo__copy {
	display: flex;
	flex: 1 1 440px;
	flex-direction: column;
	gap: 18px;
	min-width: 0;
}

.cm-demo__badges {
	gap: 10px 20px;
	font-size: 15px;
	color: var(--wp--preset--color--text-2);
}

.cm-form {
	box-sizing: border-box;
	display: flex;
	flex: 1 1 420px;
	flex-direction: column;
	gap: 14px;
	min-width: 0;
	padding: 30px;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 22px;
	background: var(--wp--preset--color--surface);
}

.cm-form label {
	font-size: 14px;
	font-weight: 600;
	color: var(--wp--preset--color--navy-deep);
}

.cm-form :is(input, select) {
	box-sizing: border-box;
	width: 100%;
	padding: 14px;
	border: 1px solid var(--wp--preset--color--input-border);
	border-radius: 12px;
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--text);
	font-family: inherit;
	font-size: 16px;
}

body .cm-form__submit {
	margin-top: 6px;
	padding: 16px;
	border: 0;
	border-radius: 999px;
	background: var(--wp--preset--color--navy-deep);
	color: var(--wp--preset--color--white);
	font-family: inherit;
	font-size: 17px;
	font-weight: 700;
	cursor: pointer;
}

.cm-form__status {
	padding: 12px 14px;
	border-radius: 12px;
	background: var(--wp--preset--color--pill);
	color: var(--wp--preset--color--pill-ink);
	font-size: 15px;
	font-weight: 600;
}

body .cm-form__submit:disabled {
	opacity: 0.6;
	cursor: wait;
}

/* Field error from Contact Form 7, shown under the field. */
.cm-form__error {
	margin-top: -6px;
	font-size: 14px;
	font-weight: 600;
	color: var(--wp--preset--color--warning);
}

/* Stays in the page while empty so screen readers announce the message when it appears. */
.cm-form__status:empty {
	padding: 0;
}

.cm-form__note {
	font-size: 12px;
	color: var(--wp--preset--color--muted);
}

/* ---------- Site footer ---------- */

.cm-site-footer {
	border-top: 1px solid var(--wp--preset--color--border);
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--on-dark-muted);
	font-size: 15px;
}

.cm-site-footer__inner {
	display: flex;
	flex-direction: column;
	gap: 40px;
	padding-block: 64px 40px;
}

.cm-site-footer__top {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 40px;
}

.cm-site-footer__brand {
	display: flex;
	flex: 1 1 260px;
	flex-direction: column;
	gap: 16px;
	line-height: 1.6;
}

.cm-logo--footer img {
	height: 28px;
}

.cm-site-footer__col {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.cm-site-footer__heading {
	font-weight: 700;
	color: var(--wp--preset--color--navy-deep);
}

.cm-site-footer__links,
.cm-site-footer__legal {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 0;
	list-style: none;
}

.cm-site-footer a {
	color: var(--wp--preset--color--on-dark-muted);
}

.cm-site-footer a:hover {
	color: var(--wp--preset--color--teal);
}

.cm-site-footer__bottom {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 12px 28px;
	padding-top: 24px;
	border-top: 1px solid var(--wp--preset--color--line);
	font-size: 13px;
}

.cm-site-footer__legal {
	flex-direction: row;
	flex-wrap: wrap;
	gap: 20px;
}

/* ---------- Other pages (page, post, blog list, 404) ---------- */

.cm-page {
	padding-block: 64px 96px;
}

/* Links inside running text need an underline: teal alone is too close to the text color. */
.wp-block-post-content a:where(:not(.wp-element-button)),
.cm-faq__item p a {
	text-decoration: underline;
	text-underline-offset: 2px;
}

body .cm-main > .cm-blog__intro {
	margin-bottom: 48px;
}

.cm-404 {
	display: flex;
	flex-direction: column;
	gap: 24px;
}

/* Author and date of a post, on the blog list and on the post itself. */
.cm-blog-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 16px;
	font-size: 14px;
	color: var(--wp--preset--color--muted);
}

.cm-blog-meta__author {
	font-weight: 600;
	color: var(--wp--preset--color--navy-deep);
}

.cm-blog-meta > * {
	margin: 0;
}

/* Posts: header and text at a readable width, with smaller headings than the design sections. */
.cm-article__header {
	display: flex;
	flex-direction: column;
	gap: 16px;
	max-width: var(--wp--style--global--content-size);
	margin-inline: auto;
	padding-bottom: 40px;
}

.cm-article__header > * {
	margin-block: 0;
}

/* Post thumbnail above the title, at the same width as the text. */
body .cm-article > .cm-article__image {
	max-width: var(--wp--style--global--content-size);
	margin: 0 auto 40px;
}

.cm-article__image img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 18px;
}

/* Post page: the article, with the latest posts beside it on wide screens and below it on phones. */
.cm-article__layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 64px;
}

@media (min-width: 1024px) {
	.cm-article__layout {
		grid-template-columns: minmax(0, 1fr) 280px;
		gap: 56px;
	}

	.cm-article__sidebar {
		position: sticky;
		top: 32px;
		align-self: start;
	}
}

.cm-article__layout > * {
	min-width: 0;
	margin-block: 0;
}

body .cm-article__sidebar-title {
	margin: 0 0 24px;
	font-size: 26px;
}

.cm-latest-list {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
	gap: 28px;
	margin: 0;
	padding: 0;
	list-style: none;
}

/* WordPress adds a top margin to list items and nav links; the grid gap spaces them instead. */
.cm-latest-list > li,
.cm-article__nav > * {
	margin-block: 0;
}

.cm-latest {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.cm-latest > * {
	margin-block: 0;
}

.cm-latest__image img {
	display: block;
	width: 100%;
	aspect-ratio: 2 / 1;
	object-fit: cover;
	border-radius: 12px;
}

body .cm-latest__title {
	font-size: 17px;
	line-height: 1.3;
}

.cm-latest:hover .cm-latest__title a {
	color: var(--wp--preset--color--teal);
}

.cm-latest__date {
	font-size: 14px;
	color: var(--wp--preset--color--muted);
}

/* Previous and next post links under the article. */
.cm-article__nav {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
	max-width: var(--wp--style--global--content-size);
	margin: 56px auto 0;
	padding-top: 32px;
	border-top: 1px solid var(--wp--preset--color--border);
}

.cm-article__nav-link {
	min-width: 0;
	font-size: 15px;
	line-height: 1.4;
}

.cm-article__nav-link--next {
	grid-column: 2;
	text-align: right;
}

.cm-article__nav-link a {
	display: block;
	color: var(--wp--preset--color--navy-deep);
	font-weight: 700;
	text-decoration: none;
}

.cm-article__nav-link a:hover {
	color: var(--wp--preset--color--teal);
}

.cm-article__nav-link .post-navigation-link__label {
	display: block;
	margin-bottom: 6px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--wp--preset--color--teal);
}

@media (max-width: 600px) {
	.cm-article__nav {
		grid-template-columns: minmax(0, 1fr);
	}

	.cm-article__nav-link--next {
		grid-column: 1;
		text-align: left;
	}
}

.cm-article__meta {
	font-size: 15px;
}

.cm-article__category a {
	color: inherit;
}

/* Post titles, and the H1 that content pages write in their own text. */
body :is(.cm-article__title, .cm-content-page h1) {
	font-size: clamp(34px, 4.2vw, 52px);
	line-height: 1.15;
}

/* Text styles below apply to posts and to pages using the "Content page, no title" template. */

.cm-article__content :is(h2, h3, h4) {
	margin-top: 1.6em;
}

.cm-article__content h2 {
	font-size: clamp(26px, 2.6vw, 32px);
	line-height: 1.15;
}

.cm-article__content h3 {
	font-size: 22px;
}

.cm-article__content h4 {
	font-size: 19px;
}

.cm-article__content :is(ul, ol) {
	padding-left: 1.4em;
}

.cm-article__content li + li {
	margin-top: 8px;
}

.cm-article__content img {
	height: auto;
	border-radius: 16px;
}

.cm-article__content figcaption {
	font-size: 14px;
	color: var(--wp--preset--color--muted);
}

.cm-article__content blockquote {
	margin-inline: 0;
	padding: 4px 0 4px 24px;
	border-left: 4px solid var(--wp--preset--color--mint);
	font-size: 19px;
	color: var(--wp--preset--color--navy-deep);
}

/* Wide tables scroll inside their own box instead of widening the page. */
.cm-article__content .wp-block-table {
	overflow-x: auto;
}

.cm-article__content table {
	border-collapse: collapse;
	font-size: 15px;
}

.cm-article__content :is(th, td) {
	padding: 10px 14px;
	border: 1px solid var(--wp--preset--color--border);
	text-align: left;
}

.cm-article__content th {
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--navy-deep);
}

/*
 * Content pages kept from the old theme (privacy, terms, contact and so on)
 * use its "contained" group classes. Only the class names are styled here, the
 * block styles are not registered: contained is the wide width, narrow
 * contained the reading width.
 */
.wp-block-post-content .is-style-contained {
	max-width: var(--wp--style--global--wide-size);
	margin-inline: auto;
}

.wp-block-post-content .is-style-narrow-contained {
	max-width: var(--wp--style--global--content-size);
	margin-inline: auto;
}

/* Long URLs used as link text (post citations) wrap instead of widening the page on phones. */
.wp-block-post-content a {
	overflow-wrap: anywhere;
}

/* Embedded videos and documents with a fixed width shrink to fit on phones. */
.wp-block-post-content iframe {
	max-width: 100%;
}

/* Contact Form 7 forms written in page text (Contact page): the demo form's field and button look. */
.wp-block-post-content .wpcf7-form {
	display: flex;
	flex-direction: column;
	gap: 14px;
	margin-block: 24px;
	padding: 30px;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 22px;
	background: var(--wp--preset--color--surface);
}

/* The form's fields sit inside .form-wrapper: stack the rows with a gap between them. */
.wp-block-post-content .wpcf7-form .form-wrapper {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

/* Two fields side by side (they stack on narrow screens). A single-field .form-row stays one column. */
.wp-block-post-content .wpcf7-form .form-row-two-fields {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 14px;
}

.wp-block-post-content .wpcf7-form label {
	display: block;
	margin-bottom: 6px;
	font-size: 14px;
	font-weight: 600;
	color: var(--wp--preset--color--navy-deep);
}

.wp-block-post-content .wpcf7-form-control-wrap {
	display: block;
}

.wp-block-post-content .wpcf7-form :is(input:not([type="submit"], [type="hidden"], [type="checkbox"], [type="radio"]), select, textarea) {
	box-sizing: border-box;
	width: 100%;
	padding: 14px;
	border: 1px solid var(--wp--preset--color--input-border);
	border-radius: 12px;
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--text);
	font-family: inherit;
	font-size: 16px;
}

.wp-block-post-content .wpcf7-form p {
	margin: 0;
	font-size: 14px;
}

.wp-block-post-content .wpcf7-submit {
	align-self: flex-start;
	padding: 16px 32px;
	border: 0;
	border-radius: 999px;
	background: var(--wp--preset--color--navy-deep);
	color: var(--wp--preset--color--white);
	font-family: inherit;
	font-size: 17px;
	font-weight: 700;
	cursor: pointer;
}

.wp-block-post-content .wpcf7-not-valid-tip {
	margin-top: 4px;
	font-size: 14px;
	font-weight: 600;
	color: var(--wp--preset--color--warning);
}

/* ---------- Inner pages: shared sections ----------
 * Used by the design pages other than Home (Prior Auth, Continuous Care,
 * Hospitals, Company and so on). Styles that only one page needs live in
 * assets/css/pages/<page-slug>.css, which loads on that page only.
 */

/* Page hero: eyebrow, H1, lead, buttons, and an optional image or stat column. */
.cm-section > .cm-page-hero__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 56px;
	padding-block: clamp(56px, 7vw, 96px) clamp(48px, 6vw, 72px);
}

.cm-page-hero__copy {
	display: flex;
	flex: 1 1 520px;
	flex-direction: column;
	gap: 24px;
	min-width: 0;
}

.cm-page-hero__media {
	flex: 1 1 420px;
	min-width: 0;
	max-width: 520px;
	margin-inline: auto;
}

.cm-page-hero__media img {
	display: block;
	width: 100%;
	height: auto;
}

body .cm-page-hero__title {
	max-width: 980px;
	font-size: clamp(36px, 4.2vw, 54px);
	line-height: 1.12;
}

.cm-page-hero__lead {
	max-width: 760px;
	font-size: var(--wp--preset--font-size--lead);
	line-height: 1.55;
	color: var(--wp--preset--color--text-2);
}

:is(.cm-section--navy, .cm-section--deep) .cm-page-hero__lead {
	color: var(--wp--preset--color--on-dark);
}

/* Small back link above a hero eyebrow, e.g. "← Continuous care". */
.cm-back-link {
	font-size: 15px;
	font-weight: 600;
}

/* Navy pill and outlined pill buttons. */
.cm-btn-navy .wp-block-button__link {
	background: var(--wp--preset--color--navy-deep);
	color: var(--wp--preset--color--white);
}

.cm-btn-outline .wp-block-button__link {
	padding: 15px 24px;
	border: 1px solid var(--wp--custom--color--placeholder-border);
	background: transparent;
	color: var(--wp--preset--color--navy-deep);
	font-weight: 600;
}

/* Stacked section content: intro, then a grid or list. */
.cm-stack {
	display: flex;
	flex-direction: column;
	gap: 40px;
}

/* Numbered step cards. The number comes from a CSS counter, the title is the bold text. */
.cm-step-cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 18px;
	padding: 0;
	list-style: none;
	counter-reset: cm-step-card;
}

.cm-step-cards li {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 28px;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 20px;
	background: var(--wp--preset--color--white);
	font-size: 16px;
	line-height: 1.55;
	counter-increment: cm-step-card;
}

.cm-step-cards li::before {
	content: counter(cm-step-card, decimal-leading-zero);
	font-size: 34px;
	font-weight: 700;
	line-height: 1.1;
	color: var(--wp--preset--color--teal);
}

.cm-step-cards strong {
	font-size: 21px;
	font-weight: 700;
	color: var(--wp--preset--color--navy-deep);
}

/* Closing call to action band: heading on the left, buttons on the right. */
.cm-section > .cm-cta-band__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 32px;
	padding-block: clamp(64px, 8vw, 88px);
}

body .cm-cta-band__title {
	flex: 1 1 520px;
	min-width: 0;
	font-size: clamp(30px, 3.4vw, 46px);
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: no-preference) {
	/*
	 * Every animation runs a fixed number of times and stops within about five
	 * seconds, because moving content that cannot be paused fails WCAG 2.2.2.
	 */
	@keyframes cmRise {
		from { opacity: 0; transform: translateY(14px); }
		to { opacity: 1; transform: none; }
	}

	@keyframes cmPulse {
		0%, 100% { opacity: 1; transform: scale(1); }
		50% { opacity: 0.35; transform: scale(0.8); }
	}

	@keyframes cmBar {
		0% { width: 8%; }
		60%, 100% { width: 100%; }
	}

	/* Timeline events appear one after another, then stay. */
	.cm-timeline__event {
		animation: cmRise 0.6s ease-out both;
		animation-delay: calc(var(--cm-i, 0) * 0.9s);
	}

	.cm-live__dot {
		animation: cmPulse 1.6s ease-in-out 3;
	}

	.cm-agent .cm-live__dot {
		animation-duration: 1.8s;
		animation-iteration-count: 2;
		animation-delay: calc(var(--cm-i, 0) * 0.3s);
	}

	/* Each agent bar fills once and stays full. */
	.cm-agent__bar span {
		animation: cmBar var(--cm-speed, 3s) ease-in-out both;
		animation-delay: calc(var(--cm-i, 0) * 0.4s);
	}
}
