/*NOTE: Font has been changed in bulma.min.css*/

:root {
    --primary: #285D50;
    --secondary: #D7E6CC;
    --tertiary: #EBF3E6;
    --link: #406496;
    --text: #2B2920;
    --bark: #645142;   
    --border: #D8D8D8;
    --accent-dark: #0F392F;
    --accent-warm: #BCD5AA;
    --accent-cool: #D2EFE8;

    /* Primary with opacity, from Figma */
    --primary-hover: #285D5014;      /* 8%, hover background */
    --primary-light: #285D5021;      /* 13%, filled tag */
    --primary-card-hover: #285D5038; /* 22%, card hover */
    --primary-line: #285D5040;       /* 25%, divider lines */
    --primary-outline: #285D5066;    /* 40%, outlined tag */

    /* Between tertiary and secondary, from Figma */
    --secondary-light: #E1ECD9; /* oppgave sidebar */

    /* Link buttons (templates/_includes/_linkbutton.twig), from Figma */
    --box-border: #578177;

    /* Form greys, from Figma */
    --grey: #77797B;       /* input borders, disabled text */
    --grey-light: #C9CACB; /* disabled checkbox */
    --grey-dark: #5B5D60;  /* small print. Figma has it at 80% opacity, which is too light for WCAG */
}

.has-color-primary {
    color: var(--primary) !important
}
.has-color-bark {
	color: var(--bark) !important;
}
.has-color-text {
	color: var(--text) !important;
}
.has-color-link {
	color: var(--link) !important;
}

.has-background-primary {
    background: var(--primary) !important
}
.has-background-secondary {
    background: var(--secondary) !important
}
.has-background-tertiary {
	background: var(--tertiary) !important;
}
.has-background-bark {
	background: var(--bark) !important;
}

.has-line-height-1 {
	line-height: 1;
}
.has-line-height-2 {
	line-height: 1.2;
}
.has-line-height-5 {
	line-height: 2.5;
}

.is-size-5_5 {
	font-size: 1.1rem !important;
}
.is-size-13px {
	font-size: 0.8125rem !important;
}
.is-size-14px {
	font-size: 0.875rem !important;
}
.is-size-15px {
	font-size: 0.9375rem !important;
}
.is-size-18px {
	font-size: 1.125rem !important;
}
.is-size-21px {
	font-size: 1.3125rem !important;
}

/* Mobile variants, same idea as Bulma's is-size-*-mobile */
@media screen and (max-width: 768px) {
	.is-size-13px-mobile {
		font-size: 0.8125rem !important;
	}
	.is-size-14px-mobile {
		font-size: 0.875rem !important;
	}
	.is-size-15px-mobile {
		font-size: 0.9375rem !important;
	}
	/* Not Bulma's is-size-6-mobile: Bulma loads first, so it loses to the px classes above */
	.is-size-16px-mobile {
		font-size: 1rem !important;
	}
	.is-size-18px-mobile {
		font-size: 1.125rem !important;
	}
	.is-size-30px-mobile {
		font-size: 1.875rem !important;
	}
	/* Page titles (h1.is-size-1) are 30px on mobile, Bulma keeps 3rem */
	.is-size-1 {
		font-size: 1.875rem !important;
		line-height: 1.25;
	}
}
/* Tablet only: page titles 40px, and the front page intro text 18px */
@media screen and (min-width: 769px) and (max-width: 1023px) {
	.is-size-1 {
		font-size: 2.5rem !important;
		line-height: 1.25;
	}
	.frontpage-hero p.is-size-5 {
		font-size: 1.125rem !important;
	}
}

.has-opacity-7 {
	opacity: 0.7;
}
.has-opacity-6 {
	opacity: 0.6;
}
.has-opacity-5 {
	opacity: 0.5;
}

.border-default {
	border: 1px solid #E7E7E7;
}

.border-t-none {
	border-top: none !important;
}

.border-none {
	border: none !important;
}

.shadow-none {
	box-shadow: none !important;
}

.border-b-active-white {
	position: relative;
	bottom: -1px;
	border-bottom: 1px solid white;
}

.has-height-100 {
	height: 100% !important;
}

.is-flex-column {
	display: flex;
	flex-direction: column;
}

.columns.is-variable .column {
	padding-bottom: var(--columnGap);
	padding-top: var(--columnGap);
}

.mt-auto {
	margin-top: auto;
}

@media screen and (min-width: 769px) {
	.has-min-width-350-tablet {
		min-width: 150px;
	}
}

/* Long words (e.g. "Undervisningsopplegg") must not go outside the screen on small views.
   hyphens needs lang on <html> and a dictionary in the browser, overflow-wrap breaks it anyway */
