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

body {
    --whitebg:#eee;
    --linkcolor:#ffdeaa;
    --darklinkcolor: #6f5311;
    --accentcolor:#ca9e58;
    --headerfonts:Eyja, Superclarendon, 'Bookman Old Style', 'URW Bookman', 'URW Bookman L', 'Georgia Pro', Georgia, serif;
    --bodyfonts:"freight-sans-pro", Inter, Roboto, 'Helvetica Neue', 'Arial Nova', 'Nimbus Sans', Arial, sans-serif;
    --archcolor: var(--mainbgcol);
    --darkerblue:#072441;
    --lighterseablue:#287ab1;
    --red:#d12229;
    --mainbgcol: #020221;
    --footerbgcol:black;
    --headerbgcol: var(--whitebg);
    --headercol: var(--red);
    --headersubscol: var(--darkerblue);
    --headerborder: var(--accentcolor) solid 10px;
    --colwidth: 600px;
    background: var(--mainbgcol);
    color: white;
    font-family: var(--bodyfonts);
    font-size: 1rem;
    line-height:1.3rem;
    box-sizing:border-box;
    display:flex;
    flex-flow: column;
    height:100vh;
    align-content:space-between;
}

p {
    columns: var(--colwidth);
}

a {
    color: var(--linkcolor);
    text-decoration-thickness: 0.045em;
    pointer-events: all;
}

hgroup,h1,h2,h3 {
    font-family: var(--headerfonts);
    line-height:1.15;
}

.topnavbar {
    /* text-transform: uppercase; */
    display:flex;
    flex-flow: row wrap;
    gap: 2em;
    padding: 1.9em 24px 2em;
    justify-content: space-between;
    align-items:center;
    background:var(--headerbgcol);
    background-size:cover;
    color:var(--headersubscol);
    border-block-end: var(--headerborder);
    & a {
        color:unset;
        font-size:1.2rem;
    }
    & a:has(hgroup) {
        text-decoration:none;
        text-wrap: nowrap;
        max-width: 100%;
        font-size: unset;
    }
}

hgroup#maintitle {
    display:block;
    font-size:1.4rem;
    &>h1 {
        font-size:2em;
        font-weight: 100;
        color:var(--headercol);
        margin-block-end:0.2em;
    }
}
@media screen and (max-width: 600px) {
    hgroup#maintitle {
        font-size:4vw;
        &>p {
            font-size: 1.25em;
            text-wrap: wrap;
        }
    }
}

header, footer {
    height:min-content;
}

.modalcontainer {
    color: var(--darkerblue);
    visibility: hidden;
    position:fixed;
    inset:0;
    display:flex;
    align-items: center;
    justify-content: center;
    background: rgba(77, 77, 77, .7);
    opacity:0;
    z-index:990;
    transition: all .4s;
    &#zoom {
        align-items:unset;
    }
    &:target {
        opacity: 1;
        visibility: visible;
    }
    & .modal {
        position: relative;
        contain: paint;
        background: var(--whitebg);
        line-height: 1.2em;
        display:flex;
        align-items:normal;
        gap:1em;
        /* height:80cqh; */
        max-height: 95vh;
        & a {
            color: var(--darklinkcolor);
        }
        &:before {
            pointer-events:none;
            position:absolute;
            content:"";
            top:10px;
            left:20px;
        }
        & h2 {
            margin-block-start: 40px;
            text-transform: capitalize;
            padding-block: 1.5em 1em;
            font-size: 2rem;
        }
        &>.text {
            max-height: 90cqh;
            overflow:auto;
            padding-inline: 48px 64px;
            padding-block-end:3em;
            max-width: var(--colwidth);
            /* min-width:20em; */
            & ul {
                margin-block-start: 2em;
                margin-inline-start: 16px;
                &>li {
                    margin-block-end: 1.5em;
                }
            }
        }
        & p {
            text-transform: initial;
            line-height: 1.3em;
            & br {
                margin-block-end: 1em;
            }
        }
        &>img {
            /* height:100cqh; */
            max-width:50%;
            object-fit:contain;
            object-position: top left;
        }
    }
}

