/*
 * rooster/card: the block's own part of the library's sheet, its tone (BRIEF-2026-11-01-BLOCK-LIBRARY.md). A family
 * tone is the theme's `is-style-accent-<slug>` on the root (the accent presets re-mapped inside); a semantic tone maps
 * the accent presets to the palette's success, warning or danger, or to the muted ink (the warning's text shade,
 * accent-text, is its ink: the palette's warning-ink, theme 1.3.8; the fill keeps warning). Each variant's look is its own
 * recipe in variants/<variant>.src.css, loaded only where that variant renders.
 */

@import "../theme.css";

.wp-block-rooster-card:is(.is-tone-success, .is-tone-warning, .is-tone-danger, .is-tone-neutral) {
	--rooster-accent: var(--rooster-tone);
	--rooster-accent-text: var(--rooster-tone-text);
	--wp--preset--color--accent: var(--rooster-tone);
	--wp--preset--color--accent-text: var(--rooster-tone-text);
}

.wp-block-rooster-card.is-tone-success {
	--rooster-tone: var(--wp--preset--color--success, light-dark(#15803d, #4ade80));
	--rooster-tone-text: var(--rooster-tone);
}

.wp-block-rooster-card.is-tone-warning {
	--rooster-tone: var(--wp--preset--color--warning, light-dark(#b45309, #fbbf24));
	--rooster-tone-text: var(--wp--preset--color--warning-ink, light-dark(#896610, #fbbf24));
}

.wp-block-rooster-card.is-tone-danger {
	--rooster-tone: var(--wp--preset--color--danger, light-dark(#b91c1c, #f87171));
	--rooster-tone-text: var(--rooster-tone);
}

.wp-block-rooster-card.is-tone-neutral {
	--rooster-tone: var(--wp--preset--color--muted, light-dark(#525252, #a3a3a3));
	--rooster-tone-text: var(--rooster-tone);
}

/*
 * The tone over the Rooster One template's own palette: its recipes draw the brand blue from the custom tokens
 * --wp--custom--rooster-one--* (the legacy's values as fallbacks); a toned block re-maps them to its tone.
 */
.wp-block-rooster-card:is([class*="is-style-accent-"], .is-tone-success, .is-tone-warning, .is-tone-danger, .is-tone-neutral) {
	--wp--custom--rooster-one--brand: var(--wp--preset--color--accent, #1e63ce);
	--wp--custom--rooster-one--brand-deep: color-mix(in srgb, var(--wp--preset--color--accent, #1e63ce) 80%, #000000);
	--wp--custom--rooster-one--blue: var(--wp--preset--color--accent-text, light-dark(#1e63ce, #8eb4ee));
	--wp--custom--rooster-one--blue-wash: color-mix(in srgb, var(--wp--preset--color--accent, #1e63ce) 14%, transparent);
}
