/* ======================================================================
   Liv og mennesker (inc/personlighet.php, assets/plattform/liv.js):
   plassholderne for bilder, filmer og tegninger, maskotene som vinker og
   svarer, og filmene fra kundene.
   ====================================================================== */

/* ---------- Plassholderne (vises bare lokalt og for redaktører) ---------- */

.hh-plass {
	display: grid;
	align-content: center;
	justify-items: start;
	gap: 10px;
	width: 100%;
	min-height: 220px;
	padding: clamp(18px, 2.4vw, 30px);
	border: 2px dashed #c4b5fd;
	border-radius: 24px;
	background: repeating-linear-gradient(-45deg, #faf8ff 0 14px, #f4f0ff 14px 28px);
	color: #3b2a6b;
	text-align: left;
	font-family: var(--font-sans, 'Nunito'), system-ui, sans-serif;
}

.hh-plass--film { border-color: #f9a8d4; background: repeating-linear-gradient(-45deg, #fff7fb 0 14px, #fdeef6 14px 28px); color: #6b1f45; }
.hh-plass--tegning { border-color: #86efac; background: repeating-linear-gradient(-45deg, #f5fef8 0 14px, #ecfbf1 14px 28px); color: #14532d; }

.hh-plass p { margin: 0; }

.hh-plass-type,
.hh-plass-merke {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 5px 11px;
	border-radius: 999px;
	background: #ede9fe;
	color: #6d28d9;
	font-size: 12px;
	font-weight: 800;
	letter-spacing: .03em;
	text-transform: uppercase;
}

.hh-plass--film .hh-plass-type { background: #fce7f3; color: #be185d; }
.hh-plass--tegning .hh-plass-type { background: #dcfce7; color: #15803d; }

.hh-plass-tittel { font-size: 19px; font-weight: 800; line-height: 1.25; }
.hh-plass-motiv { max-width: 40em; font-size: 15px; line-height: 1.55; }
.hh-plass-format { font-size: 13px; font-weight: 700; opacity: .8; }

/* Det lille merket ved en maskot som skal få en egen tegning */
.hh-plass-merke {
	margin: 0;
	border: 1.5px dashed #86efac;
	background: #f0fdf4;
	color: #15803d;
	font-size: 11px;
	letter-spacing: .02em;
	text-transform: none;
	line-height: 1.3;
}

/* ---------- Maskotene som lever ---------- */

img[data-liv] {
	cursor: pointer;
	transform-origin: 50% 88%;
	transition: translate .35s cubic-bezier(.2, .7, .2, 1), scale .35s cubic-bezier(.2, .7, .2, 1);
}

img[data-liv].liv-glad { translate: 0 -6px; scale: 1.05; }
img[data-liv].liv-vinker { animation: liv-vink 1.3s ease-in-out; }
img[data-liv].liv-hopp { animation: liv-hopp .6s cubic-bezier(.3, 1.5, .5, 1); }

@keyframes liv-vink {
	0%, 100% { rotate: 0deg; }
	15% { rotate: -10deg; }
	32% { rotate: 8deg; }
	48% { rotate: -6deg; }
	64% { rotate: 4deg; }
	80% { rotate: -2deg; }
}

@keyframes liv-hopp {
	0% { translate: 0 0; rotate: 0deg; }
	40% { translate: 0 -20px; rotate: -7deg; }
	70% { translate: 0 2px; rotate: 3deg; }
	100% { translate: 0 0; rotate: 0deg; }
}

/* Det helten sier når man trykker */
.liv-boble {
	position: absolute;
	z-index: 80;
	max-width: 240px;
	margin: 0;
	padding: 10px 14px;
	border-radius: 16px;
	background: #0a0f1f;
	color: #fff;
	font: 700 14px/1.35 var(--font-sans, 'Nunito'), system-ui, sans-serif;
	text-align: center;
	pointer-events: none;
	transform: translate(-50%, calc(-100% - 12px));
	animation: liv-inn .35s cubic-bezier(.2, .7, .2, 1) both;
	transition: opacity .4s ease;
}

.liv-boble::after {
	content: '';
	position: absolute;
	left: 50%;
	bottom: -6px;
	border: 7px solid transparent;
	border-top-color: #0a0f1f;
	border-bottom: 0;
	translate: -50% 0;
}

.liv-boble.er-borte { opacity: 0; }

@keyframes liv-inn {
	from { opacity: 0; transform: translate(-50%, calc(-100% - 2px)) scale(.92); }
}

@media (prefers-reduced-motion: reduce) {
	img[data-liv] { transition: none; }
	.liv-boble { animation: none; }
}

/* Merket i kortene i Kjenner du deg igjen, under navnet til helten */
.pf-pk-topp .hh-plass-merke { flex-basis: 100%; justify-content: flex-start; margin-top: 6px; }

/* ---------- Kundene forteller ----------
   Overskriften til venstre og knappen til høyre. Kortene står i en rad som
   blas sideveis og går ut til kanten av skjermen, med pilene under. Hvert
   kort har sin egen farge: --flate er bakgrunnen og --aksent anførselstegnet,
   de uthevede ordene og tallet (i mørk modus blandes de av lag_mork.py).
   Kort med bilde er brede, med bildet til høyre. Logoene står i en farge. */

.kf-hode {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 20px 40px;
	margin-bottom: clamp(32px, 4vw, 52px);
}

.kf-hode .pf-h2 { max-width: 11em; margin: 0; }
.kf-hode .pf-ingress { margin: 16px 0 0; }
.kf-knapp { flex-shrink: 0; gap: 8px; }

.kf-liste {
	--kf-kant: max(24px, calc((100% - 1180px) / 2));
	position: relative;
	display: flex;
	gap: clamp(14px, 1.6vw, 20px);
	margin: 0;
	padding: 0 var(--kf-kant) 4px;
	list-style: none;
	overflow-x: auto;
	/* Bare sidelengs. Uten dette kan sporet også rulles opp og ned */
	overflow-y: hidden;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scroll-padding-inline: var(--kf-kant);
	scrollbar-width: none;
}

.kf-liste::-webkit-scrollbar { display: none; }

/* Kortene toner inn uten å gli opp, så ingenting stikker ut under sporet */
.kf-liste [data-pf-vis]:not(.er-synlig) { transform: none; }

.kf-kort {
	--flate: #ebe3ff;
	--aksent: #6712fb;
	position: relative;
	display: flex;
	flex: 0 0 auto;
	gap: 24px;
	width: min(400px, 84vw);
	min-height: 440px;
	padding: clamp(24px, 2.4vw, 34px);
	border-radius: 28px;
	background: var(--flate);
	color: #1d1d26;
	scroll-snap-align: start;
	container-type: inline-size;
}

.kf-kort--foto { width: min(860px, 88vw); }

.kf-kort--blekk { --flate: #15112a; --aksent: #b9a0ff; color: #fff; }
.kf-kort--lilla { --flate: #ebe3ff; --aksent: #6712fb; }
.kf-kort--gul { --flate: #fff0b3; --aksent: #8f5b00; }
.kf-kort--mint { --flate: #d3f2e2; --aksent: #0a7444; }
.kf-kort--himmel { --flate: #d9e8ff; --aksent: #1f55d6; }
.kf-kort--fersken { --flate: #ffe0cf; --aksent: #c2410c; }
.kf-kort--rosa { --flate: #ffdcee; --aksent: #b4166f; }

.kf-innhold { display: flex; flex: 1 1 0; flex-direction: column; align-items: flex-start; min-width: 0; }

.kf-anf {
	display: block;
	height: .42em;
	margin: 0 0 22px;
	font: 800 112px/.8 var(--pf-tittel);
	color: var(--aksent);
}

.kf-sitat {
	margin: 0;
	font-family: var(--pf-tittel);
	font-size: clamp(1.25rem, 1.05rem + .5vw, 1.5rem);
	font-weight: 700;
	line-height: 1.32;
	text-wrap: pretty;
}

.kf-kort--foto .kf-sitat { font-size: clamp(1.375rem, 1.1rem + .8vw, 1.875rem); }
.kf-sitat p { margin: 0; }
.kf-sitat--plass { color: #a78bfa; font-size: 1.05rem; }
.kf-uthevet { background: none; color: var(--aksent); }

.kf-hvem { display: grid; gap: 2px; margin: 22px 0 0; font-size: 15px; line-height: 1.4; }
.kf-hvem b { font-weight: 800; }
.kf-hvem span { opacity: .72; }

.kf-merke {
	margin: 0;
	padding: 6px 14px;
	border-radius: 999px;
	background: rgba(255, 255, 255, .6);
	color: var(--aksent);
	font-size: 14px;
	font-weight: 800;
}

.kf-kort--blekk .kf-merke { background: rgba(255, 255, 255, .12); }

/* Merket og utmerkelsen side om side, som Nettbutikk og Gasellebedrift */
.kf-merker { display: flex; flex-wrap: wrap; gap: 8px; }
.kf-utmerkelse {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0;
	padding: 6px 14px 6px 11px;
	border: 1.5px solid #f2c94c;
	border-radius: 999px;
	background: #fff6d6;
	color: #7a4f00;
	font-size: 14px;
	font-weight: 800;
}

.kf-utmerkelse svg { color: #c98a00; font-size: 15px; }

.kf-tall {
	margin: auto 0 0;
	padding-top: 36px;
	font-family: var(--pf-tittel);
	font-size: clamp(4.25rem, 2.8rem + 3.6vw, 6.75rem);
	font-weight: 800;
	line-height: .95;
	letter-spacing: -.03em;
	color: var(--aksent);
	font-variant-numeric: tabular-nums;
}

/* Lange tall krymper med kortet, så de aldri stikker ut på smale kort */
.kf-tall--lang { font-size: min(clamp(3rem, 2.2rem + 2.2vw, 4.5rem), 17.5cqi); }
.kf-tall-tekst { max-width: 18em; margin: 12px 0 0; font-size: 18px; font-weight: 700; line-height: 1.35; text-wrap: pretty; }

.kf-bunn {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	width: 100%;
	margin-top: auto;
	padding-top: 28px;
}

.kf-kort--tall .kf-bunn { margin-top: 0; }

.kf-logo { display: block; width: auto; max-width: 160px; height: 38px; object-fit: contain; object-position: left center; filter: brightness(0); opacity: .82; }
.kf-kort--blekk .kf-logo { filter: brightness(0) invert(1); opacity: .9; }

.kf-lenke {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	color: inherit;
	font-size: 16px;
	font-weight: 800;
	text-decoration: none;
}

.kf-lenke svg { transition: transform .25s var(--pf-myk); }
.kf-lenke:hover { text-decoration: underline; text-underline-offset: 4px; }
.kf-lenke:hover svg { transform: translateX(3px); }
.kf-lenke:focus-visible { outline: 3px solid #a020f0; outline-offset: 4px; border-radius: 4px; }

/* Bildet eller filmen til høyre, nesten ut til kanten av kortet */
.kf-film {
	position: relative;
	flex: 0 0 44%;
	margin: -14px -14px -14px 0;
	border-radius: 20px;
	overflow: hidden;
	background: #0a0f1f;
}

.kf-film video,
.kf-film .kf-bilde { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.kf-film .kf-bilde { transition: transform 1.2s var(--pf-myk); }
.kf-kort:hover .kf-bilde { transform: scale(1.04); }
.kf-film .hh-plass { position: absolute; inset: 0; height: 100%; border-radius: inherit; }

.kf-merkelogo {
	position: absolute;
	left: 14px;
	bottom: 14px;
	display: inline-flex;
	padding: 10px 14px;
	border-radius: 14px;
	background: #fff;
}

.kf-kort .kf-merkelogo .kf-logo { height: 30px; max-width: 130px; filter: brightness(0); opacity: 1; }

.kf-lyd {
	position: absolute;
	left: 14px;
	bottom: 14px;
	display: inline-grid;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: #fff;
	color: #0a0f1f;
	font: inherit;
	font-size: 14px;
	font-weight: 800;
	cursor: pointer;
}

.kf-lyd > span { grid-area: 1 / 1; display: inline-flex; align-items: center; gap: 7px; padding: 9px 15px; }
.kf-lyd-paa { visibility: hidden; }
.har-lyd .kf-lyd-av { visibility: hidden; }
.har-lyd .kf-lyd-paa { visibility: visible; }
.har-lyd .kf-lyd { bottom: 58px; }
.kf-lyd:focus-visible { outline: 3px solid #a020f0; outline-offset: 3px; }

/* Utforsk flere caser (dynamiske/kundecase_flere.php): samme spor, med
   kundekortene (inc/kundekort.php) i stedet for de fargede kortene */
.rc-kort { flex: 0 0 auto; width: min(380px, 80vw); scroll-snap-align: start; }
.rc-kort .hh-kk { height: 100%; }

.kf-piler { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.kf-piler[hidden] { display: none; }

.kf-pil {
	display: grid;
	place-items: center;
	width: 52px;
	height: 52px;
	padding: 0;
	border: 2px solid #1d1d26;
	border-radius: 50%;
	background: transparent;
	color: #1d1d26;
	font-size: 22px;
	cursor: pointer;
	transition: background-color .2s, color .2s, opacity .2s;
}

.kf-pil:hover:not(:disabled) { background: #1d1d26; color: #fff; }
.kf-pil:disabled { opacity: .28; cursor: default; }
.kf-pil:focus-visible { outline: 3px solid #a020f0; outline-offset: 3px; }

/* Som rutenett (/kundecaser/): tre kolonner, der kortene med bilde tar to og
   står annenhver gang til venstre og høyre (rekkefølgen og --bred/--hel
   settes i template-parts/sections/plattform/kunder.php). To kolonner på
   nettbrett og en på mobil. */
.kf-rutenett {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	grid-auto-flow: dense;
	max-width: 1228px;
	margin-inline: auto;
	padding: 0 24px;
	overflow: visible;
	scroll-snap-type: none;
}

.kf-rutenett .kf-kort { width: auto; min-height: 420px; }
.kf-rutenett .kf-kort--bred { grid-column: span 2; }
.kf-rutenett .kf-kort--hel { grid-column: 1 / -1; }
.kf-rutenett .kf-kort--hel.kf-kort--foto .kf-film { flex-basis: 38%; }
.kf-rutenett .kf-kort--bred:not(.kf-kort--foto) .kf-sitat,
.kf-rutenett .kf-kort--hel:not(.kf-kort--foto) .kf-sitat { max-width: 26em; font-size: clamp(1.375rem, 1.1rem + .8vw, 1.875rem); }

@media (max-width: 1023px) {
	.kf-rutenett { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.kf-rutenett .kf-kort--bred:not(.kf-kort--foto) { grid-column: auto; }
	.kf-rutenett .kf-kort--foto { grid-column: 1 / -1; }
}

@media (max-width: 699px) {
	.kf-rutenett { grid-template-columns: minmax(0, 1fr); padding-inline: 16px; }
	.kf-rutenett .kf-kort { min-height: 0; }
	.kf-hode { flex-direction: column; align-items: flex-start; }
	.kf-kort { min-height: 0; }
	.kf-kort--foto { flex-direction: column; width: 84vw; }
	.kf-kort--foto .kf-film { order: -1; flex: none; height: 190px; margin: -10px -10px 0; }
	.kf-kort--foto .kf-sitat { font-size: 1.25rem; }
	.kf-anf { margin-bottom: 14px; font-size: 80px; }
	.kf-tall { padding-top: 28px; }
}

@media (prefers-reduced-motion: reduce) {
	.kf-film .kf-bilde,
	.kf-lenke svg { transition: none; }
	.kf-kort:hover .kf-bilde { transform: none; }
}

/* ---------- Kundecasene som mosaikk (dynamiske/kundecase_mosaikk.php) ----------
   Tre kolonner med kort av ulik form og høyde, så rutenettet ser ut som en
   mur: bilde med logo og tall, en flate i farge med et stort tall, bilde med
   tre tall på rad, og sitatet. Fargene er de samme som i Kundene forteller.
   Hele kortet er en lenke til casen. */

.km-rutenett {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	align-items: start;
	gap: 20px;
	margin-top: clamp(32px, 4vw, 52px);
}

.km-kol { display: grid; gap: 20px; }

.km-kort {
	position: relative;
	display: flex;
	flex-direction: column;
	min-width: 0;
	border-radius: 28px;
	background: var(--flate, #f4f2f8);
	color: #1d1d26;
	text-decoration: none;
	overflow: hidden;
	isolation: isolate;
}

.km-kort:focus-visible { outline: 3px solid #7c3aed; outline-offset: 4px; }
.km-kort--lilla { --flate: #ebe3ff; --aksent: #6712fb; }
.km-kort--mint { --flate: #d3f2e2; --aksent: #0a7444; }
.km-kort--himmel { --flate: #d9e8ff; --aksent: #1f55d6; }
.km-kort--fersken { --flate: #ffe0cf; --aksent: #c2410c; }

.km-foto {
	position: absolute;
	inset: 0;
	z-index: -2;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .7s cubic-bezier(.2, .7, .2, 1);
}

.km-kort:hover .km-foto { transform: scale(1.04); }

/* Sløret gjør teksten lesbar over bildet, mørkest nederst */
.km-slor {
	position: absolute;
	inset: 0;
	z-index: -1;
	background: linear-gradient(180deg, rgba(12, 9, 26, .35) 0%, rgba(12, 9, 26, .05) 35%, rgba(12, 9, 26, .2) 55%, rgba(12, 9, 26, .82) 100%);
}

.km-logo { display: block; width: auto; max-width: 46%; max-height: 46px; object-fit: contain; }
.km-logo--mork { max-height: 40px; filter: brightness(0); opacity: .85; }
.km-logo-navn { color: inherit; font-size: 1.2rem; font-weight: 800; }
.km-merkelapp { color: inherit; font-size: .75rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; opacity: .75; }
.km-tittel { display: block; font-family: var(--pf-tittel); font-size: clamp(1.25rem, 1.05rem + .6vw, 1.55rem); font-weight: 800; line-height: 1.15; text-wrap: balance; }

.km-lenke {
	display: inline-flex;
	align-items: center;
	align-self: flex-start;
	gap: 8px;
	margin-top: auto;
	padding-top: 18px;
	color: var(--aksent, #6712fb);
	font-weight: 800;
}

.km-lenke svg { transition: transform .2s ease; }
.km-kort:hover .km-lenke svg { transform: translateX(4px); }

.km-chips { display: flex; flex-wrap: wrap; gap: 6px; }

.km-chips i {
	padding: 5px 11px;
	border: 1px solid rgba(255, 255, 255, .28);
	border-radius: 999px;
	background: rgba(255, 255, 255, .14);
	font-size: .8rem;
	font-style: normal;
	font-weight: 700;
	backdrop-filter: blur(6px);
}

/* Bildet med logoen, det første tallet, tittelen og leveransene */
.km-kort--foto {
	justify-content: space-between;
	aspect-ratio: 1;
	padding: clamp(20px, 2vw, 28px);
	background: #15112a;
	color: #fff;
}

.km-kort--hoy { aspect-ratio: 4 / 5; }
.km-kort--foto .km-topp { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }

.km-merke-tall {
	display: grid;
	max-width: 52%;
	padding: 10px 14px;
	border-radius: 18px;
	background: #fff;
	color: #4a4760;
	font-size: .78rem;
	line-height: 1.3;
}

.km-merke-tall b { color: #1d1d26; font-family: var(--pf-tittel); font-size: 1.45rem; font-weight: 800; line-height: 1.1; }
.km-kort--foto .km-bunn { display: grid; gap: 10px; }

/* Flaten i farge med det første tallet stort */
.km-kort--tall { gap: 6px; padding: clamp(24px, 2.4vw, 32px); }
.km-kort--tall .km-topp { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: clamp(20px, 3vw, 40px); }
.km-mini { flex: none; width: 64px; height: 64px; border-radius: 18px; object-fit: cover; }

.km-stort {
	color: var(--aksent);
	font-family: var(--pf-tittel);
	font-size: clamp(3.6rem, 2.6rem + 3vw, 5.6rem);
	font-weight: 800;
	line-height: .95;
	letter-spacing: -.03em;
}

.km-stort--lang { font-size: clamp(2.6rem, 2rem + 2vw, 3.8rem); }
.km-tall-tekst { max-width: 22em; margin-bottom: 22px; color: #3d3a52; font-size: 1.05rem; line-height: 1.45; }
.km-kort--tall .km-merkelapp { margin-bottom: 6px; color: #4a4760; }

/* Bildet øverst og tre tall på rad */
.km-kort--tre { border: 1px solid #ebe8f2; background: #fff; }

.km-bilde {
	position: relative;
	display: grid;
	place-items: center;
	aspect-ratio: 16 / 10;
	background: #15112a;
	overflow: hidden;
	isolation: isolate;
}

.km-bilde .km-slor { background: rgba(12, 9, 26, .3); }
.km-bilde .km-logo { max-height: 52px; }
.km-innhold { display: flex; flex-direction: column; gap: 8px; padding: clamp(22px, 2.2vw, 30px); }
.km-kort--tre .km-merkelapp { color: #6b6880; }

.km-tre {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	margin-top: 14px;
	border-top: 1px solid #ebe8f2;
}

.km-tre > span {
	display: grid;
	align-content: start;
	gap: 4px;
	padding: 14px 10px 0 0;
	color: #6b6880;
	font-size: .8rem;
	line-height: 1.35;
}

.km-tre > span + span { padding-left: 12px; border-left: 1px solid #ebe8f2; }
.km-tre b { color: #1d1d26; font-family: var(--pf-tittel); font-size: 1.35rem; font-weight: 800; line-height: 1.1; }

/* Sitatet på mørk flate */
.km-kort--sitat { --flate: #15112a; --aksent: #b9a0ff; padding: clamp(26px, 2.6vw, 36px); color: #fff; }
.km-anf { display: block; height: .42em; margin-bottom: 20px; color: var(--aksent); font: 800 96px/.8 var(--pf-tittel); }
.km-sitat { margin: 0; }
.km-sitat p { margin: 0; font-family: var(--pf-tittel); font-size: clamp(1.25rem, 1.05rem + .6vw, 1.6rem); font-weight: 800; line-height: 1.25; }
.km-hvem { display: flex; align-items: center; gap: 12px; margin-top: 24px; color: rgba(255, 255, 255, .7); font-size: .9rem; }
.km-hvem b { display: block; color: #fff; }
.km-avatar { flex: none; width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }

.km-sitat-tall {
	display: flex;
	align-items: baseline;
	gap: 10px;
	margin-top: 22px;
	padding-top: 18px;
	border-top: 1px solid rgba(255, 255, 255, .14);
	color: rgba(255, 255, 255, .75);
	font-size: .9rem;
}

.km-sitat-tall b { flex: none; color: var(--aksent); font-family: var(--pf-tittel); font-size: 1.8rem; font-weight: 800; }

@media (max-width: 999px) {
	.km-rutenett { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.km-kol { display: contents; }
}

@media (max-width: 639px) {
	.km-rutenett { grid-template-columns: minmax(0, 1fr); }
	.km-kort--hoy { aspect-ratio: 1; }
}

@media (prefers-reduced-motion: reduce) {
	.km-foto,
	.km-lenke svg { transition: none; }
	.km-kort:hover .km-foto { transform: none; }
}
