/**
Custom CSS for Story-Videos
*/

:root {
    --translate-x: 0%;
    --slider-elements-count: 1;
}

.story-wrapper {
    width: 100%;
}

.story-viewer {
    display: grid;
    grid-template-areas:
            "left video right";
    grid-template-columns: 0.3fr 1fr 0.3fr;
    background-color: #282729;

}

/* Video */
.story-video {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    justify-self: center;
}

.slide-content video {
    max-width: 100%;
    cursor: pointer;
    pointer-events: none;
}

.slide-content img {
    max-width: 100%;
    cursor: pointer;
    pointer-events: none;
    align-self: center;
}

/* play button */
.video-controls-play {
    -webkit-appearance: none;
    transition: opacity 0.5s;
    height: 5rem;
    width: 5rem;
    opacity: 0.5;
    justify-self: center;
    align-self: center;
    background: unset;
    border: none;
    visibility: hidden;
    pointer-events: none;
}

.video-controls-play i {
    font-size: 4em;
    color: snow;
    pointer-events: none;
}

/* progress-bar*/
.video-controls-seekBar {
    align-self: start;
    grid-row: 1;
    grid-column: 1;
    margin: 0;
    border: none;
    border-radius: 2px;
    width: 100%;
    height: 0;
    background: unset;
}

/* Chrome styling */
@supports not (-moz-appearance: none) {
    .video-controls-seekBar {
        align-self: start;
        grid-row: 1;
        grid-column: 1;
        margin: 0;
        border: none;
        border-radius: 2px;
        width: 100%;
        height: 0.3em;
        background: unset;
        -webkit-appearance: none;
        overflow: hidden;
        filter: drop-shadow(0px 0px 2px snow);
    }

    input[type=range]:focus::-webkit-slider-runnable-track {
        background: unset;
        border-radius: 4px;
        cursor: pointer;
    }

    input[type=range]::-webkit-slider-runnable-track {
        height: 10px;
        -webkit-appearance: none;
        color: #13bba4;
        margin-top: -1px;
        cursor: pointer;
    }

    input[type='range']::-webkit-slider-thumb {
        -webkit-appearance: none;
        height: 0.3em;
        width: 0.3em;
        transform: translate(0em, 0.2em);
        cursor: grab;
        background: white;
        box-shadow: -100vw 0 0 100dvw snow;
        overflow-inline: hidden;
    }
}

/* track focus */
.video-controls-seekBar:focus::-moz-range-track {
    background: unset;
}

/* track with progress */
input[type=range]::-moz-range-progress {
    background: snow;
    border-radius: 4px;
    cursor: pointer;
}

/* slider thumb */
input[type=range]::-moz-range-thumb {
    border: none;
    border-radius: 50%;
    background: snow;
    height: 0.4rem;
    width: 0.4rem;
    box-shadow: 0 0 2px 1px snow;
    z-index: 1000;
    cursor: grab;
}

/**/
input[type=range]:-moz-focusring{
    outline: 1px solid snow;
    outline-offset: -1px;
}

/* Sound Button */
.video-controls-sound {
    grid-row: 2;
    grid-column: 1;
    height: fit-content;
    justify-self: end;
    background-color: unset;
    border: none;
    z-index: 300;
    cursor: pointer;
}

.video-controls-sound i {
    color: snow;
    font-size: 1.7em;
    padding: 0.3em;
    display: none;
}

/**/
.story-content {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    justify-self: center;
}

.story-content-inner {
    grid-row: 1;
    grid-column: 1;
    grid-row-end: span 2;
}

#storyNextLeft {
    grid-area: left;
}

#storyNextRight {
    grid-area: right;
}

.story-button {
    width: 100%;
    cursor: pointer;
    align-content: center;
    justify-self: center;
    font-size: 3em;
    text-align: center;
    color: snow;
}

/* Clickable */
.story-button:hover i {
    transform: scale(140%);
}

/* Slider */
.slider {
    width: 100%;
    overflow: hidden;
    padding-top: 1em;
    padding-bottom: 1em;
}

