/**
 * HandlaOnline hero content positioning (zones / align / max-width / offset).
 * Semantic attrs from HeroLayoutService — does not restyle Porto .btn / typography.
 *
 * Breakpoints: desktop default · tablet ≤991.98px · mobile ≤767.98px (Porto/Bootstrap).
 * Fit-guarantee: rows auto / 1fr / auto so top+bottom content always has room.
 */

/*
 * Porto theme-elements: section.section { padding:50px 0; margin:30px 0; border-top; grey bg }.
 * That chrome makes hero media look inset / banded / “off”. Heroes are full-bleed stages.
 */
section.section.section-hero,
.section-hero.ho-hero-sized {
	background-color: transparent;
	border-top: 0;
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

.section-hero.ho-hero-sized {
	display: flex;
	flex-direction: column;
	position: relative;
	overflow: hidden;
	isolation: isolate;
}

/* Static / video / carousel cover media — inset stretch (not % height alone) */
.section-hero > .ho-hero-bg-media,
.owl-carousel.ho-hero-sized .owl-item > .ho-hero-bg-media {
	position: absolute;
	inset: 0;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	max-height: none;
	margin: 0;
	padding: 0;
	border: 0;
	object-fit: cover;
	object-position: center center;
	z-index: 0;
	pointer-events: none;
	-webkit-user-select: none;
	user-select: none;
}

.section-hero > .video-bg-container {
	position: absolute;
	inset: 0;
	z-index: 1;
	overflow: hidden;
	pointer-events: none;
}

.section-hero > .video-bg-container video {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center center;
}

/*
 * Parallax: Porto JS prepends .parallax-background (default height 180% crops hard).
 * Soften crop, keep layer behind content; drop SSR fallback once plugin layer exists.
 */
.section-hero.section-parallax .parallax-background {
	z-index: 0 !important;
	pointer-events: none;
	background-repeat: no-repeat !important;
	background-size: cover !important;
	background-position-y: center !important;
}

.section-hero.section-parallax:has(> .parallax-background) {
	background-image: none !important;
}

.section-hero .ho-hero-rail {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	width: 100%;
	min-height: inherit;
	box-sizing: border-box;
	position: relative;
	z-index: 3;
}

.section-hero .ho-hero-content-wrapper {
	display: flex;
	width: 100%;
	flex: 1 1 auto;
	min-height: 12rem;
	box-sizing: border-box;
}

/* Desktop stage position (outer content holder) */
.section-hero .ho-hero-content-wrapper[data-ho-h="left"] { justify-content: flex-start; }
.section-hero .ho-hero-content-wrapper[data-ho-h="center"] { justify-content: center; }
.section-hero .ho-hero-content-wrapper[data-ho-h="right"] { justify-content: flex-end; }

.section-hero .ho-hero-content-wrapper[data-ho-v="top"] { align-items: flex-start; }
.section-hero .ho-hero-content-wrapper[data-ho-v="center"] { align-items: center; }
.section-hero .ho-hero-content-wrapper[data-ho-v="bottom"] { align-items: flex-end; }

.section-hero .ho-hero-content__inner {
	width: 100%;
	max-width: var(--ho-hero-mw, 760px);
	transform: translate(var(--ho-hero-ox, 0px), var(--ho-hero-oy, 0px));
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-height: 100%;
	align-self: stretch;
}

/* Zone grid: full-width stage — max-width applies per stack, not 1/3 column */
.section-hero .ho-hero-content__inner.ho-hero-content__inner--zones {
	max-width: 100%;
	width: 100%;
}

/* 3×3 zone grid — content-aware rows (fit-guarantee) */
.section-hero .ho-hero-zone-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
	grid-template-rows: auto minmax(0, 1fr) auto;
	grid-template-areas:
		"tl tc tr"
		"ml mc mr"
		"bl bc br";
	width: 100%;
	max-width: 100%;
	flex: 1 1 auto;
	min-height: 100%;
	gap: 0.75rem 1rem;
	box-sizing: border-box;
	overflow: visible;
}

.section-hero .ho-hero-zone-grid--mobile {
	display: none;
}