h1, h2, h3 {
	overflow-wrap: break-word;
}
@media screen and (max-width: 768px) {
	h1, h2, h3 {
		hyphens: auto;
	}
}

.content h2 {
	margin-top: 2em;
}
.content h2:not(:first-child) {
	margin-top: 2em;
}
.content p:not(:last-child) {
	margin-bottom: 0.5em;
	margin-top: 1em;
}

.content ul {
	list-style: none;
	margin-top: 0.5em;
}

.content ul li::before {
	content: "\2022";
	font-size: 1.5em;
	color: var(--bark);
	font-weight: bold;
	display: inline-block;
	width: 1em;
	margin-left: -1em;
	/* The big bullet stays on the text baseline without making the first line taller */
	line-height: 0;
}

.content li+li {
	margin-top: 0.5em;
}

.content a.anchor {
	display: none;
}
.content a {
	text-decoration: underline;
}

.box {
	border-radius: 3px;
	box-shadow: 2px 2px 8px var(--secondary);
	transition: box-shadow ease 0.25s;
}

a {
    color: var(--link)
}

a.box:focus,
a.box:hover {
	box-shadow: 0 0.5em 1em -0.125em var(--secondary);
}

a.box:active {
	box-shadow: none;
}

hr {
    opacity: 0.2;
	background-color: var(--bark);
}

/*bulma-carousel overrides */

@media screen and (min-width: 769px) {
.carousel {
	overflow: hidden;
}
}

.carousel .slider:focus {
	outline: none;
}

.carousel .slider-pagination {
	position: initial;
}

.carousel .slider-pagination .slider-page {
	background: #C4C4C4;
}
.carousel .slider-pagination .slider-page.is-active {
	background: var(--primary); /*Or*/
}
.carousel .slider-navigation-previous {
	left: 8px;
}
.carousel .slider-navigation-next {
	right: 8px;
}

.navbar-item {
	color: var(--primary) !important;
}
.navbar-item:focus,
.navbar-item:hover {
	color: var(--accent-dark) !important;
}
.navbar-item .has-color-link {
	color: var(--link) !important;
}
.navbar-item img {
	max-height: none;
}

.navbar-link {
	color: var(--primary) !important;
}
.navbar-link:focus,
.navbar-link:hover {
	color: var(--accent-dark) !important;
}

.navbar-link::after {
	border-color: var(--primary) !important;
}
.navbar-link:focus::after,
.navbar-link:hover::after {
    border-color: var(--accent-dark) !important;
}

.icon .triangle-or-collapse-auto,
.icon .triangle-or-down {
	width: 0;
	height: 0;
	border-left: 10px solid transparent;
	border-right: 10px solid transparent;
	border-top: 10px solid var(--text); 
	border-radius: 3px;
}
.is-active .icon .triangle-or-collapse-auto,
.icon .triangle-or-up {
	width: 0;
	height: 0;
	border-left: 10px solid transparent;
	border-right: 10px solid transparent;
	border-bottom: 10px solid #285D50;
	border-radius: 3px;
}

.is-active .icon .triangle-or-collapse-auto {
	border-top: none;
}

.has-color-collapse-auto {
	color: var(--text); 
}
.is-active .has-color-collapse-auto {
	color: var(--primary); 
}

.control .control-plain {
	background: none;
	border: none;
	box-shadow: none;
	border-bottom: 1px solid var(--border);
	border-radius: 0;
}

.control .control-plain::placeholder {
    color: var(--primary);  
    opacity: 0.8;
}

.navbar-brand, .navbar-tabs {
	align-items: center;
}

.navbar-burger {
    color: var(--primary);
    background: none;
    border: none;
    padding: 0;
}
.navbar-burger:focus,
.navbar-burger:hover {
	color: var(--accent-dark); /*Or*/
	background-color: transparent;
}

/* Wider lines than Bulma's, the X in .is-active follows the new spacing */
.navbar-burger span {
	height: 1.5px;
	width: 22px;
	left: calc(50% - 11px);
}
.navbar-burger span:nth-child(1) {
	top: calc(50% - 7.75px);
}
.navbar-burger span:nth-child(2) {
	top: calc(50% - 0.75px);
}
.navbar-burger span:nth-child(3) {
	top: calc(50% + 6.25px);
}
.navbar-burger.is-active span:nth-child(1) {
	transform: translateY(7px) rotate(45deg);
}
.navbar-burger.is-active span:nth-child(3) {
	transform: translateY(-7px) rotate(-45deg);
}

/* Icon and text centred on the same line (Bulma 0.9.0 has no .icon-text) */
.icon-link {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
}

