/**
 * Base: fonter, design tokens, nullstilling, typografi og brødtekst (.prose).
 * Mobil først. Brytpunkter: 640, 900, 960 (meny), 1100 px.
 */

/* Fonter ------------------------------------------------------------------ */

@font-face {
	font-family: "Plus Jakarta Sans";
	font-style: normal;
	font-weight: 200 800;
	font-display: swap;
	src: url("../fonts/plus-jakarta-sans-latin-wght-normal.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
	font-family: "Plus Jakarta Sans";
	font-style: italic;
	font-weight: 200 800;
	font-display: swap;
	src: url("../fonts/plus-jakarta-sans-latin-wght-italic.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Reservefont med tilnærmet like mål, for mindre layoutforskyvning når fonten byttes inn. */
@font-face {
	font-family: "Plus Jakarta Sans Fallback";
	src: local("Arial");
	size-adjust: 104%;
	ascent-override: 98%;
	descent-override: 21%;
	line-gap-override: 0%;
}

/* Tokens ------------------------------------------------------------------ */

:root {
	--color-navy: #0b1f44;
	--color-navy-soft: #1a2f57;
	--color-blue: #1264c8;
	--color-blue-dark: #0d51a6;
	--color-blue-light: #eaf3ff;
	--color-background: #f7f9fc;
	--color-surface: #ffffff;
	--color-text: #0b1f44;
	--color-text-muted: #536580;
	--color-border: #dce4ee;
	--color-border-strong: #c3d1e2;
	--color-gold: #f0b66d;
	--color-gold-light: #fdf2e3;
	--color-focus: var(--color-blue);

	--font-sans: "Plus Jakarta Sans", "Plus Jakarta Sans Fallback", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

	--fs-xs: 0.8125rem;
	--fs-sm: 0.875rem;
	--fs-base: 1rem;
	--fs-md: 1.0625rem;
	--fs-lead: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
	--fs-card: clamp(1.0625rem, 1.03rem + 0.15vw, 1.1875rem);
	--fs-h3: clamp(1.25rem, 1.15rem + 0.4vw, 1.4375rem);
	--fs-h2: clamp(1.625rem, 1.3rem + 1.2vw, 2.125rem);
	--fs-h1: clamp(2.25rem, 1.75rem + 1.9vw, 3rem);
	--fs-hero: clamp(2.125rem, 1.6rem + 2.1vw, 3.25rem);

	--container: 1240px;
	--container-narrow: 760px;
	--container-medium: 960px;
	--gutter: clamp(1rem, 0.6rem + 1.8vw, 2rem);
	--gap: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem);
	--space-section: clamp(2.5rem, 1.9rem + 2.2vw, 4rem);

	--radius-card: 14px;
	--radius-sm: 8px;
	--radius-pill: 999px;

	--header-height: 60px;
	--shadow-pop: 0 12px 32px rgba(11, 31, 68, 0.1);
	--ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (min-width: 960px) {
	:root {
		--header-height: 72px;
	}
}

/* Nullstilling ------------------------------------------------------------ */

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
	html {
		scroll-behavior: smooth;
	}
}

body {
	margin: 0;
	background: var(--color-background);
	color: var(--color-text);
	font-family: var(--font-sans);
	font-size: var(--fs-base);
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

img,
svg,
video,
iframe {
	display: block;
	max-width: 100%;
}

img {
	height: auto;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
blockquote,
dl,
dd {
	margin: 0;
}

h1,
h2,
h3,
h4 {
	font-weight: 800;
	line-height: 1.15;
	letter-spacing: -0.02em;
	text-wrap: balance;
}

a {
	color: var(--color-blue);
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

a:hover {
	color: var(--color-blue-dark);
}

button,
input,
select,
textarea {
	font: inherit;
	color: inherit;
}

button {
	cursor: pointer;
}

:where(ul[class], ol[class]) {
	margin: 0;
	padding: 0;
	list-style: none;
}

:focus-visible {
	outline: 3px solid var(--color-focus);
	outline-offset: 2px;
	border-radius: 4px;
}

[hidden] {
	display: none !important;
}

/* Tilgjengelighet --------------------------------------------------------- */

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.skip-link {
	position: absolute;
	top: 8px;
	left: 8px;
	z-index: 1000;
	padding: 12px 18px;
	background: var(--color-navy);
	color: #fff;
	font-weight: 700;
	border-radius: var(--radius-sm);
	transform: translateY(-200%);
}

.skip-link:focus {
	transform: none;
	color: #fff;
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}

/* Brødtekst i artikler og sider ------------------------------------------- */

.prose {
	font-size: var(--fs-md);
	line-height: 1.75;
	overflow-wrap: break-word;
}

@media (min-width: 900px) {
	.prose {
		font-size: 1.125rem;
	}
}

.prose > * + * {
	margin-top: 1.25em;
}

.prose h2 {
	margin-top: 2.2em;
	font-size: clamp(1.5rem, 1.3rem + 0.8vw, 1.875rem);
	scroll-margin-top: calc(var(--header-height) + 24px);
}

.prose h3 {
	margin-top: 1.8em;
	font-size: var(--fs-h3);
	letter-spacing: -0.015em;
	scroll-margin-top: calc(var(--header-height) + 24px);
}

.prose h4 {
	margin-top: 1.6em;
	font-size: 1.0625em;
	letter-spacing: 0;
}

.prose h2 + *,
.prose h3 + *,
.prose h4 + * {
	margin-top: 0.6em;
}

.prose > :first-child {
	margin-top: 0;
}

.prose ul,
.prose ol {
	padding-left: 1.3em;
}

.prose li + li {
	margin-top: 0.4em;
}

.prose li::marker {
	color: var(--color-blue);
	font-weight: 700;
}

.prose strong {
	font-weight: 700;
}

.prose blockquote {
	padding-left: 1.25em;
	border-left: 3px solid var(--color-blue);
	font-size: 1.1em;
	font-style: italic;
	color: var(--color-navy-soft);
}

.prose hr {
	margin-block: 2.5em;
	border: 0;
	border-top: 1px solid var(--color-border);
}

.prose img {
	border-radius: 12px;
}

.prose figure figcaption,
.prose .wp-caption-text {
	margin-top: 0.6em;
	font-size: var(--fs-sm);
	color: var(--color-text-muted);
}

.prose table {
	display: block;
	width: 100%;
	max-width: 100%;
	overflow-x: auto;
	border-collapse: collapse;
	font-size: 0.9em;
	line-height: 1.5;
}

.prose th,
.prose td {
	padding: 12px 14px;
	border-bottom: 1px solid var(--color-border);
	text-align: left;
	vertical-align: top;
}

.prose th {
	background: var(--color-blue-light);
	font-weight: 700;
	white-space: nowrap;
}

.prose iframe {
	width: 100%;
	border: 0;
	border-radius: 12px;
}

/* Justeringsklasser fra klassisk editor. */
.aligncenter {
	margin-inline: auto;
}

.wp-caption {
	max-width: 100%;
}

@media (min-width: 640px) {
	.alignleft {
		float: left;
		max-width: 50%;
		margin: 0.4em 1.5em 1em 0;
	}

	.alignright {
		float: right;
		max-width: 50%;
		margin: 0.4em 0 1em 1.5em;
	}
}