@media (max-width: 767.98px) {
	.section-hero .ho-hero-zone-grid--desktop {
		display: none;
	}
	.section-hero .ho-hero-zone-grid--mobile {
		display: grid;
	}
}

.section-hero .ho-hero-zone[data-ho-zone-cell="top-left"] { grid-area: tl; }
.section-hero .ho-hero-zone[data-ho-zone-cell="top-center"] { grid-area: tc; }
.section-hero .ho-hero-zone[data-ho-zone-cell="top-right"] { grid-area: tr; }
.section-hero .ho-hero-zone[data-ho-zone-cell="middle-left"] { grid-area: ml; }
.section-hero .ho-hero-zone[data-ho-zone-cell="middle-center"] { grid-area: mc; }
.section-hero .ho-hero-zone[data-ho-zone-cell="middle-right"] { grid-area: mr; }
.section-hero .ho-hero-zone[data-ho-zone-cell="bottom-left"] { grid-area: bl; }
.section-hero .ho-hero-zone[data-ho-zone-cell="bottom-center"] { grid-area: bc; }
.section-hero .ho-hero-zone[data-ho-zone-cell="bottom-right"] { grid-area: br; }

.section-hero .ho-hero-zone {
	display: flex;
	min-width: 0;
	box-sizing: border-box;
	overflow: visible;
	position: relative;
	z-index: 1;
}

.section-hero .ho-hero-zone[data-ho-zh="left"] { justify-content: flex-start; }
.section-hero .ho-hero-zone[data-ho-zh="center"] { justify-content: center; }
.section-hero .ho-hero-zone[data-ho-zh="right"] { justify-content: flex-end; }

.section-hero .ho-hero-zone[data-ho-zv="top"] { align-items: flex-start; }
.section-hero .ho-hero-zone[data-ho-zv="middle"] { align-items: center; }
.section-hero .ho-hero-zone[data-ho-zv="bottom"] { align-items: flex-end; }

.section-hero .ho-hero-zone__stack {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	/* Anchor width from editor max-width — not 1/3 of grid cell */
	width: min(var(--ho-hero-mw, 760px), 92vw);
	max-width: min(var(--ho-hero-mw, 760px), 92vw);
	min-width: 0;
	flex-shrink: 0;
}

.section-hero .ho-hero-zone[data-ho-zh="left"] .ho-hero-zone__stack {
	margin-right: auto;
}

.section-hero .ho-hero-zone[data-ho-zh="center"] .ho-hero-zone__stack {
	margin-left: auto;
	margin-right: auto;
}

.section-hero .ho-hero-zone[data-ho-zh="right"] .ho-hero-zone__stack {
	margin-left: auto;
}

.section-hero .ho-hero-el {
	width: 100%;
	max-width: 100%;
	min-width: 0;
}

.section-hero .ho-hero-el.text-start { text-align: left; }
.section-hero .ho-hero-el.text-center { text-align: center; }
.section-hero .ho-hero-el.text-end { text-align: right; }

.section-hero .ho-hero-el.text-start .ho-hero-btn-row { justify-content: flex-start; }
.section-hero .ho-hero-el.text-center .ho-hero-btn-row { justify-content: center; }
.section-hero .ho-hero-el.text-end .ho-hero-btn-row { justify-content: flex-end; }

/* Block-rich description: no extra <p> shell; sanitizeBlock HTML inside */
.section-hero .ho-hero-description.ho-cms-richtext > :first-child {
	margin-top: 0;
}
.section-hero .ho-hero-description.ho-cms-richtext > :last-child {
	margin-bottom: 0;
}
.section-hero .ho-hero-description.ho-cms-richtext p {
	margin-bottom: 0.75em;
}
.section-hero .ho-hero-description.ho-cms-richtext p:last-child {
	margin-bottom: 0;
}

/*
 * Soft hero text tones — NO !important (unlike Porto .text-color-light).
 * Lets TinyMCE inline color/font styles show on the frontend.
 */