/* Pagination (templates/_includes/_pagination.twig): one centred row without borders, also on mobile */
.pagination {
	justify-content: center;
	flex-wrap: nowrap;
}
.pagination .pagination-previous {
	order: 1;
}
.pagination .pagination-list {
	order: 2;
	flex-grow: 0;
	flex-wrap: nowrap;
}
.pagination .pagination-next {
	order: 3;
}
.pagination .pagination-list li {
	flex-grow: 0;
}
.pagination .pagination-previous,
.pagination .pagination-next,
.pagination .pagination-link,
.pagination .pagination-ellipsis {
	flex-grow: 0;
	min-width: 3rem;
	height: 3rem;
	border: none;
	border-radius: 8px;
	box-shadow: none;
	color: var(--primary);
	font-weight: 600;
}
.pagination .pagination-previous:hover,
.pagination .pagination-next:hover,
.pagination .pagination-link:hover {
	background-color: var(--primary-hover);
	color: var(--accent-dark);
}
.pagination .pagination-link.is-current {
	background-color: var(--primary);
	color: white;
}
/* On the text, not the icon, so it goes away with the text on mobile */
.pagination .pagination-previous .icon + span {
	margin-left: 0.5rem;
}
.pagination .pagination-next span:not(.icon) {
	margin-right: 0.5rem;
}
.pagination-chevron-left {
	transform: rotate(180deg);
}

/* Oppgaver filter (templates/_oppgaver.twig) */
.oppgaver-filter {
	background: white;
	border-radius: 8px;
	padding: 1.25rem;
}
/* While a new filter/sort loads (script in _oppgaver.twig) */
/* The filter parts one by one, not the whole form: an open dropdown keeps its white background over the list */
#oppgaver.is-loading,
#oppgaverFilterForm.is-loading :is(h2, .button, .tags, legend, .filter-select-button, .filter-option) {
	opacity: 0.4;
	transition: opacity ease 0.2s;
}
#oppgaver.is-loading,
#oppgaverFilterForm.is-loading {
	pointer-events: none;
}
.oppgaver-filter fieldset {
	border: 0;
	padding: 0;
	margin: 0;
	min-width: 0;
}
@media screen and (max-width: 768px) {
	/* Opened with the Filter button */
	.oppgaver-filter:not(.is-open) {
		display: none;
	}
}

/* Outlined primary button: Nullstill filter, Filter, Print siden */
.button.button-outline {
	height: 3rem;
	border: 1px solid var(--primary);
	border-radius: 6px;
	background: white;
	color: var(--primary);
	font-size: 1.125rem;
	font-weight: 500;
}
/* Green focus ring instead of Bulma's blue */
.button.button-outline:focus,
.button.button-outline:focus:not(:active) {
	border-color: var(--primary);
	box-shadow: 0 0 0 0.125em var(--primary-line);
}
.button.button-outline:hover {
	border-color: var(--accent-dark);
	background: var(--primary-hover);
	color: var(--accent-dark);
}
.oppgaver-filter-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 1.5rem;
	height: 1.5rem;
	margin-left: 0.5rem;
	border-radius: 999px;
	background: var(--primary);
	color: white;
	font-size: 0.875rem;
}

/* Search and sort above the cards. Taller on mobile, as in Figma */
/* .control.has-icons-left in the selectors to beat Bulma's own */
.control.has-icons-left.oppgaver-search .input,
.oppgaver-sort select {
	height: 2.5rem;
	border: 1px solid var(--grey);
	border-radius: 6px;
	box-shadow: none;
	color: var(--text);
}
.control.has-icons-left.oppgaver-search .input {
	padding-left: 2.75rem;
}
.control.has-icons-left.oppgaver-search .input::placeholder {
	color: var(--text);
}
.control.has-icons-left.oppgaver-search .icon {
	width: 2.75rem;
	height: 2.5rem;
	color: var(--text);
}
.oppgaver-sort {
	height: 2.5rem;
}
.oppgaver-sort::after {
	border-color: var(--text) !important;
}
@media screen and (max-width: 768px) {
	.control.has-icons-left.oppgaver-search .input,
	.oppgaver-sort select,
	.oppgaver-sort {
		height: 3rem;
		font-size: 1.125rem;
	}
	.control.has-icons-left.oppgaver-search .icon {
		height: 3rem;
	}
}

/* Selected value, click to remove */
.tag.is-selected:not(body) {
	gap: 0.5rem;
	border-radius: 999px;
	padding-left: 0.75rem;
	padding-right: 0.75rem;
	background: var(--primary);
	color: white;
}
.tag.is-selected:not(body):hover {
	background: var(--accent-dark);
	text-decoration: none;
}

