html, body{
	overflow: hidden;
}

.habitat-wrap{
/*    border: 1px solid red;*/
    position: fixed;
    width: 100%;
    height: 100%;
    overflow-y: scroll;
    overflow-x: hidden;
    z-index: 1;
}
#threejs-canvas{
    position: fixed;
    top: 0px;
    left: 0px;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    transition: 0.5s opacity;
}

.fullfomodel{
	position: sticky;
	top: calc(var(--header-height-1) + var(--header-height-2) + 2px);
    z-index: 2;
}

.header{
	position: fixed !important;
	width: 100%;
}

.related-hbs{
	width: 100%;
	/* background: var(--color-bg); */
	width: 100%;
	height: 45vh;
	position: absolute;
	bottom: calc(-50vh + var(--header-height-2));
	column-gap: 0.5em;
    padding: 0.5em;
    display: flex;
    overflow: hidden;
    z-index: 10;

}

.related-hbs-titles{
/*	background: var(--color-bg);*/
    position: absolute;
    height: fit-content;
    /* align-self: unset; */
    display: flex;
    transform-origin: bottom;
    bottom: 50vh;
    z-index: 100;
    text-align: center;
    flex-direction: column;
    width: 100%;
    left: 0;
    align-items: center;
    justify-content: center;
}

.related-hbs-titles .titles-cont{
	background: var(--color-bg);
	width: fit-content;
	padding: var(--padding-main);
	display: flex;
	flex-direction: column;
	row-gap: var(--padding-main);
}
.related-hbs-titles .titles-cont h4{
	margin: 0;
	font-family: "NordicPavillion";
	font-size: 0.8em;
}

.related-hbs-titles .titles-cont p{
	font-family: "NEXTMono";
    font-size: 0.7em;
    line-height: 1.4em;
    letter-spacing: -0.05em;
    margin: 0;
}

.related-atlas .i-b-col-right, .related-atlas .i-b-col-left {
    row-gap: 0.1em;
    display: grid;
}

.related-atlas .preview-model-info{
	border-top: var(--border);
    border-bottom: none;
    /* margin-top: 0.5em; */
    padding: var(--padding-main) var(--padding-main) 0 var(--padding-main);
    row-gap: 0.5em;
    display: grid;
    min-height: fit-content;
/*    height: 12vh;*/
}
.related-atlas .info-top {
    text-align: center;
    font-size: 1.2em;
}

.related-atlas .info-bottom {
    display: flex;
    justify-content: space-between;
}

.atlas-tiles-preview {
    display: flex;
    flex-direction: column;
    height: 100%;
    font-family: "NEXTMono";
    /* letter-spacing: var(--nextmono-spacing); */
    font-size: var(--nextmono-sm-f-s);
/*    max-width: 20vw;*/
    /* background: var(--color-bg); */
}
.atlas-tiles-preview .threejs-frame {
    flex-grow: 1;
}

.gallery .footer{
    position: absolute;
    background: var(--color-bg);
    width: 100vw;
    bottom: calc(-40vh - 10vh);
}

.related-atlas .info-top {
    text-align: center;
    font-size: 1.2em;
    max-height: fit-content;
}

.related-atlas .i-b-col-right p, .related-atlas .i-b-col-left p {
    margin: 0;
    letter-spacing: -0.1em;
    color: darkgrey;
}

.related-atlas .i-b-col-right p {
    text-align: right;
}
.related-atlas a {
    text-decoration: none;
    color: black;
}

.related-atlas{
    width: calc((100% / 6) - 0.4em);
    flex-shrink: 0;
}

.button-habitat{
    cursor: pointer;
}

.image-gallery{
    position: fixed;
    /* top: 0; */
    background: var(--color-bg);
    width: 100%;
    height: calc(100% - (var(--header-height-1) + (var(--header-height-2) * 2)));
    z-index: 13;
    display: flex;
    justify-content: center;
    bottom: 0;
    display: none;
}
.image-gallery img, .image-gallery video{
    height: 100%;
    max-width: 100%;
    object-fit: contain;
    flex-grow: 1;
}

.image-header{
    display: none;
}

.atlas-tiles-preview:hover .info-bottom p{
    color: black;
}

