/*
 * geckIT Einwilligung – banner and settings dialog.
 *
 * Every colour, radius, font and distance is a custom property with a neutral fallback. Themes set them on :root
 * (or on .geckit-einwilligung / .geckit-einwilligung-dialog) – the plugin itself never defines them, so a theme
 * value always wins:
 *
 *   --geckit-ew-grund          background of banner and dialog          (#fff)
 *   --geckit-ew-text           text                                     (#1d1d1b)
 *   --geckit-ew-text-leise     secondary text                           (#57534e)
 *   --geckit-ew-linie          separator lines                          (#d6d3cf)
 *   --geckit-ew-knopf          main buttons: fill                       (#1d1d1b)
 *   --geckit-ew-knopf-text     main buttons: text                       (#fff)
 *   --geckit-ew-knopf-hover    main buttons: fill on hover              (#3b3935)
 *   --geckit-ew-knopf-rand     main buttons: border                     (same as fill)
 *   --geckit-ew-zweit-text     outline buttons: text and border         (--geckit-ew-text)
 *   --geckit-ew-zweit-hover    outline buttons: fill on hover           (text colour at 6 %)
 *   --geckit-ew-link-linie     underline of links                       (currentColor)
 *   --geckit-ew-haken          checkbox colour (accent-color)           (--geckit-ew-text)
 *   --geckit-ew-fokus          focus ring                               (--geckit-ew-text)
 *   --geckit-ew-fokus-hof      halo around the focus ring               (transparent)
 *   --geckit-ew-radius         banner, dialog                           (10px)
 *   --geckit-ew-radius-knopf   buttons                                  (10px)
 *   --geckit-ew-schatten       shadow of banner and dialog
 *   --geckit-ew-abdunkeln      backdrop behind the dialog               (rgb(0 0 0 / .45))
 *   --geckit-ew-schrift        text font                                (inherit)
 *   --geckit-ew-schrift-titel  heading font                             (inherit)
 *   --geckit-ew-breite         maximum banner width                     (1120px)
 *   --geckit-ew-unten          gap between banner and bottom edge       (14px; raise it when something else sits there)
 *   --geckit-ew-ebene          z-index                                  (1000)
 *   --geckit-ew-uebergang      colour transitions                       (160ms ease)
 *
 * --geckit-ew-hoehe is set by the script (current banner height) and sizes the spacer at the end of <body>.
 */

