/*
 * Cards — core Group block, Styles: Card, Card – tinted header.
 * app: final-cards §1 .fc-card
 */
.wp-block-group.is-style-card,
.wp-block-group.is-style-card-tinted {
	overflow: hidden;
	padding: var(--sc-card-pad);
	border-radius: var(--sc-radius);
	background: var(--sc-surface);
	box-shadow: var(--sc-shadow-card);
}

/* Content fills the card (a constrained group would otherwise centre it at the site's content width). */
.wp-block-group.is-style-card > *,
.wp-block-group.is-style-card-tinted > * {
	max-width: none;
	margin-inline: 0;
}

/* Keep the card's own spacing predictable: first/last child sit flush with the padding. */
.wp-block-group.is-style-card > :first-child { margin-block-start: 0; }
.wp-block-group.is-style-card > :last-child { margin-block-end: 0; }

/*
 * Tinted header: the FIRST block inside the group becomes the header band (full width, blue tint, hairline).
 * app: final-cards §1 .fc-card__header. The negative margins undo the card padding; they need !important to beat the
 * `margin: auto` WordPress puts on children of a constrained layout.
 */
.wp-block-group.is-style-card-tinted > :first-child {
	max-width: none !important;
	margin: calc(-1 * var(--sc-card-pad)) calc(-1 * var(--sc-card-pad)) var(--sc-card-pad) !important;
	padding: 0.875rem var(--sc-card-pad);
	border-bottom: 1px solid var(--sc-hairline);
	background: var(--sc-gradient-header);
	font-size: var(--wp--preset--font-size--body);
	font-weight: 600;
}

.wp-block-group.is-style-card-tinted > :last-child { margin-block-end: 0; }

/*
 * Card – photo on top: a Photo-card Cover (scrim + title) as the first block, an info group below.
 * app: card-showcase I "Hero + scrim title" (.ev-card / .ev-media / .ev-info). The cover's own radius, border and lift
 * are dropped here, the card carries them.
 */
.wp-block-group.is-style-card-media {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border-radius: var(--sc-radius);
	background: var(--sc-surface);
	box-shadow: var(--sc-shadow-card);
}

.wp-block-group.is-style-card-media > * {
	max-width: none;
	margin: 0 !important;   /* the constrained layout's `margin-inline: auto !important` would shrink and centre children of this flex column */
}

.wp-block-column > .wp-block-group.is-style-card-media {
	height: 100%;
}

.wp-block-group.is-style-card-media > .wp-block-cover.is-style-photo-card {
	border: 0;
	border-radius: 0;
	box-shadow: none;
	transform: none;
}

.wp-block-group.is-style-card-media > .wp-block-cover.is-style-photo-card::after {
	background: var(--sc-scrim);   /* title only, no description line: the lighter scrim */
}

.wp-block-group.is-style-card-media > .wp-block-group {
	flex: 1;
	padding: 14px 16px 16px;
	gap: 12px;
}

/* Buttons row: wide primary + small icon button */
.wp-block-group.is-style-card-media .wp-block-buttons.sc-actions {
	flex-wrap: nowrap;
	gap: 8px;
}

.wp-block-group.is-style-card-media .sc-actions > .wp-block-button:first-child {
	flex: 1;
}

.wp-block-group.is-style-card-media .sc-actions > .wp-block-button:first-child .wp-block-button__link {
	width: 100%;
}

.wp-block-group.is-style-card-media .wp-block-group > p.has-label-font-size {
	margin: auto 0 0;   /* address + buttons sit at the card's bottom, so cards with fewer pill rows line up */
}

/*
 * Card with a small picture beside the text: a Columns block inside the Card group (image column + text column).
 * Tighter gap than the default, and no mid-word hyphenation in the narrow text column.
 */
.wp-block-group.is-style-card > .wp-block-columns {
	gap: 1.25rem;
}

.wp-block-group.is-style-card > .wp-block-columns h3 {
	font-size: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem);
	-webkit-hyphens: manual;   /* Safari before 17 */
	hyphens: manual;
	overflow-wrap: normal;
}
