/**
 * Hero carousel — 16:9 frame so banner isn’t cropped; videos match.
 */

.peng-hero {
	--peng-hero-ease: cubic-bezier(0.16, 1, 0.3, 1);
	--peng-hero-duration: 560ms;
	--peng-hero-pad: clamp(0.5rem, 1.2vw, 0.9rem);
	/* Shorter landscape frame */
	--peng-hero-ratio: 16 / 7.2;
	/* Cap to the banner's native width so it never upscales (avoids pixelation) */
	--peng-hero-max: 1600px;
	position: relative;
	isolation: isolate;
	display: block;
	width: 100%;
	max-width: var(--peng-hero-max);
	height: auto;
	aspect-ratio: var(--peng-hero-ratio);
	margin: 0 auto;
	overflow: hidden;
	background: #050505;
	color: #fff;
	font-family: var(--peng-font);
	touch-action: pan-y;
	box-sizing: border-box;
}

.elementor-widget-shortcode .peng-hero,
.elementor-shortcode .peng-hero,
.elementor-widget-container > .peng-hero,
.elementor-element .peng-hero {
	width: 100% !important;
	max-width: var(--peng-hero-max) !important;
	height: auto !important;
	aspect-ratio: var(--peng-hero-ratio) !important;
	min-height: 0 !important;
	margin-inline: 0 !important;
}

.peng-hero *,
.peng-hero *::before,
.peng-hero *::after {
	box-sizing: border-box;
}

.peng-hero__viewport {
	position: absolute;
	inset: 0;
	overflow: hidden;
}

.peng-hero__track {
	position: relative;
	width: 100%;
	height: 100%;
}

.peng-hero__slide {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: stretch;
	justify-content: stretch;
	padding: var(--peng-hero-pad);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	z-index: 0;
	transition:
		opacity var(--peng-hero-duration) var(--peng-hero-ease),
		visibility var(--peng-hero-duration) var(--peng-hero-ease);
}

.peng-hero__slide.is-active {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	z-index: 2;
}

.peng-hero__slide.is-leaving {
	opacity: 0;
	visibility: visible;
	z-index: 1;
}

/* Shared frame for banner image AND videos (same height everywhere) */
.peng-hero__banner-frame {
	position: relative;
	flex: 1 1 auto;
	align-self: stretch;
	width: 100%;
	height: 100%;
	min-height: 0;
	overflow: hidden;
	border: 1px solid rgba(255, 255, 255, 0.14);
	border-radius: var(--peng-radius-md, 14px);
	background: #0a0a0a;
	box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.peng-hero__image--banner,
.peng-hero__video,
.peng-hero__fallback {
	position: absolute;
	inset: 0;
	display: block;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	max-height: none !important;
	object-fit: cover !important;
	object-position: center center !important;
	border: 0;
	border-radius: inherit;
	background: #000;
	transform: none !important;
	filter: none !important;
	image-rendering: auto;
	-webkit-backface-visibility: hidden;
	backface-visibility: hidden;
}

.peng-hero__fallback {
	z-index: 0;
	background: #0a0a0a;
}

.peng-hero__video {
	z-index: 1;
	background: transparent;
}

.peng-hero__video.is-fallback,
.peng-hero__video[hidden] {
	display: none !important;
}

.peng-hero__slide--video .peng-hero__banner-frame,
.peng-hero__slide--banner .peng-hero__banner-frame {
	height: 100%;
}

.peng-hero__dots {
	position: absolute;
	left: 50%;
	bottom: calc(var(--peng-hero-pad) + 0.65rem);
	z-index: 6;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.35rem;
	max-width: calc(100% - 2rem);
	padding: 0.3rem 0.55rem;
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.48);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	transform: translateX(-50%);
	line-height: 0;
}

.peng-hero__dot,
.peng-hero button.peng-hero__dot {
	display: block !important;
	flex: 0 0 auto !important;
	width: 0.5rem !important;
	height: 0.5rem !important;
	min-width: 0.5rem !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 50% !important;
	background: rgba(255, 255, 255, 0.42) !important;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
	touch-action: manipulation;
	transition:
		width 220ms var(--peng-hero-ease),
		background 220ms ease,
		border-radius 220ms var(--peng-hero-ease);
}

.peng-hero__dot.is-active,
.peng-hero button.peng-hero__dot.is-active {
	width: 1.25rem !important;
	min-width: 1.25rem !important;
	border-radius: 999px !important;
	background: var(--peng-primary, #ff0100) !important;
}

.peng-hero__dot:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

@media (max-width: 900px) {
	.peng-hero {
		--peng-hero-pad: 0.5rem;
		/* A bit taller on tablets — closer to the image's 16:9 */
		--peng-hero-ratio: 16 / 9;
	}

	.peng-hero__banner-frame {
		border-radius: 12px;
	}
}

@media (max-width: 640px) {
	.peng-hero {
		--peng-hero-pad: 0.4rem;
		/* Taller on phones so the banner shows properly (not a thin strip) */
		--peng-hero-ratio: 16 / 10;
	}

	.peng-hero__slide,
	.peng-hero__slide--banner,
	.peng-hero__slide--video {
		padding: var(--peng-hero-pad);
	}

	.peng-hero__banner-frame {
		border-radius: 12px;
		box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3);
		height: 100% !important;
		min-height: 100% !important;
	}

	.peng-hero__image--banner,
	.peng-hero__video,
	.peng-hero__slide--video .peng-hero__video {
		width: 100% !important;
		height: 100% !important;
		object-fit: cover !important;
		object-position: center center !important;
	}

	.peng-hero__dots {
		bottom: calc(var(--peng-hero-pad) + 0.5rem);
		padding: 0.26rem 0.48rem;
	}
}

@media (max-width: 380px) {
	.peng-hero {
		--peng-hero-pad: 0.3rem;
	}
}

@media (max-height: 480px) and (orientation: landscape) {
	.peng-hero {
		--peng-hero-pad: 0.3rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.peng-hero__slide,
	.peng-hero__dot {
		transition: none !important;
	}
}