a.modal__close {
    position: absolute;
    font-size: 1.5rem;
    top: 15px;
    right: 15px;
    color: var(--darkerblue) !important;
    text-decoration: none;
    background:var(--whitebg);
    padding:5px;
}

@media screen and (max-width: 800px) {
    .modalcontainer {
        &>.modal {
            flex-direction:column;
            align-items: center;
            overflow: auto;
            height:95cqh;
            width:95cqw;
            &>.modal__close {
                align-self:flex-end;
                position:sticky;
            }
            &>img {
                height:50cqh;
                width: auto;
                max-width: 100cqw;
            }
            &>.text {
                max-height: none;
                overflow: clip;
                &>h2 {
                    margin-block-start: unset;
                }
            }
        }
    }
}
.zoommodal {
    overflow:auto;
    width:100%;
    display:flex;
    justify-content: center;
    align-items: center;
    &>picture>img {
        max-width: 100vw;
        max-height:100vh;
        margin:0 auto;
        align-self:center;
    }
    &.extrazoom {
        align-items:flex-start;
        justify-content:flex-start;
        &>picture>img {
            max-width: 300vw;
            max-height: 300vh;
        }
    }
}
#zoomlinkbox {
    position: absolute;
    top: 0;
    padding: 15px;
    width: 100%;
    justify-content: space-between;
    display: flex;
    .modal__close {
        font-size: 1.7em;
    }
}

body:has(.modalcontainer:target) {
  overflow: hidden;
}

#cornermodallink {
    align-self: flex-end;
    height:100px;
    position:fixed;
    bottom:0;
    right:0;
    &:before {
      content: "";
      height: 100px;
      width: 90px;
      border-top-left-radius: 95px;
      background-color: var(--accentcolor);
      position: absolute;
      bottom: 0;
      right: 0;
      z-index: -1;
    }
}

footer {
    padding: 0.5em 13px;
    color: #aaa;
    background:var(--footerbgcol);
}

@media (width <= 1000px) {
    main.home>nav {
        &>ul>li {
            min-width: 100%;
        }
    }
}

main.home>nav {
    height:100%;
    width:100%;
    &>ul {
        height:100%;
        padding:0;
        display:flex;
        flex-wrap: wrap;
    }
    &>ul>li {
        position: relative;
        list-style-type: none;
        min-height: 60vh;
        flex:1;
        overflow:hidden;
        text-decoration:none;
        display:flex;
        flex-direction:column;
        justify-content:flex-end;
        &:hover, &:focus-within {
            --foo:bar;
        }
        &>.archbox {
            -webkit-mask-image:var(--arch-mask);
            mask-image:var(--arch-mask);
        }
        & img {
            position: absolute;
            inset:0;
            height:100%;
            object-position:center top;
            object-fit: cover;
            width: 100%;
            filter:brightness(80%);
            z-index:-1;
        }
        & hgroup.sectiontitle {
            padding-inline: 10%;
            padding-block:0.5em;
            color: white;
            align-self:center;
            width:100%;
            font-size:min(1.4rem,32px);
            height: max(6em, 200px);
            display:flex;
            flex-flow:column;
            justify-content:center;
            & h2 {
                font-size: min(1.8em,40px);
                margin-block-end: 0.2em;
            }
            & time {
                display: block;
            }
        }
        &:focus-visible>hgroup.sectiontitle {
            text-decoration:underline;
        }
        &>.archbox {
            position: absolute;
            inset:0;
            background-color:var(--archcolor);
            background-position-x: center;
            background-position-y:-1px;
            background-repeat: no-repeat;
            background-size: cover;
            -webkit-mask-size: cover;
            mask-size: cover;
            pointer-events:none;
        }
        &>ul {
            background:var(--archcolor);
            visibility: hidden;
            display: block;
            max-height: 0px;
            font-size:1rem;
            bottom:0;
            width:100%;
            text-align:center;
            list-style:none;
            transition: all 0.5s;
            &>li {
                max-height:0px;
                opacity:0;
                text-wrap:balance;
                transition: all 0.5s;
                padding:16px;
                &>a {
                    display:inline-block;
                    text-decoration:none;
                    max-width:80%;
                    &:hover{
                        text-decoration:underline;
                    }
                }
            }
        }
        &:hover > ul, &:focus-within > ul {
            visibility:initial;
            max-height:50%;
            &>li{
                max-height:100%;
                opacity:1;
            }
        }
    }
}

