/*!
 * Stadion 3D Shortcode - Drei-Ebenen-Auswahl mit gestapeltem 3D-Rendering
 *
 * Markup-Struktur:
 *   .sge-stadium-3d
 *     > .sge-stadium-tabs
 *         > .sge-stadium-tab (3x)
 *     > .sge-stadium-active   (Sub-Header mit Nummer + Name + Beschreibung)
 *         > .sge-stadium-active-panel (3x, eine pro Ebene)
 *     > .sge-stadium-stack    (gestapelte Bilder)
 *         > .sge-stadium-layer (3x)
 *     > .sge-stadium-info     (Infobox mit "i" Icon)
 *         > .sge-stadium-info-panel (3x)
 *     > .sge-stadium-cta      (Button)
 *         > .sge-stadium-cta-link (3x)
 */

.sge-stadium-3d {
	--sge-blue: #022035;
	--sge-blue-soft: #0a3553;
	--sge-glow: #f5c518;
	--sge-grey-text: #4a5460;
	--sge-grey-light: #f5f7f9;
	--sge-border: #e3e7eb;

	max-width: 720px;
	height: calc(100vh - 20px);     /* Fallback fuer Browser ohne svh */
	height: calc(100svh - 20px);    /* Modern - "small viewport" Hoehe */
	margin: 0 auto;
	display: flex;
	flex-direction: column;
	gap: 10px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	color: var(--sge-blue);
	box-sizing: border-box;
}

.sge-stadium-3d *,
.sge-stadium-3d *::before,
.sge-stadium-3d *::after {
	box-sizing: border-box;
}

/* Bottom-Block (Tabs + Info + CTA) klebt durch flex-Layout am unteren
 * Rand. Der Stack dazwischen wird zum flex-grow Element und passt
 * sich an den verfuegbaren Platz an - bei wenig Hoehe schrumpft das
 * 3D-Bild, bei viel Hoehe waechst es. */
.sge-stadium-header,
.sge-stadium-tabs,
.sge-stadium-info,
.sge-stadium-cta {
	flex: 0 0 auto;
}

/* -------------------------- HEADER -------------------------- */

.sge-stadium-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
}

.sge-stadium-header-text {
	flex: 1 1 auto;
	min-width: 0;
}

.sge-stadium-header-title {
	margin: 0 0 8px;
	font-size: 28px;
	font-weight: 800;
	line-height: 1.05;
	letter-spacing: -0.01em;
	color: var(--sge-blue);
}

.sge-stadium-header-subtitle {
	margin: 0;
	font-size: 15px;
	color: var(--sge-grey-text);
	line-height: 1.45;
}

.sge-stadium-lang {
	flex: 0 0 auto;
	display: inline-flex;
	background: #fff;
	border-radius: 999px;
	padding: 4px;
	box-shadow: 0 1px 3px rgba(2, 32, 53, 0.06), 0 0 0 1px var(--sge-border);
	align-self: flex-start;
}

.sge-stadium-lang-link {
	display: inline-block;
	padding: 6px 14px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.08em;
	color: var(--sge-grey-text);
	text-decoration: none;
	transition: background 0.2s ease, color 0.2s ease;
	-webkit-tap-highlight-color: transparent;
}

.sge-stadium-lang-link:hover {
	color: var(--sge-blue);
}

.sge-stadium-lang-link.is-active {
	background: var(--sge-blue);
	color: #fff;
}

.sge-stadium-lang-link.is-active:hover {
	color: #fff;
}

@media (max-width: 480px) {
	.sge-stadium-header-title {
		font-size: 22px;
	}
	.sge-stadium-header-subtitle {
		font-size: 13px;
	}
}

/* -------------------------- TABS -------------------------- */

.sge-stadium-tabs {
	display: flex;
	gap: 0;
	background: #fff;
	border-radius: 999px;
	padding: 4px;
	box-shadow: 0 1px 3px rgba(2, 32, 53, 0.06), 0 0 0 1px var(--sge-border);
}

.sge-stadium-tab {
	flex: 1 1 0;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 44px;
	padding: 8px 10px;
	border: none;
	background: transparent;
	border-radius: 999px;
	cursor: pointer;
	color: var(--sge-grey-text);
	font-family: inherit;
	font-weight: 600;
	transition: background 0.2s ease, color 0.2s ease;
	-webkit-tap-highlight-color: transparent;
}

.sge-stadium-tab:hover {
	color: var(--sge-blue);
}

