.compendium-page {
    display: flex;
    flex-direction: row;
    gap: 40px;

    margin: 20px;
    margin-left: 120px;
    margin-right: 120px;
}

.nav-menu-2 {
    display: none;
}

.page-nav {
    position: sticky;
    top: 124.31px;
    flex-grow: 1;
    min-width: 280px;

    display: flex;
    flex-direction: column;
    height: auto;
    max-height: 84vh;
    overflow: scroll;

    a {
        display: block;
        margin: 0;
        padding: 0;

        font-size: 1.2rem;
        color: var(--dark-red);
    }

    a:hover {
        color: var(--light-red);
    }

    .outer-nav-controls {
        display: flex;
        flex-direction: row;
        justify-content: space-between;

        padding: 8px;
        
        background-color: var(--light-gold);

        a {
            font-weight: bold;
        }

        .expand-nav-btn {
            background-color: transparent;
            padding: 5px;
            margin: 0;
            width: auto;
            height: auto;

            .arrow {
                display: block;
                border-bottom: 4px solid var(--dark-red);
                border-right: 4px solid var(--dark-red);
                min-width: 8px;
                height: 8px;
            }
        }

        .expand-nav-btn:hover {
            box-shadow: none;
            background-color: transparent;

            .arrow {
                border-bottom: 4px solid var(--light-red);
                border-right: 4px solid var(--light-red);
            }
        }
    }

    .outer-nav {
        background-color: var(--fill-cream);

        .inner-nav {
            box-sizing: border-box;

            max-height: 0px;
            overflow: hidden;

            transition: max-height 0.3s ease-out;

            padding-left: 20px;

            a {
                line-height: 100%;
                margin-top: 2px;
                margin-bottom: 5px;
            }

            .linkss {
                padding: 5px 0px 5px 0px;
            }
        }

        .arrow {
            rotate: -45deg;
            transition: rotate 0.3s ease-in-out;
            margin-right: 5px;
        }
    }

    .outer-nav.expanded {
        .inner-nav {
            max-height: 500px;
            transition: max-height 0.3s ease-in;
        }

        .arrow {
            rotate: 45deg;
            transition: rotate 0.3s ease-in-out;
        }
    }
}

.main-book {
    flex-grow: 8;

    

    /* Fix for scrolling with link issue */
    div {
        scroll-margin-top: 110px;
    }
}

.heading-card {
    padding: 20px;
    text-align: center;

    background-color: var(--dark-red);
    border-bottom: 5px solid var(--light-red);

    h2 {
        margin: 0;
        font-size: 2.5rem;
        color: var(--gold);
    }

    p {
        margin: 0;
        color: var(--light-gold);
        text-align: center;
    }

    margin-bottom: 20px;
}

.chapter {
    background-color: var(--fill-cream);
    margin-bottom: 40px;
    padding-bottom: 40px;
}

.subsection {
    padding: 0px 80px 0px 80px;
}

h3 {
    font-size: 2.2rem;
    margin: 0;
    padding-bottom: 16px;
    padding-top: 16px;
    line-height: 100%;
    text-align: center;

    border-top: 10px double var(--light-red);
    border-bottom: 10px double var(--light-red);
    background-color: var(--light-gold);

    margin-bottom: 40px;
}

h4 {
    margin: 0;
    margin-top: 20px;
    font-size: 1.8rem;
}

h5 {
    margin: 0;
    font-family: var(--p-font);
    font-size: 1.2rem;
    font-weight: bold;
}

p, dl {
    font-size: 1.2rem;
    margin: 0;
    margin-bottom: 20px;
    text-align: justify;
}

dl {
    margin-top: 10px;
    column-count: 2;
    column-gap: 40px;

    border: 7px double var(--light-red);
    padding: 20px;

    dt {
        font-weight: bold;
    }

    dd {
        margin: 0;
        margin-left: 20px;
        margin-bottom: 20px;
    }

    dd, dt {
        break-inside: avoid-column;
    }
}

img {
    display: block;
    max-width: 100%;
}

.style-1 {
    border: 3px solid var(--light-red);

    padding: 20px;
    padding-bottom: 5px;
    margin-bottom: 20px;
}

.style-2 {
    border: 3px solid var(--light-red);
    background-color: var(--light-gold);

    padding: 20px;
    padding-bottom: 5px;
    margin-bottom: 20px;
}

.style-3 {
    background-color: var(--light-gold);

    padding: 20px;
    padding-bottom: 5px;
    margin-bottom: 20px;
}

.style-4 {
    border: 5px solid var(--light-red);
    background-color: var(--light-gold);
    border-radius: 20px;

    padding: 20px;
    padding-bottom: 5px;
    margin-bottom: 20px;
}

.style-5 {
    border: 10px double var(--light-red);
    background-color: var(--light-gold);

    padding: 20px;
    padding-bottom: 5px;
    margin-bottom: 20px;
}

