/* ---------------------------------------------------------
   1. DOKUMENT OG GRUNNLEGGENDE ELEMENTER
   --------------------------------------------------------- */

html {
    box-sizing: border-box;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    tab-size: 4;
    scroll-behavior: smooth;
    font-size: var(--font-size);
    height: 100%;
    margin: 0;    
}


*,
*:before, 
*:after {
  box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    outline: none;
    line-height: 1.6;
    vertical-align: baseline;
    font-weight: 400;
    min-height: 100vh;
    height: 100%;
    overflow-y: hidden;
    overflow-x: hidden;
    font-family: 'Raleway', sans-serif;
    -webkit-tap-highlight-color: transparent;    
    color: var(--text-main);
    background-color: var(--body-bg-color);
}

main,
header,
footer,
nav,
section,
article,
aside,
address,
figure,
figcaption,
details,
summary {
    display: block;
}

[hidden] {
    display: none !important;
}

template,
script,
style,
head,
title,
meta,
link,
base {
    color: inherit;
}


/* ---------------------------------------------------------
   2. OVERSKRIFTER OG TEKST
   --------------------------------------------------------- */

h1 {	font-size: 1.5em; margin: .67em 0; }
h2 {	font-size: 1.35em; margin: .83em 0;}
h2:not(:first-child) { margin-top: 4rem;} 
h3 {	font-size: 1.2em; font-weight: 600; margin: 1em 0; }
h4 {	font-size: 1em; font-weight: bold; margin: 1em 0; }
h5 {	font-size: 0.9em; font-weight: bold; margin: 1.67em 0; }
h6 {	font-size: 0.75em; font-weight: bold; margin: 2.33em 0; }

.index-container {
	padding: 0 1.5rem;
}

.header-count { counter-reset: h2;  }

	.header-count h2 {counter-reset: h3; }
	.header-count h3 {counter-reset: h4; }
	.header-count h4 {counter-reset: h5; }
	.header-count h5 {counter-reset: h6; }
	.header-count h2.nocount, .header-count h3.nocount, .header-count h4.nocount, .header-count h5.nocount { counter-reset: none }

	.header-count h2:before {counter-increment: h2; content: counter(h2) ".\0000a0\0000a0"}
	.header-count h3:before {counter-increment: h3; content: counter(h2) "." counter(h3) ".\0000a0\0000a0"}
	.header-count h4:before {counter-increment: h4; content: counter(h2) "." counter(h3) "." counter(h4) ".\0000a0\0000a0"}
	.header-count h5:before {counter-increment: h5; content: counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) ".\0000a0\0000a0"}
	.header-count h6:before {counter-increment: h6; content: counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) "." counter(h6) ".\0000a0\0000a0"}
	.header-count h2.nocount:before, .header-count h3.nocount:before, .header-count h4.nocount:before, .header-count h5.nocount:before, .header-count h6.nocount:before {content: none; counter-increment: none;}

	.header-count h2+aside, .header-count h2+main {
		counter-reset: table-label img-label math-label; 
	}


	.header-count .img-label {
		counter-increment: img-label;        
		margin-bottom: .5em;
	}

	.header-count .img-label::before {
		content: "Fig. " counter(h2) "." counter(img-label) "\0000a0\0000a0";
		display: inline;
		font-weight: bold;
	}
	
	.header-count .table-label {
		counter-increment: table-label;
		margin-bottom: .5em;
		font-size: .7rem;
	}

	.header-count .table-label::before {
		content: "Tabell " counter(h2) "." counter(table-label) "\0000a0\0000a0";
		display: inline;
		font-weight: bold;
	}  
		 
	.header-count .math-label {
		counter-increment: math-label;
		margin: .5em 0 1em 0;
		font-size: 0.85em;
		font-style: italic;        
	}

	.header-count .math-label::before {
		content: counter(h2) "." counter(math-label) "\0000a0\0000a0";

	}


p {
    margin: 1rem 0;
}

div,span {
    color: inherit;
}

strong,
b {
    font-weight: 700;
}

em,
i {
    font-style: italic;
}

small {
    font-size: 0.875em;
}

mark {
    padding: 0.1em 0.2em;
    background-color: #fff3a3;
    color: inherit;
}

del,
s {
    text-decoration: line-through;
}

ins,
u {
    text-decoration: underline;
}

sub,
sup {
    position: relative;
    font-size: 0.75em;
    line-height: 0;
    vertical-align: baseline;
}

sub {
    bottom: -0.25em;
}

sup {
    top: -0.5em;
}

abbr[title] {
    text-decoration: underline dotted;
    cursor: help;
}

cite {
    font-style: italic;
}

q {
    quotes: auto;
}

dfn {
    font-style: italic;
}

time {
    font-variant-numeric: tabular-nums;
}

wbr {
    display: inline;
}


