/* STORY PAGE */
/*            */
#story-grid-wrapper {
    display: grid;
    grid-template-columns: 15% 15% 65%;
    grid-template-rows: 10% 1fr;
    grid-template-areas:
        "sbar img info"
        "sbar img story"
    ;
    grid-gap: 2.5%;
}

#story-list-of-stories {
    grid-area: sbar;
    font-family: quicksand;
    color: var(--darkBlue);
    background-color: rgba(var(--headerBlueT), 1);
    border: 2px var(--borderBlue) solid;
    /* border-radius: 10px; */
    text-align: center;

    ul {
        padding: 0;
        list-style-type: none;
    }

    ul li {
        padding: 0.5em;
    }

    ul li:hover {
        transition: 0.5s;
        background-color: var(--paleYellow);
    }
    
    #bar-title {
        font-weight: bold;
        text-decoration: underline;
        font-size: 1.2em;
        margin-bottom: 0.5em;
    }
}

#story-image {
    grid-area: img;
}

#story-image img {
    border: 2px var(--borderBlue) solid;
    /* border-radius: 10px; */
    width: 100%;
    margin-bottom: 10%;
}

#story-story {
    grid-area: story;
    text-align: justify;
    padding: 0 1em;

    overflow-x: hidden;
    overflow-y: scroll;
}

/* Sub-Grid for chapter navigation buttons */
#story-header-wrapper {
    grid-area: info;
    display: grid;
    padding: 0 1em;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    grid-template-areas:
        "last chapters next"
        "title title title"
    ;
    gap: 0 2em;
}

#story-title {
    grid-area: title;

    .downwards-sub-header {
        margin-top: 1em;
    }
}

/* ALL CHAPTER BUTTON AND DROPDOWN */
/* https://codepen.io/remilaudanski/pen/gbBGyN?editors=1100 */
/* input selector */
.story-chapter-button {
    padding: 3px 15px;
    color: var(--darkBlue);
    background-color: rgba(var(--headerBlueT), 1);
    border: 2px var(--darkBlue) solid;
    border-radius: 20px;
    box-shadow: 0px 0px 8px -2px rgba(var(--darkBlueT), 0.5);

    font-family: quicksand;
    text-align: center;
    font-weight: bold;
    letter-spacing: 0.15em;
}

.story-chapter-button:hover {
    background-color: rgba(var(--darkBlueT), 0.5);
    color: var(--paleYellow);
}

#lastChapter {
    grid-area: last;
}

#nextChapter {
    grid-area: next;
}

#allChapters {
    position: relative;
    opacity: 0;
    height: 0px;
}

#story-all-chapters {
    grid-area: chapters;
    width: 100%;
    height: 30px;
}

#chapter-list {
    position: absolute;
    max-height: 0px;
    padding: 0.5em 0;

    font-family: quicksand;
    font-weight: bold;
    letter-spacing: 0.1em;
    /* font-size: 14px; */

    background-color: rgba(var(--headerBlueT), 1);
    box-shadow: 0px 5px 5px 0px rgba(var(--darkBlueT), 0.5);
    border: 2px var(--darkBlue) solid;
    border-radius: 10px;

    text-align: center;
    transition: max-height .4s ease;
    position: absolute;
    opacity: 0;

    li {
        color: var(--darkBlue);
        padding: 4px;
        list-style: none;
    }

    li:hover {
        background-color: var(--paleYellow);
        color: rgba(var(--darkBlueT), 0.6);
    }
}

#allChapters:checked+#chapter-list {
    max-height: 400px;
    opacity: 1;
    width: 100%;
    position: relative;
    margin: -1em auto;
}



/* JUMP TO POSITION FIXES */
/*                        */
#jump-to-characters {
    position: absolute;
    top: 0;
    /* top of the page */
}

#jump-to-stories {
    position: absolute;
    top: 0;
    /* top of the page */
}



/* Slighly-less-than-Large Sized Screens */
@media(max-width: 1290px) {
    #story-header-wrapper {
        gap: 5px;
    }

    #story-title .downwards-sub-header {
        margin-top: 0;
    }

    .story-chapter-button {
        font-size: 1vw;
    }
}

/* Medium sized */
@media(max-width: 840px) {
    #story-grid-wrapper {
        grid-template-columns: 20% 80%;
        grid-template-rows: 125px min-content auto;
        grid-template-areas:
            "img img"
            "sbar info"
            "sbar story"
        ;
    }

    #story-image {
        display: flex;
        justify-content: center;
    }

    #story-image img {
        width: auto;
        height: 100px;
        margin: 0 5%;
    }

    #story-title .downwards-sub-header {
        margin-top: 1em;
    }

    #story-header-wrapper {
        grid-template-columns: repeat(4, 1fr);
        grid-template-rows: repeat(3, min-content);
        grid-template-areas:
            ". chapters chapters ."
            "last last next next"
            "title title title title"
        ;
    }

    .story-chapter-button, #chapter-list, #story-list-of-stories {
        font-size: 0.75em;
    }
}

/* Phone sized */
@media(max-width: 520px) {
    #story-grid-wrapper {
        grid-template-columns: 100%;
        grid-template-rows: min-content min-content min-content 1fr;
        grid-template-areas:
            "img"
            "sbar"
            "info"
            "story"
        ;

        /* overflow-x: hidden;
        overflow-y: scroll; */
    }

    #story-story {
        padding: 0;
    }

    #story-header-wrapper {
        grid-template-areas:
            "chapters chapters chapters chapters"
            "last last next next"
            "title title title title"
        ;
    }

    #story-list-of-stories {
        font-size: 1em;
    }
}