/* Navigation */
.sidebar {
    width: 300px;
    display: flex;
    flex-direction: column;
    justify-content: start;
    padding: 1rem;
    border-right: 1px solid var(--border);
    background: var(--bg-surface);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 10;

    & .logo-wrapper {
        width: 100%;
        margin: 1rem auto;

        & a {
            width: 100%;

            & img {
                width: 100%;
            }
        }
    }

    & .main-nav {
        width: 100%;
        display: flex;
        flex-direction: column;
        padding: 1rem;
        height: 65vh;
        direction: rtl;
        overflow: auto;
        overscroll-behavior: contain;
        border-top: 1px solid var(--border);
        border-bottom: 1px solid var(--border);
        scrollbar-width: thin;
        scrollbar-color: var(--bg-elevated) transparent;

        & > * {
            direction: ltr;
        }

        & .padded {
            margin-bottom: 3rem;
        }

        & .main-link {
            font-weight: 800;
            text-decoration: underline;
        }

        .link-wrapper {
            padding-left: 1rem;
            display: flex;
            flex-direction: column;
            margin-bottom: 2rem;

            & .sub-link {
                opacity: .75;
                width: fit-content;
                font-size: .8rem;
            }

            & .sub-link::before {
                content: '|-';
            }
        }

    }

    & .footer {
        width: 100%;
        padding: 1rem;
        display: flex;
        flex-direction: column;
        margin-top: auto;

        & .social {
            margin-top: 2rem;
            width: 100%;
            display: flex;
            justify-content: space-evenly;
        }

        & .ref {
            padding: .5rem;
            border-top: 1px solid var(--border);
            font-size: .6rem;
            color: var(--text-muted);
            margin: auto;
        }
    }
}

#Collapse {
    position: absolute;
    top: 0;
    left: 300px;
    padding: 1rem;
    background: var(--bg-surface);
    display: flex;
    justify-content: center;
    align-items: center;
    user-select: none;
    -moz-user-select: none;
    border: 1px solid var(--border);

    & img {
        width: 20px;
    }
}

#Collapse:hover {
    cursor: pointer;
}


.sidebar .main-nav::-webkit-scrollbar {
    width: 0;
}

.sidebar .main-nav:hover::-webkit-scrollbar {
    width: 3px;
}

.sidebar .main-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar .main-nav::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.sidebar .main-nav::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}



/* Latest Posts */
.latest-posts {
    width: 100%;
    display: flex;
    justify-content: space-evenly;
    margin: 3rem 0;
    border-top: 1px solid var(--border);

    & a {
        color: var(--accent-gold-soft);
        margin-bottom: 1rem;
        font-size: .8rem;
    }

    & .wrapper {
        display: flex;
        flex-direction: column;
        width: 24%;

        & .inner {
            display: flex;
            flex-direction: column;
        }
    }
}

/* Components */
._cta {
    width: 100%;
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    padding: 5rem 3rem;
    border-top: 1px solid var(--border);
    margin: 2rem 0;

    & form {
        width: 50%;
        display: flex;
        flex-direction: column;
        align-items: start;

        & label {
            color: var(--accent-gold);
            font-size: 1.5rem;
        }

        & input {
            background: var(--bg-elevated);
            border: none;
            border-bottom: 1px solid var(--border);
            width: 60%;
            padding: .2rem;
            font-size: 1rem;
            margin: 1rem 0;
            color: var(--text-primary);
        }

        & button {
            padding: .3rem 2rem;
            font-size: 1rem;
            color: black;
            background: var(--accent-gold);
            margin-top: 2rem;
        }
    }
}


._footer-cta {
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 2rem;
    border-top: 1px solid var(--border);

    & .contact, 
    & .other,
    & .legal {
        width: 24%;
        display: flex;
        flex-direction: column;

        & a {
            color: var(--accent-gold-soft);
            width: 100%
        }
    }
}

._related-content {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin-top: 2rem;
    border-top: 1px solid var(--border);
    padding: 2rem;
    gap: 2rem;

    & .link-wrapper {
        display: flex;
        padding-left: 2rem;

        & a {
            font-size: .8rem;
            color: var(--accent-gold-soft);
        }
    }
}

._img-banner {
    width: 50%;
    margin: 0;
    margin: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;

    & img {
        width: 100%;
        height: auto;
        margin: 0;
        padding: 0;
    }
}


@media screen and (max-width: 1200px) {
    ._cta {
        flex-direction: column;
        align-items: start;

        & form {
            width: 100%;
            margin-bottom: 2rem;

            & input {
                width: 80%;
            }
        }
    }

    .latest-posts {
        flex-direction: column;
        padding: 0 1rem;

        & .wrapper {
            width: 100%;
            
            & .inner {
                display: grid;
                grid-template-columns: repeat(2, 1fr);
                column-gap: 2rem;
                row-gap: 1rem;
            }
        }
    }

    ._related-content {
        grid-template-columns: repeat(2, 1fr);
    }
}


@media screen and (max-width: 900px) {
    ._cta {
        & form {
            & input {
                width: 100%;
            }
        }
    }

    ._footer-cta {
        display: flex;
        flex-direction: column-reverse;
        align-items: center;
        text-align: center;
        

        & .legal, 
        & .contact, 
        & .other {
            width: 100%;
            margin: 1rem 0;
        }
    }

    ._related-content {
        grid-template-columns: repeat(1, 1fr);
    }
}
