@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@200&display=swap');

@layer styleguide {
    body {
        margin: 0;
    }

    sg-unit {
        display: block;
    }

    .guide-wrapper {
        @media screen and (min-width: 768px) {
            display: flex;
            flex-direction: row;
            flex-wrap: wrap;
        }
    }

    .guide-sitename {
        background: #000;
        padding: .5em 1em;
        font-family: serif;
        font-style: italic;
        display: flex;
        justify-content: space-between;
    }
    .guide-sitename a {
      font-size: 1rem;
      color: #fff;
      text-decoration: none;
    }
    @media screen and (max-width: 500px) {
      .guide-sitename {
        padding: .4em 1em;
        text-align: center;
      }
      .guide-sitename a {
        font-size: .8rem;
      }
    }

    .guide-nav {
        background: #130f40;
        color: #fff;
        overflow: auto;
        padding: 2em;
        @media screen and (min-width: 768px) {
            width: 240px;
            box-sizing: border-box;
            position: sticky;
            top: 0;
            height: 100%;
            min-height: 100vh;
        }
        @media screen and (max-width: 767px) { 
            padding: .8em 2em .2em 2em;
        }
    }

    .guide-nav summary {
        user-select: none;
        margin: 0 0 1em;
        padding: 0;
        font-size: 15px;
        
    }

    .guide-nav ul {
        margin: 0 0 0 1em;
        padding: 0;
        @media screen and (max-width: 767px) {
            padding-bottom: 1em;
        }
    }

    .guide-nav li {
        margin-bottom: .8em;
    }

    .guide-nav button {
        cursor: pointer;
        border: 0;
        background: transparent;
        color: #fff;
        font-size: 15px;

        &:hover {
            text-decoration: underline;
        }
    }

    .guide-sub-list {
        margin-top: .4em;
        margin-left: .8em;
    }

    .guide-sub-list button {
        display: block;
        margin-top: .4em;
        font-size: 14px;
    }

    .guide-main {
        @media screen and (min-width: 768px) {
            width: calc(100% - 240px);
        }
    }

    #guide-wrap {
        padding: 4em;
        @media screen and (max-width: 767px) {
            padding: 2em;
        }
    }

    #guide-wrap > h1 {
        all: revert;
        margin-top: 0;
        font-size: 300%;
        font-weight: bold;
    }
    #guide-wrap > h2 {
        all: revert;
        margin-top: 2em;
        font-size: 200%;
        font-weight: bold;
    }
    #guide-wrap > h3 {
        all: revert;
        margin-top: 1.6em;
        margin-bottom: .8em;
        color: #AAA;
        font-size: 160%;
        font-weight: bold;
    }

    .guide-wrap-code {
        position: relative;
        overflow: auto;
        display: block;
        background: #efefef;
        margin: 2em 0;
        padding: 0 2em 1.8em 2em;
        white-space: pre-wrap;
        overflow-wrap: break-word;
        font-size: 100%;
        line-height: 1.8;
    }

    #guide-wrap .guide-btn {
        cursor: pointer;
        position: absolute;
        right: 0;
        bottom: 0;
        background: #000;
        color: #fff;
        padding: .6em .8em;
        transition: .25s background;
    }

    #guide-wrap button.is-success {
        background: green;
    }

    .u-ta-left {
        text-align: left;
    }
    
    .u-ta-center {
        text-align: center;
    }
    
    .u-ta-right {
        text-align: right;
    }

    .c-btn {
        cursor: pointer;
        display: inline-block;
        border-radius: .3em;
        padding: .2em .8em;
        text-decoration: none;
        border: 0;
        font-size: 100%;
        line-height: 1.5;
        transition: .25s filter;

        &:hover {
            filter: brightness(120%);
        }
    }
}