.atlas {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-auto-rows: 1fr;
    column-gap: 0.5em;
    padding: 0.5em 0.5em 0em 0.5em;
    margin-bottom: -1px;
    position: absolute;
    top: calc(var(--header-height-1) + (var(--header-height-2) * 2));
    width: 100%;
    opacity: 1;
    z-index: 1;
}

.atlas-list {
    top: calc(var(--header-height-1) + (var(--header-height-2) * 2));
    position: absolute;
    width: 100%;
}

.atlas-main #threejs-canvas {
    position: absolute;
    top: 0px;
    left: 0px;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.atlas .threejs-frame {
    background: transparent;
    flex-grow: 1;
}

.atlas,
.atlas-list {
    opacity: 0;
    transition: 0.5s opacity;
}

.atlas a {
    text-decoration: none;
    color: black;
    display: flex;
    /* background: red; */
    align-items: flex-end;
    justify-content: center;
}

.atlas .info-top {
    text-align: center;
    font-size: 1.2em;
}

.atlas .info-bottom {
    display: flex;
    justify-content: space-between;
}
.atlas .i-b-col-right p {
    text-align: right;
}
.atlas .i-b-col-right p,
.atlas .i-b-col-left p {
    margin: 0;
    letter-spacing: -0.1em;
    color: darkgrey;
}
.atlas-tiles-preview:hover .info-bottom p {
    color: black;
}
.atlas .i-b-col-right,
.atlas .i-b-col-left {
    row-gap: 0em;
    display: grid;
}
.atlas .preview-model-info {
    border-top: var(--border);
    border-bottom: var(--border);
    margin-top: 0.5em;
    padding: var(--padding-main);
    row-gap: 0.5em;
    display: grid; /* height: fit-content; */
    float: inline-end;
    width: 100%;
    min-height: fit-content;
}

.atlas-tiles-preview {
    font-family: "NEXTMono";
    /*    letter-spacing: var(--nextmono-spacing);*/
    font-size: var(--nextmono-sm-f-s);
    display: none;
    z-index: 1;
}

/*.activeFilter{
    background: red !important;
}*/

.filters-p {
    color: darkgrey;
}
.filters-p.activeFilterList {
    color: black;
}

.atlas-tiles-preview.visible {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /*    height: 50vh;*/
}

.atlas-list {
    padding: 0 var(--padding-main);
}

.atlas-list-preview {
    display: none;
    grid-template-columns: 1fr 1fr 1fr;
    /*    padding: 0 var(--padding-main);*/
    height: var(--header-height-2);
    border-bottom: var(--border);
}
.atlas-list-preview.visible {
    display: grid;
}
.atlas-list-preview p {
    margin: 0em 0em 0.15em 0em;
}

.list-cont {
    display: flex;
    align-items: center;
    height: 100%;
    font-family: "NEXTMono";
    font-size: 0.8em;
    letter-spacing: -0.08em;
    line-height: 1.4em;
    text-decoration: none;
    color: darkgrey;
}

.atlas-list a {
    text-decoration: none;
}
.atlas-list-preview:hover .list-cont {
    color: black;
}

.atlas-list-preview .i-b-col-left,
.atlas-list-preview .i-b-col-right {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    column-gap: var(--padding-main);
}
.atlas-list-preview .info-top {
    text-align: center;
    display: flex;
    justify-content: center;
}
.atlas-list-preview .i-b-col-right .list-cont {
    text-align: right;
    display: flex;
    justify-content: flex-end;
}

.video-header {
    width: 100%;
    height: 100vh;
    position: relative;
    overflow: hidden;
    scroll-snap-align: start;
}

