/*
 * IT Rüsthaus Consent – Frontend-Styles
 * Farb- und Schrift-Grundlage: Markenhandbuch "IT Rüsthaus" (Kärnten, 2026).
 * Alle Marken-Töne liegen als CSS-Variablen vor und werden in
 * templates/banner.php aus den Plugin-Einstellungen befüllt – so bleibt das
 * Banner jederzeit an das Website-Design anpassbar, ohne diese Datei zu
 * bearbeiten.
 */

:root {
	--itr-font: 'Gill Sans Nova', 'Gill Sans MT', 'Gill Sans', Calibri, 'Trebuchet MS', sans-serif;
	--itr-nachtblau: #28465A;
	--itr-kalkgrau: #F4F5F3;
	--itr-radius: 14px;
	--itr-radius-sm: 8px;
}

#itr-consent-banner,
#itr-consent-banner * {
	box-sizing: border-box;
}

#itr-consent-banner {
	--itr-accent: #C23B2E;
	--itr-primary: #1C3A4B;
	--itr-bg: #FFFFFF;
	--itr-text: #23272A;

	position: fixed;
	inset: 0;
	z-index: 999999;
	font-family: var(--itr-font);
	font-size: 15px;
	line-height: 1.5;
	color: var(--itr-text);
	pointer-events: none;
}

#itr-consent-banner[hidden] {
	display: none !important;
}

#itr-consent-banner .itr-consent__overlay {
	position: absolute;
	inset: 0;
	background: rgba(28, 58, 75, 0.55); /* Eisenblau, transparent */
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease;
}

/* Overlay: nur bei zentriertem Layout oder geöffnetem Einstellungs-Dialog aktiv. */
#itr-consent-banner.itr-consent--modal-center .itr-consent__overlay,
#itr-consent-banner.itr-consent-modal-open .itr-consent__overlay {
	opacity: 1;
	pointer-events: auto;
}

#itr-consent-banner .itr-consent__panel {
	position: absolute;
	pointer-events: auto;
	background: var(--itr-bg);
	color: var(--itr-text);
	box-shadow: 0 10px 40px rgba(28, 58, 75, 0.25);
	max-height: 92vh;
	overflow-y: auto;
}

/* --- Positions-Varianten für Ebene 1 (Banner) --- */

.itr-consent--bar-bottom .itr-consent__panel {
	left: 0;
	right: 0;
	bottom: 0;
	width: 100%;
	border-radius: var(--itr-radius) var(--itr-radius) 0 0;
	padding: 24px clamp(16px, 4vw, 48px);
}

.itr-consent--box-bottom-right .itr-consent__panel {
	right: 20px;
	bottom: 20px;
	width: min(400px, calc(100vw - 40px));
	border-radius: var(--itr-radius);
	padding: 22px;
}

.itr-consent--modal-center .itr-consent__panel {
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	width: min(560px, calc(100vw - 32px));
	border-radius: var(--itr-radius);
	padding: 28px;
}

/* Ebene 2 (Einstellungen) wird unabhängig von der Banner-Position immer als
   zentrierter Dialog dargestellt – bessere Lesbarkeit für die Detailansicht. */
.itr-consent__layer--modal {
	position: fixed;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	width: min(640px, calc(100vw - 32px));
	max-height: 88vh;
	overflow-y: auto;
	background: var(--itr-bg);
	border-radius: var(--itr-radius);
	padding: 28px;
	box-shadow: 0 10px 40px rgba(28, 58, 75, 0.25);
	pointer-events: auto;
}

.itr-consent__layer--modal[hidden] {
	display: none !important;
}

/* Wenn Ebene 2 offen ist, Ebene 1 (falls sichtbar) ausblenden. */
#itr-consent-banner.itr-consent-modal-open .itr-consent__layer--banner {
	display: none;
}

/* --- Kopfbereich / Logo --- */

.itr-consent__header,
.itr-consent__modal-header {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 12px;
}

.itr-consent__logo {
	flex: 0 0 auto;
	display: inline-flex;
	width: 32px;
	height: 32px;
}
.itr-consent__logo svg,
.itr-consent__logo img {
	width: 100%;
	height: 100%;
	display: block;
}

.itr-consent__heading {
	font-family: var(--itr-font);
	font-weight: 700;
	font-size: 19px;
	margin: 0;
	color: var(--itr-primary);
	flex: 1 1 auto;
}

.itr-consent__close {
	background: none;
	border: none;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	color: var(--itr-text);
	padding: 4px 8px;
	border-radius: var(--itr-radius-sm);
}
.itr-consent__close:hover,
.itr-consent__close:focus-visible {
	background: var(--itr-kalkgrau);
}

.itr-consent__text,
.itr-consent__intro {
	margin: 0 0 16px;
	font-size: 14.5px;
}
.itr-consent__text p {
	margin: 0 0 8px;
}
.itr-consent__text a,
.itr-consent__service-name a {
	color: var(--itr-primary);
	text-decoration: underline;
}
.itr-consent__legal-links {
	font-size: 13px;
}

/* --- Buttons --- */

.itr-consent__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: flex-end;
	margin-top: 18px;
}

.itr-consent__btn {
	font-family: var(--itr-font);
	font-weight: 700;
	font-size: 14px;
	border-radius: 999px;
	padding: 11px 22px;
	cursor: pointer;
	border: 2px solid transparent;
	transition: transform 0.05s ease, opacity 0.15s ease;
	white-space: nowrap;
}
.itr-consent__btn:active {
	transform: scale(0.98);
}
.itr-consent__btn:focus-visible {
	outline: 3px solid var(--itr-accent);
	outline-offset: 2px;
}

