/*
 * Colour cards. Desktop: Homepage "Frame 32" (three 393x387 cards, 30px apart).
 */

.syb-color-cards .syb-head__title {
	max-width: 902px;
	font-size: 24px;
	line-height: 32px;
}

.syb-color-cards__grid {
	display: grid;
	gap: 16px;
}

.syb-color-card {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 24px;
	min-height: 300px;
	padding: 24px 20px;
	overflow: hidden;
	border-radius: var(--radius-lg);
}

.syb-color-card__body {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.syb-color-card__title {
	color: inherit;
	font-size: 22px;
	line-height: 32px;
}

.syb-color-card__text {
	font-size: 16px;
	font-weight: 500;
	line-height: 24px;
}

.syb-color-card.syb-tone-white .syb-color-card__title {
	color: var(--c-ink);
}

.syb-color-card__icon {
	display: block;
	margin-bottom: -6px;
}

.syb-color-card__icon .icon {
	stroke-width: 1.25;
}

.syb-color-card__list {
	display: flex;
	flex-direction: column;
	margin: 0;
	padding-left: 24px;
	font-size: 16px;
	font-weight: 500;
	line-height: 24px;
}

/* Pattern placement inside a card (the artwork runs off the bottom edge). */

.syb-color-card.syb-tone-dark {
	background-position: 12px 175px;
}

.syb-color-card.syb-tone-navy {
	background-position: -172px 38px;
}

@media (min-width: 768px) {
	.syb-color-cards .syb-head {
		margin-bottom: 43px;
	}

	.syb-color-cards .syb-head__title {
		font-size: 28px;
		line-height: 38px;
	}

	.syb-color-cards__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 24px;
	}

	.syb-color-card {
		gap: 32px;
		min-height: 387px;
		padding: 24px;
	}

	.syb-color-card.syb-tone-blue {
		padding-inline: 20px;
	}

	.syb-color-card__title {
		font-size: 24px;
		line-height: 36px;
	}
}

@media (min-width: 1100px) {
	.syb-color-cards__grid {
		grid-template-columns: repeat(var(--syb-cols, 3), minmax(0, 1fr));
		gap: 30px;
	}

	/* Two cards side by side are the tall 600x593 cards of the Capabilities page. */
	.syb-color-cards__grid[style*="--syb-cols:2"] {
		gap: 40px;
	}

	.syb-color-cards__grid[style*="--syb-cols:2"] .syb-color-card {
		min-height: 593px;
	}

	.syb-color-cards__grid[style*="--syb-cols:2"] .syb-tone-dark {
		gap: 40px;
		background-position: 27px 298px;
		background-size: 555px 555px;
	}
}

/* Small label above a card title */

.syb-color-card__eyebrow {
	margin-bottom: -8px;
	color: #cfe6ff;
	font-size: 14px;
	font-weight: 500;
	line-height: 20px;
}

.syb-color-card.syb-tone-white .syb-color-card__eyebrow {
	color: var(--c-blue);
}

/* Card height: compact (the "two paths" cards, 600x300) */

.syb-color-cards--compact .syb-color-card {
	justify-content: space-between;
	min-height: 240px;
}

.syb-color-cards--compact .syb-color-card__text {
	max-width: 440px;
}

@media (min-width: 768px) {
	.syb-color-cards--compact .syb-color-card,
	.syb-color-cards--compact .syb-color-cards__grid[style*="--syb-cols:2"] .syb-color-card {
		gap: 20px;
		min-height: 300px;
		padding: 28px;
	}

	.syb-color-cards--compact .syb-color-cards__grid[style*="--syb-cols:2"] .syb-tone-dark,
	.syb-color-cards--compact .syb-tone-dark {
		gap: 20px;
		background-position: right -69px top 20px;
		background-size: 369px 369px;
	}

	.syb-color-cards--compact .syb-color-card__body {
		gap: 8px;
	}

	.syb-color-cards--compact .syb-color-card__eyebrow {
		margin-bottom: 0;
	}
}

/*
 * One card at a time (Style > Text and button): the active card shows its text and
 * button, the others only their title. The first card is active until the pointer
 * (or keyboard focus) moves to another one; the change fades.
 * Touch screens have no pointer to follow, and below 1100px the cards no longer sit in
 * one row, so there every card shows everything.
 */

@media (hover: hover) and (pointer: fine) and (min-width: 1100px) {
	.syb-color-cards--reveal .syb-color-card__text,
	.syb-color-cards--reveal .syb-color-card__list,
	.syb-color-cards--reveal .syb-color-card > .btn {
		opacity: 0;
		transition: opacity 0.35s ease;
		/* Still reachable with the Tab key; the card becomes active when it gets focus. */
		pointer-events: none;
	}

	.syb-color-cards--reveal .syb-color-card.is-active .syb-color-card__text,
	.syb-color-cards--reveal .syb-color-card.is-active .syb-color-card__list,
	.syb-color-cards--reveal .syb-color-card.is-active > .btn,
	.syb-color-cards--reveal .syb-color-card:focus-within .syb-color-card__text,
	.syb-color-cards--reveal .syb-color-card:focus-within .syb-color-card__list,
	.syb-color-cards--reveal .syb-color-card:focus-within > .btn {
		opacity: 1;
		pointer-events: auto;
	}
}