.section-hero .ho-hero-richtext--light {
	color: var(--light, #fff);
}
.section-hero .ho-hero-richtext--dark {
	color: var(--dark, #212529);
}
.section-hero .ho-cms-richtext > p,
.section-hero .ho-cms-richtext > div,
.section-hero .ho-cms-richtext > span {
	margin-top: 0;
}
.section-hero .ho-cms-richtext img,
.section-hero .ho-cms-richtext video {
	max-width: 100%;
	height: auto;
	display: inline-block;
	vertical-align: middle;
}
.section-hero .ho-cms-richtext iframe {
	max-width: 100%;
	aspect-ratio: 16 / 9;
	width: 100%;
	border: 0;
}
.section-hero .ho-cms-richtext figure {
	margin: 0.75rem 0;
	max-width: 100%;
}
.section-hero .ho-hero-subtitle.ho-cms-richtext > :first-child {
	margin-top: 0;
}
.section-hero .ho-hero-subtitle.ho-cms-richtext > :last-child {
	margin-bottom: 0;
}
.section-hero .ho-hero-subtitle.ho-cms-richtext p {
	margin-bottom: 0;
}

.section-hero .ho-hero-el .text-12 {
	overflow-wrap: break-word;
	word-break: normal;
	hyphens: auto;
}
/* Beat Porto .text-12 { font-size: 3.5em !important } only as a soft default —
   author span styles use inline !important from sanitize and win for their text. */
.section-hero .ho-hero-el .ho-cms-richtext.text-12 {
	font-size: clamp(2rem, 4.2vw, 3.5em) !important;
	line-height: 1.2;
}

.section-hero .ho-hero-btn-row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	align-items: center;
}

/* Tablet (Porto below lg) — stage holder */
@media (max-width: 991.98px) {
	.section-hero .ho-hero-content-wrapper[data-ho-h-md="left"] { justify-content: flex-start; }
	.section-hero .ho-hero-content-wrapper[data-ho-h-md="center"] { justify-content: center; }
	.section-hero .ho-hero-content-wrapper[data-ho-h-md="right"] { justify-content: flex-end; }

	.section-hero .ho-hero-content-wrapper[data-ho-v-md="top"] { align-items: flex-start; }
	.section-hero .ho-hero-content-wrapper[data-ho-v-md="center"] { align-items: center; }
	.section-hero .ho-hero-content-wrapper[data-ho-v-md="bottom"] { align-items: flex-end; }

	.section-hero .ho-hero-content__inner.ho-hero-content__inner--zones {
		max-width: 100%;
		transform: translate(var(--ho-hero-ox-md, 0px), var(--ho-hero-oy-md, 0px));
	}

	/* Use vw — % max-width would resolve against the 1/3 zone cell */
	.section-hero .ho-hero-zone__stack {
		width: min(var(--ho-hero-mw-md, var(--ho-hero-mw, 760px)), calc(100vw - 2.5rem));
		max-width: min(var(--ho-hero-mw-md, var(--ho-hero-mw, 760px)), calc(100vw - 2.5rem));
	}

	.section-hero .ho-hero-content__inner:not(.ho-hero-content__inner--zones) {
		max-width: var(--ho-hero-mw-md, var(--ho-hero-mw, 760px));
		transform: translate(var(--ho-hero-ox-md, 0px), var(--ho-hero-oy-md, 0px));
	}

	.section-hero .ho-hero-el .text-12 {
		font-size: clamp(2rem, 5.5vw, 3rem) !important;
		line-height: 1.18; /* no !important — TinyMCE line-height must win */
	}
}

/*
 * Phone — 3×3 grid is unreadable: mobile maxWidth defaults to 100% of the zone cell
 * (~1/3 viewport). Collapse to one full-width column + readable type scale.
 */
@media (max-width: 767.98px) {
	.section-hero .ho-hero-content-wrapper[data-ho-h-sm="left"] { justify-content: flex-start; }
	.section-hero .ho-hero-content-wrapper[data-ho-h-sm="center"] { justify-content: center; }
	.section-hero .ho-hero-content-wrapper[data-ho-h-sm="right"] { justify-content: flex-end; }

	.section-hero .ho-hero-content-wrapper[data-ho-v-sm="top"] { align-items: flex-start; }
	.section-hero .ho-hero-content-wrapper[data-ho-v-sm="center"] { align-items: center; }
	.section-hero .ho-hero-content-wrapper[data-ho-v-sm="bottom"] { align-items: flex-end; }

	.section-hero .ho-hero-content__inner.ho-hero-content__inner--zones {
		max-width: 100%;
		transform: translate(var(--ho-hero-ox-sm, 0px), var(--ho-hero-oy-sm, 0px));
	}

	.section-hero .ho-hero-content__inner:not(.ho-hero-content__inner--zones) {
		max-width: 100%;
		transform: translate(var(--ho-hero-ox-sm, 0px), var(--ho-hero-oy-sm, 0px));
	}

	.section-hero .ho-hero-rail {
		padding-top: 2rem !important;
		padding-bottom: 2rem !important;
		padding-left: max(0px, env(safe-area-inset-left, 0px));
		padding-right: max(0px, env(safe-area-inset-right, 0px));
	}

	.section-hero .ho-hero-zone-grid--mobile {
		display: grid;
		grid-template-columns: minmax(0, 1fr);
		grid-template-rows: none;
		grid-auto-rows: auto;
		grid-template-areas: none;
		gap: 0.35rem;
		width: 100%;
		max-width: 100%;
		min-height: 100%;
		padding-inline: 1.25rem;
		box-sizing: border-box;
		align-content: center;
	}

	.section-hero .ho-hero-zone-grid--mobile .ho-hero-zone {
		grid-area: auto;
		width: 100%;
		min-width: 0;
		min-height: 0;
	}

	.section-hero .ho-hero-zone-grid--mobile .ho-hero-zone:not(:has(.ho-hero-zone__stack)) {
		display: none;
	}

	.section-hero .ho-hero-zone-grid--mobile .ho-hero-zone__stack {
		width: 100%;
		max-width: 100%;
	}

	.section-hero .ho-hero-btn-row {
		flex-direction: column;
		align-items: stretch;
		gap: 0.65rem;
		margin-top: 0.25rem;
	}

	.section-hero .ho-hero-btn-row .btn {
		width: 100%;
		justify-content: center;
		text-align: center;
		padding-top: 0.85rem;
		padding-bottom: 0.85rem;
	}

	/* Underrubrik — layout defaults only; author Tiny styles override */
	.section-hero .ho-hero-el--subtitle .ho-cms-richtext,
	.section-hero .ho-hero-el--subtitle .ho-cms-richtext p {
		font-size: clamp(0.72rem, 3.2vw, 0.9rem);
		letter-spacing: 0.14em;
		line-height: 1.45;
		margin-bottom: 0.4rem;
		overflow-wrap: anywhere;
	}

	/* Rubrik — Porto .text-12 is 3.5em (too big on phones) */
	.section-hero .ho-hero-el .text-12 {
		font-size: clamp(1.7rem, 8vw, 2.35rem) !important;
		line-height: 1.15; /* no !important — Tiny line-height / font-size win via inline !important */
		margin-bottom: 0.85rem !important;
		overflow-wrap: break-word;
		hyphens: manual;
	}

	/* Beskrivning */
	.section-hero .ho-hero-description {
		font-size: clamp(0.95rem, 3.6vw, 1.1rem);
		line-height: 1.55; /* no !important */
		margin-bottom: 1.15rem !important;
		max-width: 36rem;
		margin-left: auto;
		margin-right: auto;
	}

	.section-hero .ho-hero-el.text-start .ho-hero-description {
		margin-left: 0;
		margin-right: auto;
	}

	.section-hero .ho-hero-el.text-end .ho-hero-description {
		margin-left: auto;
		margin-right: 0;
	}

	.section-hero .ho-hero-el[data-ho-ta-sm="left"] { text-align: left; }
	.section-hero .ho-hero-el[data-ho-ta-sm="center"] { text-align: center; }
	.section-hero .ho-hero-el[data-ho-ta-sm="right"] { text-align: right; }

	.section-hero .ho-hero-el[data-ho-ta-sm="left"] .ho-hero-btn-row { justify-content: flex-start; }
	.section-hero .ho-hero-el[data-ho-ta-sm="center"] .ho-hero-btn-row { justify-content: center; }
	.section-hero .ho-hero-el[data-ho-ta-sm="right"] .ho-hero-btn-row { justify-content: flex-end; }
}
