/**
 * KOPFPUNK Handmade — System-Styles (Credit-Leiste, Cookie-Banner)
 *
 * Projektspezifische Anpassung über CSS-Variablen, z. B.:
 * :root { --kph-consent-bg: #fff; --kph-consent-fg: #000; }
 */

:root {
	--kph-lime: #d3ff00;
	--kph-consent-accent: var(--kph-lime);
	--kph-consent-bg: #000;
	--kph-consent-fg: #fff;
	--kph-consent-line: #3d3d3d;
	--kph-consent-on-accent: #000;
}

/* -------------------------------------------------------------------------
 * Credit-Leiste
 * ---------------------------------------------------------------------- */

.kph-credit {
	background: #000;
	color: #fff;
	text-align: center;
	padding: 10px 16px;
	font-size: 14px;
	line-height: 1.4;
}

.kph-credit__link,
.kph-credit__link:visited {
	color: #fff;
	text-decoration: none;
	transition: color 0.2s ease;
}

.kph-credit__link:hover,
.kph-credit__link:focus-visible {
	color: var(--kph-lime);
}

.kph-credit__link:focus-visible {
	outline: 2px solid var(--kph-lime);
	outline-offset: 3px;
}

/* -------------------------------------------------------------------------
 * Cookie-Banner
 * ---------------------------------------------------------------------- */

.kph-consent {
	position: fixed;
	z-index: 2147483000;
	left: 16px;
	right: 16px;
	bottom: 16px;
	max-width: 640px;
	max-height: calc(100vh - 32px);
	max-height: calc(100dvh - 32px);
	overflow-y: auto;
	margin: 0 auto;
	background: var(--kph-consent-bg);
	color: var(--kph-consent-fg);
	border: 1px solid var(--kph-consent-line);
	font-size: 15px;
	line-height: 1.5;
	box-shadow: 0 8px 40px rgba(0, 0, 0, 0.35);
	text-align: left;
}

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

.kph-consent:focus,
.kph-consent:focus-visible {
	outline: none;
}

.kph-consent__inner {
	padding: 24px;
}

.kph-consent__title {
	margin: 0 0 8px;
	font-size: 20px;
	line-height: 1.25;
	color: var(--kph-consent-accent);
}

.kph-consent__text,
.kph-consent__used {
	margin: 0 0 12px;
}

.kph-consent__used {
	font-size: 13px;
	opacity: 0.8;
}

.kph-consent__used span {
	font-weight: 600;
}

.kph-consent a {
	color: var(--kph-consent-accent);
	text-decoration: underline;
}

.kph-consent a:hover,
.kph-consent a:focus-visible {
	color: var(--kph-consent-fg);
}

/* Kategorien */
.kph-consent__prefs {
	margin: 16px 0;
	border-top: 1px solid var(--kph-consent-line);
}

.kph-consent__prefs[hidden] {
	display: none;
}

.kph-consent__cat {
	padding: 14px 0;
	border-bottom: 1px solid var(--kph-consent-line);
}

.kph-consent__cat-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.kph-consent__switch {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	cursor: pointer;
	font-weight: 600;
}

.kph-consent__switch input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
}

.kph-consent__track {
	position: relative;
	flex: 0 0 auto;
	width: 40px;
	height: 22px;
	border: 1px solid var(--kph-consent-fg);
	border-radius: 11px;
	transition: background-color 0.2s ease, border-color 0.2s ease;
}

.kph-consent__track::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: var(--kph-consent-fg);
	transition: transform 0.2s ease, background-color 0.2s ease;
}

.kph-consent__switch input:checked + .kph-consent__track {
	background: var(--kph-consent-accent);
	border-color: var(--kph-consent-accent);
}

.kph-consent__switch input:checked + .kph-consent__track::after {
	transform: translateX(18px);
	background: var(--kph-consent-on-accent);
}

.kph-consent__switch input:disabled + .kph-consent__track {
	opacity: 0.5;
}

.kph-consent__switch input:focus-visible + .kph-consent__track {
	outline: 2px solid var(--kph-consent-accent);
	outline-offset: 3px;
}

.kph-consent__always {
	font-size: 13px;
	opacity: 0.8;
}

.kph-consent__cat-desc {
	margin: 8px 0 6px;
	font-size: 14px;
	opacity: 0.85;
}

.kph-consent__services {
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 13px;
}

.kph-consent__services li {
	margin: 4px 0;
}

