/*
#ffead3 (beige) #ea7b7b (peach) #d25353 (red) #9e3b3b (darker red)

/* debugger */
/*
* { outline: 1px solid red; }

/* switches */
body.unauthed .requires-auth {
    display: none;
}

body.authed .requires-unauth {
    display: none;
}

/* main layout */
.layout {
    display: grid;
    grid-template-columns: 1fr 4fr;
    height: 100vh;
    overflow: auto;

    font-family: 'Varela Round', 'Chiron GoRound TC', sans-serif;
}

.layout.on-export {
    height: auto;
}

/* The side navigation menu */
.sidebar {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    height: calc(100vh - 3rem);

    margin: 1.5rem 0 1.5rem 1.5rem;
    padding: 1.5rem;

    border-radius: 2rem;
    background-color: rgba(255, 244, 233, 0.7);
    box-shadow: 0 1px 1rem rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* sidebar header */
.sidebar-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 0 1 auto;

    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    color: #363644;
}

.logo {
    width: 100%;
    height: 100%;

    max-width: 300px;

    object-fit: contain;
    border-radius: 0.5rem;

    margin-bottom: 0.5rem;
}

/* Sidebar links */
.sidebar-content {
    flex: 1 1 auto;

    min-height: 0;

    padding: 1.5rem 0;
    overflow-x: hidden;
    overflow-y: auto;

    scroll-behavior: smooth;
    scrollbar-color: #9e3b3b #ffead3;
}

.sidebar a {
    position: relative;
    display: block;

    font-size: clamp(1rem, 1.2vw, 1.5rem);
    color: #363644;

    padding: 1.2rem 1rem;
    margin: 0 1rem 0.5rem 0;

    text-decoration: none;
    border-radius: 0.5rem;
}

/* Links on mouse-over */
.sidebar a:hover:not(.active) {
    background-color: #ea7b7b;
    color: #363644;
}
.sidebar a.active {
    background-color: #9e3b3b;
    color: #e1e1e1;
    font-weight: 600;
}

.sidebar-footer {
    display: flex;
    align-items: center;
    gap: 1rem;

    position: relative;

    flex: 0 0 auto;
    padding: 1rem 0 0;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    font-size: 0.8rem;
    color: #363644;

    span {
        opacity: 1;
        transition: opacity 0.25s ease;
    }
    &.search-on span {
        opacity: 0;
    }

    input {
        position: absolute;
        left: 5rem;
        right: 0;

        font-family: inherit;
        font-size: 1.2rem;

        width: auto;

        padding: 0.75rem;

        opacity: 0;

        transform: scaleX(0);
        transform-origin: left;

        pointer-events: none;
        transition: transform 0.25s ease, opacity 0.25s ease;

        border: 1px solid rgba(41, 42, 43, 0.6);
        border-radius: 1rem;
    }
    &.search-on input {
        opacity: 1;
        transform: scaleX(1);
        pointer-events: auto;
    }
}

.sidebar-search-button {
    font-family: inherit;
    font-size: 1.5rem;

    flex: 0 0 auto;
    width: 4rem;
    height: 4rem;

    border-radius: 1rem;

    text-align: center;
    text-decoration: none;

    padding: auto;
    border: none;

    background-color: #9e3b3b;
    color: #e1e1e1;
}

/* Page content. */
.content {
    display: flex;
    flex-direction: column;

    padding: 1.5rem;
    min-height: 0;
}

.content-bg.on-export {
    position: absolute;
    left: 50%;
    top: 50%;

    width: 150%;
    height: 150%;

    background-image: url('/assets/gd_background.svg');
    background-size: 300px;
    background-repeat: repeat;

    z-index: -1;

    transform: translate(-50%, -50%) rotate(7deg);;
}

/* On screens that are less than 800px wide, make the sidebar into a topbar */
@media screen and (max-width: 800px) {
    .layout {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr 3fr;
    }
    .logo { display: none; }
    .sidebar {
        position: relative;
        width: calc(100vw - 3rem);
        height: 25vh;
        margin: 1.5rem 1.5rem 0 1.5rem;
    }
    .sidebar-content { padding: 1rem 0 0.5rem; }
    .sidebar a { float: left; }
    .sidebar-footer { padding: 1rem 0 0.5rem; }
}

/* On screens that are less than 400px, display the bar vertically, instead of horizontally */
@media screen and (max-width: 400px) {
    .sidebar a {
        text-align: center;
        float: none;
    }
}