@media screen and (orientation:landscape) {
    .habitat-wrap-child{
        height: 100vh;
        width: 100%;
        position: sticky;
        /* top: calc(var(--header-height-1) + (var(--header-height-2) * 2)); */
        top: calc(var(--header-height-1));
        border-bottom: var(--border);
    }
    .full-model{
        width: 100%;

        height: 100%;
    }
    .related-hbs-buttons{
        z-index: 100;
        position: absolute;
        bottom: calc(-45vh - 0.4em);
        height: calc(45vh + 0.4em);
        width: 100%;
        display: flex;
        justify-content: space-between;
        pointer-events: none;
    }
    .related-hbs-buttons .button-back-c,.related-hbs-buttons .button-forward-c{
        pointer-events: all !important;
        cursor: pointer;
    }
    .related-hbs .button-back-c, .related-hbs .button-forward-c{
        position: fixed;
        height: 45vh;
        bottom: var(--header-height-2);
    }
    .related-hbs .button-forward-c{
        right: 0;

    }
    .habitat-header{
/*        display: grid !important;*/
    }
}

@media screen and (orientation:landscape) and (min-width:850px) and (max-width:1000px){
    .related-atlas{
            width: calc((100% / 5) - 0.36em);
    }
}
@media screen and (orientation:landscape) and (max-width:850px){
    .related-atlas{
            width: calc((100% / 4) - 0.33em);
    }
}

/*ipad, tablets*/