.video-header video {
    z-index: 12;
    position: relative;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.atlas-scroll {
    left: 0;
    top: unset;
    width: 100%;
    height: 100%;
    overflow-y: scroll;
    position: absolute;
    overflow-x: hidden;
    scroll-snap-align: start;
    background: var(--color-bg);
}
.atlas-scroll .header-b.header-b-center:not(.footer .header-b.header-b-center),
.atlas-scroll .header h2 {
    opacity: 0;
}
.video-header,
.atlas-main {
    scroll-snap-align: start;
    display: block;
}

.atlas-main {
    height: 100%;
    overflow-y: hidden;
    position: absolute;
    left: 0px;
    top: 0px;
    width: 100%;
}

.atlas-main .footer {
    width: 100%;
    /* border-top: var(--border); */
    height: var(--header-height-2);
    padding-left: var(--padding-main);
    padding-right: var(--padding-main);
    font-family: "NordicPavillion";
    font-size: 0.8em;
    position: absolute;
    left: 0;
    bottom: calc(var(--header-height-2) * -1);
}

@media screen and (orientation: landscape) {
    #model-viewer-container {
        width: 300px; /* Adjust width */
        height: 300px; /* Adjust height */
        position: absolute;
        pointer-events: none; /* Prevent interaction with the container itself */

        display: none; /* Initially hidden */
        z-index: 1000; /* Ensure it's above other content */
        /*        background: red;*/
    }
    .atlas-list,
    .atlas {
        min-height: calc(
            100% - (var(--header-height-1) + (var(--header-height-2) * 3))
        );
    }
    .atlas-tiles-preview {
        height: var(--preview-h);
    }
    .atlas .preview-model-info {
        /*        height: var(--preview-info-h);*/
    }
    .atlas-main {
        overflow-y: scroll !important;
    }
    .atlas .i-b-col-right,
    .atlas .i-b-col-left {
        row-gap: 0.1em;
    }
    .atlas .preview-model-info,
    .atlas-list .atlas-list-preview {
        font-size: 0.93em;
    }
    .atlas .i-b-col-left div,
    .atlas .i-b-col-right div {
        height: fit-content;
    }
    .list-cont.size-list p {
        margin-bottom: 0.4em;
    }
}
@media screen and (orientation: landscape) and (min-width: 850px) and (max-width: 1000px) {
    .atlas {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

@media screen and (max-aspect-ratio: 3/2) {
    .atlas {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}
@media screen and (max-aspect-ratio: 3/2.2) {
    .atlas {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        /*        background: red;*/
    }
    :root {
        --preview-h: 35vh;
    }
}
@media screen and (orientation: landscape) and (max-width: 850px) {
    .atlas {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}
@media screen and (orientation: landscape) and (min-width: 820px) {
    .atlas .preview-model-info {
        padding: var(--padding-main) var(--padding-main) 1em var(--padding-main);
    }
}

/*ipad, tablets*/

@media screen and (min-width: 600px) and (max-width: 820px) and (orientation: portrait),
    (min-width: 821px) and (orientation: portrait) {
    .atlas {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        grid-auto-rows: 1fr;
    }
    .atlas-main {
        overflow-y: scroll !important;
    }

    .atlas .info-top {
        font-size: 1em;
    }

    .atlas-list-preview {
        /*grid-template-columns: 1fr 1fr;
        grid-template-rows: 1fr 2;
        height: fit-content;
        padding-bottom: 0.5em;
        padding-top: 0.5em;
        row-gap: 0.5em;*/
    }
    .atlas-list-preview .i-b-col-left,
    .atlas-list-preview .i-b-col-right {
        /*display: flex;
        flex-direction: column;*/
        display: grid;
        grid-template-columns: 1fr 1fr;
        height: fit-content;
        margin: auto 0;
    }
    .atlas-list-preview .info-top {
        /*grid-column-start: 1;
        grid-column-end: 3;
        grid-row-start: 1;*/
        margin: auto;
    }
    .atlas-list-preview p {
        font-size: 0.9em;
    }
    .atlas-list-preview .info-top .list-cont {
        font-size: 0.9em;
        color: black;
    }
    .atlas-main .footer {
        margin-bottom: 2px;
        z-index: 1;
    }
    .atlas-main .atlas {
        margin-bottom: var(--header-height-2);
    }
    .atlas .preview-model-info {
        height: 10vh;
    }
    .atlas-tiles-preview.visible {
        /*        max-height: 25vh;*/
    }
    .atlas .threejs-frame {
        height: 16vh;
        flex-grow: 0;
        flex-shrink: 0;
    }
    .atlas a {
        flex-grow: 1;
    }
    .atlas .preview-model-info {
        height: 100%;
        flex-grow: 1;
        padding: 0.8em 0.2em 0.8em 0.2em;
        margin-top: 0;
    }
    .video-header,
    .atlas-main {
        height: 100% !important;
    }
    .info-top {
        height: fit-content !important;
    }
    .info-top.mobile-hide {
        display: block !important;
    }
    .info-top.desktop-hide {
        display: none !important;
    }
}

@media screen and (max-width: 600px) and (orientation: portrait) {
    .atlas {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        grid-auto-rows: 1fr;
    }
    .atlas-main {
        overflow-y: scroll !important;
    }

    .atlas .info-top {
        font-size: 1em;
    }

    .atlas-list-preview {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 1fr 2;
        height: fit-content;
        padding-bottom: 0.5em;
        padding-top: 0.5em;
        row-gap: 0.5em;
    }
    .atlas-list-preview .i-b-col-left,
    .atlas-list-preview .i-b-col-right {
        display: flex;
        flex-direction: column;
    }
    .atlas-list-preview .info-top {
        grid-column-start: 1;
        grid-column-end: 3;
        grid-row-start: 1;
    }
    .atlas-list-preview .info-top .list-cont {
        font-size: 0.9em;
        color: black;
    }
    .atlas-main .footer {
        bottom: calc((var(--header-height-2) * -1) + 2px);
        width: 100%;
        background: var(--color-bg);
        z-index: 1;
    }
    .atlas-main .atlas {
        margin-bottom: var(--header-height-2);
    }
    .atlas .preview-model-info {
        height: 10vh;
    }
    .atlas-tiles-preview.visible {
        max-height: 25vh;
    }
    .atlas .threejs-frame {
        height: 16vh;
        flex-grow: 0;
        flex-shrink: 0;
    }
    .atlas a {
        /*        flex-grow: 1;*/
    }
    .atlas .preview-model-info {
        height: 100%;
        flex-grow: 1;
        padding: 0.8em 0.2em 0.8em 0.2em;
        margin-top: 0;
    }
    .video-header,
    .atlas-main {
        height: 100% !important;
    }
}