.casesnav {
    &>ul {
        display:flex;
        flex-flow: row nowrap;
        list-style:none;
        overflow:hidden;
        &>li {
            font-size:1.2rem;
            position:relative;
            flex:1;
            text-wrap: balance;
            padding: 16px;
            text-transform: uppercase;
            &:focus-visible:after {
                content:"";
                border:1px solid orange;
                position:absolute;
                inset:0;
            }
            &>ul {
                list-style:none;
                text-decoration:none;
                height: 0%;
                max-height:0px;
                visibility:hidden;
                opacity:0;
                transition:max-height 0.5s, visibility 0.6s, opacity 0.5s;
                &>li {
                    max-height:0px;
                    transition: all 0.5s;
                    text-transform: initial;
                    font-size: 1rem;
                    padding-block-start: 1em;
                    & a {
                        text-decoration:none;
                        &:hover {
                            text-decoration:underline;
                        }
                    }
                }
            }
            &:has(:hover), &:has(:focus-visible) {
                &>li>ul {
                    visibility:initial;
                    height:100%;
                    max-height:200px;
                    opacity:1;
                    &>li {
                        max-height:200px;
                    }
                }
            }
        }
    }
}

main {
    display: flex;
    flex-direction:row;
    flex: 1;
    position: relative;
}

section#case {
    padding:16px;
    flex:3;
    display: flex;
    flex-flow: row wrap;
    justify-content: center;
    & a {
        /* flex:400px; */
        height: 450px;
        /* min-width: 26%; */
    }
    & img {
        object-fit:contain;
        width: 100%;
        height:100%;
        padding: 8px;
    }
    & h2 {
        position:sticky;
        display:block;
        background: var(--mainbgcol);
        width:100%;
        font-size:2rem;
        padding: 8px;
        top:0;
    }
    & #casedescription {
        display:block;
        padding-inline: 16px;
        padding-block:1em;
        flex-grow:1;
        width: 100%;
        &>p {
            column-width:100cqw;
        }
    }
}

@keyframes growfade {
    0% {
        transform: scale(0%);
        opacity: 1;
    }
    10% {
        transform: scale(100%);
    }
    50% {
        opacity: 0;
    }
}
.hotspot {
    position: absolute;
    translate: -50% -50%;
    width: 6em;
    height: 6em;
    border-radius: 100%;
    &>div {
        animation-iteration-count: infinite;
        animation: growfade infinite 7s 2s;
        background: rgba(255,255,255,0.7);
        opacity:0;
        border-radius:inherit;
        width: 100%;
        height: 100%;
    }

    &:before {
        content: "";
        position: absolute;
        inset: 37%;
        background: var(--accentcolor);
        border-radius: inherit;
        opacity: 0.8;
    }
}

.hotbox {
    position: absolute;
    cursor:zoom-in;
}

