/* Custom styles that extend the default mkdocs theme */

@font-face {
    font-family: 'DM Sans';
    src: url('../fonts/DMSans-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'DM Sans';
    src: url('../fonts/DMSans-Light.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
}

@font-face {
    font-family: 'DM Sans';
    src: url('../fonts/DMSans-ExtraBold.ttf') format('truetype');
    font-weight: 800;
    font-style: normal;
}

:root {
    --readit-primary: #000;
    --readit-primary-85: #262626;
    --readit-primary-75: #3f3f3f;
    --readit-primary-25: #bfbfbf;
    --readit-primary-12: #e0e0e0;
    --readit-primary-light: #f0f0f0;
    --readit-primary-white: #fff;
    --readit-accent: #ffd000;

    --bs-body-bg: var(--readit-primary);
    --bs-body-color: var(--readit-primary-light);
    --bs-border-width: 0;
}

body {
    font-family: 'DM Sans', sans-serif;
    line-height: 1.2em;
}
    body::before {
        /* Remove mkdocs grid background image element. */
        display: none;
    }

h1, h2, h3, h4, h5, h6 {
    font-weight: bold;
    line-height: 1.1em;
    margin-bottom: 0.8em;
    position: relative; /* Keep the headerlink inside. */
}

    /* The heading permalink icon. */
    .headerlink {
        color: inherit;
        font-size: 0.8rem;
        line-height: 1em; /* Remove the heading line-height. */
        padding: 0.7rem;
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
    }

p {
    font-weight: lighter;
    margin-bottom: 1.2em;
}

a {
    color: var(--readit-accent);
}
    a:hover {
        color: var(--readit-primary-light);
    }

code,
.hljs {
    background-color: var(--readit-primary-85);
    color: var(--readit-primary-light);
}
code {
    padding: 0 0.2em; /* Remove mkdocs paddings, since the elements overlap. */
}

.bg-primary {
    background-color: var(--readit-primary) !important;
}

.bg-body-tertiary {
    background-color: var(--readit-primary-85) !important;
}

.nav {
    --bs-nav-link-color: var(--readit-primary-light);
    --bs-nav-link-hover-color: var(--readit-primary-white);
    --bs-nav-link-disabled-color: var(--readit-primary-75);
}

    .nav-link {
        /* Make the active and hover borders yellow. */
        border-color: var(--readit-accent) !important;
    }
        .nav-link:focus-visible {
            box-shadow: none; /* Remove the dark Bootstrap outline. */
            outline: auto; /* Use the browser's default outline. */
        }

.navbar {
    --bs-navbar-active-color: var(--readit-accent);
    --bs-navbar-brand-color: var(--readit-primary-light);
    --bs-navbar-brand-hover-color: var(--readit-primary-white);
    --bs-navbar-color: var(--readit-primary-light);
    --bs-navbar-disabled-color: var(--readit-primary-75);
    --bs-navbar-hover-color: var(--readit-primary-white);
}
    .navbar.bg-primary {
        /* Remove default MkDocs background. */
        background-image: none;
    }

    .navbar-brand {
        align-items: center;
        color: var(--readit-primary-25);
        display: flex;
        font-size: 16px;
        white-space: normal; /* Override default Bootstrap behavior. */
    }

        .navbar-brand img {
            height: 50px;
        }

    .navbar-nav {
        --bs-nav-link-padding-x: 1rem;

        flex-wrap: nowrap; /* Keep nav items on a single line. */
        margin-left: auto;
    }
        .navbar-nav:last-child {
            flex-direction: row;
            margin-top: 0.5rem;
        }

        .dropdown-menu {
            --bs-dropdown-bg: var(--readit-primary-85);
            --bs-dropdown-border-radius: 12px;
            --bs-dropdown-link-active-bg: inherit;
            --bs-dropdown-link-active-color: var(--readit-accent);
            --bs-dropdown-link-hover-bg: var(--readit-primary-75);
            --bs-dropdown-item-border-radius: 12px;
            --bs-dropdown-item-padding-y: 10px;
            --bs-dropdown-item-padding-x: 10px;

            padding: 30px;
        }

            .dropdown-menu li:not(:last-child) {
                margin-bottom: 10px;
            }

                .dropdown-item:focus,
                .dropdown-item:hover {
                    /* Use the same hover color on active links as well. */
                    background-color: var(--bs-dropdown-link-hover-bg);
                }

.bs-sidebar {
    --bs-border-width: 1px;
    --bs-navbar-toggler-border-color: var(--readit-accent);
    --bs-navbar-toggler-border-radius: 8px;
    --bs-navbar-toggler-font-size: 20px;
    --bs-navbar-toggler-padding-y: 8px;
    --bs-navbar-toggler-padding-x: 12px;

    margin-bottom: 20px; /* Space above content on mobile. */
}

    /* NOTICE:
        The navbar-collapse closing animation is broken due to
        Bootstrap CSS: `.card { height: var(--bs-card-height); }`
        Seems to be impossible to fix with CSS.
    */
    .navbar-toggler {
        margin-bottom: 10px;
    }
        .bs-sidebar .navbar-toggler:focus {
            outline: auto; /* Use the browser's default outline. */
        }

footer {
    background-color: var(--readit-accent);
    color: var(--readit-primary);
    margin-bottom: 0; /* Remove mkdocs bottom margin. */
    margin-top: 112px;
    text-align: initial; /* Remove mkdocs default text alignment. */
}

    footer .container {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        min-height: 500px; /* Can be higher on mobile. */
        padding-bottom: 80px;
        padding-top: 80px;
    }

        .footer-logo {
            max-width: 100px;
            min-width: 50px;
            width: 13vw; /* Makes the logo shrink on mobile. */
        }
            .footer-logo:hover {
                opacity: 0.85;
            }

            .footer-logo img {
                height: 100%;
                width: 100%;
            }

        .footer-link-container {
            font-size: 1.1rem;
            margin: -1.5rem;
        }

            .footer-link-list {
                margin: 1.5rem;
            }

                /* Apply max-width only on `md` screens and up. */
                @media (min-width: 768px) {
                    .footer-link-list {
                        max-width: 12rem;
                    }
                }

                .footer-link-list-title {
                    font-weight: bold;
                }

                .footer-link-list-items {
                    list-style-type: none;
                    margin: 0;
                    padding: 0;
                }

                    .footer-link-list-items a {
                        display: block;
                        margin-top: 0.2rem;
                        text-decoration: none;
                    }

        .footer-bottom {
            font-size: 0.9rem;
        }

            footer p:last-child {
                margin-bottom: 0; /* Remove bottom margin from the last paragraph. */
            }

            footer a {
                color: var(--readit-primary);
            }
                footer a:hover {
                    color: var(--readit-primary-85);
                }

.modal {
    --bs-modal-bg: var(--readit-primary-85);
}

    .form-group {
        margin-bottom: 1rem; /* Space below search input. */
    }
