/* Forside (forslag, /ny-forside/). Lastes bare på sider som har blokken med klassen pk-fs.
   Samme farger og font som resten av nettstedet; samme kurver og regler for bevegelse som katalogen:
   kun transform/opacity/clip-path, hover bare med mus, alt dempet ved prefers-reduced-motion. */

.pk-fs {
	--fs-tekst: #222;
	--fs-dempet: #45454d;
	--fs-flate: #f2f3f5;
	--fs-kant: #c9c9d2;
	--fs-radius: 24px;
	--fs-ease: cubic-bezier(0.23, 1, 0.32, 1);
	--fs-skygge: 0 1px 2px rgba(0, 0, 0, .06), 0 12px 32px rgba(0, 0, 0, .10);
	color: var(--fs-tekst);
	overflow-x: clip;
}

.pk-fs :focus-visible {
	outline: 3px solid var(--fs-tekst);
	outline-offset: 3px;
}

/* ---------- Seksjoner og bredde ---------- */

/* Klassisk tema: WordPress pakker innholdet i hver gruppe i .wp-block-group__inner-container (med padding fra GP).
   Den ekstra boksen fjernes, så gruppene våre styrer layout selv (rutenett, flex, bredde). */
.pk-fs .wp-block-group__inner-container {
	display: contents;
}

.pk-fs .pk-fs-seksjon {
	margin: 0;
	padding-block: clamp(3rem, 6vw, 5rem);
}

.pk-fs .pk-fs-inner {
	max-width: 1200px;
	margin-inline: auto;
	padding-inline: clamp(1.25rem, 4vw, 2.5rem);
}

.pk-fs-flate {
	background: var(--fs-flate);
}

.pk-fs h1,
.pk-fs h2,
.pk-fs h3 {
	color: var(--fs-tekst);
	text-wrap: balance;
}

.pk-fs h2 {
	font-size: clamp(1.75rem, 3.5vw, 2.5rem);
	line-height: 1.15;
	letter-spacing: -.015em;
	margin: 0 0 1.25rem;
}

.pk-fs h3 {
	font-size: 1.2rem;
	line-height: 1.25;
	margin: 0 0 .5rem;
}

.pk-fs p,
.pk-fs li {
	font-size: 1.075rem;
	line-height: 1.7;
	text-wrap: pretty;
}

.pk-fs .pk-fs-ingress {
	font-size: clamp(1.15rem, 2vw, 1.35rem);
	line-height: 1.5;
}

.pk-fs .wp-block-columns {
	gap: clamp(2rem, 6vw, 5rem);
	align-items: center;
	margin: 0;
}

.pk-fs .wp-block-column > :last-child {
	margin-bottom: 0;
}

/* ---------- Bilder ---------- */

.pk-fs .wp-block-image {
	margin: 0;
}

.pk-fs .wp-block-image img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 5 / 4;
	object-fit: cover;
	border-radius: var(--fs-radius);
}

/* ---------- Knapper ---------- */

.pk-fs .wp-block-buttons {
	gap: .75rem;
	margin-top: 2rem;
}

.pk-fs .wp-block-button a.wp-block-button__link {
	display: inline-flex;
	align-items: center;
	min-height: 52px;
	padding: .75rem 1.6rem;
	border: 1px solid #222;
	border-radius: 999px;
	background: #222;
	color: #fff;
	font-size: 1.05rem;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	transition: transform 160ms var(--fs-ease), background-color 160ms ease, color 160ms ease;
}

.pk-fs .wp-block-button a.wp-block-button__link:hover,
.pk-fs .wp-block-button a.wp-block-button__link:focus-visible {
	background: #000;
	color: #fff;
}

.pk-fs .wp-block-button.is-style-outline a.wp-block-button__link {
	background: transparent;
	color: #222;
}

.pk-fs .wp-block-button.is-style-outline a.wp-block-button__link:hover,
.pk-fs .wp-block-button.is-style-outline a.wp-block-button__link:focus-visible {
	background: #222;
	color: #fff;
}

