/* ------------------------------------------------------------------
   Dalafisk – hero
   ------------------------------------------------------------------
   Ported from HTMLdesigns/dalafisk-landningssida.html (section.hero).
   Design class names mapped to the theme's vocabulary:
     hero__scen    -> dalafisk-hero--stage
     hero__bild    -> dalafisk-hero--image
     hero__kort    -> dalafisk-hero--content
     ogonbryn      -> dalafisk-hero--eyebrow
     trust         -> dalafisk-hero--trust
     hero__ingress -> dalafisk-hero--intro
     hero__knappar -> dalafisk-hero--buttons
   ------------------------------------------------------------------ */

.dalafisk-hero {
	padding: var(--dalafisk-announcement-gap) var(--dalafisk-announcement-inset) 15px;
}

.dalafisk-hero--stage {
	position: relative;
	isolation: isolate;
	border-radius: 15px;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Height presets mirror Pinnacle's desktop_height / mobile_height selects.
   The design's own hero is full screen, sitting under the announcement row. */
.dalafisk-hero--stage.desktop-height-full {
	min-height: calc(100vh - var(--dalafisk-announcement-gap) - 15px);
}
.dalafisk-hero--stage.desktop-height-450 { min-height: 450px; }
.dalafisk-hero--stage.desktop-height-550 { min-height: 550px; }
.dalafisk-hero--stage.desktop-height-650 { min-height: 650px; }
.dalafisk-hero--stage.desktop-height-750 { min-height: 750px; }

/* `desktop-height-full` / `mobile-height-full` are PINNACLE class names, and
   app.css sizes them with `height: calc(100vh - …)` — not min-height — plus
   100svh/100dvh copies under @supports. A min-height can never beat an explicit
   height, so the stage ignored the sizes above: 100vh instead of the design's
   882px on desktop, and 100vh instead of 700px on phones (300px too tall).
   The design sizes the stage by min-height alone and lets content grow it, so
   the inherited height is cleared. Only the `-full` pair needs this; Pinnacle's
   numeric presets use min-height and already lose on specificity. */
.dalafisk-hero--stage.desktop-height-full,
.dalafisk-hero--stage.mobile-height-full {
	height: auto;
}

.dalafisk-hero--image {
	position: absolute;
	inset: 0;
	z-index: -2;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	pointer-events: none;
}
/* responsive-image wraps the <img>; the wrapper has to fill the stage too. */
.dalafisk-hero--bg,
.dalafisk-hero--bg img,
.dalafisk-hero--bg svg {
	position: absolute;
	inset: 0;
	z-index: -2;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	pointer-events: none;
}

/* Mobile / desktop image swap, using Pinnacle's 768px breakpoint so the hero
   switches at the same width as the theme's other image sections. */
.dalafisk-hero--image-mobile {
	display: block;
}
.dalafisk-hero--image-desktop {
	display: none;
}
@media only screen and (min-width: 768px) {
	.dalafisk-hero--image-mobile {
		display: none;
	}
	.dalafisk-hero--image-desktop {
		display: block;
	}
}

.dalafisk-hero--overlay {
	position: absolute;
	inset: 0;
	z-index: -1;
	background: rgba(var(--dalafisk-hero-overlay-rgb, 0, 0, 0), var(--dalafisk-hero-overlay-opacity, 0));
	pointer-events: none;
}

/* The text sits straight on the image with no plate behind it, so it carries
   a shadow instead. */
.dalafisk-hero--content {
	/* Pinnacle colours headings through --color-heading (app.css), so rebind it
	   here rather than overriding h1 with !important. The section writes
	   --dalafisk-hero-text inline; the fallback is the ported design. */
	--color-heading: var(--dalafisk-hero-text, var(--dalafisk-white));

	max-width: 720px;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 18px;
	text-align: center;
	color: var(--dalafisk-hero-text, var(--dalafisk-white));
	text-shadow: 0 2px 14px rgba(0, 0, 0, .45);
	font-weight: 400;
	font-size: 16px;
	line-height: 1.55;
}

/* Dark type on a bright photo does not want the shadow that carries white type;
   the section drops this class when "Text shadow" is unticked. */
.dalafisk-hero--content-flat {
	text-shadow: none;
}

.dalafisk-hero--eyebrow {
	font-size: 11px;
	letter-spacing: 2px;
	text-transform: uppercase;
	/* The design hides this line (.ogonbryn is display:none), so its #555 was
	   never seen over a photo. Shown, it follows the hero's own text colour
	   instead, one step back so it still reads as an eyebrow. */
	color: rgba(var(--dalafisk-hero-text-rgb, 255, 255, 255), .82);
}

.dalafisk-hero h1,
.dalafisk-hero .dalafisk-hero--heading {
	font-size: clamp(32px, 3.5vw, 46px);
	line-height: 1.1;
	letter-spacing: -.02em;
	margin: 0;
}

.dalafisk-hero--intro {
	font-size: 17px;
	line-height: 1.45;
	color: rgba(var(--dalafisk-hero-text-rgb, 255, 255, 255), .92);
	margin: 0;
}

.dalafisk-hero--buttons {
	display: flex;
	gap: 14px;
	align-items: center;
	flex-wrap: wrap;
	justify-content: center;
}

/* Over the image the buttons invert: solid in the text colour, outline in it
   too. A white button on a bright photo is invisible, so both follow the
   setting rather than staying white; the solid one's label is flipped for it in
   the section (--dalafisk-hero-button-label). */
.dalafisk-hero--content .dalafisk-button {
	background: var(--dalafisk-hero-text, var(--dalafisk-white));
	color: var(--dalafisk-hero-button-label, var(--dalafisk-ink));
	border-color: var(--dalafisk-hero-text, var(--dalafisk-white));
	text-shadow: none;
}
.dalafisk-hero--content .dalafisk-button:hover {
	background: transparent;
	color: var(--dalafisk-hero-text, var(--dalafisk-white));
}
.dalafisk-hero--content .dalafisk-button--outline {
	background: transparent;
	color: var(--dalafisk-hero-text, var(--dalafisk-white));
	border-color: var(--dalafisk-hero-text, var(--dalafisk-white));
}
.dalafisk-hero--content .dalafisk-button--outline:hover {
	background: var(--dalafisk-hero-text, var(--dalafisk-white));
	color: var(--dalafisk-hero-button-label, var(--dalafisk-ink));
}

/* The trust pill keeps the light treatment so it reads as a badge. Every part
   of it is a block setting; the values below are the ported design. */
.dalafisk-hero--trust {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 14px;
	background: var(--dalafisk-hero-pill-bg, var(--dalafisk-white));
	border: 1.5px solid var(--dalafisk-hero-pill-outline, var(--dalafisk-ink));
	border-radius: 999px;
	padding: 8px 16px;
	color: var(--dalafisk-hero-pill-text, var(--dalafisk-ink));
	text-shadow: none;
}
/* Outline off. Only the colour goes: removing the 1.5px border would pull the
   pill 3px narrower and shorter and shift the lines around it. */
.dalafisk-hero--trust-flat {
	border-color: transparent;
}
.dalafisk-hero--trust .dalafisk-rating__stars {
	color: var(--dalafisk-hero-pill-stars, var(--dalafisk-rating-color));
}
.dalafisk-hero--trust b {
	font-weight: 600;
}
/* The rating snippet hard-codes 14px on its text span. In the design this copy
   is plain text inside .trust, so it follows the pill down to 13px on phones;
   here it stayed at 14. Inheriting is a no-op on desktop, where the pill is
   14px anyway, and fixes the leading with it (both are 1.55). */
.dalafisk-hero--trust .dalafisk-rating__text {
	font-size: inherit;
}

/* Line break in the heading that only applies on phones. */
.dalafisk-hero--break-mobile {
	display: none;
}

/* The hero does not wait to be scrolled into view — it is already there.
   Its content staggers in line by line instead, so the eye follows the copy. */
.dalafisk-hero--content > * {
	animation: dalafisk-rise-in .46s cubic-bezier(.22, 1, .36, 1) backwards;
}
html[data-dalafisk-direction="back"] .dalafisk-hero--content > * {
	animation-name: dalafisk-sink-in;
}
.dalafisk-hero--content > *:nth-child(1) { animation-delay: .06s; }
.dalafisk-hero--content > *:nth-child(2) { animation-delay: .13s; }
.dalafisk-hero--content > *:nth-child(3) { animation-delay: .2s; }
.dalafisk-hero--content > *:nth-child(4) { animation-delay: .27s; }
.dalafisk-hero--content > *:nth-child(n+5) { animation-delay: .34s; }

@media (max-width: 920px) {
	.dalafisk-hero--stage {
		padding: 16px 24px;
	}
	.dalafisk-hero--content {
		max-width: 100%;
	}
}

@media (max-width: 640px) {
	.dalafisk-hero {
		padding: var(--dalafisk-announcement-gap) var(--dalafisk-announcement-gap) 15px;
	}
	.dalafisk-hero--stage {
		border-radius: 15px;
		padding: 14px;
	}
	.dalafisk-hero--stage.desktop-height-full,
	.dalafisk-hero--stage.mobile-height-full {
		min-height: 700px;
	}
	.dalafisk-hero--stage.mobile-height-350 { min-height: 350px; }
	.dalafisk-hero--stage.mobile-height-400 { min-height: 400px; }
	.dalafisk-hero--stage.mobile-height-450 { min-height: 450px; }
	.dalafisk-hero--stage.mobile-height-500 { min-height: 500px; }
	.dalafisk-hero--content {
		max-width: 100%;
		padding: 0 4px;
		gap: 14px;
	}
	.dalafisk-hero h1,
	.dalafisk-hero .dalafisk-hero--heading {
		font-size: 34px;
	}
	.dalafisk-hero--intro {
		font-size: 14px;
	}
	.dalafisk-hero--buttons {
		gap: 8px;
		justify-content: center;
		flex-wrap: wrap;
	}
	.dalafisk-hero--buttons .dalafisk-button {
		font-size: 13.5px;
		padding: 11px 15px;
		gap: 6px;
	}
	.dalafisk-hero--trust {
		font-size: 13px;
		padding: 7px 15px;
		white-space: nowrap;
	}
	.dalafisk-hero--break-mobile {
		display: inline;
	}
}