@media screen and (min-width: 600px) and (max-width: 820px) and (orientation:portrait), (min-width: 821px) and (orientation:portrait){
    .habitat-wrap-child{
        height: 100vh;
        width: 100%;
        position: sticky;
        /* top: calc(var(--header-height-1) + (var(--header-height-2) * 2)); */
        top: calc(var(--header-height-1));
        border-bottom: var(--border);
    }
    .full-model{
        width: 100%;

        height: 100%;
    }
    .related-hbs-buttons{
        z-index: 100;
        position: absolute;
        bottom: calc(-45vh - 0.4em);
        height: calc(45vh + 0.4em);
        width: 100%;
        display: flex;
        justify-content: space-between;
        pointer-events: none;
    }
    .related-hbs-buttons .button-back-c,.related-hbs-buttons .button-forward-c{
        pointer-events: all !important;
        cursor: pointer;
    }
    .related-hbs .button-back-c, .related-hbs .button-forward-c{
        position: fixed;
        height: 45vh;
        bottom: var(--header-height-2);
    }
    .related-hbs .button-forward-c{
        right: 0;

    }
    .desktop-hide{
        display: none;
    }
    .habitat-mobile-header.desktop-hide,
    .mobile-hide.habitat-wrap-child {
        display: block !important;
    }
    .button-down{
        height: 5vh;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .button-down .arrow-down{
        width: 1.6em;
        height: 1.6em;
    }
    .button-down .arrow-down svg{
        fill: none;
        stroke: black;
        stroke-width: 0.2em;
    }
    .preview-model-info.full-model-info .info-bottom{
        display: none;
    }
    .mobile-hide.habitat-header-ipad{
        display: flex !important;
    }
    .ipad-button{
        display: flex !important;
    }
    .filters-cont.habitat-header{
        display: flex;
    }
    .filters-header.habitat-header.mobile-hide{
        display: grid;
/*        background: green;*/
        width: 100%;
        justify-content: space-between;
        align-items: center;
    }
    .filters-header.habitat-header .filters-left, .filters-header.habitat-header .filters-right{
        display: grid;
        grid-template-columns: 1fr 1fr;
        row-gap: 0.3em;
    }
    .habitat-header .filters-subcont p{
        margin: 0 !important;

    }
    .habitat-header .filters-subcont{
        height: fit-content;
    }
    .habitat-header .habitat-info-p{
        height: fit-content;
      /*  display: flex;
        align-items: center;*/
    }
    .related-hbs{
        bottom: calc(-33vh + var(--header-height-2));
    }
    .related-hbs-buttons{
        bottom: calc(-33vh - 0.4em);
        height: calc(33vh + 0.4em);
    }
    .gallery .footer{
        bottom: calc(-23vh - 10vh);
    }
    .related-atlas{
        width: calc((100% / 4) - 0.4em);
    }
    .atlas-tiles-preview{
        max-width: none !important;
    }
    .button-back-c.mobile-hide, .button-forward-c.mobile-hide{
        display: flex !important;
        z-index: 10;
        position: absolute;
        background: var(--color-bg);
        height: 100%;
    }
    .button-back-c.mobile-hide{
        left: 0;
    }
    .button-forward-c.mobile-hide{
        right: 0;
    }
    .image-gallery img, .image-gallery video{
/*        max-width: 90%;*/

    }
    .filters-cont.image-header .filters-header{
        display: grid;
    }
    .filters-cont.image-header .filters-header .filters-subcont{
        margin: auto;
    }
}

@media screen and (max-width: 600px) and (orientation:portrait){
    html, body{
        position: absolute;
        display: flex;
        inset: 0;
        padding: 1px;
        overflow: hidden;
        width: 100%;
        height: 100%;
    }
    .header{
        position: sticky !important;
        top: 0px;
    }
    .full-model.threejs-frame{
      flex-grow: 1;
    }
    .preview-model-info.full-model-info{
      height: 100%;
      display: flex;
      flex-direction: column;
    }
    .full-model, .intro-c{
        position: relative;
        top: 0px ;
    }
    .top-h{
/*        position: fixed;*/
        transform: translateY(0vh);
        transition: 0.5s transform ;
    }
    .scrollUp .top-h{
        transform: translateY(0vh);
    }
    .scrollDown .top-h{
        border-bottom: var(--border);
        transform: translateY(calc(var(--header-height-1) + (var(--header-height-2) * 2 ))) !important;
    }
    .habitat-mobile-header{
        position: sticky;
        top: 0px;
        z-index: -1;
        margin-bottom: 5vh;
    }
    .info-top.desktop-hide:not(.preview-model-info .info-top){
        display: grid;
        grid-template-columns: 1fr 10fr 1fr;
        /* background: red; */
        height: var(--header-height-2);
        font-family: "NEXTMono";
        font-size: 1em;

        padding: 0 var(--padding-main) 0 var(--padding-main);
        position: fixed;
        width: 100%;
        z-index: 100;
        background: var(--color-bg);
    }
    .info-top div{
        border-bottom: var(--border);
    }
    .info-top.desktop-hide .title,.info-top.desktop-hide  .back{
        text-align: center;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .info-top.desktop-hide p{
        margin: 0;
    }

    .habitat-mobile-header .info-bottom{
        display: flex;
        justify-content: space-between;
        /*position: absolute;
        bottom: 0;*/
        width: calc(100% - (var(--padding-main) * 2));
        border-top: var(--border);
        padding: var(--padding-main) 0 var(--padding-main) 0;
        margin: 0 var(--padding-main) 0 var(--padding-main);
    }
    .habitat-mobile-header .i-b-col-right p, .habitat-mobile-header .i-b-col-left p{
        margin: 0;
        letter-spacing: -0.1em;
        font-family: "NEXTMono";
        /* letter-spacing: var(--nextmono-spacing); */
        font-size: var(--nextmono-sm-f-s);
    }
    .habitat-mobile-header .i-b-col-right, .habitat-mobile-header .i-b-col-left{
        row-gap: 0.1em;
        font-size: 1.1em;
        display: grid;
    }
    .habitat-mobile-header .i-b-col-right p{
        text-align: right;
    }
    .image-gallery{
        height: 100% !important;
    }
    .button-back, .button-forward {
        width: 6.8vw;
        height: 6.8vw;
        margin: var(--padding-main) 0;
    }
    .button-forward-c, .button-back-c{
        height: fit-content;
    }
    .gallery-buttons-bottom {
        position: fixed;
        bottom: 0;
        width: calc(100% - (var(--padding-main) * 2));
        height: var(--header-height-1);
        left: 0;
        /* background: red; */
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-top: var(--border);
        margin-left: var(--padding-main);
        margin-right: var(--padding-main);
    }
    .gallery-buttons-top{
        position: fixed;
        width: calc(100% - (var(--padding-main) * 2));
        border-bottom: var(--border);
        height: var(--header-height-2);
        display: grid;
        grid-template-columns: 1fr 15fr 1fr;
        justify-content: space-between;
        align-items: center;
    }
    .gallery-buttons-top .title{
        font-family: "NEXTMono";
        font-size: 1em;
        text-align: center;
    }
    .gallery-buttons-top .close-gallery{
        background: none;
        padding: 0px;
        position: relative;
        align-self: center;
    }
    .button-text{
        display: none;
    }
    .button-habitat .close-button{
        width: 5.5vw;
        height: 5.5vw;
        cursor: pointer;
    }
    .image-caption{
        font-family: "NordicPavillion";
        text-align: center;
        font-size: 0.9em;
        margin-bottom: 0.5em;
    }
    .image-credits{
        font-family: "NEXTMono";
        text-align: center;
        font-size: 0.7em;
    }
    .image-gallery{
        z-index: 101;
        background: rgba(248, 250, 243, 0.9);
    }
    .image-gallery img, .image-gallery video{
        height: calc(100% - var(--header-height-1) - var(--header-height-2));
        margin-top: var(--header-height-2);
    }
    .atlas-tiles-preview{
        max-width: 100%;
        overflow: hidden;
        padding: 0.5em;
    }
    .related-hbs{
        height: calc(33vh + 0.4em);
/*        bottom: calc(-33vh + var(--header-height-2));*/
        padding-bottom: var(--header-2-height);
        /* border: 1px solid red; */
        overflow: hidden;
        bottom: calc(-33vh);
        height: calc(33vh);
        padding-top: 0;
        padding-left: 0;
        padding-right: 0;
        column-gap: 0em;
    }
    .gallery{

    }
    .gallery .footer{
        bottom: calc(-33vh - var(--header-height-2))
    }
    .related-atlas{
        min-width: calc((100% / 3));
        flex-grow: 0;
        flex-shrink: 1;
/*        border: 1px solid red;*/
    }
    .related-atlas .preview-model-info{
        padding: var(--padding-main);
    }
    .related-atlas .info-top{
        font-size: 1em;
    }
    .intro-c{
        pointer-events: all !important;
    }
    .related-hbs-buttons{
        z-index: 100;
        position: absolute;
        bottom: calc(-33vh - 0.4em);
        height: calc(33vh + 0.4em);
        width: 100%;
        display: flex;
        justify-content: space-between;
        pointer-events: none;
        padding-bottom: var(--header-height-2);
    }
    .related-hbs-buttons .button-back-c,.related-hbs-buttons .button-forward-c{
        pointer-events: all !important;
        cursor: pointer;
        height: 100%;
/*        background: red;*/
    }
    .related-atlas .preview-model-info{
        border-top: var(--border);
        border-bottom: none;
        /* margin-top: 0.5em; */
        padding: var(--padding-main);
        row-gap: 0.5em;
        display: grid;
        height: 12vh;
        flex-grow: 1;
        display: flex;
        background: var(--color-bg);
        justify-content: center;
    }
    .atlas-tiles-preview .threejs-frame{

        flex-grow: 1;
        /* border: 1px solid green; */
        width: calc(100% + 1em);
        left: -0.5em;
        position: relative;
        top: -0.5em;
    }
    .info-top.desktop-hide{
/*        padding: ;*/
    }
    .info-top.desktop-hide .back{
        justify-content: flex-start;
    }
    .button-down{
        height: 6vh;
        display: flex;
        align-items: baseline;
        justify-content: center;
        /* background: red; */
        margin-bottom: 1em;
        position: absolute;
        bottom: 13vh;
        left: 0;
        width: 100%;
    }
    .button-down .arrow-down{
        width: 1.6em;
        height: 1.6em;
    }
    .button-down .arrow-down svg{
        fill: none;
        stroke: black;
        stroke-width: 0.2em;
    }
    .button-down p{
        margin: 0;
        text-align: center;
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.7em;
        font-family: 'NordicPavillion';
    }
    /*.button-down .arrow-down::before{
        content: url(svgs/g-down.svg);
    }*/
}
