/* EJL · portada */
.hero {
	--media-w: 62%;
	position: relative;
	display: grid;
	grid-template-rows: 1fr auto;
	min-height: clamp(36rem, calc(100svh - var(--header-h)), 52rem);
	overflow: hidden;
	background: var(--ejl-black);
	color: var(--ejl-white);
	isolation: isolate;
}

/* Sombra inferior para que los rótulos del carrusel se lean sobre la fotografía */
.hero::after {
	content: "";
	position: absolute;
	inset: auto 0 0 0;
	z-index: -1;
	height: 11rem;
	background: linear-gradient(to top, rgb(26 26 26 / 0.92), rgb(26 26 26 / 0));
	pointer-events: none;
}

.hero__media {
	position: absolute;
	inset: 0 0 0 auto;
	z-index: -1;
	width: var(--media-w);
	clip-path: polygon(28% 0, 100% 0, 100% 100%, 0 100%);
}
/* Franja amarilla sobre el corte: misma inclinación que el logotipo */
.hero__media::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 3;
	background: var(--ejl-yellow);
	clip-path: polygon(28% 0, calc(28% + 14px) 0, 14px 100%, 0 100%);
}
.hero__frame {
	position: absolute;
	inset: 0;
	visibility: hidden;
	clip-path: polygon(100% 0, 100% 0, 100% 100%, 100% 100%);
}
.hero__frame img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transform: scale(1.08);
	transition: transform 7.5s linear;
}
.hero__frame.is-prev { visibility: visible; z-index: 1; clip-path: polygon(-40% 0, 100% 0, 100% 100%, -80% 100%); }
.hero__frame.is-active {
	visibility: visible;
	z-index: 2;
	clip-path: polygon(-40% 0, 100% 0, 100% 100%, -80% 100%);
	transition: clip-path 900ms var(--ease-in-out);
}
.hero__frame.is-active img { transform: scale(1); }
/* La primera imagen entra al cargar la página */
@starting-style {
	.hero__frame.is-active { clip-path: polygon(100% 0, 100% 0, 100% 100%, 100% 100%); }
	.hero__frame.is-active img { transform: scale(1.08); }
}

.hero__content { display: grid; align-content: center; padding-block: var(--space-5) var(--space-3); }
.hero__slide { grid-area: 1 / 1; max-width: min(40rem, 50%); visibility: hidden; transition: visibility 0s linear 300ms; }
.hero__slide.is-active { visibility: visible; transition-delay: 0s; }

.hero__title { margin-bottom: var(--space-3); text-transform: uppercase; }
.hero__title .line { display: block; overflow: hidden; padding-block: 0.06em; }
.hero__title .line > span { display: block; transform: translateY(110%); transition: transform 300ms var(--ease-out); }
.hero__title .line--accent { color: var(--ejl-yellow); }
.hero__slide.is-active .line > span { transform: none; transition: transform 700ms var(--ease-out) 150ms; }
.hero__slide.is-active .line--accent > span { transition-delay: 210ms; }
.hero__text, .hero__cta { opacity: 0; transform: translateY(16px); transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out); }
.hero__text { max-width: 30rem; font-size: var(--fs-md); font-weight: 300; letter-spacing: 0.06em; }
.hero__slide.is-active .hero__text,
.hero__slide.is-active .hero__cta { opacity: 1; transform: none; transition: opacity 600ms var(--ease-out) 330ms, transform 600ms var(--ease-out) 330ms; }
.hero__slide.is-active .hero__cta { transition-delay: 390ms; }
@starting-style {
	.hero__slide.is-active .line > span { transform: translateY(110%); }
	.hero__slide.is-active .hero__text,
	.hero__slide.is-active .hero__cta { opacity: 0; transform: translateY(16px); }
}

.hero__controls { grid-area: 2 / 1; display: flex; gap: var(--space-1); margin-top: var(--space-4); }
.hero__controls[hidden] { display: none; }
.hero__controls .icon-play, .hero__controls [aria-pressed="true"] .icon-pause { display: none; }
.hero__controls [aria-pressed="true"] .icon-play { display: block; }

.hero__rail {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: var(--space-2);
	max-width: var(--wrap);
	margin-block: 0;
	padding: 0 0 var(--space-3);
	list-style: none;
}
.hero__rail[hidden] { display: none; }
.hero__rail button {
	width: 100%;
	min-height: 48px;
	padding: 0;
	border: 0;
	background: transparent;
	text-align: left;
	font-size: var(--fs-xs);
	font-weight: 700;
	letter-spacing: 0.1em;
	opacity: 0.75;
	text-shadow: 0 1px 8px rgb(0 0 0 / 0.8);
	transition: opacity var(--dur-ui) ease;
}
.hero__rail button[aria-current="true"] { opacity: 1; }
.hero__bar { display: block; height: 4px; margin-bottom: 0.75rem; overflow: hidden; background: rgb(255 255 255 / 0.3); }
.hero__bar span { display: block; height: 100%; background: var(--ejl-yellow); transform: scaleX(0); transform-origin: left; }
.hero__rail [aria-current="true"] .hero__bar span { transform: scaleX(1); }
.hero.is-playing .hero__rail [aria-current="true"] .hero__bar span { animation: ejl-progress var(--slide-time, 7000ms) linear both; }
.hero.is-paused .hero__rail [aria-current="true"] .hero__bar span { animation-play-state: paused; }
@keyframes ejl-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }

@media (max-width: 900px) {
	.hero { grid-template-rows: auto auto auto; min-height: 0; }
	.hero__media {
		position: relative;
		grid-row: 1;
		width: 100%;
		height: min(64vw, 24rem);
		min-height: 15rem;
		clip-path: polygon(0 0, 100% 0, 100% 86%, 0 100%);
	}
	.hero__media::after { clip-path: polygon(0 calc(100% - 8px), 100% calc(86% - 8px), 100% 86%, 0 100%); }
	.hero__content { padding-block: var(--space-3); }
	.hero__slide { max-width: 100%; }
	.hero__controls { margin-top: var(--space-3); }
	.hero__rail { width: calc(100% - 2 * var(--gutter)); margin-inline: auto; }
	.hero::after { display: none; }
}

/* En teléfono quedan solo las barras; el nombre sigue disponible para lectores de pantalla */
@media (max-width: 640px) {
	.hero__tag { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
	.hero__bar { margin: 0; }
}

@media (prefers-reduced-motion: reduce) {
	.hero__frame, .hero__frame.is-prev, .hero__frame.is-active { clip-path: none; }
	.hero__frame { opacity: 0; transition: opacity 300ms ease; }
	.hero__frame.is-active { opacity: 1; transition: opacity 300ms ease; }
	.hero__frame.is-prev { opacity: 1; }
	.hero__frame img, .hero__frame.is-active img { transform: none; transition: none; }
	.hero__title .line > span, .hero__text, .hero__cta,
	.hero__slide.is-active .line > span,
	.hero__slide.is-active .hero__text,
	.hero__slide.is-active .hero__cta { transform: none; transition: opacity 200ms ease; }
}