.pk-fs .wp-block-button a.wp-block-button__link:active {
	transform: scale(0.97);
}

/* ---------- Toppen ---------- */

.pk-fs .pk-fs-helt {
	padding-top: clamp(2rem, 5vw, 4.5rem) !important;
}

@media (min-width: 782px) {
	.pk-fs-helt .wp-block-column:first-child {
		flex: 1 1 44%;
	}

	.pk-fs-helt .wp-block-column:last-child {
		flex: 1 1 56%;
	}
}

.pk-fs-helt h1 {
	font-size: clamp(2.5rem, 5.4vw, 4.25rem);
	line-height: 1.03;
	letter-spacing: -.03em;
	margin: 0 0 1.5rem;
}

/* «Velkommen til» som liten linje over navnet, men fortsatt en del av H1 (leses som én setning). */
.pk-fs-helt h1 .pk-fs-h1-intro {
	display: block;
	margin-bottom: .5rem;
	font-size: clamp(1.15rem, 1.8vw, 1.4rem);
	font-weight: 500;
	line-height: 1.3;
	letter-spacing: 0;
	color: var(--fs-dempet);
}

.pk-fs .pk-fs-slagord {
	display: inline-flex;
	margin: 0 0 1.5rem;
	padding: .4rem 1rem;
	font-size: .95rem;
	font-style: italic;
	font-weight: 600;
	color: var(--fs-tekst);
	background: var(--fs-flate);
	border: 1px solid var(--fs-kant);
	border-radius: 999px;
}

.pk-fs-helt .pk-fs-ingress {
	margin-bottom: 1rem;
}

.pk-fs-helt p:not([class]) {
	color: var(--fs-dempet);
	max-width: 52ch;
}

.pk-fs-helt .wp-block-image img {
	aspect-ratio: 1;
	border-radius: 32px;
}

/* ---------- Sentrert topp i seksjoner ---------- */

.pk-fs .pk-fs-topp {
	max-width: 720px;
	margin: 0 auto clamp(2rem, 4vw, 3rem);
	text-align: center;
}

.pk-fs .pk-fs-topp p {
	color: var(--fs-dempet);
	margin: 0;
}

/* ---------- Kort ---------- */

.pk-fs .pk-fs-kort {
	display: grid;
	gap: 1.25rem;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
}

.pk-fs .pk-fs-kort--fire {
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
}

.pk-fs .pk-fs-kort__ett {
	display: flex;
	flex-direction: column;
	margin: 0;
	padding: clamp(1.5rem, 3vw, 2.25rem);
	background: #fff;
	border: 1px solid var(--fs-kant);
	border-radius: 20px;
	transition: transform 200ms var(--fs-ease), box-shadow 200ms var(--fs-ease);
}

.pk-fs .pk-fs-kort__ett p {
	margin: 0 0 1rem;
	color: var(--fs-dempet);
}

.pk-fs .pk-fs-kort__ett > :last-child {
	margin-bottom: 0;
}

.pk-fs .pk-fs-lenke {
	margin-top: auto !important;
	padding-top: .5rem;
}

.pk-fs .pk-fs-lenke a {
	display: inline-flex;
	align-items: center;
	gap: .4rem;
	min-height: 44px;
	color: var(--fs-tekst);
	font-weight: 600;
	text-decoration: none;
}

.pk-fs .pk-fs-lenke a span {
	display: inline-block;
	transition: transform 200ms var(--fs-ease);
}

/* Hele kortet er klikkbart via lenken (én lenke per kort for skjermlesere). */
.pk-fs-fagmiljo .pk-fs-kort__ett {
	position: relative;
}

.pk-fs-fagmiljo .pk-fs-lenke a::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
}

.pk-fs-fagmiljo .pk-fs-kort__ett:focus-within {
	outline: 3px solid var(--fs-tekst);
	outline-offset: 3px;
}

