/* Consent-Dialoge, Baustein component-Consent.md */

html.mg-consent-open {
	overflow: hidden;
}

.consent {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	padding: 16px;
	background: rgba( 43, 41, 38, 0.45 );
	overflow-y: auto;
}

.consent[hidden],
.consent__dialog[hidden] {
	display: none;
}

.consent__dialog {
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	width: 540px;
	max-width: 100%;
	margin: auto;
	min-height: 540px;
	padding: 40px;
	background: var( --wp--preset--color--surface );
	color: var( --wp--preset--color--ink );
	border: 1px solid var( --wp--preset--color--ink );
	border-radius: 0;
	box-shadow: none;
}

.consent__dialog--2 {
	min-height: 600px;
}

.consent__top {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
}

.consent__privacy {
	font-size: 14px;
	color: var( --wp--preset--color--ink-muted );
	text-decoration: none;
}

.consent__text-button,
.consent__close {
	padding: 0;
	border: 0;
	background: none;
	font: inherit;
	font-size: 15px;
	color: var( --wp--preset--color--ink );
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}

.consent__close {
	font-size: 28px;
	line-height: 1;
	text-decoration: none;
}

.consent__text {
	margin: 32px 0 0;
	font-size: 20px;
	line-height: 1.55;
	color: var( --wp--preset--color--ink );
}

.consent__title {
	margin: 32px 0 0;
	font-size: 36px;
	font-weight: 700;
	line-height: 1.1;
	letter-spacing: -0.02em;
}

.consent__intro {
	margin: 16px 0 24px;
	font-size: 16px;
	line-height: 1.5;
}

.consent__rows {
	margin-bottom: 24px;
}

.consent__row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	padding: 20px 0;
	border-top: 1px solid var( --wp--preset--color--ink );
}

.consent__row-title {
	margin: 0;
	font-size: 18px;
	font-weight: 700;
	letter-spacing: 0;
}

.consent__row-desc {
	margin: 4px 0 0;
	font-size: 14px;
	line-height: 1.45;
	color: var( --wp--preset--color--ink-muted );
}

.consent__legal {
	margin: 24px 0 0;
	font-size: 14px;
	color: var( --wp--preset--color--ink-muted );
}

.consent__dialog--2 .consent__legal {
	margin-top: auto;
	padding-top: 8px;
}

.consent__legal a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* Schalter: 48 x 28, eckig, Knopf 20 px mit 3 px Abstand */
.consent__switch {
	position: relative;
	flex: none;
	box-sizing: border-box;
	width: 48px;
	height: 28px;
	padding: 0;
	border: 1px solid var( --wp--preset--color--ink );
	border-radius: 0;
	background: transparent;
	cursor: pointer;
	transition: background 0.15s;
}

.consent__knob {
	position: absolute;
	top: 3px;
	left: 3px;
	width: 20px;
	height: 20px;
	background: var( --wp--preset--color--ink );
	transition: transform 0.15s;
}

.consent__switch[aria-checked="true"] {
	background: var( --wp--preset--color--ink );
}

.consent__switch[aria-checked="true"] .consent__knob {
	background: var( --wp--preset--color--surface );
	transform: translateX( 20px );
}

.consent__switch--locked,
.consent__switch--locked[aria-checked="true"] {
	background: var( --wp--preset--color--mittelgrau );
	border-color: var( --wp--preset--color--mittelgrau );
	cursor: default;
}

.consent__switch--locked .consent__knob {
	background: var( --wp--preset--color--surface );
	transform: translateX( 20px );
}

.consent__buttons {
	display: flex;
	gap: 16px;
	margin-top: auto;
	padding-top: 32px;
}

.consent__dialog--2 .consent__buttons {
	margin-top: 24px;
	padding-top: 0;
}

.consent__button {
	flex: 1;
	box-sizing: border-box;
	min-height: 48px;
	padding: 12px 16px;
	border: 1px solid var( --wp--preset--color--ink );
	border-radius: 0;
	font: inherit;
	font-size: 16px;
	cursor: pointer;
}

.consent__button--outline {
	background: transparent;
	color: var( --wp--preset--color--ink );
}

.consent__button--filled {
	background: var( --wp--preset--color--ink );
	color: var( --wp--preset--color--on-ink );
}

.consent__dialog :focus-visible {
	outline: 2px solid var( --wp--preset--color--ink );
	outline-offset: 3px;
}

.consent__title:focus {
	outline: none;
}

.footer-links__button {
	padding: 0;
	border: 0;
	background: none;
	font: inherit;
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}

@media ( max-width: 600px ) {
	.consent__dialog {
		width: 350px;
		min-height: 350px;
		padding: 24px;
	}

	.consent__dialog--2 {
		min-height: 0;
	}

	.consent__privacy {
		font-size: 13px;
	}

	.consent__text-button {
		font-size: 14px;
	}

	.consent__text {
		margin-top: 24px;
		font-size: 17px;
	}

	.consent__title {
		margin-top: 24px;
		font-size: 28px;
	}

	.consent__intro {
		font-size: 15px;
	}

	.consent__row-title {
		font-size: 16px;
	}

	.consent__row-desc {
		font-size: 13px;
	}

	.consent__buttons {
		flex-direction: column;
	}

	/* Mobil: "Alle akzeptieren" bzw. "Speichern" oben */
	.consent__buttons--1 .consent__button--filled {
		order: -1;
	}

	.consent__buttons--2 .consent__button--save {
		order: -2;
	}

	.consent__buttons--2 .consent__button--accept {
		order: -1;
	}
}

@media ( prefers-reduced-motion: reduce ) {
	.consent__switch,
	.consent__knob {
		transition: none;
	}
}