#character-creation {
    #cc-gear {

        dd {
            margin-left: 40px;
        }

        ul {
            padding: 0;
        }
    }

    #cc-abilities {

        #roll-3d20 {
            display: flex;
            flex-direction: row;
            gap: 60px;
            justify-content: center;
            align-content: center;
            align-items: center;
            margin-bottom: 10px;

            #p-3d20 {
                max-width: 250px;
                height: min-content;
                border: 5px solid var(--light-red);
                border-radius: 30px;

                background-color: var(--half-gold);

                margin: 0;
                padding: 20px;
            }

            #img-3d20 {
                width: auto;
                height: 150px;
                margin-bottom: 10px;
                margin-top: 10px;
            }
        }

        #how-to-sturdy {
            p {
                margin-bottom: 0;
            }

            img {
                width: auto;
                max-height: 180px;
                margin-bottom: 20px;
                justify-self: center;
            }
        }
    }

    #cc-eccentricities {
        .table {
            margin-bottom: 40px;

            h4 {
                font-size: 1.5rem;
                text-align: center;
                margin-bottom: 10px;
                padding: 5px;
                background-color: var(--light-gold);

                border-top: 3px solid var(--gold);
                border-bottom: 3px solid var(--gold);
            }
        }

        .ecc-table-wrap {
            display: grid;
            grid-template-columns: 1fr 1fr 1fr 1fr;
            gap: 10px;

            .ecct {
                font-size: 1.08rem;
                margin: 0;
                width: 100%;
                border-spacing: 0px;

                th {
                    text-align: left;
                    background-color: var(--dark-red);
                    color: var(--gold);
                    font-weight: bold;
                    padding: 5px;
                    border: none;
                    margin: 0;
                }

                tr:nth-child(even) {
                    background-color: var(--light-gold);
                }

                tr {
                    margin: 0;
                    border: none;
                }

                td {
                    padding-left: 5px;
                }
            }
        }

        .blurb {
            border: 5px solid var(--light-red);
            border-radius: 20px;
            padding: 4px;

            background-color: var(--light-gold);

            #d100 {
                border: 5px solid var(--gold);
                border-radius: 14px;
                padding: 20px;

                p + p {
                    margin-bottom: 0;
                }
            }
        }
    }

    #cc-finishing {

        .col-3, .col-2, #occupations {
            display: flex;
            gap: 20px;
            align-items: flex-start;
            margin-bottom: 20px;

            .subsub {
                max-width: 50%;
                align-self: center;
            }
        }

        #rand-bg-h {
            font-size: 1.5rem;
            text-align: center;
            margin-bottom: 10px;
            padding: 5px;
            background-color: var(--light-gold);

            border-top: 3px solid var(--gold);
            border-bottom: 3px solid var(--gold);
        }

        .bg-table {
            font-size: 1.08rem;
            margin: 0;
            width: 100%;
            border-spacing: 0px;
            border-bottom: 2px solid var(--light-gold);

            th {
                text-align: left;
                background-color: var(--dark-red);
                color: var(--gold);
                font-weight: bold;
                padding: 5px;
                border: none;
                margin: 0;
            }

            tr:nth-child(even) {
                background-color: var(--light-gold);
            }

            tr {
                margin: 0;
                border: none;
                height: min-content;
            }

            td {
                padding-left: 5px;
            }
        }

        #age-table {
            tr {
                height: 20px;
            }
        }
    }
}

#time-travel {
    ul {
        list-style: none;
        margin-left: 0;
        padding-left: 0;
    }
}

@media (max-width: 1500px) {
    .compendium-page {
        margin-left: 20px;
        margin-right: 20px;

        gap: 20px;
    }
}

@media (max-width: 1300px) {
    .compendium-page {
        display: flex;
        flex-direction: column;

        .nav-grid {
            display: none;
        }

        .nav-menu-2 {
            display: block;
            position: fixed;
            top: 134.31px;
            left: 30px;
            
            height: 50px;
            width: min-content;

            .hamburger-2 {
                width: 100%;
                display: flex;
                justify-content: center;
                align-content: center;
                align-self: center;
                flex-direction: column;

                padding: 5px;
                border-radius: 5px;
                border: 0px;
                background-color: var(--light-gold);
                border: 3px solid var(--light-red);

                transition-duration: 0.5s;

                span {
                    background-color: var(--dark-red);
                    height: 6px;
                    width: 40px;
                    border-radius: 20px;
                    /* border: 1px solid #000000; */
                    padding: 0;
                    margin: 3px;
                }
            }
        }

        .nav-grid.expanded {
            display: block;
            position: fixed;
            top: 194.31px;
            left: 30px;

            background-color: var(--light-gold);
            border: 3px solid var(--light-red);

            width: 250px;

            .page-nav {
                max-width: 100%;
                min-width: min-content;
            }
        }
    }
}

@media (max-width: 900px) {
    #character-creation {
        #cc-eccentricities {
            .ecc-table-wrap {
                grid-template-columns: 1fr 1fr;
            }
        }

        #cc-finishing {
            .col-3, .col-2, #occupations {
                flex-direction: column;

                .subsub {
                    max-width: 100%;
                }
            }
        }
    }
}

@media (max-width: 800px) {
    #character-creation {
        #cc-abilities {
            #roll-3d20 {
                flex-direction: column;
                gap: 20px;
            }
        }
    }

    dl {
        column-count: 1;
    }
}

@media (max-width: 600px) {
    .subsection {
        padding: 0px 40px 0px 40px;
    }

    p, dl, h5 {
        font-size: 1rem;
    }

    #character-creation {
        #cc-eccentricities {
            .ecc-table-wrap {
                grid-template-columns: 1fr;
            }
        }
    }
}

@media (max-width: 500px) {
    .compendium-page {
        margin: 0;

        .heading-card {
            border-top: 5px solid var(--light-red);
        }

        .nav-menu-2, .nav-grid.expanded {
            left: 10px;
        }

        .nav-menu-2 {
            top: 114.31px;
        }

        .nav-grid.expanded {
            top: 174.31px;
        }
    }
}