/*
 * FRT-Ticketing: hervorgehobene Hinweise (Pflichtenheft Abschnitt 2, Prototyp 6).
 *
 * Vier Arten mit hellem Grund, Rahmen rundum und Symbol links: Erfolg,
 * Fehler, Warnung, Information. Die Farbe trägt die Bedeutung nie allein,
 * deshalb hat jede Art ihr eigenes Symbol.
 *
 * Gilt für die Hinweise des Plugins (.frt-note mit Art) und für die
 * WooCommerce-Hinweise, diese aber nur auf den Seiten des Plugins: Die
 * Body-Klasse frt-notices setzt NoticeStyle nur dort, andere Seiten der
 * Website behalten die Gestaltung des Themes.
 */

/* Farben und Symbole je Art */

.frt-note.frt-note--success,
body.frt-notices .woocommerce-message {
	--frt-note-color: #1e7a46;
	--frt-note-bg: #e8f5ec;
	--frt-note-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 28'%3E%3Ccircle cx='14' cy='14' r='14' fill='%231E7A46'/%3E%3Cpath d='M8 14.5l4 4 8-9' fill='none' stroke='%23fff' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.frt-note.frt-note--error,
body.frt-notices .woocommerce-error {
	--frt-note-color: #a8180c;
	--frt-note-bg: #fcedeb;
	--frt-note-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 28'%3E%3Ccircle cx='14' cy='14' r='14' fill='%23A8180C'/%3E%3Cpath d='M14 7.5v8' fill='none' stroke='%23fff' stroke-width='2.8' stroke-linecap='round'/%3E%3Ccircle cx='14' cy='20.5' r='1.7' fill='%23fff'/%3E%3C/svg%3E");
}

.frt-note.frt-note--warning,
body.frt-notices .woocommerce-info[data-frt-kind="warning"] {
	--frt-note-color: #b85c00;
	--frt-note-bg: #fff3e0;
	--frt-note-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 28'%3E%3Cpath d='M14 2.5L27 25.5H1z' fill='%23B85C00' stroke='%23B85C00' stroke-width='1.5' stroke-linejoin='round'/%3E%3Cpath d='M14 10.5v7' fill='none' stroke='%23fff' stroke-width='2.6' stroke-linecap='round'/%3E%3Ccircle cx='14' cy='21.5' r='1.6' fill='%23fff'/%3E%3C/svg%3E");
}

.frt-note.frt-note--info,
body.frt-notices .woocommerce-info:not([data-frt-kind="warning"]) {
	--frt-note-color: #1f5fa8;
	--frt-note-bg: #e8f1fb;
	--frt-note-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 28'%3E%3Ccircle cx='14' cy='14' r='14' fill='%231F5FA8'/%3E%3Ccircle cx='14' cy='8.2' r='1.8' fill='%23fff'/%3E%3Cpath d='M14 12.5v8.5' fill='none' stroke='%23fff' stroke-width='2.8' stroke-linecap='round'/%3E%3C/svg%3E");
}

/* Kasten */

:is(.frt-note--success, .frt-note--error, .frt-note--warning, .frt-note--info).frt-note,
body.frt-notices :is(.woocommerce-message, .woocommerce-error, .woocommerce-info) {
	position: relative;
	box-sizing: border-box;
	width: auto;
	margin: 0 0 16px;
	padding: 16px 16px 16px 56px;
	border: 2px solid var(--frt-note-color);
	border-radius: 12px;
	background: var(--frt-note-bg);
	color: #133333;
	font-size: inherit;
	line-height: 1.5;
	list-style: none;
	text-align: left;
	overflow-wrap: break-word;
}

/* Symbol links; ersetzt das Schriftsymbol von WooCommerce. */
:is(.frt-note--success, .frt-note--error, .frt-note--warning, .frt-note--info).frt-note::before,
body.frt-notices :is(.woocommerce-message, .woocommerce-error, .woocommerce-info)::before {
	content: "";
	position: absolute;
	top: 16px;
	left: 16px;
	width: 28px;
	height: 28px;
	margin: 0;
	background: var(--frt-note-icon) center / 28px 28px no-repeat;
	font-family: inherit;
}

:is(.frt-note--success, .frt-note--error, .frt-note--warning, .frt-note--info).frt-note > :first-child {
	margin-top: 0;
}

:is(.frt-note--success, .frt-note--error, .frt-note--warning, .frt-note--info).frt-note > :last-child {
	margin-bottom: 0;
}

.frt-note p {
	margin: 0 0 8px;
}

body.frt-notices .woocommerce-error li {
	margin: 0;
	padding: 0;
	list-style: none;
}

body.frt-notices .woocommerce-error li + li {
	margin-top: 6px;
}

/* Links im Hinweis bleiben als Links erkennbar. */
:is(.frt-note--success, .frt-note--error, .frt-note--warning, .frt-note--info).frt-note a:not(.frt-button),
body.frt-notices :is(.woocommerce-message, .woocommerce-error, .woocommerce-info) a:not(.button) {
	color: #133333;
	font-weight: 600;
	text-decoration: underline;
}

/*
 * Überschrift in der Farbe von Rahmen und Symbol. 19 px fett zählt nach
 * WCAG 2.1 als große Schrift; nur so erreicht auch Orange auf Hellorange
 * den nötigen Kontrast.
 */
.frt-note .frt-note__title {
	margin: 0 0 6px;
	color: var(--frt-note-color);
	font-family: inherit;
	font-size: 19px;
	font-weight: 700;
	line-height: 1.3;
}

/* Knöpfe im Hinweis in seiner Farbe: Hauptknopf gefüllt, Nebenknopf weiß. */
.frt-note.frt-note .frt-button,
body.frt-notices :is(.woocommerce-message, .woocommerce-error, .woocommerce-info) .button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: auto;
	min-height: 48px;
	margin: 4px 0;
	padding: 0 18px;
	border: 2px solid var(--frt-note-color);
	border-radius: 10px;
	background: #fff;
	color: var(--frt-note-color);
	font-weight: 600;
	text-decoration: none;
}