/* Multi select dropdown: a <details> with a panel that opens over the content */
.filter-select {
	position: relative;
}
.filter-select-button {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	/* min-height, so the button grows with padding when the text wraps (e.g. on tablet) */
	box-sizing: border-box;
	min-height: 3rem;
	padding: 0.5rem 1rem;
	line-height: 1.3;
	border: 1px solid var(--grey);
	border-radius: 3px;
	background: white;
	font-size: 1.125rem;
	list-style: none;
	cursor: pointer;
}
.filter-select-button::-webkit-details-marker {
	display: none;
}
.filter-select-button:focus-visible {
	outline: 2px solid var(--primary);
	outline-offset: 2px;
}
.filter-select-button svg {
	transition: transform ease 0.15s;
}
.filter-select[open] .filter-select-button svg {
	transform: rotate(180deg);
}
.filter-select-panel {
	position: absolute;
	top: calc(100% + 0.5rem);
	left: 0;
	right: 0;
	z-index: 30;
	max-height: 22rem;
	overflow-y: auto;
	padding: 0.5rem 0;
	border: 1px solid var(--border);
	border-radius: 3px;
	background: white;
	box-shadow: 0 4px 12px rgba(10, 10, 10, 0.12);
}
.filter-option {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.75rem 1.25rem;
	cursor: pointer;
}
.filter-option:hover {
	background: var(--primary-hover);
}
.filter-option.is-disabled {
	color: var(--grey);
	cursor: default;
	background: none;
}

/* Checkbox: grey outline, primary when checked, grey with a dash when disabled.
   The icons are data URIs, where CSS variables don't work, so the dash has --grey written out. */
.filter-option input[type="checkbox"] {
	appearance: none;
	flex-shrink: 0;
	width: 1.375rem;
	height: 1.375rem;
	margin: 0;
	border: 1.5px solid var(--grey);
	border-radius: 2px;
	background: white center / 1rem no-repeat;
	cursor: inherit;
}
.filter-option input[type="checkbox"]:checked {
	border-color: var(--primary);
	background-color: var(--primary);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 8.5l3.5 3.5L13 4.5'/%3E%3C/svg%3E");
}
.filter-option input[type="checkbox"]:disabled {
	border-color: var(--grey-light);
	background-color: var(--grey-light);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%2377797B' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M3 8h10'/%3E%3C/svg%3E");
}
.filter-option input[type="checkbox"]:focus-visible {
	outline: 2px solid var(--primary);
	outline-offset: 2px;
}

/* Oppgave sidebar (templates/_oppgave.twig) */
.oppgave-meta {
	padding: 1.5rem;
	background: var(--secondary-light);
}
.oppgave-meta .button.button-outline {
	background: transparent;
}
/* The print button above the title on mobile and tablet, smaller as in Figma */
.oppgave-print-top .button.button-outline {
	height: 2.625rem;
	background: transparent;
	font-size: 1rem;
}
.oppgave-meta section:not(:last-child) {
	margin-bottom: 2rem;
}
.oppgave-meta-heading {
	margin-bottom: 0.75rem;
	font-size: 1.375rem;
	font-weight: 600;
}
.oppgave-meta .tag:not(body):not(.is-outlined) {
	background-color: var(--accent-warm);
}
/* File links: the icon stays by the first line when the text wraps */
.oppgave-meta .icon-link {
	align-items: flex-start;
	gap: 0.5rem;
}
.oppgave-meta .fa-solid {
	font-size: 1.25rem;
	margin-top: 0.125rem;
}
/* One kompetansemål: tags, then the text, with a line between them */
.oppgave-meta-mal + .oppgave-meta-mal {
	margin-top: 1.25rem;
	padding-top: 1.25rem;
	border-top: 1px solid var(--primary-line);
}

/* Footer (templates/_layout.twig) */
@media screen and (max-width: 768px) {
	.footer-logo {
		width: 166px;
		height: auto;
	}
}

/* Site header (templates/_layout.twig) */
.site-header {
	padding: 1.5rem;
	margin: 0.5rem 0;
}
.navbar-chevron {
	transition: transform ease 0.15s;
}

/*
	The nav gets .is-collapsed from a script in _layout.twig when the full menu
	doesn't fit (always below 1024px). It then shows the burger menu at any width.
*/
.site-header .navbar:not(.is-collapsed) .navbar-collapsed-only,
.site-header .navbar.is-collapsed .navbar-expanded-only {
	display: none !important;
}

