/* Cookie-Hinweis (annasnudel-consent). Loaded only while a service is
   configured. Uses the theme's presets; falls back to plain colours.
   Designed and built by BatuWeb.de. */

.an-consent {
	position: fixed;
	inset-inline: var(--wp--preset--spacing--s, 1rem);
	inset-block-end: var(--wp--preset--spacing--s, 1rem);
	z-index: 1000;
	display: flex;
	justify-content: center;
	pointer-events: none;
}

.an-consent[hidden] {
	display: none;
}

.an-consent__inner {
	position: relative;
	pointer-events: auto;
	/* Wider on a desktop (owner, 11-13): fewer lines, less of the page covered. */
	inline-size: min(100%, 62rem);
	max-block-size: calc(100vh - 2rem);
	max-block-size: calc(100dvh - 2rem); /* a phone's browser bar */
	overflow-y: auto;
	padding: var(--wp--preset--spacing--m, 1.5rem);
	background: var(--wp--preset--color--paper, #fcf9f2);
	color: var(--wp--preset--color--contrast, #263a2d);
	border: 1px solid var(--wp--preset--color--line, #d9d1c3);
	border-radius: var(--an-radius-m, 0.75rem);
	box-shadow: var(--an-shadow-m, 0 0.5rem 2rem rgb(0 0 0 / 0.15));
	font-size: var(--wp--preset--font-size--s, 0.95rem);
}

/* Closes without a choice; the theme's button rule is undone here. */
.an-consent__close {
	position: absolute;
	inset-block-start: var(--wp--preset--spacing--xs, 0.5rem);
	inset-inline-end: var(--wp--preset--spacing--xs, 0.5rem);
	inline-size: 2.5rem;
	block-size: 2.5rem;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: none;
	color: inherit;
	font: inherit;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
}

.an-consent__close:hover {
	background: var(--wp--preset--color--line, #d9d1c3);
}

.an-consent__title {
	margin: 0 0 var(--wp--preset--spacing--xs, 0.5rem);
	padding-inline-end: 2.5rem; /* room for the close button */
	font-size: var(--wp--preset--font-size--l, 1.4rem);
}

.an-consent__text {
	margin: 0;
}

/* The theme draws a line under every <details>; not inside the banner. */
.an-consent__details {
	margin-block-start: var(--wp--preset--spacing--s, 1rem);
	border: 0;
}

/* The theme styles summaries as FAQ headings; here it is a plain link. */
.an-consent__details summary {
	display: inline;
	padding: 0;
	font: inherit;
	font-weight: var(--an-weight-semibold, 600);
	cursor: pointer;
	text-decoration: underline;
}

.an-consent__details summary::after,
.an-consent__details summary::before {
	content: none;
}

.an-consent__choices {
	display: grid;
	gap: var(--wp--preset--spacing--xs, 0.5rem);
	margin: var(--wp--preset--spacing--s, 1rem) 0;
	padding: 0;
	border: 0;
}

.an-consent__choice {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	gap: var(--wp--preset--spacing--xs, 0.5rem);
	align-items: start;
}

.an-consent__choice strong {
	display: block;
}

.an-consent__service {
	display: block;
	margin-block-start: 0.25rem;
	font-size: var(--wp--preset--font-size--xs, 0.85rem);
}

/* "Akzeptieren" first (on top on a phone), "Ablehnen" beside or below it;
   both look the same on purpose: no nudging. */
/*
 * Ablehnen left, Akzeptieren right (owner, 11-04); stacked on a phone,
 * wrap-reverse puts Akzeptieren on top (owner, 11-02). Same style for both.
 */
.an-consent__actions {
	display: flex;
	flex-wrap: wrap-reverse;
	gap: var(--wp--preset--spacing--xs, 0.5rem);
	justify-content: flex-end;
	margin-block-start: var(--wp--preset--spacing--s, 1rem);
}

.an-consent__actions .btn {
	flex: 1 1 10rem;
}

/*
 * Akzeptieren in the site's green, Ablehnen in its terracotta (owner, 11-13):
 * both filled, the same size and weight, so neither is the obvious one.
 */
.an-consent__actions [data-an-consent="all"] {
	background-color: var(--wp--preset--color--contrast, #263a2d);
	border-color: var(--wp--preset--color--contrast, #263a2d);
	color: var(--wp--preset--color--paper, #fcf9f2);
}

.an-consent__actions [data-an-consent="all"]:hover,
.an-consent__actions [data-an-consent="all"]:focus-visible {
	background-color: var(--wp--preset--color--deep, #1b2820);
	border-color: var(--wp--preset--color--deep, #1b2820);
	color: var(--wp--preset--color--paper, #fcf9f2);
}

@media (min-width: 48rem) {
	/* On a wide banner the two buttons sit at the right, not across it. */
	.an-consent__actions .btn {
		flex: 0 1 14rem;
	}
}

/* The first appearance, 3 s after the page (consent.js): a short fade up. */
@media (prefers-reduced-motion: no-preference) {
	.an-consent--enter .an-consent__inner {
		animation: an-consent-in 0.45s ease both;
	}

	@keyframes an-consent-in {
		from {
			opacity: 0;
			transform: translateY(1rem);
		}
	}
}

@media print {
	.an-consent {
		display: none;
	}
}
