/**
 * Hero Scroll — Stilar
 *
 * ClipPath inset-animation: pill → fullskärm → rundad rektangel.
 */

/* Scroll-spacer — ger utrymme för animationen
   Negativ margin äter upp BB:s tomma 1px-kolumn i header-layouten */
.juni-hero-spacer {
	position: relative;
	margin-top: -1px;
	padding-top: 0;
}

/* Sticky-wrapper med clipPath — drivs av CSS-variabler från GSAP */
.juni-hero-wrap {
	position: sticky;
	top: 0;
	width: 100%;
	height: var(--jhs-desktop-height, 100vh);
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	will-change: clip-path;

	/* Default-värden för pill-läge — skrivs över av GSAP vid scroll */
	--jhs-inset-y: 35%;
	--jhs-inset-x: 35%;
	--jhs-radius: 600px;

	clip-path: inset(
		var(--jhs-inset-y)
		var(--jhs-inset-x)
		var(--jhs-inset-y)
		var(--jhs-inset-x)
		round var(--jhs-radius)
	);
}

/* Fullscreen-läge: starta utan inset */
.juni-hero-wrap--fullscreen {
	--jhs-inset-y: 0%;
	--jhs-inset-x: 0%;
	--jhs-radius: 0px;
}

.juni-hero-inner {
	position: absolute;
	inset: 0;
	overflow: hidden;
}

/* Fotot */
.juni-hero-photo {
	width: 100%;
	height: 100%;
	object-fit: cover;
	will-change: transform;
	border: none;
	outline: none;
}

/* Gradient-overlay */
.juni-hero-overlay {
	position: absolute;
	inset: 0;
	pointer-events: none;
}

/* Text ovanpå fotot — linjerar med navbarens logo */
.juni-hero-text {
	position: absolute;
	bottom: clamp(60px, 10vh, 120px);
	left: 0;
	right: 0;
	padding-left: max(24px, calc((100% - var(--jhs-layout-width, 1200px)) / 2));
	padding-right: 24px;
	z-index: 2;
}

.juni-hero-label {
	font-size: 0.7rem;
	font-weight: 600;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	margin-bottom: 1.5rem;
	display: flex;
	align-items: center;
	gap: 12px;
}

.juni-hero-label-line {
	display: block;
	width: 28px;
	height: 1px;
}

.juni-hero-title {
	font-family: 'Instrument Serif', Georgia, serif;
	font-size: clamp(2.5rem, 5.5vw, 4.5rem);
	font-weight: 400;
	line-height: 1.08;
	color: #fff;
	letter-spacing: -0.02em;
	margin: 0;
	padding: 0;
	max-width: var(--jhs-text-max-width, 700px);
}

.juni-hero-title em {
	font-style: italic;
}

/* Knappar */
.juni-hero-buttons {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-top: 2rem;
	flex-wrap: wrap;
}

.juni-hero-btn {
	display: inline-flex;
	align-items: center;
	padding: 14px 32px;
	font-size: 0.9rem;
	font-weight: 600;
	text-decoration: none;
	border-radius: 100px;
	transition: opacity 0.2s ease, transform 0.2s ease;
	white-space: nowrap;
}

.juni-hero-btn:hover {
	opacity: 0.88;
	transform: translateY(-1px);
}

.juni-hero-btn--primary {
	color: #0C1210;
}

.juni-hero-btn--secondary {
	color: #fff;
	border: 1px solid rgba(255, 255, 255, 0.4);
	background: rgba(255, 255, 255, 0.08);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
}

.juni-hero-btn--secondary:hover {
	border-color: rgba(255, 255, 255, 0.7);
	background: rgba(255, 255, 255, 0.15);
}

/* Scroll-indikator */
.juni-hero-scroll-hint {
	position: absolute;
	bottom: 24px;
	right: clamp(20px, 5vw, 48px);
	z-index: 2;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	color: rgba(255, 255, 255, 0.5);
	font-size: 0.65rem;
	letter-spacing: 0.15em;
	text-transform: uppercase;
}

.juni-hero-scroll-line {
	width: 1px;
	height: 40px;
	background: rgba(255, 255, 255, 0.3);
	position: relative;
	overflow: hidden;
}

.juni-hero-scroll-line span {
	position: absolute;
	top: -100%;
	left: 0;
	width: 100%;
	height: 100%;
	animation: juni-hero-pulse 2s ease-in-out infinite;
}

@keyframes juni-hero-pulse {
	0% { top: -100%; }
	50% { top: 100%; }
	100% { top: 100%; }
}

/* Tablet och mobil */
@media (max-width: 1024px) {
	.juni-hero-spacer {
		margin-top: var(--jhs-mobile-offset, 70px);
	}
}

@media (max-width: 768px) {
	.juni-hero-wrap {
		height: var(--jhs-mobile-height, 100vh);
	}

	.juni-hero-text {
		padding-left: 20px;
		padding-right: 20px;
	}

	.juni-hero-title {
		font-size: var(--jhs-mobile-title-size, 2.2rem) !important;
	}

	.juni-hero-buttons {
		margin-top: 1.5rem;
		gap: 12px;
	}

	.juni-hero-btn {
		padding: 12px 24px;
		font-size: 0.85rem;
	}
}

/* Dölj BB:s standard-wrapper-padding + nolla marginaler för att stänga glipor */
.fl-module-hero-scroll,
.fl-module-hero-scroll > .fl-module-content {
	margin: 0 !important;
	padding: 0 !important;
}

/* JS lägger till .juni-hero-host på raden/kolumnen för att nollställa padding
   och dra upp raden 1-2px för att äta upp ev. glippor från theme/header */
.fl-row.juni-hero-host {
	margin-top: -2px !important;
	margin-bottom: 0 !important;
}

.fl-row.juni-hero-host > .fl-row-content-wrap,
.fl-col.juni-hero-host > .fl-col-content {
	padding-top: 0 !important;
	padding-bottom: 0 !important;
	margin-top: 0 !important;
	margin-bottom: 0 !important;
	border-top: 0 !important;
}

/* Tvinga bort eventuella borders på sticky-wrappern själv */
.juni-hero-wrap,
.juni-hero-inner {
	border: 0 !important;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
	.juni-hero-wrap {
		clip-path: inset(0% 0% 0% 0% round 0px) !important;
	}

	.juni-hero-photo {
		transform: scale(1) !important;
	}

	.juni-hero-text {
		opacity: 1 !important;
		transform: none !important;
	}

	.juni-hero-scroll-hint {
		display: none;
	}

	.juni-hero-scroll-line span {
		animation: none;
	}
}