/* Phone header */
@media screen and (max-width: 1023px) {
	.site-header {
		padding: 0;
		margin: 0;
	}
	.site-header .navbar-brand {
		padding: 0.25rem 1rem;
		border-bottom: 1px solid var(--primary-line);
	}
	.site-header .navbar-brand img {
		width: 124px;
		height: auto;
	}
	.site-header .navbar-menu {
		padding: 1rem 1.75rem 1.5rem;
	}
}

/* Collapsed menu */
.site-header .is-collapsed .navbar-menu {
	background: none;
	box-shadow: none;
}
.site-header .is-collapsed .navbar-end {
	font-weight: 600 !important;
}
/* Line between items, not after the last one */
.site-header .is-collapsed .navbar-end > :is(a.navbar-item, .has-dropdown) + :is(a.navbar-item, .has-dropdown) {
	border-top: 1px solid var(--primary-line);
}
.site-header .is-collapsed .navbar-end > a.navbar-item,
.site-header .is-collapsed .navbar-link {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 0.875rem 0 !important;
	background: none !important;
}
.site-header .is-collapsed .navbar-link::after {
	display: none;
}
/* Links point right, submenus point down and turn up when open */
.site-header .is-collapsed .navbar-link .navbar-chevron {
	transform: rotate(90deg);
}
.site-header .is-collapsed .is-open .navbar-link .navbar-chevron {
	transform: rotate(-90deg);
}

/* Submenu: indented under its parent. !important beats the spacing helpers used for desktop */
.site-header .is-collapsed .has-dropdown:not(.is-open) .navbar-dropdown {
	display: none;
}
.site-header .is-collapsed .navbar-dropdown {
	padding: 0 0 0.75rem !important;
}
.site-header .is-collapsed .navbar-dropdown .navbar-item {
	padding: 0.5rem 0 0.5rem 1rem !important;
	color: var(--primary) !important;
	background: none !important;
}
.site-header .is-collapsed .navbar-dropdown .navbar-item:hover,
.site-header .is-collapsed .navbar-dropdown .navbar-item:focus {
	color: var(--accent-dark) !important;
}
.site-header .is-collapsed .navbar-dropdown .navbar-item p {
	color: var(--text);
	font-size: 0.875rem;
}

.site-header .is-collapsed .navbar-search {
	padding: 1.5rem 0 0;
}
.site-header .is-collapsed .navbar-search .control.has-icons-left .input {
	height: 3rem;
	padding-left: 3rem;
	border: 1px solid var(--text);
	border-radius: 8px;
	box-shadow: none;
}
.site-header .is-collapsed .navbar-search .control.has-icons-left .icon {
	height: 3rem;
	width: 3rem;
	color: var(--text);
}

/* Bulma only has the burger layout below 1024px, so repeat the parts we need above it */
@media screen and (min-width: 1024px) {
	.site-header .navbar.is-collapsed > .container {
		display: block;
	}
	.site-header .navbar.is-collapsed .navbar-burger {
		display: block;
	}
	.site-header .navbar.is-collapsed .navbar-menu {
		display: none;
		margin-right: 0;
		padding: 1rem 0 1.5rem;
	}
	.site-header .navbar.is-collapsed .navbar-menu.is-active,
	.site-header .navbar.is-collapsed .navbar-end,
	.site-header .navbar.is-collapsed .has-dropdown {
		display: block;
	}
	.site-header .navbar.is-collapsed .navbar-dropdown {
		display: block;
		position: static;
		min-width: 0;
		border: none;
		box-shadow: none;
		background: none;
		opacity: 1;
		pointer-events: auto;
		transform: none;
	}
}

.has-border-radius-3 {
	border-radius: 3px;
	overflow: hidden;
}

.has-border-radius-8 {
	border-radius: 8px;
	overflow: hidden;
}

/* Begrepsbase (templates/_begrepsbase.twig) */
.begrep-toggle {
	display: block;
}
.begrep-toggle.is-active {
	background: var(--accent-warm);
}
.begrep-chevron svg {
	transition: transform ease 0.15s;
}
.begrep-toggle.is-active .begrep-chevron svg {
	transform: rotate(180deg);
}
.content.begrep-body {
	background: white;
}
.content.begrep-body figure {
	margin: 0 0 1.25rem;
}
.content.begrep-body img {
	display: block;
	width: 100%;
	height: auto;
}

