/**
 * Hero Slider - Frontend Styles
 *
 * Responsive, accessibility-optimiert, Twenty Twenty-Five kompatibel
 */

/* ==========================================================================
   Container & Layout
   ========================================================================== */

.hero-slider {
	position: relative;
	width: 100%;
	overflow: hidden;
	background: var(--wp--preset--color--base, #000);
	min-height: 240px;
}

/* Aspect Ratios */
.hero-slider--aspect-16-9 {
	aspect-ratio: 16 / 9;
}

.hero-slider--aspect-21-9 {
	aspect-ratio: 21 / 9;
}

.hero-slider--aspect-4-3 {
	aspect-ratio: 4 / 3;
}

.hero-slider--aspect-auto {
	aspect-ratio: auto;
	min-height: 320px;
}

/* Mobile: Höhere Aspect Ratio */
@media (max-width: 768px) {
	.hero-slider--aspect-21-9,
	.hero-slider--aspect-16-9 {
		aspect-ratio: 4 / 3;
	}
}

/* Height Presets */
.hero-slider--height-compact {
	height: clamp(240px, 35vh, 480px);
}

.hero-slider--height-standard {
	height: clamp(320px, 55vh, 820px);
}

.hero-slider--height-tall {
	height: clamp(420px, 75vh, 1100px);
}

/* Layout Modes */
.hero-slider--layout-fullbleed,
.hero-slider--layout-fullscreen {
	width: 100vw;
	max-width: 100vw;
	position: relative;
	left: 50%;
	transform: translateX(-50%);
	margin-left: 0;
	margin-right: 0;
}

.hero-slider--layout-fullscreen {
	height: 100vh;
	min-height: 100vh;
}

@supports (width: 100svw) {
	.hero-slider--layout-fullbleed,
	.hero-slider--layout-fullscreen {
		width: 100svw;
		max-width: 100svw;
	}
}

@supports (height: 100svh) {
	.hero-slider--layout-fullscreen {
		height: 100svh;
		min-height: 100svh;
	}
}

/* ==========================================================================
   Slider Track & Slides
   ========================================================================== */

.hero-slider__track {
	position: relative;
	width: 100%;
	height: 100%;
	display: flex;
	transition: transform 0.5s ease-in-out;
}

/* Reduced Motion: Keine Transitions */
@media (prefers-reduced-motion: reduce) {
	.hero-slider__track {
		transition: none;
	}
}

.hero-slider__slide {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
	overflow: hidden;
}

.hero-slider:not(.is-initialized) .hero-slider__slide:first-child {
	opacity: 1;
	visibility: visible;
	position: relative;
}

.hero-slider__slide.is-active {
	opacity: 1;
	visibility: visible;
	position: relative;
}

/* Reduced Motion: Instant */
@media (prefers-reduced-motion: reduce) {
	.hero-slider__slide {
		transition: none;
	}
}

/* Bilder */
.hero-slider__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
}

/* Layer Content */
.hero-slider__layer {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: flex-start;
	padding: clamp(20px, 6vw, 80px);
	color: #fff;
	z-index: 2;
	text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}

.hero-slider__layer > * {
	max-width: min(680px, 92%);
}

