/**
 * The site notice: the strip across the top of every page (inc/site-notice.php).
 *
 * Loaded on the site only while a notice is showing, and on the Site Notice
 * screen, whose preview is drawn with these same rules. Every colour is a
 * palette token from theme.json. Both pairs pass AA for the strip's 16px
 * semibold text (§G): cream on green 7.4:1, cream on rust 5.1:1.
 *
 * @package fsff
 */

.fsff-notice {
	padding-block: 0.625rem;
	background-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--base);
}

.fsff-notice--alert {
	background-color: var(--wp--preset--color--accent);
}

.fsff-notice .fsff-notice__text {
	margin-block: 0;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	line-height: 1.45;
	text-align: center;
	text-wrap: balance;
}

/*
 * The link takes the strip's colour, not the palette's green, which would
 * vanish on it. Matched class for class against theme.json's link and hover
 * rules so it wins whichever loads last.
 */
.fsff-notice .fsff-notice__text a,
.fsff-notice .fsff-notice__text a:hover,
.fsff-notice .fsff-notice__link {
	color: inherit;
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 0.18em;
}

.fsff-notice .fsff-notice__text a:hover {
	text-decoration-thickness: 2px;
}

/* The site's focus ring is green, which would vanish on the green strip. */
.fsff-notice .fsff-notice__text a:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/*
 * A warning sign before an alert, drawn in the text colour. It is decorative,
 * since the words say what has happened, so it is a background rather than
 * an image a screen reader would announce.
 */
.fsff-notice--alert .fsff-notice__text::before {
	content: "";
	display: inline-block;
	inline-size: 1.15em;
	block-size: 1.15em;
	margin-inline-end: 0.45em;
	vertical-align: -0.2em;
	background-color: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.5 1.5 21h21L12 2.5zm-1.2 6.5h2.4l-.3 6.5h-1.8l-.3-6.5zM12 16.6a1.4 1.4 0 1 1 0 2.8 1.4 1.4 0 0 1 0-2.8z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.5 1.5 21h21L12 2.5zm-1.2 6.5h2.4l-.3 6.5h-1.8l-.3-6.5zM12 16.6a1.4 1.4 0 1 1 0 2.8 1.4 1.4 0 0 1 0-2.8z'/%3E%3C/svg%3E") center / contain no-repeat;
}
