/**
 * Hero slider (Figma: Claude | Design System, "Hero Banner").
 *
 * Slides are stacked in one grid cell and crossfade, so the frame grows to
 * fit the tallest slide instead of relying on fixed heights.
 */

.hero-slider {
	--hero-slider-inset: clamp(24px, 6.5vw, 104px); /* content and controls distance from the left edge */
	--hero-slider-edge: clamp(24px, 2vw, 32px); /* controls and callout distance from the bottom/right edge */

	position: relative;
	margin-inline: clamp(16px, 2.5vw, 40px);
	font-family: var(--emc-font-family);

	/* Light text on a dark image: match Figma's greyscale rendering. */
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

.hero-slider__frame {
	position: relative;
	overflow: hidden;
	background-color: var(--emc-color-purple-100);
	border-radius: 8px;
}

.hero-slider__slides {
	display: grid;
	touch-action: pan-y;
}

/* Slide */

.hero-slider__slide {
	position: relative;
	isolation: isolate;
	display: flex;
	grid-area: 1 / 1;
	align-items: center;
	min-height: clamp(520px, 45vw, 720px);
	padding: clamp(48px, 6vw, 96px) var(--hero-slider-inset) clamp(88px, 6vw, 96px);
}

/* Slides and previews crossfade: the outgoing one stays visible until it has faded out. */
.hero-slider__slide,
.hero-slider__preview {
	visibility: hidden;
	opacity: 0;
	transition:
		opacity var(--emc-duration-slow) ease,
		visibility 0s linear var(--emc-duration-slow);
}

.hero-slider__slide--active,
.hero-slider__preview--active {
	visibility: visible;
	opacity: 1;
	transition: opacity var(--emc-duration-slow) ease;
}

.hero-slider__slide::before {
	position: absolute;
	inset: 0;
	z-index: -1;
	content: "";
	background-image: linear-gradient(70.28deg, var(--emc-color-purple-100) 11.53%, rgb(43 9 80 / 0%) 87.91%);
}

.hero-slider__image {
	position: absolute;
	inset: 0;
	z-index: -2;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Content */

.hero-slider__content {
	display: flex;
	flex-direction: column;
	gap: 40px;
	width: 100%;
	max-width: 640px;
}

.hero-slider__text {
	display: flex;
	flex-direction: column;
	gap: 24px;
}

.hero-slider__heading {
	margin: 0;
	font-family: inherit;
	font-size: clamp(2.5rem, 1.75rem + 2.5vw, 4rem);
	font-weight: var(--emc-font-weight-light);
	line-height: 1;
	color: var(--emc-color-purple-off);
	overflow-wrap: break-word;
}

.hero-slider__body {
	margin: 0;
	font-size: clamp(1rem, 0.9rem + 0.25vw, 1.125rem);
	font-weight: var(--emc-font-weight-light);
	line-height: 1.78;
	color: var(--emc-color-white);
}

.hero-slider__actions {
	--button-focus-ring: var(--emc-color-white);

	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	align-items: center;
}

/* Controls */

.hero-slider__controls {
	position: absolute;
	bottom: var(--hero-slider-edge);
	left: var(--hero-slider-inset);
	z-index: 1;
	display: flex;
	gap: 16px;
	align-items: center;
}

.hero-slider__controls[hidden] {
	display: none;
}

.hero-slider__arrows {
	display: flex;
	justify-content: space-between;
	width: 80px;
}

.hero-slider__arrow,
.hero-slider__dot {
	appearance: none;
	padding: 0;
	cursor: pointer;
	background: none;
	border: 0;
	border-radius: 4px;
}

.hero-slider__arrow:focus-visible,
.hero-slider__dot:focus-visible {
	outline: 2px solid var(--emc-color-white);
	outline-offset: 2px;
}

.hero-slider__arrow {
	display: block;
	width: 32px;
	height: 32px;
}

.hero-slider__arrow--next {
	transform: rotate(180deg);
}

.hero-slider__arrow[aria-disabled="true"] {
	cursor: default;
}

.hero-slider__arrow-icon {
	display: block;
}

.hero-slider__arrow-icon--disabled,
.hero-slider__arrow[aria-disabled="true"] .hero-slider__arrow-icon--enabled {
	display: none;
}

.hero-slider__arrow[aria-disabled="true"] .hero-slider__arrow-icon--disabled {
	display: block;
}

/* Each dot button is 16px wide (8px dot + 8px gap) to give a bigger target. */
.hero-slider__dots {
	display: flex;
	margin-inline: -4px;
}

.hero-slider__dot {
	display: grid;
	place-items: center;
	width: 16px;
	height: 24px;
}

.hero-slider__dot::before {
	width: 8px;
	height: 8px;
	content: "";
	background-color: var(--emc-color-white);
	border-radius: 8px;
	transition: background-color var(--emc-duration-base) ease;
}

.hero-slider__dot[aria-current="true"]::before {
	background-color: var(--emc-color-purple-80);
}

.hero-slider__status {
	margin: 0;
	font-size: 10px;
	font-weight: var(--emc-font-weight-regular);
	line-height: 16px;
	color: var(--emc-color-text-03);
	white-space: nowrap;
}

/*
 * Previews: a "What's next?" card per slide, stacked like the slides. Only shown where
 * there's room to overlay them bottom-right without covering the content.
 */

.hero-slider__previews {
	position: absolute;
	right: var(--hero-slider-edge);
	bottom: var(--hero-slider-edge);
	z-index: 2;
	display: none;
	place-items: end;
}

.hero-slider__preview {
	grid-area: 1 / 1;
}

/* Small screens: stack the buttons full width so a wrapped secondary button lines up with the primary. */
@media (max-width: 599px) {

	.hero-slider__actions {
		flex-direction: column;
		gap: 8px;
		align-items: stretch;
	}
}

@media (min-width: 1400px) {

	.hero-slider__previews:not([hidden]) {
		display: grid;
	}
}

@media (prefers-reduced-motion: reduce) {

	.hero-slider__slide,
	.hero-slider__slide--active,
	.hero-slider__preview,
	.hero-slider__preview--active,
	.hero-slider__dot::before {
		transition: none;
	}
}
