/**
 * HYPRO Hero slider — slide stacking, crossfade and controls.
 * The slide layout itself (text column, photo panel, heights) is lp.css §5.
 */

/* All slides share one grid cell, so the hero is as tall as its tallest
   slide and switching slides never shifts the page. */
.hypro-hero-slider__track {
	display: grid;
}

.hypro-hero-slide {
	grid-area: 1 / 1;
	position: relative; /* the photo panel is positioned against the slide */
	display: flex;
	flex-direction: column;
	min-width: 0;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.7s ease, visibility 0s linear 0.7s;
}

.hypro-hero-slide.is-active {
	opacity: 1;
	visibility: visible;
	transition: opacity 0.7s ease;
}

@media (prefers-reduced-motion: reduce) {
	.hypro-hero-slide,
	.hypro-hero-slide.is-active {
		transition: none;
	}
}

/* A slide shorter than the tallest one still fills the hero: its inner
   area stretches, and on mobile its photo stays pinned to the bottom (the
   spare space goes between text and photo, not under the photo). */
.hypro-hero-slide > .lp-hero__inner {
	flex: 1 0 auto;
	box-sizing: border-box;
	width: 100%; /* .lp-inner's auto margins would otherwise shrink it to fit */
}

@media (max-width: 768px) {
	/* lp.css's 32px gap above the photo moves to the text, so the photo's
	   top margin can be auto. */
	.hypro-hero-slide .lp-hero__text {
		margin-bottom: 32px;
	}

	/* height: auto — lp.css's desktop height: 100% would now resolve against
	   the stretched slide; let the 3:4 aspect ratio size it as before. */
	.hypro-hero-slide .lp-hero__image-slot {
		height: auto;
		margin-top: auto;
	}
}

/* Hero text comes from core blocks: drop their default spacing, the
   column's 24px gap does it. */
.hypro-hero-slide .lp-hero__text > * {
	margin-block: 0;
}

.hypro-hero-slide .lp-hero__ctas {
	gap: 12px;
}

/* ── Full-width photo (per-slide option, desktop only) ────────────────── */

/* The photo panel stops being a right-hand column and covers the whole
   slide; the side fades go away and a flat overlay (--hypro-hero-overlay,
   set per slide) keeps the text legible. Below 1025px nothing changes. */
@media (min-width: 1025px) {
	.hypro-hero-slide.has-full-image .lp-hero__image-slot {
		left: 0;
		width: 100%;
		aspect-ratio: auto;
	}

	.hypro-hero-slide.has-full-image .lp-hero__image {
		object-position: center;
	}

	.hypro-hero-slide.has-full-image .lp-hero__image-fade {
		display: none;
	}

	.hypro-hero-slide.has-full-image .lp-hero__image-overlay {
		position: absolute;
		inset: 0;
		background: rgba(12, 12, 10, var(--hypro-hero-overlay, 0.3));
		pointer-events: none;
	}
}

@media (max-width: 1024px) {
	.lp-hero__image-overlay {
		display: none;
	}
}

/* Slide without text: the photo is the whole slide, no empty text gap. */
@media (max-width: 768px) {
	.hypro-hero-slide.has-no-text > .lp-hero__inner {
		padding-top: 0;
	}

	.hypro-hero-slide.has-no-text .lp-hero__image-slot {
		margin-top: 0;
	}
}

/* Editor: hidden text column while "Ocultar texto" is on. */
.editor-styles-wrapper .hypro-hero-slide.has-no-text .lp-hero__text {
	display: none;
}

/* ── Controls ─────────────────────────────────────────────────────────── */

.hypro-hero-slider__controls {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 36px;
	z-index: 2;
	pointer-events: none;
}

.hypro-hero-slider__bar {
	display: flex;
	align-items: center;
	gap: 4px;
	width: fit-content;
	padding: 4px;
	border-radius: 999px;
	background: rgba(12, 12, 10, 0.55);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	pointer-events: auto;
}

.hypro-hero-slider__arrow,
.hypro-hero-slider__pause {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #fff;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.hypro-hero-slider__arrow:hover,
.hypro-hero-slider__pause:hover {
	background: rgba(255, 255, 255, 0.14);
}

.hypro-hero-slider__pause .hypro-hero-slider__icon-play,
.hypro-hero-slider__pause.is-paused .hypro-hero-slider__icon-pause {
	display: none;
}

.hypro-hero-slider__pause.is-paused .hypro-hero-slider__icon-play {
	display: block;
}

.hypro-hero-slider__dots {
	display: flex;
	align-items: center;
	gap: 2px;
}

/* 24px hit area around an 8px dot. */
.hypro-hero-slider__dot {
	position: relative;
	width: 24px;
	height: 32px;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
	transition: width 0.3s ease;
}

.hypro-hero-slider__dot::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 8px;
	right: 8px;
	height: 8px;
	margin-top: -4px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.45);
	transition: background-color 0.2s ease;
}

.hypro-hero-slider__dot:hover::before {
	background: rgba(255, 255, 255, 0.75);
}

.hypro-hero-slider__dot[aria-current="true"] {
	width: 40px;
}

.hypro-hero-slider__dot[aria-current="true"]::before {
	background: #fff;
}

.hypro-hero-slider :focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

/* Desktop: line the controls up with the text column (lp.css indents it 5%). */
@media (min-width: 1025px) {
	.hypro-hero-slider__bar {
		margin-left: 5%;
	}
}

@media (max-width: 1024px) {
	.hypro-hero-slider__controls {
		bottom: 16px;
	}

	.hypro-hero-slider__bar {
		margin-inline: auto;
	}
}

/* ── Block editor: show every slide, stacked and labelled ─────────────── */

/* hypro-editor-typography.css styles every heading, paragraph and button in
   the canvas; give the hero's back their lp.css look. */
.editor-styles-wrapper .hypro-hero-slide .lp-hero__heading {
	font-family: var(--hypro-font-display, 'Yumex', serif);
	font-weight: 700;
	letter-spacing: normal;
	line-height: 1.1;
}

.editor-styles-wrapper .hypro-hero-slide .lp-hero__eyebrow {
	font-weight: 700;
	letter-spacing: 0.12em;
}

.editor-styles-wrapper .hypro-hero-slide .lp-btn-block > .wp-block-button__link {
	padding: 14px 28px;
	border-radius: 0.5rem;
	font-size: 1rem;
	font-weight: 600;
	letter-spacing: normal;
	line-height: 1;
}

.editor-styles-wrapper .hypro-hero-slider__track {
	display: block;
	counter-reset: hypro-slide;
}

.editor-styles-wrapper .hypro-hero-slide {
	opacity: 1;
	visibility: visible;
	counter-increment: hypro-slide;
}

.editor-styles-wrapper .hypro-hero-slide + .hypro-hero-slide {
	border-top: 2px dashed rgba(255, 255, 255, 0.25);
}

.editor-styles-wrapper .hypro-hero-slide::before {
	content: "Slide " counter(hypro-slide);
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 3;
	padding: 2px 10px;
	border-radius: 999px;
	background: var(--hypro-lime, #b5f23d);
	color: #0c0c0a;
	font: 700 11px/18px var(--hypro-font-ui, 'DM Sans', sans-serif);
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.editor-styles-wrapper .hypro-hero-slider .block-list-appender {
	position: relative;
	padding: 16px var(--hypro-container-pad, 24px) 24px;
}

.editor-styles-wrapper .hypro-hero-slider .block-editor-button-block-appender {
	color: #fff;
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}
