/*
 * Herrenmoden Kraemer – Cookie-Einwilligung
 *
 * Nutzt die Farben und Schriften des Kraemer-Themes (theme.json-Presets) und
 * fällt in anderen Themes auf dieselben Werte zurück. Zum Anpassen genügt es,
 * die Variablen unten zu überschreiben, z. B. im Website-Editor unter
 * „Stile → Zusätzliches CSS“:  .kc { --kc-accent: #8c7141; }
 */
.kc {
	--kc-ink: var(--wp--preset--color--ink, #252b2b);
	--kc-paper: var(--wp--preset--color--paper, #f7f8f6);
	--kc-white: var(--wp--preset--color--white, #fff);
	--kc-accent: var(--wp--preset--color--gold, #8c7141);
	--kc-accent-light: var(--wp--preset--color--gold-light, #ddcba7);
	--kc-muted: var(--wp--preset--color--slate, #5e6865);
	--kc-line: rgba(37, 43, 43, .13);
	--kc-serif: var(--wp--preset--font-family--serif, "Iowan Old Style", Baskerville, "Times New Roman", serif);
	--kc-sans: var(--wp--preset--font-family--sans, Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
	--kc-shadow: 0 18px 55px rgba(37, 43, 43, .14);
	--kc-radius: 2px;
	--kc-z: 99990;
	color: var(--kc-ink);
	font-family: var(--kc-sans);
	font-size: 16px;
	line-height: 1.6;
}
.kc *, .kc *::before, .kc *::after { box-sizing: border-box; }
.kc [hidden] { display: none !important; }

/* ---------- Banner ---------- */
.kc-banner {
	position: fixed;
	z-index: var(--kc-z);
	left: 24px;
	bottom: 24px;
	width: min(460px, calc(100% - 48px));
	max-height: calc(100vh - 48px);
	overflow-y: auto;
	padding: 28px 30px 24px;
	color: var(--kc-ink);
	background: var(--kc-white);
	border: 1px solid var(--kc-line);
	border-top: 2px solid var(--kc-accent);
	border-radius: var(--kc-radius);
	box-shadow: var(--kc-shadow);
	animation: kc-in .35s cubic-bezier(.2, .65, .3, 1) both;
}
@keyframes kc-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.kc-eyebrow {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 0 0 10px;
	color: var(--kc-accent);
	font-family: var(--kc-sans);
	font-size: .68rem;
	font-weight: 700;
	letter-spacing: .16em;
	line-height: 1.2;
	text-transform: uppercase;
}
.kc-eyebrow::before { content: ""; width: 28px; height: 1px; background: currentColor; }

.kc-title {
	margin: 0 0 12px;
	color: var(--kc-ink);
	font-family: var(--kc-serif);
	font-size: 1.65rem;
	font-weight: 400;
	letter-spacing: -.02em;
	line-height: 1.15;
}
.kc-text {
	margin: 0 0 22px;
	color: var(--kc-muted);
	font-size: .9rem;
	line-height: 1.65;
}
.kc-text a { color: var(--kc-ink); }

/* ---------- Buttons ---------- */
.kc-actions {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
}
.kc-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	margin: 0;
	padding: 12px 16px;
	color: var(--kc-white);
	background: var(--kc-ink);
	border: 1px solid var(--kc-ink);
	border-radius: var(--kc-radius);
	font-family: var(--kc-sans);
	font-size: .7rem;
	font-weight: 700;
	letter-spacing: .12em;
	line-height: 1.2;
	text-align: center;
	text-transform: uppercase;
	cursor: pointer;
	transition: color .2s, background-color .2s, border-color .2s;
	-webkit-appearance: none;
	appearance: none;
}
.kc-button:hover { color: var(--kc-ink); background: var(--kc-accent-light); border-color: var(--kc-accent-light); }
.kc-button--outline { color: var(--kc-ink); background: transparent; border-color: var(--kc-line); }
.kc-button--outline:hover { color: var(--kc-white); background: var(--kc-ink); border-color: var(--kc-ink); }
.kc-button--quiet {
	grid-column: 1 / -1;
	min-height: 40px;
	color: var(--kc-ink);
	background: transparent;
	border-color: transparent;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: .35em;
}
.kc-button--quiet:hover { color: var(--kc-accent); background: transparent; border-color: transparent; }

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

.kc-links {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 10px;
	margin: 14px 0 0;
	color: var(--kc-muted);
	font-size: .75rem;
}
.kc-links a { color: var(--kc-muted); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; }
.kc-links a:hover { color: var(--kc-accent); }

/* ---------- Einstellungsdialog ---------- */
.kc-dialog {
	width: min(660px, calc(100% - 32px));
	max-width: none;
	max-height: min(860px, calc(100% - 32px));
	margin: auto;
	padding: 0;
	color: var(--kc-ink);
	background: var(--kc-white);
	border: 0;
	border-top: 2px solid var(--kc-accent);
	border-radius: var(--kc-radius);
	box-shadow: var(--kc-shadow);
	overflow: hidden;
}
.kc-dialog[open] { display: flex; }
.kc-dialog::backdrop { background: rgba(23, 33, 39, .5); }
.kc-dialog__inner { display: flex; flex-direction: column; width: 100%; max-height: inherit; min-height: 0; }
.kc-dialog__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	padding: 26px 30px 18px;
	border-bottom: 1px solid var(--kc-line);
}
.kc-dialog__head .kc-title { margin: 0; }
.kc-close {
	display: grid;
	place-items: center;
	flex: 0 0 auto;
	width: 40px;
	height: 40px;
	margin: -4px -8px 0 0;
	padding: 0;
	color: var(--kc-ink);
	background: transparent;
	border: 1px solid transparent;
	border-radius: 50%;
	cursor: pointer;
}
.kc-close:hover { color: var(--kc-accent); border-color: var(--kc-line); }
.kc-dialog__body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 22px 30px 8px; overscroll-behavior: contain; }
.kc-dialog__foot { padding: 18px 30px 22px; border-top: 1px solid var(--kc-line); background: var(--kc-paper); }
.kc-dialog__foot .kc-actions { grid-template-columns: repeat(3, 1fr); }

.kc-category { padding: 20px 0; border-top: 1px solid var(--kc-line); }
.kc-category__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.kc-category__title {
	margin: 0;
	color: var(--kc-ink);
	font-family: var(--kc-sans);
	font-size: .78rem;
	font-weight: 700;
	letter-spacing: .12em;
	line-height: 1.3;
	text-transform: uppercase;
}
.kc-category__text { margin: 8px 0 0; color: var(--kc-muted); font-size: .86rem; line-height: 1.6; }

/* Schalter */
.kc-switch { position: relative; display: inline-flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.kc-switch__input {
	position: absolute;
	inset: 0;
	z-index: 1;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: pointer;
}
.kc-switch__input:disabled { cursor: not-allowed; }
.kc-switch__track {
	position: relative;
	order: 2;
	width: 44px;
	height: 24px;
	background: rgba(37, 43, 43, .22);
	border-radius: 12px;
	transition: background-color .2s;
}
.kc-switch__track::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 18px;
	height: 18px;
	background: var(--kc-white);
	border-radius: 50%;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
	transition: transform .2s;
}
.kc-switch__input:checked ~ .kc-switch__track { background: var(--kc-ink); }
.kc-switch__input:checked ~ .kc-switch__track::after { transform: translateX(20px); }
.kc-switch__input:disabled ~ .kc-switch__track { opacity: .45; }
.kc-switch__input:focus-visible ~ .kc-switch__track { outline: 2px solid var(--kc-accent); outline-offset: 2px; }
.kc-switch__input[data-kc-mixed="true"] ~ .kc-switch__track { background: var(--kc-accent); }
.kc-switch__input[data-kc-mixed="true"] ~ .kc-switch__track::after { transform: translateX(10px); }
.kc-switch__state { order: 1; min-width: 3.2em; color: var(--kc-muted); font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-align: right; text-transform: uppercase; }
.kc-switch__state::before { content: attr(data-off); }
.kc-switch__input:checked ~ .kc-switch__state::before { content: attr(data-on); color: var(--kc-ink); }
.kc-switch--small .kc-switch__track { width: 36px; height: 20px; }
.kc-switch--small .kc-switch__track::after { width: 14px; height: 14px; }
.kc-switch--small .kc-switch__input:checked ~ .kc-switch__track::after { transform: translateX(16px); }
.kc-switch--small .kc-switch__input[data-kc-mixed="true"] ~ .kc-switch__track::after { transform: translateX(8px); }

/* Dienste */
.kc-services { margin-top: 12px; }
.kc-services > summary {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: var(--kc-ink);
	font-size: .78rem;
	cursor: pointer;
	list-style: none;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: .3em;
}
.kc-services > summary::-webkit-details-marker { display: none; }
.kc-services > summary::after { content: "+"; color: var(--kc-accent); text-decoration: none; }
.kc-services[open] > summary::after { content: "−"; }
.kc-service { margin-top: 12px; padding: 14px 16px; background: var(--kc-paper); border: 1px solid var(--kc-line); }
.kc-service__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.kc-service__name { margin: 0; font-family: var(--kc-serif); font-size: 1.1rem; line-height: 1.3; }
.kc-service__facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 10px 0 0; font-size: .78rem; line-height: 1.5; }
.kc-service__facts dt { color: var(--kc-muted); font-weight: 700; }
.kc-service__facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.kc-service__facts a { color: var(--kc-accent); }
.kc-cookies { margin: 0; padding: 0; list-style: none; }
.kc-cookies li + li { margin-top: 4px; }
.kc-cookies code, .kc-service__facts code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .74rem; }
.kc-cookies__purpose { display: block; color: var(--kc-muted); }

/* ---------- Wiederaufruf ---------- */
.kc-reopen {
	position: fixed;
	z-index: calc(var(--kc-z) - 1);
	left: 16px;
	bottom: 16px;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	color: var(--kc-ink);
	background: var(--kc-white);
	border: 1px solid var(--kc-line);
	border-radius: 50%;
	box-shadow: 0 6px 20px rgba(37, 43, 43, .1);
	cursor: pointer;
	transition: color .2s, border-color .2s;
}
.kc-reopen:hover { color: var(--kc-accent); border-color: var(--kc-accent); }

.kc-visually-hidden {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
}

/* ---------- Platzhalter für blockierte Inhalte (Videos, Karten) ---------- */
.kc-placeholder {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 14px;
	width: 100%;
	min-height: 220px;
	padding: 28px;
	color: var(--kc-ink);
	background: var(--kc-paper);
	border: 1px solid var(--kc-line);
	font-family: var(--kc-sans);
	text-align: center;
}
/* Responsive Einbettungen aus dem Einbettungs-Block: Platzhalter füllt die vorgesehene Fläche. */
.wp-block-embed__wrapper:has(> .kc-placeholder) { position: relative; }
.wp-embed-responsive .wp-has-aspect-ratio .wp-block-embed__wrapper > .kc-placeholder { position: absolute; inset: 0; min-height: 0; max-width: none !important; aspect-ratio: auto !important; overflow-y: auto; }
.kc-placeholder p { max-width: 460px; margin: 0; color: var(--kc-muted); font-size: .88rem; line-height: 1.6; }
.kc-placeholder .kc-placeholder__actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 18px; }
.kc-placeholder .kc-button { min-width: 180px; }
.kc-placeholder a { color: var(--kc-ink); font-size: .78rem; }

/* ---------- Kleine Bildschirme ---------- */
@media (max-width: 620px) {
	.kc-banner {
		left: 0;
		right: 0;
		bottom: 0;
		width: 100%;
		max-height: 85vh;
		padding: 22px 20px calc(18px + env(safe-area-inset-bottom));
		border-left: 0;
		border-right: 0;
		border-bottom: 0;
		border-radius: 0;
	}
	.kc-title { font-size: 1.4rem; }
	.kc-text { margin-bottom: 18px; font-size: .86rem; }
	.kc-dialog { width: 100%; max-height: 100%; height: 100%; margin: 0; border-radius: 0; }
	.kc-dialog__head, .kc-dialog__body, .kc-dialog__foot { padding-left: 20px; padding-right: 20px; }
	.kc-dialog__foot { padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
	.kc-dialog__foot .kc-actions { grid-template-columns: 1fr 1fr; }
	.kc-dialog__foot .kc-actions > :first-child { grid-column: 1 / -1; }
	.kc-service__facts { grid-template-columns: 1fr; gap: 2px; }
	.kc-service__facts dd { margin-bottom: 6px; }
}
@media (max-width: 360px) {
	.kc-actions, .kc-dialog__foot .kc-actions { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
	.kc-banner { animation: none; }
	.kc-switch__track, .kc-switch__track::after, .kc-button { transition: none; }
}
@media print { .kc { display: none !important; } }