/*
 * Playing by itself (Style > Play by itself): a thin bar along the bottom of the active
 * card fills in --syb-autoplay seconds; builder.js then moves on to the next card
 * (is-playing). is-held stops the bar: pointer or focus in the cards, or off screen.
 */

@media (hover: hover) and (pointer: fine) and (min-width: 1100px) {
	.is-playing > .syb-color-card {
		position: relative;
	}

	.is-playing > .syb-color-card::after {
		content: "";
		position: absolute;
		right: 0;
		bottom: 0;
		left: 0;
		height: 3px;
		background: currentColor;
		opacity: 0.55;
		transform: scaleX(0);
		transform-origin: left center;
		pointer-events: none;
	}

	.is-playing > .syb-color-card.syb-tone-white::after {
		background: var(--c-blue);
	}

	.is-playing > .syb-color-card.is-active::after {
		animation: syb-card-timer var(--syb-autoplay, 5s) linear forwards;
	}

	.is-playing.is-held > .syb-color-card.is-active::after {
		animation-play-state: paused;
	}
}

@keyframes syb-card-timer {
	to {
		transform: scaleX(1);
	}
}

@media (prefers-reduced-motion: reduce) {
	.syb-color-cards--reveal .syb-color-card__text,
	.syb-color-cards--reveal .syb-color-card__list,
	.syb-color-cards--reveal .syb-color-card > .btn {
		transition: none;
	}
}

/*
 * Side by side on phones and tablets (Style > On phones and tablets). Below 1100px the
 * cards form one row that is wider than the screen.
 *
 * Without script, and when the block is too tall to pin, the row is swiped sideways.
 * With script (builder.js adds is-pinned) the block stays in place while the page is
 * scrolled and the row moves sideways instead; once the last card is in view the page
 * scrolls on. The section is made taller by the distance the row has to travel.
 */

@media (max-width: 1099.98px) {
	.syb-color-cards--hscroll .syb-color-cards__grid {
		display: flex;
		gap: 16px;
		margin-inline: calc(var(--gutter) * -1);
		padding-inline: var(--gutter);
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		scroll-padding-inline: var(--gutter);
		scrollbar-width: none;
	}

	.syb-color-cards--hscroll .syb-color-cards__grid::-webkit-scrollbar {
		display: none;
	}

	.syb-color-cards--hscroll .syb-color-card {
		flex: 0 0 min(82vw, 360px);
		scroll-snap-align: start;
	}

	/* Pinned: the row no longer scrolls by itself, the script moves it. */
	.syb-color-cards--hscroll.is-pinned {
		overflow-x: clip;
	}

	.syb-color-cards--hscroll.is-pinned > .container {
		position: sticky;
		top: calc(var(--header-h) + 20px);
	}

	.syb-color-cards--hscroll.is-pinned .syb-color-cards__grid {
		overflow: visible;
		scroll-snap-type: none;
		will-change: transform;
	}
}

/*
 * Colour "Background image": a picture from the Media Library fills the card, under a
 * dark layer (Darken the picture) so the white text stays readable. Without a picture
 * the card is plain dark.
 */

.syb-color-card.syb-tone-image {
	position: relative;
	isolation: isolate;
	background: var(--c-footer);
	color: var(--c-white);
	box-shadow: inset 0 4px 4px rgba(255, 255, 255, 0.25);
}

.syb-color-card__media {
	position: absolute;
	inset: 0;
	z-index: -1;
	overflow: hidden;
	border-radius: inherit;
}

.syb-color-card__media::after {
	content: "";
	position: absolute;
	inset: 0;
	/* Darker towards the bottom, where the text and button sit. */
	background: linear-gradient(180deg, rgba(15, 17, 32, calc(var(--syb-card-shade, 0.45) * 0.7)) 0%, rgba(15, 17, 32, var(--syb-card-shade, 0.45)) 100%);
}

.syb-color-card__photo {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.syb-color-card.syb-tone-image .syb-color-card__eyebrow {
	color: rgba(255, 255, 255, 0.82);
}

@media (hover: hover) and (pointer: fine) {
	.syb-color-card.syb-tone-image:hover .syb-color-card__photo {
		transform: scale(1.04);
	}
}

@media (prefers-reduced-motion: reduce) {
	.syb-color-card__photo {
		transition: none;
	}
}