/*
 * Data Unifier Hub page (/data-unifier-hub/) styles.
 * Loads on that page only. Shared page sections are in assets/css/theme.css.
 */

/* Hero diagram: sources flow into the hub, the hub feeds the record and the solutions. */
.cm-duh-flow {
	box-sizing: border-box;
	display: grid;
	flex: 1 1 480px;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: 16px;
	min-width: 0;
	max-width: 600px;
	margin-inline: auto;
	padding: 26px;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 22px;
	background: var(--wp--preset--color--white);
	box-shadow: var(--wp--custom--shadow--card);
}

.cm-duh-flow__col {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.cm-duh-flow__label {
	margin-bottom: 4px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.1em;
	color: var(--wp--preset--color--muted);
}

.cm-duh-flow__chip {
	padding: 8px 12px;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 10px;
	background: var(--wp--preset--color--surface);
	font-size: 14px;
	font-weight: 600;
	color: var(--wp--preset--color--navy-deep);
}

.cm-duh-flow__chip--out {
	border-color: var(--wp--preset--color--mint);
	background: var(--wp--preset--color--pill);
}

.cm-duh-flow__hub {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 4px;
	width: 116px;
	height: 116px;
	border: 6px solid var(--wp--preset--color--pill);
	border-radius: 50%;
	background: var(--wp--preset--color--mint);
	color: var(--wp--preset--color--mint-ink);
	font-size: 13px;
	font-weight: 700;
	line-height: 1.2;
	text-align: center;
}

.cm-duh-flow__hub small {
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.1em;
}

@media (max-width: 560px) {
	.cm-duh-flow {
		grid-template-columns: 1fr;
		justify-items: stretch;
	}

	.cm-duh-flow__hub {
		justify-self: center;
	}
}

/* Integrations: the heading in the page width, then two full-width logo strips. */
.cm-section > .cm-duh-integrations__head {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 20px 40px;
	padding-bottom: 36px;
}

.cm-duh-marquee-toggle {
	padding: 10px 18px;
	border: 1px solid var(--wp--custom--color--placeholder-border);
	border-radius: 999px;
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--navy-deep);
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}

.cm-duh-marquees {
	display: flex;
	flex-direction: column;
	gap: 28px;
	padding-bottom: clamp(64px, 8vw, 96px);
}