/* Begrep links in rich text, and their popover (script in _layout.twig, content from _begrep.twig) */
.content a[href*="/begrep/"],
.content a[href*="begrepsbase?begrep="] {
	color: inherit;
	text-decoration: underline dotted;
	text-decoration-thickness: 0.1em;
	text-underline-offset: 0.24em;
}
.content a[href*="/begrep/"].is-seen,
.content a[href*="begrepsbase?begrep="].is-seen {
	color: var(--primary);
}
.begrep-popover {
	position: absolute;
	z-index: 40;
	width: min(28rem, 100vw - 2rem);
	background: white;
	border: 1px solid var(--primary);
	border-radius: 3px;
	box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.1);
	color: var(--text);
	font-size: 1rem;
}
.begrep-popover:focus {
	outline: none;
}
.begrep-popover[hidden] {
	display: none;
}
/* Scrolls inside, so the arrow on the outer box isn't clipped */
.begrep-popover-body {
	max-height: 70vh;
	overflow-y: auto;
	padding: 1rem;
}
/* Arrow pointing at the word, a rotated square like the tag tooltip */
.begrep-popover::before {
	content: "";
	position: absolute;
	top: -0.375rem;
	left: calc(var(--arrow-left, 1.5rem) - 0.375rem);
	width: 0.75rem;
	height: 0.75rem;
	background: white;
	border-left: 1px solid var(--primary);
	border-top: 1px solid var(--primary);
	transform: rotate(45deg);
	/* Only the half outside the box, so it doesn't cover scrolled content */
	clip-path: polygon(0 0, 100% 0, 0 100%);
}
.begrep-popover.is-above::before {
	top: auto;
	bottom: -0.375rem;
	transform: rotate(225deg);
}
.begrep-popover img {
	display: block;
	width: 100%;
	height: auto;
	margin-bottom: 1rem;
}
.begrep-popover-title {
	font-size: 1.25rem;
	font-weight: 600;
	margin-bottom: 0.5rem;
}

@media print {
	html {
		font-size:12px;
	}

	.print-none {
		display: none !important;
	}
	.print-block {
		display: block !important;
	}
	.print-full-width {
		width: 100% !important;
	}
	.print-flex {
		display: flex !important;
		flex-direction: column;
	}
	.print-flex .print-flex-1 {
		order: 1;
	}
	.print-flex .print-flex-2 {
		order: 2;
	}
	.print-flex .print-flex-3 {
		order: 3;
	}

	/*Generic print rules*/
	html.print #toplinks {
		display: none !important;
	}
	html #navbarMenu {
		display: none !important;
	}
	html nav .navbar-burger {
		display: none !important;
	}
	/* The body class too: .has-background-tertiary (!important) otherwise wins over html body */
	html body,
	html body.has-background-tertiary {
		background: white !important;
	}
	/* Admin bar (craft-admin-bar plugin) for logged in users */
	admin-bar,
	.admin-bar,
	#admin-bar {
		display: none !important;
	}
	html article {
		padding-top: 0.5rem;
	}
	html footer {
		display: none !important;
	}
	.site-header .navbar-brand img {
		width: 6rem;
		height: auto;
		/* Black logo on paper */
		filter: brightness(0);
	}

	/* Print friendly pages ({% set printfriendy = true %}, e.g. _oppgave.twig):
	   black text, more space on the sides and all images half width, centred */
	html.print .has-color-primary {
		color: black !important;
	}
	/* Paper margins. The first page has a small top margin, so the logo is at the top of the paper */
	@page {
		margin: 1.5cm 2.5cm;
	}
	@page :first {
		margin-top: 0.5cm;
	}
	html.print .site-header,
	html.print .site-header .navbar-brand,
	html.print .site-header .navbar-brand .navbar-item {
		margin: 0;
		padding-top: 0;
	}
	html.print article figure,
	html.print article .content img {
		display: block;
		width: 50%;
		margin-left: auto;
		margin-right: auto;
	}
	html.print article figcaption,
	html.print .oppgave-image-caption {
		text-align: center;
	}
	/* Font sizes on paper: text 12px, headings a bit bigger, title about twice the text */
	html.print .print-flex-1 {
		font-size: 1rem !important;
	}
	html.print h1.is-size-1 {
		font-size: 2.25rem !important;
		margin-bottom: 2rem !important;
	}
	html.print .print-flex-1 > p.is-size-5 {
		font-size: 1.25rem !important;
	}
	html.print .content h2 {
		font-size: 1.35em;
		margin-top: 1.5em;
	}
	html.print .content h3 {
		font-size: 1.15em;
	}

	/* Oppgave sidebar boxed on its own page */
	.print-flex .print-flex-2 {
		break-before: page;
	}
	.oppgave-meta {
		border: 1px solid var(--border);
		background: none;
	}

	.slider-container {
		transition: none !important;
		display: block !important;
		transform: none !important;
	}

	.slider-container .slider-item[data-cloned="true"] {
		display: none !important;
	}

	.carousel .slider-navigation-previous,
	.carousel .slider-navigation-next {
		display: none !important;
	}
}