section#item {
    display: flex;
    flex-flow: column;
    flex:1;
    position:relative;
    --labelmargin: 100px;
    --labelheight: 60px;
    & .imgbox {
        flex: 1;
        margin: 1em 16px 10px;
        position:relative;
        display: flex;
        align-items: center;
        justify-content: center;
        container-type: size;
        & .imgwrapper {
            position: relative;
            height: fit-content;
            width: fit-content;
            &>a{
                display:block;
                &>img{
                    max-width:100cqw;
                    max-height:100cqh;
                }
            }
        }
    }
    & a[href^="#zoom"] {
        cursor: zoom-in;
    }
    & .imgwrapper::before {
        content: "↔";
        pointer-events:none;
        position: absolute;
        top: 5px;
        left: 5px;
        background: white;
        z-index: 1;
        color: var(--darkerblue);
        padding: 0.38em 8.5px 0.5em;
        rotate: -45deg;
        border-radius: 100%;
        opacity: 0.85;
    }
    & .nextprev {
        position: absolute;
        top: 50%;
        translate: 0 -50%;
        font-size: 3rem;
        text-decoration: none;
        padding: 0.25em 2.5px 0.35em;
        color:var(--darkerblue);
        background:var(--whitebg);
        &#prev {
            left:0;
        }
        &#next {
            right:0;
        }
    }
    & #itemdescbox {
        /* position:absolute; */
        bottom:0;
        right:0px;
        width: 100%;
        background: rgba(255,255,255,0.9);
        & a {
            color: var(--darklinkcolor);
        }
        color:black;
        padding: 16px;
        display:flex;
        flex-flow: column;
        &>details {
            display:contents;
            &>summary {
                cursor:pointer;
                display:flex;
                gap:1em;
                align-items:center;
                &::marker {
                    font-size:1.5rem;
                    content:"";
                }
                &:before {
                    content:"";
                    transition: all 0.2s;
                    align-self:flex-start;
                    font-size: 18px;
                    translate: 0 4px;
                    border: 0.5em solid transparent;
                    border-left: 0.8em solid black;
                    border-right: none;
                }
                &>span {
                    display: flex;
                    /* margin-inline-end: var(--labelmargin); */
                    flex: 1;
                    max-width:calc(100% - 120px);
                    flex-flow: row wrap;
                    justify-content:space-between;
                    align-items:center;
                    gap: 16px;
                    &>*{
                        vertical-align:middle;
                    }
                    &>h2 {
                        min-width: min(20em, 100%);
                    }
                    &>a{
                        font-style: italic;
                        text-wrap: nowrap;
                        font-weight: 200;
                        font-size: 1rem;
                    }
                }
            }
            &>#itemdesc {
                display:flex;
                flex-flow: row wrap;
                gap: 1em;
                overflow:auto;
                padding-inline-end: var(--labelmargin);
                margin-block-start:1em;
                padding-inline-start: 32px;
                text-wrap: pretty;
                max-height: 18em;
                &>p {
                    column-width:100cqw;
                    height:fit-content;
                }
                &>p:first-child {
                    flex: 18em 0 0;
                    line-height:1em;
                }
                &>p:last-child {
                    flex: 30em 1;
                }
                & br {
                    content:"";
                    display:block;
                    margin-block-end: 0.5em;
                }
            }
        }
    }
}

.original_link {
    background: var(--whitebg);
    color: var(--darkerblue);
    font-family: var(--headerfonts);
    padding: 5px;
    text-decoration: none;
    border-radius: 0.4em;
    font-size: 1.2em;
    margin-inline-end: 8px;
}
@media screen and (width < 1265px) {
    #itemdesc>p:last-child {
        border-block-start: 1px solid black;
        padding-block-start: 1em;
    }
}
#itemdescbox:has(details[open]) {
    position:absolute;
}
details[open] > summary:before {
    rotate:90deg;
}

.leftnav {
    flex-basis: 300px;
    height:100%;
    --navborder: 1px solid var(--accentcolor);
    & .modal__close {
        visibility:hidden;
        opacity:0;
    }
    & a {
        text-decoration:none;
        color:white;
    }
    &>ul {
        list-style: none;
        & li {
            & li, & div {
                padding: 0.6em 13px;
            }
            & a {
                display:block;
                /* padding-inline-start:1.5em; */
                position: relative;
                margin-inline-start: 13px;
                list-style: none;
            }
            & div {
                padding-block: 1em;
                position:relative;
                &:before {
                    content:"";
                    position:absolute;
                    right:1em;
                    transition: all 0.2s;
                    translate: 0 5px;
                    border: 0.35em solid transparent;
                    border-left: 0.6em solid white;
                    border-right: none;
                }
            }
            & ul {
                pointer-events:none;
                visibility:hidden;
                overflow:hidden;
                max-height:0;
                transition: all 0.5s;
                position: relative;
                &:before {
                    content:"";
                    position:absolute;
                    inset:0.8em;
                    top:0;
                    border-top:var(--navborder);
                }
            }
            &.open,&:has(:focus-visible) {
                &>div:before {
                    rotate:90deg;
                }
                &>ul{
                    max-height:400px;
                    visibility:visible;
                    padding-block:0.6em;
                    transition: all 0.2s;
                }
            }
        }
    }
    & li.open {
        position:relative;
        /*border-right:-1px solid black;
        border-top: var(--navborder);
        border-bottom: var(--navborder);
        margin-right:-1px;*/
        & a.active {
            text-decoration: none;
            border-inline-start: 5px solid var(--accentcolor);
        }
    }
}