.cm-duh-marquee-row {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.cm-duh-logo-group__title {
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.1em;
	color: var(--wp--preset--color--teal);
}

/* The logos fade out at both edges of the page. */
.cm-duh-marquee {
	overflow: hidden;
	-webkit-mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
	mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
}

/* Without motion (reduced motion, or before the animation starts) the logos sit centered and wrap. */
.cm-duh-marquee__track {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 14px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.cm-duh-marquee__track li {
	display: flex;
	flex: none;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 156px;
	height: 68px;
	overflow: hidden;
	padding: 12px 18px;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 12px;
	background: var(--wp--preset--color--white);
}

.cm-duh-marquee__track li[aria-hidden="true"] {
	display: none;
}

/* The logo files have uneven white space around them; --zoom evens out how big each one looks. */
.cm-duh-marquee__track img {
	display: block;
	max-width: 100%;
	max-height: 32px;
	object-fit: contain;
	transform: scale(var(--zoom, 1));
}

/* What it connects and Why ColigoMed: one panel, equal columns with dividers; rows on smaller screens. */
.cm-duh-features {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	overflow: hidden;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 20px;
	background: var(--wp--preset--color--white);
}

.cm-duh-features--4 {
	grid-template-columns: repeat(4, minmax(0, 1fr));
}

.cm-duh-feature {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 24px 22px;
	font-size: 14px;
	line-height: 1.55;
	color: var(--wp--preset--color--text-2);
}

.cm-duh-feature__num {
	font-size: 26px;
	font-weight: 700;
	line-height: 1.1;
	color: var(--wp--preset--color--teal);
}

.cm-duh-feature + .cm-duh-feature {
	border-left: 1px solid var(--wp--preset--color--border);
}

.cm-section .cm-duh-feature__title {
	font-size: 16px;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: 0;
}

@media (max-width: 1000px) {
	.cm-duh-features,
	.cm-duh-features--4 {
		grid-template-columns: minmax(0, 1fr);
	}

	.cm-duh-feature {
		display: grid;
		grid-template-columns: 44px 1fr;
		gap: 4px 18px;
	}

	.cm-duh-feature :is(.cm-duh-icon, .cm-duh-feature__num) {
		grid-row: span 2;
	}

	.cm-duh-feature + .cm-duh-feature {
		border-top: 1px solid var(--wp--preset--color--border);
		border-left: 0;
	}
}

/* The icon at the top of each column. */
.cm-duh-icon img {
	display: block;
	width: 44px;
	height: 44px;
}

/* Two benefit cards with check lists. */
.cm-duh-checks {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 0;
	list-style: none;
}

.cm-duh-checks li {
	position: relative;
	padding-left: 30px;
	font-size: 16px;
	line-height: 1.55;
	color: var(--wp--preset--color--text-2);
}

.cm-duh-checks li::before {
	content: "✓" / "";
	position: absolute;
	top: 1px;
	left: 0;
	display: grid;
	place-items: center;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: var(--wp--preset--color--pill);
	color: var(--wp--preset--color--pill-ink);
	font-size: 12px;
	font-weight: 700;
}

/* Patient quote under the benefit cards, with a mint bar on the left. */
.cm-quote.cm-duh-quote {
	max-width: 900px;
	border-left: 4px solid var(--wp--preset--color--mint);
	border-radius: 0 20px 20px 0;
}

.cm-duh-quote p {
	font-size: 19px;
	line-height: 1.6;
	color: var(--wp--preset--color--navy-deep);
}

/* Security band: copy on the left, three badges on the right. */
.cm-section > .cm-duh-security {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 32px 56px;
}

.cm-duh-security__copy {
	display: flex;
	flex: 1 1 420px;
	flex-direction: column;
	gap: 16px;
	min-width: 0;
}

.cm-duh-badges {
	display: grid;
	flex: 1 1 480px;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px;
	padding: 0;
	list-style: none;
}

.cm-duh-badges li {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 20px;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 16px;
	background: var(--wp--preset--color--white);
	font-size: 14px;
	line-height: 1.45;
	color: var(--wp--preset--color--text-2);
}

.cm-duh-badges img {
	display: block;
	align-self: flex-start;
	width: auto;
	height: 64px;
	margin-bottom: 8px;
}

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

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

/*
 * Motion: the logo strips scroll slowly and loop. This is the one animation on
 * the site that does not stop by itself, so it pauses on hover, on keyboard
 * focus and with the Pause button (WCAG 2.2.2), and stays still for visitors
 * who ask for reduced motion. assets/js/pages/data-unifier-hub.js shows the
 * button and adds .is-moving once the strips are ready.
 */
@media (prefers-reduced-motion: no-preference) {
	@keyframes cmDuhScroll {
		from { transform: translateX(0); }
		to { transform: translateX(-50%); }
	}

	.cm-duh-marquees.is-moving .cm-duh-marquee__track {
		flex-wrap: nowrap;
		justify-content: flex-start;
		gap: 0;
		width: max-content;
		animation: cmDuhScroll 45s linear infinite;
	}

	/* Spacing as a margin, not a gap, so half the strip is exactly one copy of the logos. */
	.cm-duh-marquees.is-moving .cm-duh-marquee__track li {
		margin-right: 14px;
	}

	.cm-duh-marquees.is-moving .cm-duh-marquee__track li[aria-hidden="true"] {
		display: flex;
	}

	.cm-duh-marquees.is-moving .cm-duh-marquee-row:nth-child(2) .cm-duh-marquee__track {
		animation-duration: 40s;
		animation-direction: reverse;
	}

	.cm-duh-marquees.is-paused .cm-duh-marquee__track,
	.cm-duh-marquee:hover .cm-duh-marquee__track,
	.cm-duh-marquee:focus-within .cm-duh-marquee__track {
		animation-play-state: paused;
	}
}
