/*
 * Copyright (c) 2026 Angelsportverein Zeven e.V.
 * Autor: Yannik Mühlthaler
 * Alle Rechte vorbehalten.
 */

.asv-hero {
	position: relative;
	width: 100%;
	max-width: none;
}

.asv-hero__slider {
	position: relative;
	overflow: hidden;
	width: 100%;
	max-width: none;
	height: 400px;
}

.asv-hero.alignfull,
.asv-hero__slider.alignfull,
.asv-hero__slide.alignfull {
	max-width: none;
	width: 100%;
}

@media (min-width: 640px) {
	.asv-hero__slider {
		height: 500px;
	}
}

@media (min-width: 1024px) {
	.asv-hero__slider {
		height: 600px;
	}
}

/* Slides übereinander, Fade wie im React-Carousel */
.asv-hero__slider > .asv-hero__slide {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	min-height: 0;
	margin: 0;
	opacity: 0;
	transition: opacity 1.5s ease-in-out;
	pointer-events: none;
	z-index: 0;
}

/* Fallback bis hero-slider.js initialisiert */
.asv-hero__slider:not(.asv-hero__slider--ready) > .asv-hero__slide:first-child {
	opacity: 1;
	pointer-events: auto;
	z-index: 1;
}

.asv-hero__slider--ready > .asv-hero__slide.asv-hero__slide--active {
	opacity: 1;
	pointer-events: auto;
	z-index: 1;
}

.asv-hero__slider--ready > .asv-hero__slide[aria-hidden="true"] {
	visibility: hidden;
}

.asv-hero__slide.wp-block-cover {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
}

.asv-hero__slide .wp-block-cover__image-background,
.asv-hero__slide .wp-block-cover__background {
	transform-origin: center center;
}

.asv-hero__slide--gradient::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(
		to bottom,
		rgba(0, 0, 0, 0) 0%,
		rgba(0, 0, 0, 0.4) 50%,
		rgba(0, 0, 0, 0.9) 100%
	);
	pointer-events: none;
	z-index: 1;
}

.asv-hero__slide--gradient .wp-block-cover__inner-container {
	position: relative;
	z-index: 2;
	width: 100%;
	max-width: 48rem;
	margin-left: auto;
	margin-right: auto;
	padding-left: 1rem;
	padding-right: 1rem;
	text-align: center;
}

@media (min-width: 640px) {
	.asv-hero__slide--gradient .wp-block-cover__inner-container {
		padding-left: 1.5rem;
		padding-right: 1.5rem;
	}
}

@media (min-width: 1024px) {
	.asv-hero__slide--gradient .wp-block-cover__inner-container {
		padding-left: 2rem;
		padding-right: 2rem;
	}
}

.asv-hero__slide .wp-block-heading {
	color: #fff;
	font-weight: 700;
	font-size: 1.875rem;
	line-height: 1.25;
	margin: 0;
}

@media (min-width: 640px) {
	.asv-hero__slide .wp-block-heading {
		font-size: 2.25rem;
	}
}

@media (min-width: 1024px) {
	.asv-hero__slide .wp-block-heading {
		font-size: 3rem;
	}
}

.asv-hero__slide .wp-block-cover__inner-container > p {
	color: #e5e7eb;
	font-weight: 300;
	font-size: 1.125rem;
	line-height: 1.5;
	max-width: 42rem;
	margin: 0.75rem auto 0;
}

@media (min-width: 640px) {
	.asv-hero__slide .wp-block-cover__inner-container > p {
		font-size: 1.25rem;
		margin-top: 1rem;
	}
}

.asv-hero__slide .wp-block-buttons {
	justify-content: center;
	margin-top: 2rem;
}

.asv-hero__cta .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.75rem 1.25rem;
	border: 1px solid transparent;
	border-radius: 0.5rem;
	background: #166534;
	color: #fff;
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.25;
	text-decoration: none;
	box-shadow: none;
}

