/* =========================================================
   GRUNDSTIL
   ========================================================= */

body {
    margin: 0;
    font-family: sans-serif;
    background: #ffffff;
    color: #222;
    font-size: 0.8em;
}

.wrapper {
    max-width: 1200px;
    margin: auto;
    padding: 20px;
}

.small {
    font-size: 0.6em;
}


/* =========================================================
   GENERELLE LINKS
   ========================================================= */

a {
    color: #222;
    text-decoration: none;
}

a:hover {
    color: #000;
}


/* =========================================================
   HEADER / LOGO
   ========================================================= */

header {
    height: 110px;
    display: flex;
    align-items: center;

    padding: 10px 0;
    margin-bottom: 20px;

    background: #ffffff;
    border: 1px dotted rgba(0, 0, 0, 0.4);
}

header img {
    max-width: 100%;
    max-height: 100%;
    display: block;
}


/* =========================================================
   MENU – GENERELT
   ========================================================= */

.menu {
    position: relative;
    z-index: 1000;
    margin-bottom: 30px;
}

.menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.menu-toggle {
    display: none;
}

.burger {
    display: none;
}


/* =========================================================
   HOVEDMENU
   ========================================================= */

.main-menu {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.main-menu > li {
    position: relative;
}

.main-menu > li > a,
.main-menu > li > .submenu-button {
    display: flex;
    align-items: center;
    min-height: 38px;

    box-sizing: border-box;
    padding: 8px 16px;

    border: 1px solid #222;
    background: #fff;
    color: #222;

    font: inherit;
    line-height: 1.2;
    white-space: nowrap;

    cursor: pointer;

    transition:
        background-color 0.2s,
        color 0.2s;
}


/* Farver på hovedmenuen */

.main-menu > li:nth-child(1) > a:hover,
.main-menu > li:nth-child(1) > a:focus-visible {
    background: #b3cfe3;
}

.main-menu > li:nth-child(2) > a:hover,
.main-menu > li:nth-child(2) > a:focus-visible {
    background: #d1beed;
}

.main-menu > li:nth-child(3) > a:hover,
.main-menu > li:nth-child(3) > a:focus-visible {
    background: #fff5c9;
}



.main-menu > li:nth-child(4) > .submenu-button:hover,
.main-menu > li:nth-child(4) > .submenu-button:focus-visible {
    background: #ffbb99;}

.main-menu > li:nth-child(4) > .submenu-button {
    color: #222;
    border-color: #222;
    
    }


/* =========================================================
   MENU-KNAPPER OG PILE
   ========================================================= */

.submenu-button {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;

    width: 100%;
    border: 0;

    background: #fff;
    color: #222;

    font: inherit;
    text-align: left;

    cursor: pointer;
}

.menu-arrow {
    display: inline-block;
    flex-shrink: 0;

    font-size: 0.85em;

    transition: transform 0.2s;
}


/* =========================================================
   UNDERMENUER
   ========================================================= */

.submenu {
    min-width: 220px;

    background: #fff;
    border: 1px solid #222;

    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition:
        opacity 0.15s,
        visibility 0.15s;
}

.submenu > li {
    position: relative;
}

.submenu > li + li {
    border-top: 1px solid rgba(0, 0, 0, 0.18);
}

.submenu a,
.submenu .submenu-button {
    display: flex;
    align-items: center;
    justify-content: space-between;

    box-sizing: border-box;
    width: 100%;
    min-height: 38px;

    padding: 9px 14px;

    background: #fff;
    color: #222;

    font: inherit;
    line-height: 1.3;
    white-space: normal;
}

.submenu a:hover,
.submenu a:focus-visible,
.submenu .submenu-button:hover,
.submenu .submenu-button:focus-visible {
    background: #f3f0ea;
}


/* Niveau 2: under Archive */

.level-2 {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
}


/* Niveau 3: ud til højre */

.level-3 {
    position: absolute;
    top: -1px;
    left: calc(100% + 4px);
}


/* =========================================================
   MENU ÅBNES VED HOVER PÅ COMPUTER
   ========================================================= */

@media (hover: hover) and (pointer: fine) {

    .has-submenu:hover > .submenu {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
}


/* =========================================================
   MENU LÅST ÅBEN VED KLIK
   ========================================================= */

.has-submenu.open > .submenu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}


/* Archive-pil */

.main-menu > .has-submenu.open
> .submenu-button
> .menu-arrow {
    transform: rotate(180deg);
}


/* Pile i niveau 2 */

.level-2 > .has-submenu.open
> .submenu-button
> .menu-arrow {
    transform: rotate(90deg);
}


/* =========================================================
   TASTATURFOKUS
   ========================================================= */

.menu a:focus-visible,
.menu button:focus-visible,
.burger:focus-visible {
    outline: 2px solid #222;
    outline-offset: 2px;
}


/* =========================================================
   MOBILMENU
   ========================================================= */

@media (max-width: 700px) {

    .burger {
        display: flex;
        align-items: center;
        gap: 8px;

        width: fit-content;
        box-sizing: border-box;

        padding: 8px 12px;
        margin-bottom: 8px;

        border: 1px solid #222;
        background: #fff;

        font-size: 14px;

        cursor: pointer;
        user-select: none;
    }

    .burger-symbol {
        font-size: 24px;
        line-height: 1;
    }

    .main-menu {
        display: none;
        flex-direction: column;
        gap: 6px;
    }

    #menuToggle:checked ~ .main-menu {
        display: flex;
    }

    .main-menu > li {
        width: 100%;
    }

    .main-menu > li > a,
    .main-menu > li > .submenu-button {
        width: 100%;
    }
    
    



    /* Undermenuer bliver en del af sidens almindelige flow */

    .submenu,
    .level-2,
    .level-3 {
        position: static;

        display: none;
        min-width: 0;

        margin: 5px 0 5px 14px;

        border: 0;
        border-left: 1px solid rgba(0, 0, 0, 0.45);

        box-shadow: none;

        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .has-submenu.open > .submenu {
        display: block;
    }


    /* Hover skal ikke udfolde menuer på mobil */

    .has-submenu:hover > .submenu {
        display: none;
    }

    .has-submenu.open:hover > .submenu {
        display: block;
    }

    .submenu > li + li {
        border-top: 0;
    }

    .submenu a,
    .submenu .submenu-button {
        padding-left: 18px;
        border-bottom: 1px solid rgba(0, 0, 0, 0.14);
    }


    /* Niveau 2-pile peger mod højre/nedad på mobil */

    .level-2 .menu-arrow {
        transform: rotate(90deg);
    }

    .level-2 > .has-submenu.open
    > .submenu-button
    > .menu-arrow {
        transform: rotate(270deg);
    }
}


/* =========================================================
   INTRO
   ========================================================= */

.intro h1 {
    margin-bottom: 10px;
}

.intro p {
    max-width: 700px;
    margin-bottom: 40px;

    line-height: 1.5;
}


/* =========================================================
   GALLERI
   ========================================================= */

.gallery {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;

    gap: 12px;
}


/* Fremhævede / nye værker */

.itemnew {
    position: relative;

    display: flex;

    width: auto;
    height: 400px;

    overflow: hidden;
    background: #fff;
}


/* Almindelige værker */

.item {
    position: relative;

    display: flex;

    width: auto;
    height: 220px;

    overflow: hidden;
    background: #fff;
}


/*
   Billederne beholder deres naturlige proportioner.
   Ingen object-fit: cover, da det ville beskære værkerne.
*/

.item img,
.itemnew img {
    display: block;

    width: auto;
    height: 100%;
    max-width: 100%;

    object-fit: contain;

    box-sizing: border-box;
    border: 0.5px solid rgba(0, 0, 0, 0.25);

    cursor: pointer;

    transition:
        transform 0.2s,
        filter 0.2s;
}

.item img:hover,
.itemnew img:hover {
    filter: brightness(1.05);
    transform: scale(1.01);
}


/* Tablet */

@media (max-width: 900px) {

    .item {
        width: calc(33.333% - 12px);
    }

    .item img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    .itemnew {
        max-width: 100%;
        height: 350px;
    }
}


/* Mobil */

@media (max-width: 600px) {

    .item,
    .itemnew {
        width: 100%;
        height: auto;

        justify-content: center;
    }

    .item img,
    .itemnew img {
        width: 100%;
        height: auto;
        max-height: none;

        object-fit: contain;
    }
}


/* =========================================================
   NUMMERERING PÅ VÆRKER
   ========================================================= */

.item .number,
.itemnew .number {
    position: absolute;
    right: 8px;
    bottom: 6px;

    padding: 2px 6px;

    background: rgba(255, 255, 255, 0.7);

    font-size: 12px;

    border-radius: 6px;
}


/* Rød prik */

.dot {
    display: inline-block;

    width: 7px;
    height: 7px;

    margin-right: 4px;

    background: red;

    border-radius: 50%;
}


/* Usynlig prik, så tallene stadig flugter */

.dotwhite {
    display: inline-block;

    width: 7px;
    height: 7px;

    margin-right: 4px;

    background: transparent;

    border-radius: 50%;
}


/* =========================================================
   VÆRKLISTE
   ========================================================= */

.works {
    max-width: 900px;
    margin-top: 60px;
}

.works h2 {
    margin-bottom: 20px;
}

.worklist {
    margin: 0;
    padding: 0;

    list-style: none;
}

.worklist li {
    padding: 8px 0;

    border-bottom: 1px solid rgba(0, 0, 0, 0.2);

    line-height: 1.4;
}


/* =========================================================
   FOOTER
   ========================================================= */

footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;

    margin-top: 60px;
    padding: 20px;

    border-top: 1px solid #222;
}

.socials {
    display: flex;
    gap: 14px;
}

.socials a {
    margin-left: 0;

    font-size: 20px;
    text-decoration: none;
}

.icon {
    width: 22px;
    height: 22px;

    fill: #222;

    transition:
        fill 0.2s,
        transform 0.2s;
}

.socials a:hover .icon {
    fill: #b03030;
    transform: scale(1.1);
}


/* Footer på mobil */

@media (max-width: 600px) {

    footer {
        flex-direction: column;
        align-items: flex-start;
    }
}


/* =========================================================
   LIGHTBOX
   ========================================================= */

#lightbox {
    position: fixed;
    inset: 0;

    display: flex;
    justify-content: center;
    align-items: center;

    z-index: 9999;

    background: rgba(30, 30, 30, 0.92);

    opacity: 0;
    pointer-events: none;

    transition: opacity 0.2s;
}

#lightbox.active {
    opacity: 1;
    pointer-events: auto;
}


/* Wrapper omkring lightbox-billedet */

.lb-inner {
    position: relative;

    width: fit-content;
    height: fit-content;

    max-width: 90vw;
    max-height: 90vh;
}


/*
   !important bevares her, fordi det sikrer, at generelle
   billedregler ikke tvinger lightbox-billedet til 100 % bredde.
*/

#lightbox img {
    display: block;

    width: auto !important;
    height: auto !important;

    max-width: 90vw !important;
    max-height: 90vh !important;

    object-fit: contain !important;

    background: #fff;

    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
}


/* Copyright inde i billedets nederste højre hjørne */

.lb-inner .copyright {
    position: absolute;
    right: 10px;
    bottom: 8px;

    padding: 2px 6px;

    background: rgba(0, 0, 0, 0.2);
    color: rgba(255, 255, 255, 0.65);

    font-size: 11px;
    letter-spacing: 0.03em;

    border-radius: 4px;

    text-shadow: 0 0 6px rgba(0, 0, 0, 0.7);

    user-select: none;
    pointer-events: none;
}