.carousel .slider-item img {
    max-height: 90vh;
}
.carousel .slider-item figure {
    text-align: center;
}
.pfont {
    font-weight: 500;
    font-size: 16px;
    line-height: 19px;
    color: var(--text);
}
.iframe-container{
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; 
    height: 0;
}
.iframe-container iframe{
    position: absolute;
    top:0;
    left: 0;
    width: 100%;
    height: 100%;
}

.task-tab-a {
    color: var(--primary) !important;
    background: #285D500F !important; /* primary with 0.06 opacity */
}
.task-tab-a:focus,
.task-tab-a:hover {
    background: var(--secondary) !important;
}

.layout-header-a {
    color: white !important;
}
.layout-header-a:focus,
.layout-header-a:hover {
    color: var(--accent-cool) !important;
}

/* Not available in Bulma 0.9.0. Underline values from Figma */
.is-underlined {
    text-decoration: underline;
    text-decoration-skip-ink: none;
    text-decoration-thickness: 0.05em;
    text-underline-offset: 0.24em;
    text-underline-position: from-font;
}
/* Hover on text links, e.g. "Se alle" and back links: dark text and a thicker underline */
.link-hover:is(:hover, :focus-visible) {
    color: var(--text) !important;
    text-decoration: underline;
    text-decoration-skip-ink: none;
    text-decoration-thickness: 0.1em;
    text-underline-offset: 0.24em;
}
.link-hover:is(:hover, :focus-visible) .is-underlined {
    text-decoration-thickness: 0.1em;
}
/* max-height is the fallback (cut without "…") where line-clamp is unsupported */
.is-line-clamp-3 {
    line-height: 1.5;
    max-height: 4.5em;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Sizes and colours from Figma */
.tag:not(body) {
    color: var(--text);
    background-color: var(--primary-light);
    border-radius: 3px;
    font-size: 1rem;
    height: 2rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}
.tag:not(body).is-outlined {
    background-color: transparent;
    box-shadow: inset 0 0 0 1px var(--primary-outline);
}

/* Link card (templates/_includes/_card.twig) */
/* Rounded without overflow: hidden on the card, so tag tooltips can go outside it */
.link-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: none;
    transition: background-color ease 0.15s, border-color ease 0.15s, box-shadow ease 0.15s;
}
.link-card .card-image {
    border-radius: 7px 7px 0 0;
    overflow: hidden;
}
.link-card:hover,
.link-card:focus-within,
.link-button:hover,
.link-button:focus-visible {
    /* primary with 0.22 opacity on white, so it looks the same on any section background */
    background: linear-gradient(var(--primary-card-hover), var(--primary-card-hover)), white;
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary); /* 2px border without moving the content */
}
/* Label left, tags right. Tags that don't fit continue on the next line, also right-aligned */
.link-card-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
}
.link-card-label {
    margin-right: auto;
    padding-right: 0.5rem;
}
/* The tags become items of .link-card-meta, so they wrap one by one together with the label */
.link-card-meta .tags {
    display: contents;
}
.link-card-meta .tags .tag {
    margin: 0;
}
/* Tag with a tooltip, e.g. "3 fag". Above the card link so it gets the hover */
.link-card .tag[data-tooltip] {
    position: relative;
    z-index: 1;
    cursor: default;
}
/* The box above the tag. Also on keyboard focus; Escape hides it with .is-tooltip-hidden (script in _layout.twig) */
.link-card .tag[data-tooltip]:is(:hover, :focus-visible):not(.is-tooltip-hidden)::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 0.625rem);
    left: var(--tooltip-left, -0.25rem); /* set by a script in _layout.twig when there's no room */
    width: max-content;
    max-width: min(18rem, calc(100vw - 2rem));
    padding: 0.75rem 1rem;
    border: 1px solid var(--primary);
    border-radius: 3px;
    background: white;
    color: var(--text);
    font-size: 1.125rem;
    line-height: 1.4;
    white-space: normal;
}
/* The arrow: a rotated square with two borders, on top of the box's bottom edge */
.link-card .tag[data-tooltip]:is(:hover, :focus-visible):not(.is-tooltip-hidden)::before {
    content: "";
    position: absolute;
    bottom: calc(100% + 0.25rem);
    left: calc(50% - 0.375rem);
    z-index: 1;
    width: 0.75rem;
    height: 0.75rem;
    border-right: 1px solid var(--primary);
    border-bottom: 1px solid var(--primary);
    background: white;
    transform: rotate(45deg);
}