.pk-fs-fagmiljo .pk-fs-lenke a:focus-visible {
	outline: none;
}

.pk-fs-fagmiljo .pk-fs-kort__ett:active {
	transform: scale(0.99);
}

/* Kjerneverdier: nummerering i hjørnet (dekorativt, via CSS-teller). */
.pk-fs-verdier .pk-fs-kort {
	counter-reset: verdi;
}

.pk-fs-verdier .pk-fs-kort__ett::before {
	counter-increment: verdi;
	content: counter(verdi, decimal-leading-zero);
	display: block;
	margin-bottom: 1.5rem;
	font-size: .9rem;
	font-weight: 600;
	letter-spacing: .08em;
	color: var(--fs-dempet);
}

@media (hover: hover) and (pointer: fine) {
	.pk-fs .pk-fs-kort__ett:hover {
		transform: translateY(-3px);
		box-shadow: var(--fs-skygge);
	}

	.pk-fs .pk-fs-kort__ett:hover .pk-fs-lenke a span {
		transform: translateX(3px);
	}
}

/* ---------- Lister ---------- */

.pk-fs .wp-block-list {
	list-style: none;
	margin: 1.25rem 0 0;
	padding: 0;
}

.pk-fs .wp-block-list li {
	position: relative;
	margin: 0 0 .85rem;
	padding-left: 2.25rem;
}

/* Hake i sirkel for punktlister. */
.pk-fs ul.wp-block-list li::before {
	content: "";
	position: absolute;
	left: 0;
	top: .3em;
	width: 1.4rem;
	height: 1.4rem;
	border-radius: 50%;
	background: #222 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center / 62% no-repeat;
}

/* Tall i sirkel for nummererte lister. */
.pk-fs ol.wp-block-list {
	counter-reset: punkt;
}

.pk-fs ol.wp-block-list li {
	counter-increment: punkt;
	padding-left: 3rem;
	margin-bottom: 1.1rem;
}

.pk-fs ol.wp-block-list li::before {
	content: counter(punkt);
	position: absolute;
	left: 0;
	top: .1em;
	display: grid;
	place-items: center;
	width: 2rem;
	height: 2rem;
	border-radius: 50%;
	border: 1px solid #222;
	font-size: .95rem;
	font-weight: 600;
	line-height: 1;
}

/* ---------- Bli med ---------- */

.pk-fs .pk-fs-blimed {
	padding-top: 0 !important;
}

.pk-fs .pk-fs-blimed__boks {
	padding: clamp(2.5rem, 7vw, 5rem) clamp(1.5rem, 6vw, 5rem);
	background: #222;
	color: #fff;
	border-radius: 32px;
	text-align: center;
}

.pk-fs .pk-fs-blimed__boks h2 {
	color: #fff;
	max-width: 22ch;
	margin-inline: auto;
}

.pk-fs .pk-fs-blimed__boks p {
	max-width: 62ch;
	margin: 0 auto .75rem;
	color: #e4e4e9;
}

.pk-fs .pk-fs-blimed__boks .pk-fs-ingress {
	color: #fff;
	margin-bottom: 1.25rem;
}

.pk-fs .pk-fs-blimed__boks .wp-block-buttons {
	justify-content: center;
}

.pk-fs .pk-fs-blimed__boks .wp-block-button a.wp-block-button__link {
	background: #fff;
	border-color: #fff;
	color: #222;
}

.pk-fs .pk-fs-blimed__boks .wp-block-button a.wp-block-button__link:hover,
.pk-fs .pk-fs-blimed__boks .wp-block-button a.wp-block-button__link:focus-visible {
	background: #e4e4e9;
	color: #222;
}

.pk-fs .pk-fs-blimed__boks .wp-block-button.is-style-outline a.wp-block-button__link {
	background: transparent;
	color: #fff;
}

.pk-fs .pk-fs-blimed__boks .wp-block-button.is-style-outline a.wp-block-button__link:hover,
.pk-fs .pk-fs-blimed__boks .wp-block-button.is-style-outline a.wp-block-button__link:focus-visible {
	background: #fff;
	color: #222;
}