#breadcrumb {
    display:none;
    visibility:hidden;
}
@media screen and (max-width:900px) {
    section#item>.imgbox {
        container-type: unset;
    }
    main {
        flex-direction: column;
    }
    #breadcrumb {
        display: flex;
        visibility:visible;
        justify-content: center;
        padding: 1em 32px;
        & > .breadcrumb {
            display: flex;
            flex-flow: row wrap;
        }
    }
    .leftnav {
        position:fixed;
        inset: 5vmin;
        margin-block-start:3em;
        z-index: 990;
        visibility:hidden;
        opacity:0;
        display:none;
        transition:all 0.5s;
        &:before {
            position:fixed;
            content:"";
            inset:0;
            background:#666;
            opacity: 0;
        }
        & .modal__close {
            visibility: visible;
            opacity: 1;
            position:fixed;
        }
        &>ul {
            margin-block-start:2em;
            position: absolute;
            &>li {
                &>div:before {
                    display:none;
                }
                &>ul{
                    max-height:400px;
                    visibility:visible;
                    padding-block:0.6em;
                    transition: all 0.2s;
                }
            }
        }
    }
    #nav:target {
        visibility:visible;
        opacity:1;
        display:block;
        &:before {
            visibility:visible;
            opacity: 0.8;
            display:block;
        }
    }
    section#item {
        overflow:auto;
        &>.nextprev {
            position: fixed;
        }
        &>#itemdescbox {
            max-height:none;
            position:relative;
            &>details>#itemdesc {
                padding-inline-end: 40px;
            }
        }
        &>.imgwrapper{
            max-height:60vh;
            &>img {
                max-height:100%;
                position:relative;
            }
        }
    }
}

.sticky {
    position:sticky;
    top:0;
    left:0;
}

.border {
    --borderheight:36px;
    margin:0;
    height:var(--borderheight);
    background: var(--accentcolor);
    border:none;
    &:after {
        content:"";
        height:var(--borderheight);
        background-color:black;
        display:block;
        mask-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20410%20410%22%3E%3Cpath%20d%3D%22%20%20M5%20205%20%20L205%205%20%20L405%20205%20%20L205%20405%20%20Z%22%20fill-rule%3D%22nonzero%22%2F%3E%3Cpath%20d%3D%22%20%20M5%20205%20%20L205%205%20%20L405%20205%20%20L205%20405%20%20Z%22%20%20transform-origin%3D%22center%22%20%20transform%3D%22rotate(45)%22%20%20fill-rule%3D%22nonzero%22%2F%3E%3C%2Fsvg%3E");
        mask-repeat:repeat-x;
        mask-size:var(--borderheight);
    }
}

.breadcrumb {
    list-style: none;
    &>li{
        display: inline;
        &:after {
            margin-inline:8px;
            vertical-align:-2px;
            font-size: 1.2em;
            content:"/";
        }
        &:last-of-type:after{
            content:none;
        }
    }
}

main.landing {
    flex-direction:column;
    padding-block-end:3em;
    & .banner {
        position:relative;
        margin-block-end:3em;
        &>img {
            width:100%;
        }
        &>hgroup#maintitle {
            position: absolute;
            bottom: 0;
            padding: 16px;
            background: rgba(255,255,255,0.8);
            color: var(--darkerblue);
            width: 100%;
            font-size: 2rem;
            text-align: center;
        }
    }
    & p {
        width:min(50em,100%);
        margin:0 auto;
    }
    &>a {
        margin: 0 auto;
        font-size:1.4rem;
        font-family: var(--headerfonts);
        font-style:italic;
        margin-block-start:2em;
        text-decoration-thickness: 0.5px;
    }
}
