@import "variables";
@import "markdown";
@import "utils";
@import "landing-page";
@import "top-bar";
@import "menu";
@import "shortcodes";
@import "syntax";
@import "search-widget";
@import "graphql-playground-widget";
@import "breadcrumbs";
@import "blog";

html {
    font-size: $font-size-base;
    letter-spacing: 0.33px;
    // scroll-behavior: smooth;
}

html,
body {
    min-width: $body-min-width;
    overflow-x: hidden;
}

body {
    color: $body-font-color;
    background: $body-background;
    font-family: 'Open Sans', sans-serif;
    font-weight: $body-font-weight;

    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;

    box-sizing: border-box;
    * {
        box-sizing: inherit;
    }
}

h1,
h2,
h3,
h4,
h5 {
    // font-weight: 400;
}

a {
    text-decoration: none;
    color: $color-link;

    &:visited {
        color: $color-visited-link;
    }
}

img {
    vertical-align: middle;
}

aside nav ul {
    padding: 0;
    margin: 0;
    list-style: none;

    li {
        margin: 1em 0;
    }

    a {
        display: block;
    }

    a:hover {
        opacity: .5;
    }

    ul {
        padding-left: $padding-16;
    }
}

ul.pagination {
    display: flex;
    justify-content: center;

    .page-item a {
        padding: $padding-16;
    }
}

.container {
    min-width: $container-min-width;
    max-width: $container-max-width;
    margin: $top-bar-height auto 0;
}

ul.contents-list {
    padding: 0;
    list-style-type: none;
    text-transform: capitalize;
}

.book-brand {
    margin-top: 0;
}

.book-menu {
    flex: 0 0 $menu-width;
    font-size: $font-size-14;

    nav {
        width: $menu-width;
        padding: $padding-16;

        @include fixed;
    }

    @include dark-links;
}

.book-page {
    min-width: $body-min-width;
    min-height: 80vh;
    flex: 1;
    padding: $padding-16 * 1.6;
}

.book-header {
    margin-bottom: $padding-16;
    display: none;
}

.book-toc {
    flex: 0 0 $toc-width;
    font-size: $font-size-12;

    nav {
        width: $toc-width;
        padding: $padding-16;

        @include fixed;
    }

    nav > ul > li {
        margin: 0;
    }
    a.active {
        font-weight: bold;
        position: relative;
        &::before {
            content: '';
            position: absolute;
            left: -12px;
            top: 3px;
            display: block;
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background-color: $brand-color;
            opacity: 0.5;
        }
    }
}

.book-git-footer {
    display: flex;
    margin-top: $padding-16;
    font-size: $font-size-14;
    align-items: baseline;

    img {
        width: $font-size-14;
        vertical-align: bottom;
    }
}

.book-footer {
    height: 200px;
    text-align: center;
    color: $gray-600;
    margin-top: 60px;
    font-size: 12px;
}

.book-posts {
    min-width: $body-min-width;
    max-width: $sm-breakpoint;
    padding: $padding-16;

    article {
        padding-bottom: $padding-16;
    }
}

.footer {
    @include texture-bg;
    padding: 30px 10px;
    margin-top: 120px;
    color: $gray-600;

    .gh-link {
        margin-left: 12px;
    }

    .footer-logo img {
        width: 100px;
        filter: saturate(0%);
        opacity: 0.5;
    }

    .links {
        margin-left: 12px;
        margin-bottom: 60px;
        ul {
            font-size: 18px;
            list-style-type: none;
            padding-left: 0;
            li {
                margin: 12px 0;
            }
        }
        .email-link {
            display: flex;
            align-items: center;
            img {
                width: 24px;
                height: 24px;
                margin-right: 6px;
            }
        }
    }
    .copyright {
        font-size: 12px;
        text-align: center;
    }
    a:link, a:visited {
        color: $gray-500;
        transition: color 0.2s;
    }
    a:hover {
        color: $gray-200;
    }
}

// Responsive styles
aside nav,
.book-page,
.markdown {
    transition: 0.2s ease-in-out;
    transition-property: transform, margin-left, opacity;
    will-change: transform, margin-left;
}

@media screen and (max-width: $md-breakpoint) {
    .book-toc {
        display: none;
    }
}

@media screen and (max-width: $sm-breakpoint) {
    .book-menu {
        margin-left: -$menu-width;
    }

    .book-header {
        display: flex;
    }

    #menu-control:checked + main {
        .book-menu nav,
        .book-page {
            transform: translateX($menu-width);
        }

        .book-header label {
            transform: rotate(90deg);
        }

        .markdown {
            opacity: 0.25;
        }
    }
}

// Extra space for big screens
@media screen and (min-width: $container-max-width) {
    .book-menu nav {
        padding-top: $padding-16;
    }
}