.pk-fs .pk-fs-blimed__boks :focus-visible {
	outline-color: #fff;
}

/* ---------- Mobil ---------- */

@media (max-width: 781px) {
	/* Bildet først i alle delte seksjoner, så rytmen blir lik når kolonnene stables. */
	.pk-fs-delt:not(.pk-fs-delt--speil) .wp-block-column:last-child,
	.pk-fs-helt .wp-block-column:last-child {
		order: -1;
	}

	.pk-fs-helt .wp-block-image img {
		aspect-ratio: 4 / 3;
		border-radius: var(--fs-radius);
	}

	.pk-fs .pk-fs-slagord {
		font-size: .85rem;
		padding: .35rem .85rem;
	}

	.pk-fs .pk-fs-kort__ett {
		padding: 1.35rem 1.5rem;
	}

	.pk-fs-verdier .pk-fs-kort__ett::before {
		margin-bottom: .75rem;
	}

	.pk-fs .wp-block-buttons {
		flex-direction: column;
		align-items: stretch;
	}

	.pk-fs .wp-block-button a.wp-block-button__link {
		width: 100%;
		justify-content: center;
	}
}

/* ---------- Bevegelse ---------- */

@media (prefers-reduced-motion: no-preference) {
	/* Toppen toner inn ved første visning. Bildet animeres ikke i opasitet (påvirker ikke LCP). */
	.pk-fs-helt .wp-block-column:first-child > * {
		animation: pk-fs-inn 600ms var(--fs-ease) both;
	}

	.pk-fs-helt .wp-block-column:first-child > :nth-child(2) { animation-delay: 60ms; }
	.pk-fs-helt .wp-block-column:first-child > :nth-child(3) { animation-delay: 120ms; }
	.pk-fs-helt .wp-block-column:first-child > :nth-child(4) { animation-delay: 180ms; }
	.pk-fs-helt .wp-block-column:first-child > :nth-child(5) { animation-delay: 240ms; }

	.pk-fs-helt .wp-block-image img {
		animation: pk-fs-bilde 900ms var(--fs-ease) both;
	}

	/* Resten kommer rolig til syne når man scroller (der nettleseren støtter scroll-drevne animasjoner). */
	@supports (animation-timeline: view()) {
		.pk-fs-seksjon:not(.pk-fs-helt) .pk-fs-topp,
		.pk-fs-seksjon:not(.pk-fs-helt) .wp-block-column,
		.pk-fs-kort__ett,
		.pk-fs-blimed__boks {
			animation: pk-fs-inn linear both;
			animation-timeline: view();
			animation-range: entry 0% entry 35%;
		}

		.pk-fs-seksjon:not(.pk-fs-helt) .wp-block-image img {
			animation: pk-fs-avdekk linear both;
			animation-timeline: view();
			animation-range: entry 0% entry 55%;
		}
	}
}

@keyframes pk-fs-inn {
	from {
		opacity: 0;
		transform: translateY(16px);
	}
}

@keyframes pk-fs-bilde {
	from {
		transform: scale(0.96);
		clip-path: inset(6% round 32px);
	}
	to {
		clip-path: inset(0 round 32px);
	}
}

@keyframes pk-fs-avdekk {
	from {
		clip-path: inset(10% 10% 10% 10% round var(--fs-radius));
		transform: scale(1.04);
	}
	to {
		clip-path: inset(0 round var(--fs-radius));
		transform: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.pk-fs *,
	.pk-fs *::before,
	.pk-fs *::after {
		transition-property: opacity, background-color, color !important;
	}

	.pk-fs .wp-block-button a.wp-block-button__link:active,
	.pk-fs .pk-fs-kort__ett:hover,
	.pk-fs .pk-fs-kort__ett:active,
	.pk-fs .pk-fs-kort__ett:hover .pk-fs-lenke a span {
		transform: none;
	}
}
