/*
 * Helpers — the few `sc-*` classes that content may use (Advanced → Additional CSS class).
 * Every helper is listed on the Style guide page; don't add one without adding it there.
 */

/* Muted explanation under a component on the Style guide ("How to use"). */
.sc-howto {
	margin-block-start: 0.75rem;
	padding-inline-start: 0.875rem;
	border-inline-start: 2px solid var(--sc-hairline);
	color: var(--sc-text-muted);
	font-size: var(--wp--preset--font-size--label);
}

/* Colour swatch card on the Style guide: put a palette background colour on the Group. */
.wp-block-group.sc-swatch {
	min-height: 5.5rem;
	padding: 1rem;
	border: 1px solid var(--sc-hairline);
	border-radius: var(--sc-radius);
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
}

.sc-swatch > * {
	max-width: none;
	margin: 0;
	font-size: var(--wp--preset--font-size--label);
	line-height: 1.3;
}

.sc-swatch > * + * {
	margin-block-start: 4px;
}

.sc-swatch > :first-child {
	font-weight: 700;
}

/* Photo ratios for Photo card / Glass caption when you don't use the Dimensions panel. */
.sc-ratio-1-1.wp-block-cover { aspect-ratio: 1 / 1; }
.sc-ratio-4-3.wp-block-cover { aspect-ratio: 4 / 3; }
.sc-ratio-3-1.wp-block-cover { aspect-ratio: 3 / 1; }
.sc-ratio-2-1.wp-block-cover { aspect-ratio: 2 / 1; }

/* Visually hidden text for screen readers. */
.sc-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Feature list around an image (Columns → Additional CSS class). On phones only the image stays: the lists are hidden. */
@media (max-width: 781px) {
	.sc-feature-list > .wp-block-column:not(:has(figure)) {
		display: none;
	}
}

/* Photo-card grid (Group → Additional CSS class). On phones only the card titles stay: the one-line descriptions are hidden. */
@media (max-width: 781px) {
	.sc-hide-desc-mobile .wp-block-cover.is-style-photo-card .wp-block-cover__inner-container p {
		display: none;
	}
}