/* Caption */
.hero-slider__caption {
	position: absolute;
	left: clamp(16px, 4vw, 56px);
	bottom: clamp(16px, 6vw, 72px);
	z-index: 3;
	max-width: 70%;
	color: #fff;
	text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.hero-slider__caption h2 {
	margin: 0;
	font-size: clamp(1.5rem, 3vw, 3rem);
	line-height: 1.1;
}

/* ==========================================================================
   Controls (Buttons)
   ========================================================================== */

.hero-slider__controls {
	position: absolute;
	top: 50%;
	left: clamp(12px, 2vw, 32px);
	right: clamp(12px, 2vw, 32px);
	transform: translateY(-50%);
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 0;
	pointer-events: none;
	z-index: 10;
}

.hero-slider__control {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 2px solid rgba(255, 255, 255, 0.8);
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.5);
	color: #fff;
	cursor: pointer;
	pointer-events: auto;
	transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.hero-slider__control:hover {
	background: rgba(0, 0, 0, 0.7);
	border-color: #fff;
	transform: scale(1.05);
}

.hero-slider__control:focus {
	outline: 2px solid var(--wp--preset--color--primary, #0073aa);
	outline-offset: 2px;
}

.hero-slider__control:active {
	transform: scale(0.95);
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
	.hero-slider__control {
		transition: none;
	}
	.hero-slider__control:hover,
	.hero-slider__control:active {
		transform: none;
	}
}

/* Play/Pause Button */
.hero-slider__control--play-pause {
	position: absolute;
	top: 1rem;
	right: 1rem;
	transform: none;
}

.hero-slider__control--play-pause .hero-slider__icon--play {
	display: none;
}

.hero-slider__control--play-pause.is-playing .hero-slider__icon--pause {
	display: block;
}

.hero-slider__control--play-pause.is-playing .hero-slider__icon--play {
	display: none;
}

.hero-slider__control--play-pause.is-paused .hero-slider__icon--pause {
	display: none;
}

.hero-slider__control--play-pause.is-paused .hero-slider__icon--play {
	display: block;
}

/* Prev/Next Buttons */
.hero-slider__control--prev {
	margin-right: auto;
}

.hero-slider__control--next {
	margin-left: auto;
}

/* Mobile: Kleinere Buttons */
@media (max-width: 768px) {
	.hero-slider__control {
		width: 36px;
		height: 36px;
	}
	
	.hero-slider__control svg {
		width: 20px;
		height: 20px;
	}
}

/* ==========================================================================
   Pagination Dots
   ========================================================================== */

.hero-slider__pagination {
	position: absolute;
	bottom: 1.5rem;
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	gap: 0.5rem;
	z-index: 10;
}

.hero-slider__dot {
	width: 12px;
	height: 12px;
	padding: 0;
	border: 2px solid rgba(255, 255, 255, 0.8);
	border-radius: 50%;
	background: transparent;
	cursor: pointer;
	transition: background 0.2s ease, transform 0.2s ease;
}

.hero-slider__dot:hover {
	background: rgba(255, 255, 255, 0.5);
	transform: scale(1.2);
}

.hero-slider__dot:focus {
	outline: 2px solid var(--wp--preset--color--primary, #0073aa);
	outline-offset: 2px;
}

.hero-slider__dot.is-active {
	background: rgba(255, 255, 255, 0.9);
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
	.hero-slider__dot {
		transition: none;
	}
	.hero-slider__dot:hover {
		transform: none;
	}
}

/* Mobile */
@media (max-width: 768px) {
	.hero-slider__pagination {
		bottom: 1rem;
	}
	
	.hero-slider__dot {
		width: 10px;
		height: 10px;
	}
}

/* ==========================================================================
   Design Styles
   ========================================================================== */

/* Minimal */
.hero-slider.is-style-minimal .hero-slider__control {
	background: rgba(0, 0, 0, 0.25);
	border-width: 1px;
	width: 36px;
	height: 36px;
}

.hero-slider.is-style-minimal .hero-slider__pagination {
	gap: 0.35rem;
	bottom: 1rem;
}

.hero-slider.is-style-minimal .hero-slider__dot {
	width: 8px;
	height: 8px;
	border-width: 1px;
}

.hero-slider.is-style-minimal .hero-slider__caption {
	text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* Overlay */
.hero-slider.is-style-overlay .hero-slider__slide::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(
		180deg,
		rgba(0, 0, 0, 0.05) 0%,
		rgba(0, 0, 0, 0.55) 70%
	);
	z-index: 1;
	pointer-events: none;
}

.hero-slider.is-style-overlay .hero-slider__caption {
	background: rgba(0, 0, 0, 0.35);
	padding: clamp(12px, 2vw, 24px);
	border-radius: 10px;
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

/* Visually Hidden (Screenreader-only) */
.hero-slider__sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border-width: 0;
}

/* Focus Visible */
.hero-slider *:focus-visible {
	outline: 2px solid var(--wp--preset--color--primary, #0073aa);
	outline-offset: 2px;
}

/* ==========================================================================
   High Contrast Mode
   ========================================================================== */

@media (prefers-contrast: high) {
	.hero-slider__control {
		border-width: 3px;
		background: #000;
	}
	
	.hero-slider__dot {
		border-width: 3px;
	}
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
	.hero-slider__controls,
	.hero-slider__pagination {
		display: none;
	}
	
	.hero-slider__slide {
		opacity: 1 !important;
		visibility: visible !important;
		position: relative !important;
		page-break-inside: avoid;
	}
}

/* ==========================================================================
   Twenty Twenty-Five Theme Integration
   ========================================================================== */

/* Respektiere Theme-Spacing */
.hero-slider.alignwide:not(.hero-slider--layout-fullbleed):not(.hero-slider--layout-fullscreen),
.hero-slider.alignfull:not(.hero-slider--layout-fullbleed):not(.hero-slider--layout-fullscreen) {
	margin-left: auto;
	margin-right: auto;
}

/* Theme-Color-Support */
.hero-slider__control {
	background: rgba(var(--wp--preset--color--base-rgb, 0, 0, 0), 0.5);
	border-color: rgba(var(--wp--preset--color--contrast-rgb, 255, 255, 255), 0.8);
	color: var(--wp--preset--color--contrast, #fff);
}

.hero-slider__control:hover {
	background: rgba(var(--wp--preset--color--base-rgb, 0, 0, 0), 0.7);
	border-color: var(--wp--preset--color--contrast, #fff);
}

.hero-slider__dot {
	border-color: rgba(var(--wp--preset--color--contrast-rgb, 255, 255, 255), 0.8);
}

.hero-slider__dot.is-active {
	background: rgba(var(--wp--preset--color--contrast-rgb, 255, 255, 255), 0.9);
}