/* Buttons */
.kph-consent__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 16px;
}

.kph-consent__btn {
	flex: 1 1 auto;
	margin: 0;
	padding: 11px 18px;
	border: 1px solid var(--kph-consent-accent);
	border-radius: 0;
	background: var(--kph-consent-accent);
	color: var(--kph-consent-on-accent);
	font: inherit;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.kph-consent__btn:hover {
	background: var(--kph-consent-fg);
	border-color: var(--kph-consent-fg);
	color: var(--kph-consent-bg);
}

.kph-consent__btn--ghost {
	background: transparent;
	color: var(--kph-consent-fg);
	border-color: var(--kph-consent-fg);
}

.kph-consent__btn--ghost:hover {
	background: var(--kph-consent-fg);
	color: var(--kph-consent-bg);
}

.kph-consent__btn:focus-visible {
	outline: 2px solid var(--kph-consent-accent);
	outline-offset: 2px;
}

.kph-consent__btn[hidden] {
	display: none;
}

.kph-consent__links {
	margin: 16px 0 0;
	font-size: 13px;
}

@media (max-width: 480px) {
	.kph-consent {
		left: 8px;
		right: 8px;
		bottom: 8px;
		max-height: calc(100dvh - 16px);
	}

	.kph-consent__inner {
		padding: 18px;
	}

	.kph-consent__btn {
		flex-basis: 100%;
	}
}

/* Wieder-Öffnen-Button (nur ohne Link im Footer) */
.kph-consent-reopen {
	position: fixed;
	z-index: 2147482000;
	left: 16px;
	bottom: 16px;
	margin: 0;
	padding: 6px 10px;
	border: 1px solid var(--kph-consent-line);
	border-radius: 0;
	background: var(--kph-consent-bg);
	color: var(--kph-consent-accent);
	font: inherit;
	font-size: 12px;
	line-height: 1.2;
	cursor: pointer;
}

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

.kph-consent-reopen:hover,
.kph-consent-reopen:focus-visible {
	color: var(--kph-consent-fg);
	outline: 2px solid var(--kph-consent-accent);
	outline-offset: 2px;
}

/* -------------------------------------------------------------------------
 * Platzhalter für blockierte Inhalte
 * ---------------------------------------------------------------------- */

iframe[data-kph-blocked] {
	display: none !important;
}

.kph-consent-ph {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	max-width: var(--kph-ph-max, 100%);
	aspect-ratio: var(--kph-ph-ratio, 16 / 9);
	min-height: 200px;
	box-sizing: border-box;
	background: var(--kph-consent-bg);
	color: var(--kph-consent-fg);
	border: 1px solid var(--kph-consent-line);
	text-align: center;
	font-size: 14px;
	line-height: 1.5;
}

/* WordPress-Embeds mit festem Seitenverhältnis */
.wp-has-aspect-ratio .kph-consent-ph,
.wp-block-embed__wrapper .kph-consent-ph {
	position: absolute;
	inset: 0;
	max-width: none;
	aspect-ratio: auto;
	min-height: 0;
}

.wp-block-embed__wrapper:has(> .kph-consent-ph) {
	position: relative;
	min-height: 200px;
}

.kph-consent-ph__inner {
	display: block;
	max-width: 420px;
	padding: 20px;
}

.kph-consent-ph__title,
.kph-consent-ph__text,
.kph-consent-ph__actions {
	display: block;
}

.kph-consent-ph__title {
	margin: 0 0 6px;
	font-weight: 600;
	font-size: 16px;
	color: var(--kph-consent-accent);
}

.kph-consent-ph__text {
	margin: 0 0 14px;
}

.kph-consent-ph__actions {
	margin: 0;
}

.kph-consent-ph__btn {
	margin: 0 8px 0 0;
	padding: 9px 16px;
	border: 1px solid var(--kph-consent-accent);
	border-radius: 0;
	background: var(--kph-consent-accent);
	color: var(--kph-consent-on-accent);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.kph-consent-ph__btn:hover,
.kph-consent-ph__btn:focus-visible {
	background: var(--kph-consent-fg);
	border-color: var(--kph-consent-fg);
	color: var(--kph-consent-bg);
}

.kph-consent-ph__btn:focus-visible {
	outline: 2px solid var(--kph-consent-accent);
	outline-offset: 2px;
}

.kph-consent-ph__link,
.kph-consent-ph__link:visited {
	color: var(--kph-consent-accent);
	font-size: 13px;
}