.geckit-einwilligung,
.geckit-einwilligung-dialog {
	box-sizing: border-box;
	color: var(--geckit-ew-text, #1d1d1b);
	font-family: var(--geckit-ew-schrift, inherit);
	font-size: 1rem;
	line-height: 1.5;
	text-align: left;
}

.geckit-einwilligung *,
.geckit-einwilligung *::before,
.geckit-einwilligung *::after,
.geckit-einwilligung-dialog *,
.geckit-einwilligung-dialog *::before,
.geckit-einwilligung-dialog *::after {
	box-sizing: inherit;
}

/* ---------- Banner (first layer) ---------- */

.geckit-einwilligung {
	position: fixed;
	left: 0;
	right: 0;
	bottom: var(--geckit-ew-unten, 14px);
	z-index: var(--geckit-ew-ebene, 1000);
	width: min(var(--geckit-ew-breite, 1120px), calc(100% - 20px));
	max-height: calc(100vh - var(--geckit-ew-unten, 14px) - 10px);
	max-height: calc(100dvh - var(--geckit-ew-unten, 14px) - 10px);
	margin: 0 auto;
	overflow: auto;
	overscroll-behavior: contain;
	background: var(--geckit-ew-grund, #fff);
	border: 1px solid var(--geckit-ew-linie, #d6d3cf);
	border-radius: var(--geckit-ew-radius, 10px);
	box-shadow: var(--geckit-ew-schatten, 0 2px 6px rgb(0 0 0 / 0.18), 0 24px 56px -12px rgb(0 0 0 / 0.35));
}

.geckit-einwilligung[hidden],
.geckit-einwilligung-dialog [hidden] {
	display: none !important;
}

.geckit-einwilligung__innen {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	grid-template-areas:
		"inhalt aktionen"
		"weiteres aktionen";
	align-items: center;
	gap: 4px 40px;
	padding: 20px 24px 10px;
}

.geckit-einwilligung__inhalt {
	grid-area: inhalt;
}

.geckit-einwilligung .geckit-einwilligung__titel,
.geckit-einwilligung-dialog .geckit-einwilligung__titel {
	margin: 0 0 6px;
	font-family: var(--geckit-ew-schrift-titel, inherit);
	font-size: 1.25rem;
	font-weight: 650;
	line-height: 1.25;
	letter-spacing: normal;
	color: inherit;
}

.geckit-einwilligung .geckit-einwilligung__text,
.geckit-einwilligung-dialog .geckit-einwilligung__text {
	margin: 0;
	max-width: 62em;
	font-size: 1rem;
	line-height: 1.55;
}

/* Second row: “Settings” (a button that looks like a link) next to the links to privacy policy and legal notice. */
.geckit-einwilligung__weiteres {
	grid-area: weiteres;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0 24px;
}

.geckit-einwilligung__weiteres .geckit-einwilligung__links {
	display: contents;
}

.geckit-einwilligung__links {
	display: flex;
	flex-wrap: wrap;
	gap: 0 24px;
	margin: 0;
	font-size: 0.9375rem;
}

.geckit-einwilligung__links a,
.geckit-einwilligung__details a,
.geckit-einwilligung__textknopf {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	margin: 0;
	padding: 0;
	font: inherit;
	font-size: 0.9375rem;
	font-weight: 500;
	color: inherit;
	background: none;
	border: 0;
	cursor: pointer;
	text-decoration: underline;
	text-decoration-color: var(--geckit-ew-link-linie, currentColor);
	text-decoration-thickness: 2px;
	text-underline-offset: 4px;
	transition: text-decoration-color var(--geckit-ew-uebergang, 160ms ease);
}

.geckit-einwilligung__textknopf {
	font-weight: 600;
}

.geckit-einwilligung__links a:hover,
.geckit-einwilligung__details a:hover,
.geckit-einwilligung__textknopf:hover {
	text-decoration-color: currentColor;
}

/* The two choices: equal columns, so both buttons are always exactly the same size. */
.geckit-einwilligung__aktionen {
	grid-area: aktionen;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
	width: min(420px, 100%);
}

/* ---------- Buttons ---------- */

.geckit-einwilligung__knopf {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	margin: 0;
	padding: 10px 22px;
	font: inherit;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	cursor: pointer;
	color: var(--geckit-ew-knopf-text, #fff);
	background: var(--geckit-ew-knopf, #1d1d1b);
	border: 1px solid var(--geckit-ew-knopf-rand, var(--geckit-ew-knopf, #1d1d1b));
	border-radius: var(--geckit-ew-radius-knopf, 10px);
	box-shadow: none;
	transition: background-color var(--geckit-ew-uebergang, 160ms ease), border-color var(--geckit-ew-uebergang, 160ms ease), color var(--geckit-ew-uebergang, 160ms ease);
}

.geckit-einwilligung__knopf:hover {
	background: var(--geckit-ew-knopf-hover, #3b3935);
}

.geckit-einwilligung__knopf--zweit {
	color: var(--geckit-ew-zweit-text, var(--geckit-ew-text, #1d1d1b));
	background: transparent;
	border: 1.5px solid var(--geckit-ew-zweit-text, var(--geckit-ew-text, #1d1d1b));
}

.geckit-einwilligung__knopf--zweit:hover {
	background: var(--geckit-ew-zweit-hover, rgb(0 0 0 / 0.06));
}

.geckit-einwilligung :focus-visible,
.geckit-einwilligung-dialog :focus-visible {
	outline: 3px solid var(--geckit-ew-fokus, var(--geckit-ew-text, #1d1d1b));
	outline-offset: 3px;
	box-shadow: 0 0 0 7px var(--geckit-ew-fokus-hof, transparent);
}

/* ---------- Settings dialog (second layer) ---------- */

.geckit-einwilligung-dialog {
	width: min(680px, calc(100% - 20px));
	max-width: none;
	max-height: calc(100vh - 20px);
	max-height: calc(100dvh - 20px);
	margin: auto;
	padding: 0;
	overflow: hidden;
	background: var(--geckit-ew-grund, #fff);
	border: 1px solid var(--geckit-ew-linie, #d6d3cf);
	border-radius: var(--geckit-ew-radius, 10px);
	box-shadow: var(--geckit-ew-schatten, 0 2px 6px rgb(0 0 0 / 0.18), 0 24px 56px -12px rgb(0 0 0 / 0.35));
}

.geckit-einwilligung-dialog[open] {
	display: flex;
	flex-direction: column;
}

.geckit-einwilligung-dialog::backdrop {
	background: var(--geckit-ew-abdunkeln, rgb(0 0 0 / 0.45));
}

.geckit-einwilligung__kopf {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 14px 14px 14px 24px;
	border-bottom: 1px solid var(--geckit-ew-linie, #d6d3cf);
}

.geckit-einwilligung-dialog .geckit-einwilligung__kopf .geckit-einwilligung__titel {
	margin: 0;
}

.geckit-einwilligung__titel:focus {
	outline: none;
}

.geckit-einwilligung__schliessen {
	position: relative;
	flex: none;
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 0;
	color: inherit;
	background: transparent;
	border: 0;
	border-radius: 6px;
	cursor: pointer;
	transition: background-color var(--geckit-ew-uebergang, 160ms ease);
}

.geckit-einwilligung__schliessen:hover {
	background: var(--geckit-ew-zweit-hover, rgb(0 0 0 / 0.06));
}

.geckit-einwilligung__kreuz::before,
.geckit-einwilligung__kreuz::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 20px;
	height: 2px;
	background: currentColor;
	border-radius: 1px;
	transform: translate(-50%, -50%) rotate(45deg);
}

.geckit-einwilligung__kreuz::after {
	transform: translate(-50%, -50%) rotate(-45deg);
}

.geckit-einwilligung__rumpf {
	flex: 1 1 auto;
	overflow: auto;
	overscroll-behavior: contain;
	padding: 18px 24px 8px;
}

.geckit-einwilligung__stand {
	margin: 8px 0 0;
	font-size: 0.9375rem;
	color: var(--geckit-ew-text-leise, #57534e);
}

.geckit-einwilligung__kategorie {
	margin-top: 20px;
	padding-top: 16px;
	border-top: 1px solid var(--geckit-ew-linie, #d6d3cf);
}

.geckit-einwilligung__kategorie-kopf {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 4px 16px;
}

.geckit-einwilligung-dialog .geckit-einwilligung__kategorie-name {
	margin: 0;
	font-family: var(--geckit-ew-schrift-titel, inherit);
	font-size: 1.0625rem;
	font-weight: 650;
	line-height: 1.3;
	letter-spacing: normal;
	color: inherit;
}

.geckit-einwilligung__immer {
	font-size: 0.9375rem;
	font-weight: 600;
	color: var(--geckit-ew-text-leise, #57534e);
}

.geckit-einwilligung .geckit-einwilligung__kategorie-text,
.geckit-einwilligung-dialog .geckit-einwilligung__kategorie-text {
	margin: 4px 0 0;
	font-size: 0.9375rem;
	color: var(--geckit-ew-text-leise, #57534e);
}

.geckit-einwilligung__dienste {
	margin: 8px 0 0;
	padding: 0;
	list-style: none;
}

.geckit-einwilligung__dienst + .geckit-einwilligung__dienst {
	border-top: 1px solid var(--geckit-ew-linie, #d6d3cf);
}

/* One row: [checkbox] name … Details; the details panel spans the row below. */
.geckit-einwilligung__dienst {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: center;
	column-gap: 10px;
}

.geckit-einwilligung__dienst > span.geckit-einwilligung__dienst-name {
	grid-column: 1 / 3;
}

.geckit-einwilligung__dienst-name {
	display: flex;
	align-items: center;
	min-height: 44px;
	padding-block: 8px;
	font-weight: 600;
}

label.geckit-einwilligung__dienst-name,
.geckit-einwilligung__alle label {
	cursor: pointer;
}

.geckit-einwilligung__alle {
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 44px;
}

.geckit-einwilligung__alle label {
	padding-block: 10px;
}

.geckit-einwilligung-dialog input[type="checkbox"] {
	flex: none;
	width: 22px;
	height: 22px;
	margin: 0;
	accent-color: var(--geckit-ew-haken, var(--geckit-ew-text, #1d1d1b));
	cursor: pointer;
}

.geckit-einwilligung__details-knopf {
	grid-column: 3;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	margin: 0;
	padding: 0;
	font: inherit;
	font-size: 0.9375rem;
	font-weight: 500;
	color: inherit;
	background: none;
	border: 0;
	cursor: pointer;
	text-decoration: underline;
	text-decoration-color: var(--geckit-ew-link-linie, currentColor);
	text-decoration-thickness: 2px;
	text-underline-offset: 4px;
}

.geckit-einwilligung__details-knopf:hover {
	text-decoration-color: currentColor;
}

/* Small chevron, turns when open (no animation). */
.geckit-einwilligung__details-knopf::after {
	content: "";
	width: 7px;
	height: 7px;
	margin-top: -4px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg);
}

.geckit-einwilligung__details-knopf[aria-expanded="true"]::after {
	margin-top: 3px;
	transform: rotate(-135deg);
}

.geckit-einwilligung__details {
	grid-column: 1 / -1;
	padding: 0 0 12px 32px;
	font-size: 0.9375rem;
}

.geckit-einwilligung__dienst:not(.geckit-einwilligung__dienst--wahl) .geckit-einwilligung__details {
	padding-left: 0;
}

.geckit-einwilligung__angaben {
	display: grid;
	grid-template-columns: minmax(8em, max-content) minmax(0, 1fr);
	gap: 6px 16px;
	margin: 4px 0 6px;
}

.geckit-einwilligung__angaben dt {
	font-weight: 600;
	color: var(--geckit-ew-text-leise, #57534e);
}

.geckit-einwilligung__angaben dd {
	margin: 0;
}

.geckit-einwilligung__angaben dt.geckit-einwilligung__versteckt + dd {
	grid-column: 1 / -1;
}

.geckit-einwilligung-dialog .geckit-einwilligung__links {
	margin-top: 16px;
	padding-top: 6px;
	border-top: 1px solid var(--geckit-ew-linie, #d6d3cf);
}

.geckit-einwilligung__fuss {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 10px;
	padding: 14px 24px 18px;
	border-top: 1px solid var(--geckit-ew-linie, #d6d3cf);
}

/* ---------- Spacer, hidden text ---------- */

.geckit-einwilligung-platz {
	display: none;
}

.geckit-einwilligung-offen .geckit-einwilligung-platz {
	display: block;
	height: calc(var(--geckit-ew-hoehe, 0px) + var(--geckit-ew-unten, 14px));
}

.geckit-einwilligung__versteckt {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* ---------- Narrow screens ---------- */

@media (max-width: 900px) {
	.geckit-einwilligung__innen {
		grid-template-columns: minmax(0, 1fr);
		grid-template-areas:
			"inhalt"
			"aktionen"
			"weiteres";
		align-items: stretch;
		gap: 12px;
		padding: 16px 16px 4px;
	}

	.geckit-einwilligung__aktionen {
		width: 100%;
	}

	.geckit-einwilligung__weiteres {
		margin-top: -6px;
	}
}

@media (max-width: 560px) {
	.geckit-einwilligung {
		width: calc(100% - 16px);
		bottom: var(--geckit-ew-unten, 8px);
	}

	.geckit-einwilligung .geckit-einwilligung__titel {
		margin-bottom: 4px;
		font-size: 1.0625rem;
	}

	.geckit-einwilligung__knopf {
		padding-inline: 12px;
	}

	.geckit-einwilligung__weiteres {
		gap: 0 18px;
	}

	.geckit-einwilligung .geckit-einwilligung__text {
		font-size: 0.9375rem;
	}

	.geckit-einwilligung__kopf {
		padding-left: 18px;
	}

	.geckit-einwilligung__rumpf {
		padding: 14px 18px 8px;
	}

	.geckit-einwilligung__fuss {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		padding: 12px 18px 16px;
	}

	.geckit-einwilligung__fuss .geckit-einwilligung__knopf--speichern {
		grid-column: 1 / -1;
	}

	.geckit-einwilligung__details {
		padding-left: 0;
	}

	.geckit-einwilligung__angaben {
		grid-template-columns: minmax(0, 1fr);
		gap: 2px;
	}

	.geckit-einwilligung__angaben dd + dt {
		margin-top: 8px;
	}
}

/* Small phones (320–380 px): the banner must not cover most of the screen. Tighter spacing, smaller text, the three
   links in one row, both choices still side by side and exactly the same size. */
@media (max-width: 380px) {
	.geckit-einwilligung__innen {
		gap: 10px;
		padding: 12px 12px 0;
	}

	.geckit-einwilligung .geckit-einwilligung__titel {
		margin-bottom: 2px;
		font-size: 1rem;
	}

	.geckit-einwilligung .geckit-einwilligung__text {
		font-size: 0.875rem;
		line-height: 1.45;
	}

	.geckit-einwilligung__aktionen {
		gap: 8px;
	}

	.geckit-einwilligung .geckit-einwilligung__knopf {
		min-height: 44px;
		padding: 8px;
		font-size: 0.875rem;
	}

	.geckit-einwilligung__weiteres {
		gap: 0 14px;
		margin-top: -4px;
	}

	.geckit-einwilligung__weiteres .geckit-einwilligung__links a,
	.geckit-einwilligung__weiteres .geckit-einwilligung__textknopf {
		font-size: 0.8125rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.geckit-einwilligung *,
	.geckit-einwilligung-dialog * {
		transition: none !important;
	}
}

@media (forced-colors: active) {
	.geckit-einwilligung,
	.geckit-einwilligung-dialog,
	.geckit-einwilligung__knopf {
		border: 1px solid CanvasText;
	}
}