/* "Alle akzeptieren" und "Nur notwendige" sind bewusst gleichwertig
   gestaltet (gleiche Größe/Gewicht) – ohne optische Bevorzugung einer
   Option, wie es für eine rechtskonforme Opt-in-Lösung erforderlich ist. */
.itr-consent__btn--primary {
	background: var(--itr-accent);
	border-color: var(--itr-accent);
	color: #fff;
}
.itr-consent__btn--primary:hover {
	opacity: 0.92;
}

.itr-consent__btn--secondary {
	background: transparent;
	border-color: var(--itr-primary);
	color: var(--itr-primary);
}
.itr-consent__btn--secondary:hover {
	background: var(--itr-kalkgrau);
}

.itr-consent__btn--ghost {
	background: transparent;
	border-color: transparent;
	color: var(--itr-text);
	text-decoration: underline;
	padding-left: 8px;
	padding-right: 8px;
}
.itr-consent__btn--ghost:hover {
	color: var(--itr-primary);
}

/* --- Kategorien / Toggles --- */

.itr-consent__categories {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.itr-consent__category {
	border: 1px solid #E4E6E5;
	border-radius: var(--itr-radius-sm);
	padding: 14px 16px;
}

.itr-consent__category-head {
	display: flex;
	align-items: center;
	gap: 12px;
}

.itr-consent__category-title {
	flex: 1 1 auto;
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.itr-consent__category-name {
	font-weight: 700;
	color: var(--itr-primary);
}

.itr-consent__category-badge {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	background: var(--itr-kalkgrau);
	color: var(--itr-nachtblau);
	padding: 3px 8px;
	border-radius: 999px;
}

.itr-consent__category-desc {
	margin: 8px 0 0;
	font-size: 13.5px;
	color: var(--itr-text);
	opacity: 0.85;
}

.itr-consent__toggle-details {
	background: none;
	border: none;
	color: var(--itr-primary);
	text-decoration: underline;
	font-size: 13px;
	cursor: pointer;
	white-space: nowrap;
}

.itr-consent__services {
	list-style: none;
	margin: 12px 0 0;
	padding: 12px 0 0;
	border-top: 1px dashed #E4E6E5;
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.itr-consent__services[hidden] {
	display: none;
}
.itr-consent__service {
	display: flex;
	flex-direction: column;
	gap: 2px;
	font-size: 13px;
}
.itr-consent__service-name {
	font-weight: 700;
}
.itr-consent__service-desc {
	opacity: 0.9;
}
.itr-consent__service-meta {
	opacity: 0.65;
	font-size: 12px;
}

/* Toggle-Switch */
.itr-consent__switch {
	position: relative;
	display: inline-block;
	width: 42px;
	height: 24px;
	flex: 0 0 auto;
}
.itr-consent__switch input {
	opacity: 0;
	width: 0;
	height: 0;
}
.itr-consent__slider {
	position: absolute;
	inset: 0;
	background: #C7CDD1;
	border-radius: 999px;
	cursor: pointer;
	transition: background 0.15s ease;
}
.itr-consent__slider::before {
	content: "";
	position: absolute;
	width: 18px;
	height: 18px;
	left: 3px;
	top: 3px;
	background: #fff;
	border-radius: 50%;
	transition: transform 0.15s ease;
	box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.itr-consent__switch input:checked + .itr-consent__slider {
	background: var(--itr-accent);
}
.itr-consent__switch input:checked + .itr-consent__slider::before {
	transform: translateX(18px);
}
.itr-consent__switch input:focus-visible + .itr-consent__slider {
	outline: 3px solid var(--itr-primary);
	outline-offset: 2px;
}
.itr-consent__switch--locked .itr-consent__slider {
	cursor: not-allowed;
	opacity: 0.9;
}
.itr-consent__switch input:disabled + .itr-consent__slider {
	background: var(--itr-primary);
}

/* --- Wiederaufruf-Button --- */

.itr-consent-reopen {
	--itr-accent: #C23B2E;
	position: fixed;
	bottom: 18px;
	z-index: 999998;
	width: 46px;
	height: 46px;
	border-radius: 50%;
	background: #fff;
	border: 2px solid var(--itr-accent);
	box-shadow: 0 4px 14px rgba(28, 58, 75, 0.3);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 8px;
}
.itr-consent-reopen[hidden] {
	display: none !important;
}
.itr-consent-reopen svg {
	width: 100%;
	height: 100%;
}
.itr-consent-reopen--bottom-left {
	left: 18px;
}
.itr-consent-reopen--bottom-right {
	right: 18px;
}

/* --- Generischer Content-Gate-Platzhalter (ITR_Script_Blocker) --- */

.itr-consent-gate__placeholder {
	background: var(--itr-kalkgrau, #F4F5F3);
	border: 1px dashed #C7CDD1;
	border-radius: var(--itr-radius-sm);
	padding: 20px;
	text-align: center;
	font-family: var(--itr-font);
}
.itr-consent-gate__open-settings {
	margin-top: 10px;
	background: #1C3A4B;
	color: #fff;
	border: none;
	border-radius: 999px;
	padding: 8px 18px;
	cursor: pointer;
	font-weight: 700;
}

@media (max-width: 480px) {
	.itr-consent__actions {
		flex-direction: column;
		align-items: stretch;
	}
	.itr-consent__btn {
		width: 100%;
		text-align: center;
	}
}