.sge-stadium-tab.is-active {
	background: var(--sge-blue);
	color: #fff;
}

.sge-stadium-tab-icon {
	flex: 0 0 auto;
	width: 22px;
	height: 22px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.sge-stadium-tab-icon svg {
	width: 100%;
	height: 100%;
	stroke: currentColor;
	stroke-width: 1.6;
	fill: none;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.sge-stadium-tab-text {
	display: inline-flex;
	align-items: center;
	line-height: 1;
	text-align: left;
}

.sge-stadium-tab-label {
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.06em;
	opacity: 1;
	white-space: nowrap;
}

/* -------------------------- 3D STACK + HOTSPOTS -------------------------- */

.sge-stadium-stack {
	position: relative;
	width: 100%;
	flex: 1 1 0;
	min-height: 300px;
	max-height: 40vh;
	margin: 20px 0;
}

/* Label oben links ueberm Bild ("EBENE X") - eine Pill mit weissem
 * Hintergrund, dezenter Schatten, dunkelblauer Schrift.
 *
 * Die drei Pills sind absolut positioniert ueber den Stack-Bereich.
 * Jede Pill sitzt an der Y-Position ihres zugehoerigen Bildes
 * (passend zu den Hotspot-Zonen):
 *   Ebene 2 (Dach):    oben    -> top: 4%
 *   Ebene 1 (Stadion): mitte   -> top: 28%
 *   Ebene 0 (Aussen):  unten   -> top: 70%
 * Nur die Pill mit .is-active ist sichtbar. pointer-events: none
 * damit das Label keine Klicks vom darunter liegenden Hotspot
 * abfaengt. */
.sge-stadium-stack-label {
	position: absolute;
	inset: 0;
	z-index: 3;
	pointer-events: none;
}

.sge-stadium-stack-label-pill {
	position: absolute;
	left: 4%;
	display: none;
	background: #fff;
	color: var(--sge-blue);
	padding: 7px 16px;
	border-radius: 999px;
	font-weight: 700;
	font-size: 13px;
	letter-spacing: 0.1em;
	box-shadow: 0 2px 8px rgba(2, 32, 53, 0.1), 0 0 0 1px rgba(2, 32, 53, 0.05);
	white-space: nowrap;
}

.sge-stadium-stack-label-pill[data-ebene="2"] { top: 4%; }
.sge-stadium-stack-label-pill[data-ebene="1"] { top: 38%; }
.sge-stadium-stack-label-pill[data-ebene="0"] { top: 70%; }

.sge-stadium-stack-label-pill.is-active {
	display: inline-block;
}

.sge-stadium-layer {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
}

/* Filter mit -webkit-filter Prefix fuer aeltere Safari + Safari Mobile.
 * Transition fuer opacity (inaktive Ebenen) UND filter (Glow auf der
 * aktiven Ebene) - damit sowohl das Aufdimmen als auch der Glow-
 * Wechsel sauber animiert. */
.sge-stadium-layer img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	display: block;
	-webkit-transition: opacity 0.35s ease, -webkit-filter 0.35s ease;
	transition: opacity 0.35s ease, filter 0.35s ease;
}

/* Inaktive Ebenen: leicht abgedunkelt per opacity - das Bild bleibt
 * sichtbar, tritt aber dezent in den Hintergrund. */
.sge-stadium-layer:not(.is-active) img {
	opacity: 0.7;
}

/* Aktive Ebene: gelber Glow per drop-shadow. Doppelter Layer fuer
 * gleichmaessigeren weichen Rand. */
.sge-stadium-layer.is-active img {
	-webkit-filter: drop-shadow(0 0 24px rgba(245, 197, 24, 0.55))
	                drop-shadow(0 0 8px rgba(245, 197, 24, 0.8));
	filter: drop-shadow(0 0 24px rgba(245, 197, 24, 0.55))
	        drop-shadow(0 0 8px rgba(245, 197, 24, 0.8));
}

/* Klickbare Hotspots ueber dem Bild - jeder deckt eine vertikale
 * Zone ab, ungefaehr passend zu den isometrischen Bildbereichen:
 *   Ebene 2 (Dach):    obere 28%
 *   Ebene 1 (Stadion): mittlere 42%
 *   Ebene 0 (Aussen):  untere 30%
 * Transparenter Button mit cursor: pointer - sieht aus wie das Bild,
 * verhaelt sich aber wie ein Switch. */
.sge-stadium-hotspot {
	position: absolute;
	left: 0;
	right: 0;
	background: transparent;
	border: none;
	padding: 0;
	margin: 0;
	cursor: pointer;
	z-index: 2;
	-webkit-tap-highlight-color: transparent;
}

.sge-stadium-hotspot[data-ebene="2"] { top: 0;   height: 36%; }
.sge-stadium-hotspot[data-ebene="1"] { top: 36%; height: 32%; }
.sge-stadium-hotspot[data-ebene="0"] { top: 68%; bottom: 0; }

.sge-stadium-hotspot:focus {
	outline: none;
}
.sge-stadium-hotspot:focus-visible {
	outline: 2px dashed var(--sge-glow);
	outline-offset: -6px;
	border-radius: 8px;
}

/* Beim Hover ueber einen Hotspot bekommt das darunter liegende Layer-
 * Bild den Glow-Filter und die volle Opacity (hebt den Inaktiv-Dim
 * fuer den Hover-Moment auf). Nur auf Geraeten mit echtem Hover
 * (Desktop), nicht auf Touch. */
@media (hover: hover) {
	.sge-stadium-stack:has(.sge-stadium-hotspot[data-ebene="0"]:hover) .sge-stadium-layer[data-ebene="0"] img,
	.sge-stadium-stack:has(.sge-stadium-hotspot[data-ebene="1"]:hover) .sge-stadium-layer[data-ebene="1"] img,
	.sge-stadium-stack:has(.sge-stadium-hotspot[data-ebene="2"]:hover) .sge-stadium-layer[data-ebene="2"] img {
		opacity: 1;
		-webkit-filter: drop-shadow(0 0 18px rgba(245, 197, 24, 0.45));
		filter: drop-shadow(0 0 18px rgba(245, 197, 24, 0.45));
	}
}

/* -------------------------- INFO-BOX -------------------------- */

.sge-stadium-info {
	background: var(--sge-grey-light);
	border-radius: 14px;
	padding: 18px 20px;
	position: relative;
}

.sge-stadium-info-panel {
	display: none;
	align-items: flex-start;
	gap: 14px;
}

.sge-stadium-info-panel.is-active {
	display: flex;
}

.sge-stadium-info-icon {
	flex: 0 0 auto;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: var(--sge-blue);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 15px;
	font-style: italic;
	font-family: Georgia, "Times New Roman", serif;
}

.sge-stadium-info-body {
	flex: 1 1 auto;
	min-width: 0;
}

.sge-stadium-info-text {
	font-size: 14px;
	color: var(--sge-grey-text);
	line-height: 1.5;
}

/* -------------------------- CTA-BUTTON -------------------------- */

.sge-stadium-cta {
	position: relative;
}

.sge-stadium-cta-link {
	display: none;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
	background: #ffc72c;
	color: var(--sge-blue);
	text-decoration: none;
	border-radius: 14px;
	padding: 18px 22px;
	font-weight: 700;
	font-size: 14px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	transition: background 0.2s ease, transform 0.1s ease;
}

.sge-stadium-cta-link.is-active {
	display: flex;
}

.sge-stadium-cta-link:hover {
	background: #f0b81f;
	color: var(--sge-blue);
}

.sge-stadium-cta-link:active {
	transform: translateY(1px);
}

.sge-stadium-cta-icon {
	flex: 0 0 auto;
	width: 22px;
	height: 22px;
}

.sge-stadium-cta-icon svg {
	width: 100%;
	height: 100%;
	stroke: currentColor;
	stroke-width: 1.8;
	fill: none;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.sge-stadium-cta-text {
	flex: 1 1 auto;
	text-align: left;
}

/* -------------------------- RESPONSIVE -------------------------- */

@media (max-width: 480px) {
	.sge-stadium-tab {
		padding: 8px 6px;
		gap: 6px;
	}
	.sge-stadium-tab-icon {
		width: 20px;
		height: 20px;
	}
	.sge-stadium-tab-label {
		font-size: 11px;
	}
	.sge-stadium-stack-label-pill {
		padding: 5px 11px;
		font-size: 11px;
	}
	.sge-stadium-cta-link {
		padding: 14px 18px;
		font-size: 12px;
	}
	.sge-stadium-info {
		padding: 14px 16px;
	}
}

/* Auf grossen Screens bleibt's mittig in einer Card-Box mit max-width */
@media (min-width: 720px) {
	.sge-stadium-3d {
		max-width: 560px;
	}
}