/* ---------------------------------------------------------
   3. LENKER
   --------------------------------------------------------- */

a {
    color: var(--text-link);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
    cursor: pointer;
}

a:link.inherit, a:visited.inherit, a:active.inherit {
    line-height: inherit;
    color: inherit;
    text-decoration: inherit;
}

/* ---------------------------------------------------------
   4. LISTER
   --------------------------------------------------------- */

ul,
ol {
    margin-block: .5rem 1rem;
    padding-inline-start: 1.5rem;
}

ul {
    list-style-type: disc;
}

ol {
    list-style-type: decimal;
}

li {
    margin-block: 0;
}

li > ul,
li > ol {
    margin-block-end: 0;
}

dl {
    margin-block: 0 1em;
}

dt {
    font-weight: 600;
}

dd {
    margin-inline-start: 2em;
    margin-block-end: 0.5em;
}

::marker {
    font-size: 1.1rem;
    font-weight: bold;
    color: #293949;
} 

/* ---------------------------------------------------------
   5. SITATER, MATTE OG KODE
   --------------------------------------------------------- */

blockquote {
    margin: 1em 0;
    border-inline-start: 3px solid #3ba666;
    padding: .75rem 1rem .1rem 1rem;
    background-color: #fafafa;    
}

pre {
    margin-block: 0 1em;
    overflow: auto;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.875em;
    line-height: 1.5;
    white-space: pre;
}

math {
    font-size: 1.2em;
    background-color: #f2fff7;
    padding: 1.5rem 1rem;
    math-style: normal;
    width: 100%;
    overflow-x: auto;
}

mtext {
    padding-left: 2rem;
    font-family: initial;
    font-style: italic;
    color: #333333;
}

mtext::before {
    content: "- ";
    font-size: 1.3rem;
    display: contents
}

code,
kbd,
samp {
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.9em;
}

pre code {
    font-size: inherit;
}

kbd {
    padding: 0.1em 0.35em;
    border: 1px solid #d1d5db;
    border-radius: 3px;
}

hr {
    height: 0;
    margin-block: 1.5em;
    border: 0;
    border-top: 1px solid #d1d5db;
}


/* ---------------------------------------------------------
   6. SKJEMAER
   --------------------------------------------------------- */

form {
    margin: 0;
}

fieldset {
    min-width: 0;
    margin: 0;
    padding: 1em;
    border: 1px solid #d1d5db;
    border-radius: 4px;
}

legend {
    padding-inline: 0.4em;
    font-weight: 600;
}

label {
    display: inline-block;
    margin-block-end: 0.25em;
}

input,
select,
textarea {
    margin: 0;
    font: inherit;
}

a.button, button {
    margin: 0;
    display: inline-block;
    background: var(--bg-color-button-primary);
    color: var(--text-inverse-bright);
    font-size: .95rem;
    max-width: 100%;
    padding: 0.5
    rem 1.3rem;
    line-height: 1.3;
    border: 1px solid var(--bg-color-button-primary);
    font-family: 'Raleway', sans-serif;
    transition: all ease-in-out 0.2s;
    outline: none;
}

a.button:hover, button:hover, button:focus {
    cursor: pointer;
}

button.primary {
    background-color: var(--primary-color); 
    color: var(--text-inverse-bright);
    border: 1px solid var(--primary-color);
}
button.gray {
    background: var(--bg-color-button-secondary);
    color: var(--text-normal);
    border-color: var(--border-normal);
}

input,
select,
textarea {
    max-width: 100%;
}