.slideables {
    transform: translateX(var(--translate-x));
    display: flex;
    flex-direction: row;
    width: calc(100% * var(--slider-elements-count));
    justify-self: start;
    justify-content: space-around;
    transition: transform 0.7s;
}

.slide-content {
    width: 100%;
    max-width: 400px;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
}

.slide-content-inner {
    max-width: 100%;
    grid-row: 1;
    grid-column: 1;
}


@media screen and (max-width: 700px) {
    .story-content {
        width: 100%;
    }

    .story-content-element {
        width: 100%;
    }

    #slideables .slide-content .slide-content-inner {
        width: 100%;
    }

    #slideables {
        max-width: unset;
        justify-content: space-around;
    }
}

@media screen and (max-width: 700px) {
    html, body {
        margin: 0;
        padding: 0;
        height: 100%;
        overflow: hidden;
    }

    .story-viewer {
        position: fixed;
        inset: 0;
        background-color: black;
        z-index: 9999;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .slider {
        width: 100vw;
        height: 100vh;
        overflow: hidden;
        padding: 0;
    }

    .slideables {
        display: flex;
        width: 100%;
        height: 100%;
        transition: transform 0.5s ease;
    }

    .slide-content {
        position: relative;
        width: 100vw;
        height: 100vh;
        max-width: 100%;
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .slide-content video,
    .slide-content img {
        width: 100vw;
        height: 100vh;
        object-fit: cover;
        pointer-events: none;
    }

    /* Arrows */
    .story-button {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        font-size: 2.5rem;
        color: white;
        background: rgba(0, 0, 0, 0.3);
        width: 2.5rem;
        height: 2.5rem;
        border-radius: 50%;
        display: flex !important;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 1001;
    }

    #storyNextLeft {
        left: 1rem;
    }

    #storyNextRight {
        right: 1rem;
    }

    .slide-content video + .video-controls-play,
    .slide-content video + .video-controls-play + .video-controls-seekBar,
    .slide-content video + .video-controls-play + .video-controls-seekBar + .video-controls-sound {
        display: block;
    }

    .video-controls-play {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        height: 4rem;
        width: 4rem;
        background: none;
        border: none;
        opacity: 0.8;
        z-index: 1002;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .video-controls-play i {
        font-size: 3.5rem;
        color: white;
    }

    .video-controls-seekBar {
        position: absolute;
        bottom: 2.8rem;
        left: 1rem;
        right: 1rem;
        height: 5px;
        background: rgba(255, 255, 255, 0.3);
        z-index: 1002;
        -webkit-appearance: none;
    }

    .video-controls-seekBar::-webkit-slider-thumb {
        -webkit-appearance: none;
        background: white;
        height: 10px;
        width: 10px;
        border-radius: 50%;
        cursor: pointer;
    }

    .video-controls-sound {
        position: absolute;
        bottom: 1.2rem;
        right: 1rem;
        background: none;
        border: none;
        z-index: 1002;
        font-size: 1.8rem;
        color: white;
    }

    .video-controls-sound i {
        display: inline;
    }

    .slide-content:not(:has(video)) .video-controls-play,
    .slide-content:not(:has(video)) .video-controls-seekBar,
    .slide-content:not(:has(video)) .video-controls-sound {
        display: none !important;
    }
        #nav {
        display: none;
    }

    .mobile-only {
        display: block;
        background-color: #333;
        color: white;
        padding: 0.5em 1em;
        border: none;
        font-size: 1em;
        margin: 1em 0;
        cursor: pointer;
    }
}

#mobileBackButton {
  display: none;
}

@media (max-width: 700px) {
  #mobileBackButton {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 1em;
    left: 1em;
    z-index: 9999999;

    background-color: rgba(0, 0, 0, 0.75);
    color: #fff;
    border: none;
    padding: 0.5em 0.8em;
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  }

  #mobileBackButton i {
    margin-right: 0.5em;
  }
}
@media (max-width: 700px) {
    #titleBar {
        display: none !important;
    }
}