/* TYPOGRAPHY */

.thumbnail-title {
    /* border: 1px red solid; */
    position: relative;
    top: calc(var(--margin) * 3);
    margin: calc(var(--margin) * 3);

    font-family: var(--font-book);
    font-size: var(--font-size);
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing);
    line-height: var(--line-height);

    width: 60vw;
    height: fit-content;
    text-align: center;
}

.title-track {
    display: inline-flex;
    gap: 3rem;

    animation: title-loop 8s ease-in-out 2s 1 forwards;
}

.title-track-hidden {
    display: none;
}

.text-btn {
    position: fixed;
    bottom: 0;
    right: 0;
    margin: calc(var(--margin) * 3);

    font-family: var(--font-book);
    font-size: var(--font-size);
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing);
    line-height: var(--line-height);
}

/* THUMBNAIL */

.overview {
    width: calc(100vw - (var(--margin) * 6));
    height: calc(100vh - (var(--margin) * 12));
    margin-top: calc(var(--margin) * 2);
    margin-bottom: calc(var(--margin) * 6);

    display: flex;
}

.thumbnail-gallery {
    width: 100%;
    height: 100%;
    scroll-snap-align: start;
    overflow: hidden;
    transition: width 0.4s ease;

    font-family: var(--font-book);
    font-size: var(--font-size);
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing);
    line-height: var(--line-height);
}

.thumbnail-box::-webkit-scrollbar {
    display: none;
}

.thumbnail-box {
    width: 100%;
    height: 100%;
    overflow-y: scroll;
}

.thumbnail-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
}

.text-gallery-content::-webkit-scrollbar {
    display: none;
}

.text-gallery {
    /* border: red 1px solid; */
    width: 0;
    height: 100%;
    transition: width 0.4s ease 0.2s;

    display: flex;
    align-items: center;
    justify-content: center;

    font-family: var(--font-book);
    font-size: var(--font-size);
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing);
    line-height: var(--line-height);
}

.text-gallery-content {
    /* border: red 1px solid; */

    opacity: 0;
    transition: opacity 0.2s ease;

    height: calc(100% - (var(--margin) * 4));
    width: 100%;
    margin: calc(var(--margin) * 6);
    overflow-y: scroll;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.text-gallery-caption {
    margin-top: calc(var(--margin) * 2);
    text-transform: initial;
    letter-spacing: 0;
}

.overview.is-open .thumbnail-gallery {
    width: 50%;
}

.overview.is-open .text-gallery {
    width: 50%;
    transition-delay: 0s;
}

.overview.is-open .text-gallery-content {
    opacity: 1;
    transition-delay: 0.4s;
}

/* VIDEO */

iframe {
    width: 100%;
    height: 100%;
}


@media (max-width: 1000px) {

    .overview {
        width: calc(100vw - (var(--margin) * 4));
        height: calc(100vh - (var(--margin) * 8));
        margin-top: calc(var(--margin) * 2);
        margin-bottom: calc(var(--margin) * 2);

        display: flex;
    }

    .thumbnail-title {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        margin: calc(var(--margin) * 2);

        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
        text-align: left;
    }

    .title-track-hidden{
        display: block;
    }

    .thumbnail-title::after {
        content: "";
        position: absolute;
        inset: 0 0 0 auto;

        width: 6rem;

        background: linear-gradient(to right,
                transparent,
                var(--bg));
    }

    @keyframes title-loop {
        from {
            transform: translateX(0);
        }

        to {
            transform: translateX(calc(-50% - 1.5rem));
        }
    }

    .text-btn {
        position: fixed;
        bottom: 0;
        right: 0;
        margin: calc(var(--margin) * 2);

        font-family: var(--font-book);
        font-size: var(--font-size);
        text-transform: uppercase;
        letter-spacing: var(--letter-spacing);
        line-height: var(--line-height);
    }


    /* TEXT GALLERY */

    .overview {
        flex-direction: column;
    }

    .thumbnail-gallery {
        width: 100%;
        height: 100%;
        transition: height 0.4s ease;
    }

    .text-gallery {
        width: 100%;
        height: 0;
        transition: height 0.4s ease 0.2s;
    }

    .text-gallery-content {
        height: calc(100% - (var(--margin) * 8));
        width: 100%;
        margin: calc(var(--margin) * 4);
        overflow-y: scroll;

        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: start;
        text-align: center;
    }

    .overview.is-open .thumbnail-gallery {
        width: 100%;
        height: 50%;
    }

    .overview.is-open .text-gallery {
        width: 100%;
        height: 50%;
        transition-delay: 0s;
    }
}