/* Makes the whole card clickable through the title link */
.link-card-link::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}
.link-card-title {
    line-height: 1.3;
}
.link-card:hover .link-card-link,
.link-card:focus-within .link-card-link {
    /* No bold: a wider weight makes multi-line titles break in a new place */
    text-decoration-thickness: 0.1em;
}

/* Link button (templates/_includes/_linkbutton.twig) */
.link-button {
    align-items: flex-start;
    border: 1px solid var(--box-border);
    background: white;
    padding: 1.25rem 1.5rem;
    transition: background-color ease 0.15s, border-color ease 0.15s, box-shadow ease 0.15s;
}
.link-button .icon i {
    font-size: 2.75rem;
}
.link-button .media-left {
    margin-right: 1.5rem;
}
/* The arrow in the middle of the title's first line (24px x 1.3, 18px x 1.3 on mobile) */
.link-button .media-right {
    margin-top: 0.45rem;
}
.link-button-title {
    font-weight: 600;
    line-height: 1.3;
}
@media screen and (max-width: 768px) {
    .link-button {
        padding: 1rem 1.25rem;
    }
    .link-button .icon.is-large {
        width: 2.5rem;
        height: 2.5rem;
    }
    .link-button .icon i {
        font-size: 2rem;
    }
    .link-button .media-left {
        margin-right: 1.25rem;
    }
    .link-button .media-right {
        margin-top: 0.2rem;
    }
    .link-button-title {
        margin-bottom: 0.25rem !important;
    }
}

/* Newsletter block on the front page (templates/_frontpage.twig) */
.nyhetsbrev-box {
    background: white;
    border: 1px solid var(--box-border);
    border-radius: 8px;
    overflow: hidden;
}
.nyhetsbrev-content {
    padding: 3.5rem;
}
.nyhetsbrev-label {
    letter-spacing: 0.08em;
}
.nyhetsbrev-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.nyhetsbrev-list li + li {
    margin-top: 0.75rem;
}
.nyhetsbrev-smatekst {
    color: var(--grey-dark);
}
/* Image fills its part of the box, the text sets the height */
.nyhetsbrev-image {
    position: relative;
}
.nyhetsbrev-image img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
@media screen and (max-width: 768px) {
    .nyhetsbrev-content {
        padding: 1.5rem;
    }
}

/* Sections with alternating backgrounds and a curved divider (templates/_includes/_wave.twig)
   between them. The wave gets the colour of the next section. */
.wave-sections > .section:nth-child(odd) {
    background-color: var(--tertiary);
    --wave-color: var(--secondary);
}
.wave-sections > .section:nth-child(even) {
    background-color: var(--secondary);
    --wave-color: var(--tertiary);
    /* More air in the darker sections (e.g. snarveier and the newsletter block) */
    padding-top: 5rem;
    padding-bottom: 5rem;
}
.wave-sections > .section:not(:last-child) {
    position: relative;
    padding-bottom: 7rem;
}
.wave-sections > .section:last-child > .section-wave {
    display: none;
}
.section-wave {
    position: absolute;
    left: 0;
    bottom: -1px; /* avoids a hairline gap from rounding */
    display: block;
    width: 100%;
    height: 4.5rem; /* 72px, as in the design at 1440px wide */
    color: var(--wave-color, var(--secondary));
}
.wave-sections {
    overflow-x: hidden; /* 100vw below includes the scrollbar */
}
/* First section on the front page: no top padding on desktop (Bulma 0.9 has no responsive pt-0) */
@media screen and (min-width: 1024px) {
    .frontpage-hero {
        padding-top: 0;
    }
}
@media screen and (min-width: 769px) {
    /* Let the image go down behind the wave, and out towards the right edge of the window,
       but never past the edge of the widest container (Bulma fullhd: 1344px) */
    .hero-image {
        margin-bottom: -7rem;
        margin-right: max(50% - 50vw, 50% - 672px);
        padding-right: 0;
    }
    .hero-image img {
        display: block;
        width: 100%;
    }
}
@media screen and (max-width: 768px) {
    .wave-sections > .section:not(:last-child) {
        padding-bottom: 5rem;
    }
    .section-wave {
        height: 2.5rem;
    }
}
/* Bottom padding of the darker sections includes the wave */
.wave-sections > .section:nth-child(even):not(:last-child) {
    padding-bottom: 9.5rem;
}
@media screen and (max-width: 768px) {
    .wave-sections > .section:nth-child(even) {
        padding-top: 4rem;
        padding-bottom: 4rem;
    }
    .wave-sections > .section:nth-child(even):not(:last-child) {
        padding-bottom: 6.5rem;
    }
}
