:root {
    --space: 1rem;
}

@media (min-width: 800px) {
    :root {
        --space: 2rem;
    }
}

@media not print {
    body {
        padding: var(--space);
    }
}

main {
    display: flex;
    flex-direction: column;
    align-items: center;
    counter-reset: counter-level-1;
}

p a, p a:visited {
    color: var(--link-color, #00f);
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', 'Arial', 'Helvetica Neue', Helvetica, sans-serif
}

h2 {
    margin-bottom: calc(1 * var(--space));
}

h3 {
    margin-bottom: calc(0.75 * var(--space));
}

h2 svg {
    width: 2rem;
    height: 2rem;
}

h3 svg {
    width: 1.75rem;
    height: 1.75rem;
}

h2 svg, h3 svg {
    opacity: 0;
    transition: opacity 0.1s linear;
}

h2:hover svg, h3:hover svg {
    opacity: 0.6;
}

img {
    height: auto !important;
}

img[data-icon-name] {
    max-width: 20px !important;
    margin-right: 5px;
    position: relative;
    top: -2px;
    display: inline !important;
}

ul, ul li, ol, ol li {
    break-inside: auto;
    page-break-inside: auto;
}

ul li {
    margin-bottom: .5rem;
}

/**
    Counter-Stuff
*/
main > section > h2 {
    counter-increment: counter-level-1;
    counter-reset: counter-level-2;
}

main > section > section > h2:first-child, main > section > div > header > h3 {
    counter-increment: counter-level-2;
    counter-reset: counter-level-3;
}

main > section > section > section > h2:first-child, main > section > section > div > header > h3 {
    counter-increment: counter-level-3;
    counter-reset: counter-level-4;
}

main > section > section > section > section > h2:first-child, main > section > section > section > div > header > h3 {
    counter-increment: counter-level-4;
}

main > section > h2:before {
    content: counter(counter-level-1) ". ";
}

main > section > section > h2:before, main > section > div > header > h3:before {
    content: counter(counter-level-1) "." counter(counter-level-2) ". ";
}

main > section > section > section > h2:before, main > section > section > div > header > h3:before {
    content: counter(counter-level-1) "." counter(counter-level-2) "." counter(counter-level-3) ". ";
}

main > section > section > section > section > h2:before, main > section > section > section > div > header > h3:before {
    content: counter(counter-level-1) "." counter(counter-level-2) "." counter(counter-level-3) "." counter(counter-level-4) ". ";
}

ol > li::marker {
    content: counters(list-item, '.') '. ';
}

/**
    General spacing
*/
section, .section {
    margin-bottom: calc(3 * var(--space));
    width: 100%;
    max-width: 1200px;
    background: #fff;
}

.frame {
    margin-bottom: calc(1.5 * var(--space));
}

/**
    Content elements
*/
figure {
    margin: 0.25rem 0;
}

figure.image {
    border: 1px solid darkgrey;
}

figcaption {
    font-style: italic;
    opacity: 0.6;
    margin: .5rem 0 0 0;
}

.ce-image {
    display: grid;
    gap: var(--space);
}

.ce-image.ce-center .ce-gallery {
    justify-self: center;
}

.ce-image.ce-below .ce-gallery {
    order: 1;
}

@media (min-width: 800px) {
    .ce-image.ce-right, .ce-image.ce-left {
        grid-template-columns: 1fr 1fr;
    }

    .ce-image {
        gap: calc(2 * var(--space));
    }
}

.ce-image.ce-right .ce-bodytext {
    grid-row: 1 / 2;
    grid-column: 1 / 2;
}

.ce-focuspoint-bodytext {
    margin-bottom: var(--space);
}

.show-for-print {
    display: none;
}

a.to-top {
    position: fixed;
    right: 10px;
    bottom: 10px;
    text-decoration: none;
    padding: 10px;
    width: 40px;
    height: 40px;
    text-align: center;
    line-height: 15px;
    display: block;
    background: black;
    border: 1px solid black;
    color: white;
}

a.to-top:hover {
    color: black;
    background: white;
    cursor: pointer;
}

/**
    Sticky navigation
*/
@media (min-width: 1850px) {
    nav.section {
        position: fixed;
        left: 20px;
        max-width: 300px;
        display: inline-block;
        width: auto;
        background: none;
        margin-bottom: 0;
    }
}

nav li, nav summary {
    margin-bottom: 0.2rem;
}

nav ol {
    margin-bottom: 0.4rem !important;
}

summary {
    position: relative;
}

summary::marker {
    content: '';
}

summary:before {
    content: "►";
    float: left;
    position: absolute;
    left: -45px;
}

details details summary:before {
    left: -55px;
}

details[open] > summary:before {
    content: "▼";
}

nav a.active {
    color: var(--link-color, #00f);
}

/**
    Cover section
*/
section.cover {
    display: grid;
    justify-items: center;
    padding: calc(2 * var(--space)) 0;
    gap: calc(2 * var(--space));
}

/** RTE styles */
span.badge {
    background-color: #ececec;
    font-size: 75%;
    padding: .25em .5em;
    color: #505050;
    border-radius: .25rem;
    white-space: nowrap
}

span.badge--green {
    background-color: #c4f3c6;
    color: #215023;
}

span.badge--blue {
    background-color: #c4e8f3;
    color: #214550;
}

span.badge--red {
    background-color: #f2cece;
    color: #502121;
}


/* mbox */
.frame-layout-0 {
    --mbox-bg: #e0e0e0;
    --mbox-border-color: #adadad;
}

.frame-layout-1 {
    --mbox-bg: #e9f2fa;
    --mbox-border-color: #c5ddf3;
}

.frame-layout-2 {
    --mbox-bg: #dbebdb;
    --mbox-border-color: #9fcb9f;
}

.frame-layout-3 {
    --mbox-bg: #fcf1e2;
    --mbox-border-color: #f6dab1;
}

.frame-layout-4 {
    --mbox-bg: #f7e2e2;
    --mbox-border-color: #e9b1b1;
}

blockquote {
    display: grid;
    grid-template-columns: 2rem auto;
    gap: 1.25rem;
    align-items: center;
    background: var(--mbox-bg);
    border-left-color: var(--mbox-border-color);
}

blockquote .icon {
    background-color: var(--mbox-border-color);
    border-radius: 100%;
    width: 2rem;
    height: 2rem;
    display: grid;
    justify-content: center;
    align-content: center;
}

/* Service navigation */
.language-menu {
    display: flex;
    position: fixed;
    right: .5rem;
    top: .5rem;
    z-index: 2;
}

.language-menu ul, .language-menu ul li {
    list-style: none;
    padding: 0;
    margin: 0;
}

.language-menu ul li a {
    display: flex;
    align-items: center;
    text-decoration: none;
    padding: .35rem;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.9);
}

.language-menu ul li a:hover {
    color: var(--link-color, #00f);
}

.language-menu ul li ul {
    height: 0;
    overflow: hidden;
}

.language-menu ul li:hover ul {
    height: auto;
}

.language-menu .icon-actions-caret-down svg {
    max-width: 15px;
    max-height: 15px;
}

.language-menu > ul > li > a {
    pointer-events: none;
}

/* Print */

@media print {
    .show-for-print {
        display: block;
    }

    nav, a.to-top {
        display: none !important;
    }

    h2 {
        margin-top: 1rem;
        font-size: 1.5rem
    }

    h3 {
        margin-top: 1rem;
        font-size: 1.25rem;
    }

    p {
        margin-bottom: 1rem;
    }

    figure.image {
        max-height: 80vh;
        object-fit: contain;
    }

    figure.image > img {
        max-height: 80vh !important;
        height: auto !important;
        width: auto !important;
    }

    p > span {
        -webkit-print-color-adjust: exact;
    }

    main {
        display: block;
    }
}