.frt-note.frt-note .frt-button.frt-button--primary {
	background: var(--frt-note-color);
	color: #fff;
}

body.frt-notices :is(.woocommerce-message, .woocommerce-error, .woocommerce-info) .button {
	float: none;
	margin-left: 8px;
}

.frt-note.frt-note .frt-button:is(:hover, :focus),
body.frt-notices :is(.woocommerce-message, .woocommerce-error, .woocommerce-info) .button:is(:hover, :focus) {
	border-color: var(--frt-note-color);
	background: var(--frt-note-bg);
	color: #133333;
}

.frt-note.frt-note .frt-button.frt-button--primary:is(:hover, :focus) {
	background: #133333;
	border-color: #133333;
	color: #fff;
}

.frt-note.frt-note .frt-button:focus-visible,
body.frt-notices :is(.woocommerce-message, .woocommerce-error, .woocommerce-info) .button:focus-visible {
	outline: 3px solid #133333;
	outline-offset: 2px;
}

.frt-note form {
	margin: 4px 0 8px;
}

/*
 * Niveau-Schild (Pflichtenheft 5, Prototyp 10c): weiße Schrift auf Farbe,
 * Kontrast nach WCAG 2.1 AA. Farben hier anpassen oder im Child-Theme überschreiben.
 */
.frt-level {
	display: inline-block;
	align-self: flex-start;
	padding: 3px 10px;
	border-radius: 999px;
	color: #fff;
	font-size: 0.85rem;
	font-weight: 600;
	line-height: 1.4;
}

.frt-level--beginner {
	background: #1e7a46;
}

.frt-level--advanced {
	background: #5b2d9e;
}