input,
textarea,
select,
.drop-down-field {
    display: block;
    font-size: 1rem;
    padding: 0.5rem;
    line-height: 1.4;
    width: 100%;
    font-family: 'Raleway', sans-serif;
    color: var(--text-main);
    background-color: var(--bg-color-input);
    border: 1px solid var(--border-normal);
    border-radius: 2px;
    transition: background-color ease-in-out 0.3s;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.drop-down-field {
    height: 2.65rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="url"],
input[type="tel"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="month"],
input[type="week"],
input[type="file"],
select,
textarea {
    vertical-align: middle;
}

input[type="checkbox"],
input[type="radio"] {
    vertical-align: middle;
}

input[type="checkbox"] {
    position: relative;
    width: 42px;
    height: 22px;
    margin: 0 .8rem 0 0;
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid var(--border-normal);
    border-radius: 20px;
    background-color: var(--bg-color-input);
    outline: none;
    transition: all .25s;
}

input[type="checkbox"]:before {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 8px;
    margin: 3px;
    top: 0;
    left: 0;
    background-color: #999;
    transition: all .25s;
}

input[type="range"] {
    vertical-align: middle;
}

input[type="color"] {
    width: 3em;
    min-height: 2em;
    padding: 2px;
    vertical-align: middle;
}

input[type="file"] {
    max-width: 100%;
}

input[type="image"] {
    cursor: pointer;
}

input::placeholder,
textarea::placeholder {
    color: #6b7280;
    opacity: 1;
}

textarea {
    display: block;
    width: 100%;
    min-height: 5em;
    resize: vertical;
}

select {
    cursor: pointer;
}

select[multiple] {
    min-height: 6em;
}

option {
    font: inherit;
}

optgroup {
    font-weight: 600;
}

button {
    display: inline-block;
    padding: 0.4em 0.8em;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: #f3f4f6;
    color: inherit;
    text-align: center;
    cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: none;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

input:read-only,
textarea:read-only {
    background-color: #f9fafb;
}

input:required,
select:required,
textarea:required {
    color: inherit;
}

input:invalid,
select:invalid,
textarea:invalid {
    color: inherit;
}

input[type="submit"],
input[type="reset"],
input[type="button"],
button[type="submit"],
button[type="reset"],
button[type="button"] {
    cursor: pointer;
}

output {
    display: inline-block;
}

progress,
meter {
    vertical-align: middle;
}

progress {
    max-width: 100%;
}

datalist {
    color: inherit;
}


/* ---------------------------------------------------------
   7. TABELLER
   --------------------------------------------------------- */

table {
    border-collapse: collapse;
    border-spacing: 0;
    width: 100%;
}

caption {
    padding: 0.5em;
    font-weight: 600;
    text-align: left;
    caption-side: top;
}

thead,
tbody,
tfoot {
    vertical-align: middle;
}

tr {
    vertical-align: inherit;
}

th,
td {
    padding: 0.5em;
    text-align: left;
    vertical-align: top;
}

th {
    font-weight: 600;
}

th[scope="col"],
th[scope="row"] {
    font-weight: 600;
}


/* ---------------------------------------------------------
   8. BILDER OG MEDIER
   --------------------------------------------------------- */

img,
picture,
video,
canvas,
svg {
    vertical-align: inherit;
}

img,
video {
    height: initial;
}

img {
    border-style: none;
}

figure {
    margin: 1em 0;
}

figcaption {
    margin-block-start: 0.4em;
    font-size: 0.875em;
}

audio {
    max-width: 100%;
}

audio,
video {
    display: inline-block;
}

iframe {
    max-width: 100%;
    border: 0;
}

embed,
object {
    max-width: 100%;
}

source,
track {
    color: inherit;
}


/* ---------------------------------------------------------
   9. SEMANTISKE OMRÅDER OG INTERAKTIVE ELEMENTER
   --------------------------------------------------------- */

summary {
    display: list-item;
    cursor: pointer;
}

details > summary {
    font-weight: 600;
}

details[open] > summary {
    margin-block-end: 0.5em;
}

dialog {
    color: inherit;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 1.5em;
    max-width: min(90vw, 600px);
}

dialog::backdrop {
    background: rgb(0 0 0 / 45%);
}

menu {
    margin-block: 1em;
    padding-inline-start: 1.5em;
}

menuitem {
    color: inherit;
}

search {
    display: block;
}


/* ---------------------------------------------------------
   10. RUBRIKKER OG DATAGRUPPER
   --------------------------------------------------------- */

address {
    margin-block: 0 1em;
    font-style: normal;
}

data {
    color: inherit;
}

bdi {
    unicode-bidi: isolate;
}

bdo[dir="rtl"] {
    direction: rtl;
}

bdo[dir="ltr"] {
    direction: ltr;
}


/* ---------------------------------------------------------
   11. SVG OG GRAFIKK
   --------------------------------------------------------- */

svg {
    overflow: hidden;
}

svg:not(:root) {
    overflow: hidden;
}

svg text {
    font-family: inherit;
}

svg a {
    cursor: pointer;
}


/* ---------------------------------------------------------
   12. TILGJENGELIGHET OG FOKUS
   --------------------------------------------------------- */

:focus-visible {
    outline-color: #2563eb;
}

:disabled {
    cursor: not-allowed;
}

[aria-hidden="true"] {
    color: inherit;
}

[aria-current="page"] {
    font-weight: 600;
}

[aria-expanded="true"] {
    color: inherit;
}

[aria-invalid="true"] {
    outline-color: #dc2626;
}

[aria-busy="true"] {
    cursor: progress;
}

[aria-disabled="true"] {
    color: inherit;
}


/* ---------------------------------------------------------
   13. RESPONSIVE MEDIER
   --------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

@media print {
    body {
        background: white;
        color: black;
    }

    a {
        color: inherit;
        text-decoration: underline;
    }

    button,
    input[type="submit"],
    input[type="button"],
    input[type="reset"] {
        display: none;
    }

    img,
    video,
    figure,
    table {
        break-inside: avoid;
    }
}


/* HELPERS */

.no-text-wrap {
    white-space: nowrap;
    text-overflow: ellipsis;
    text-wrap: nowrap;
    overflow: hidden;
}    