.asv-hero__cta .wp-block-button__link:hover,
.asv-hero__cta .wp-block-button__link:focus-visible {
	background: #14532d;
	color: #fff;
}

.asv-hero__cta .wp-block-button__link:focus-visible {
	outline: 2px solid #166534;
	outline-offset: 2px;
}

/* Steuerung: halbtransparente Kreise mit Chevron */
.asv-hero__slider .asv-hero__controls {
	position: absolute;
	inset: 0;
	pointer-events: none;
	z-index: 3;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
}

.asv-hero__slider .asv-hero__controls > * {
	margin: 0;
}

.asv-hero__slider .asv-hero__controls .wp-block-buttons {
	display: block;
	width: 100%;
	height: 100%;
}

.asv-hero__slider .asv-hero__btn--prev,
.asv-hero__slider .asv-hero__btn--next {
	position: absolute;
	top: 50%;
	margin: 0;
	transform: translate3d(0, -50%, 0);
	transition: transform 200ms ease;
}

.asv-hero__slider .asv-hero__btn--prev {
	left: 1rem;
}

.asv-hero__slider .asv-hero__btn--next {
	right: 1rem;
}

.asv-hero__controls .wp-element-button {
	pointer-events: auto;
}

.asv-hero__btn .wp-block-button__link {
	width: auto;
	height: auto;
	min-width: 0;
	padding: 0.375rem;
	border: none;
	border-radius: 9999px;
	background: rgba(255, 255, 255, 0.2);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	color: transparent;
	font-size: 0;
	line-height: 0;
	text-decoration: none;
	box-shadow: none;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

@media (min-width: 640px) {
	.asv-hero__btn .wp-block-button__link {
		padding: 0.5rem;
	}
}

@media (min-width: 1024px) {
	.asv-hero__btn .wp-block-button__link {
		padding: 0.75rem;
	}
}

.asv-hero__btn .wp-block-button__link:hover,
.asv-hero__btn .wp-block-button__link:focus-visible {
	background: rgba(255, 255, 255, 0.3);
}

.asv-hero__slider .asv-hero__btn--prev:hover,
.asv-hero__slider .asv-hero__btn--prev:focus-within,
.asv-hero__slider .asv-hero__btn--next:hover,
.asv-hero__slider .asv-hero__btn--next:focus-within {
	transform: translate3d(0, -50%, 0) scale(1.1);
}

.asv-hero__btn--prev .wp-block-button__link::before,
.asv-hero__btn--next .wp-block-button__link::before {
	content: "";
	display: block;
	width: 1rem;
	height: 1rem;
	background-color: #fff;
	mask-size: contain;
	mask-repeat: no-repeat;
	mask-position: center;
	-webkit-mask-size: contain;
	-webkit-mask-repeat: no-repeat;
	-webkit-mask-position: center;
}

@media (min-width: 640px) {
	.asv-hero__btn--prev .wp-block-button__link::before,
	.asv-hero__btn--next .wp-block-button__link::before {
		width: 1.25rem;
		height: 1.25rem;
	}
}

@media (min-width: 1024px) {
	.asv-hero__btn--prev .wp-block-button__link::before,
	.asv-hero__btn--next .wp-block-button__link::before {
		width: 1.5rem;
		height: 1.5rem;
	}
}

.asv-hero__btn--prev .wp-block-button__link::before {
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 18l-6-6 6-6'/%3E%3C/svg%3E");
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 18l-6-6 6-6'/%3E%3C/svg%3E");
}

.asv-hero__btn--next .wp-block-button__link::before {
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18l6-6-6-6'/%3E%3C/svg%3E");
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18l6-6-6-6'/%3E%3C/svg%3E");
}

.asv-hero__btn .wp-block-button__link:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

/* Indikatoren unten mittig */
.asv-hero__indicators {
	position: absolute;
	bottom: 0.5rem;
	left: 50%;
	transform: translateX(-50%);
	z-index: 4;
	display: flex;
	align-items: center;
	gap: 0.25rem;
	margin: 0;
	padding: 0;
	pointer-events: auto;
}

/* WordPress blockGap (24px) in der Indikatoren-Gruppe deaktivieren */
.asv-hero__indicators.is-layout-flex {
	gap: 0.25rem;
}

@media (min-width: 640px) {
	.asv-hero__indicators,
	.asv-hero__indicators.is-layout-flex {
		bottom: 1rem;
		gap: 0.3125rem;
	}
}

@media (min-width: 1024px) {
	.asv-hero__indicators,
	.asv-hero__indicators.is-layout-flex {
		bottom: 1.5rem;
		gap: 0.4375rem;
	}
}

.asv-hero__indicator {
	flex-shrink: 0;
	width: 0.3125rem;
	height: 0.3125rem;
	padding: 0;
	border: none;
	border-radius: 9999px;
	background-color: rgba(255, 255, 255, 0.3);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	cursor: pointer;
	transition: width 300ms ease, background-color 300ms ease;
}

.asv-hero__indicator:hover,
.asv-hero__indicator:focus-visible {
	background-color: rgba(255, 255, 255, 0.5);
}

.asv-hero__indicator.is-active {
	width: 0.5625rem;
	background-color: rgba(255, 255, 255, 0.9);
}

@media (min-width: 640px) {
	.asv-hero__indicator {
		width: 0.375rem;
		height: 0.375rem;
	}

	.asv-hero__indicator.is-active {
		width: 0.75rem;
	}
}

@media (min-width: 1024px) {
	.asv-hero__indicator {
		width: 0.4375rem;
		height: 0.4375rem;
	}

	.asv-hero__indicator.is-active {
		width: 0.875rem;
	}
}

.asv-hero__indicator:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

/* Mobil: Touch-Targets, kompaktere Typografie */
@media (max-width: 767px) {
	.asv-hero__slide .wp-block-heading {
		font-size: 1.625rem;
	}

	.asv-hero__slide .wp-block-cover__inner-container > p {
		font-size: 1rem;
		margin-top: 0.5rem;
	}

	.asv-hero__btn .wp-block-button__link {
		min-width: 2.75rem;
		min-height: 2.75rem;
		padding: 0.625rem;
	}

	.asv-hero__slider .asv-hero__btn--prev {
		left: 0.5rem;
	}

	.asv-hero__slider .asv-hero__btn--next {
		right: 0.5rem;
	}

	.asv-hero__indicators {
		bottom: 0.75rem;
		gap: 0.375rem;
	}

	.asv-hero__indicator {
		width: 0.5rem;
		height: 0.5rem;
		padding: 0.625rem;
		background-clip: content-box;
	}

	.asv-hero__indicator.is-active {
		width: 1rem;
	}
}

/* Ken-Burns nur auf aktivem Slide (8s linear, scale 1 → 1.1) */
.asv-hero__slide.asv-kenburns:not(.asv-hero__slide--active) .wp-block-cover__image-background,
.asv-hero__slide.asv-kenburns:not(.asv-hero__slide--active) .wp-block-cover__background {
	transform: scale(1);
	animation: none;
}

.asv-hero__slide.asv-kenburns.asv-hero__slide--active .wp-block-cover__image-background,
.asv-hero__slide.asv-kenburns.asv-hero__slide--active .wp-block-cover__background {
	animation: asvKenBurns 8s linear forwards;
}

@keyframes asvKenBurns {
	from {
		transform: scale(1);
	}
	to {
		transform: scale(1.1);
	}
}

@media (prefers-reduced-motion: reduce) {
	.asv-hero__slider > .asv-hero__slide {
		transition: none;
	}

	.asv-hero__slide.asv-kenburns.asv-hero__slide--active .wp-block-cover__image-background,
	.asv-hero__slide.asv-kenburns.asv-hero__slide--active .wp-block-cover__background {
		animation: none;
	}
}
