/*   global adjustment   */

html {
    font-family: Roboto, 'Noto Sans', 'Noto Sans CJK SC', 'Source Han Sans CN',
        'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif;
    font-size: 16px;
}

body {
    margin: 0;
    overflow-y: scroll;
    background-color: #dddddd;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: #009688;
    word-break: normal;
}

a,
a:link,
a:visited {
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: darkorange;
    text-decoration: underline;
}

code {
    font-family: 'Roboto Mono', 'Fira Code', 'Monaco', 'Consolas',
        'Noto Sans Mono', 'Noto Mono', 'Droid Sans Mono', monospace;
}

/* nav bar */

nav {
    position: fixed;
    right: 0;
    top: 0;
    height: 48px;
    width: 100%;
    background-color: #009688;
    opacity: 0.9;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.8);
    overflow: auto;
    z-index: 1000;
}

nav .nav-list,
.ft-content {
    display: block;
    height: 100%;
    width: 1140px;
    margin: auto;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
}

nav .nav-list .nav-link {
    display: inline-block;
    box-sizing: border-box;
    height: 48px;
    line-height: 48px;
    color: white;
    padding: 0 1em;
    transition: background-color 0.4s;
}

nav .nav-list .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* header */

.header {
    box-shadow: 0 3px 5px rgba(0, 0, 0, 0.15);
    width: 100%;
    height: 360px;
    overflow: hidden;
    position: relative;
    background-color: teal;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.header .motto {
    position: relative;
    width: 1140px;
    margin-top: 150px;
    margin-left: calc(50% - 570px);
    margin-bottom: 0;
}

.header .motto .motto-text {
    font-weight: bold;
    margin: 0;
    color: white;
    text-shadow: 0 3px 5px rgba(0, 0, 0, 0.15);
}

.header .motto .upper {
    font-size: 2.2rem;
}

.header .motto .lower {
    font-size: 1.4rem;
    margin-top: 10px;
}

/* elements under header */

/* wrapper of <main> and <aside> */
.content {
    flex-grow: 1;
    position: relative;
    width: 1140px;
    margin: 0 auto;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

/* main content, against `aside` */
main {
    width: 850px;
}

.tag-tip {
    padding: 13px;
    border-radius: 2px;
    box-shadow: 0 3px 5px rgba(0, 0, 0, 0.15);
    background-color: #009688;
    color: white;
    margin: 1.5rem 0;
    font-weight: bold;
}

/* something looks like `material paper` */

.paper {
    margin: 24px 0;
    background-color: white;
    box-shadow: 0 3px 5px rgba(0, 0, 0, 0.15);
    padding: 13px;
    box-sizing: border-box;
    border-radius: 2px;
}

.paper .title {
    font-size: 1.5rem;
}

/* bottom pagination, prev/next button */

.pagination {
    margin: 0;
    display: flex;
}

.pagination a {
    margin-bottom: 24px;
    height: 40px;
    width: 40px;
    background-color: #009688;
    border-radius: 100%;
    box-shadow: 0 3px 5px rgba(0, 0, 0, 0.15);
    color: white;
    line-height: 40px;
    font-size: 20px;
    text-align: center;
    transition: 0.2s;
}

.pagination a:hover {
    text-decoration: none;
    background-color: #00aa99;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.pagination a:focus {
    text-decoration: none;
    background-color: teal;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.pagination .next {
    margin-left: auto;
}

/* side bar */

aside {
    width: 260px;
}

.side-box {
    background-color: white;
    box-shadow: 0 3px 5px rgba(0, 0, 0, 0.15);
    border-radius: 2px;
    overflow: hidden;
    margin: 24px 0;
}

.side-box .side-box-header {
    background-color: #2ca499;
    color: white;
    padding: 0 1em;
    height: 40px;
    line-height: 40px;
    font-weight: bold;
}

.side-box-item {
    color: #444444;
    overflow: hidden;
    border-bottom: 1px solid #e6e6e6;
    transition: background-color 0.4s;
}

.side-box-item .side-box-item__inner {
    padding: 0 1em;
    height: 34px;
    line-height: 34px;
    color: inherit;
    white-space: nowrap;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
}

.side-box-item:hover {
    background-color: #e6e6e6;
}

.side-box-item:last-child {
    border-bottom: none;
}

/* footer */

.footer {
    border-top: 8px solid #2d2d2d;
    background-color: #1c1c1c;
    padding: 24px 0;
    font-size: 14px;
    color: #999;
}

.footer .ft-content span::after {
    content: ' | ';
    display: inline;
}

.footer .ft-content span:last-child::after {
    content: unset;
}

/* article elements */

article .anchor {
    scroll-margin-top: 56px;
}

article p.more {
    text-align: right;
    font-size: 14px;
    margin-bottom: 0;
}

article header .title {
    margin-top: 0;
    margin-bottom: 16px;
}

article header .meta {
    color: grey;
    font-size: 14px;
    line-height: normal;
    margin: 0;
}

article p {
    line-height: 27px;
    overflow-wrap: break-word;
}

article pre,
article figure,
article blockquote,
article .table-wrapper {
    margin: 16px -13px;
}

article pre {
    padding: 13px 20px;
}

article code {
    font-size: 85%;
    padding: 2px 4px;
    border-radius: 2px;
    background-color: #eeeeee;
    word-break: normal;
}

article pre code {
    padding: unset;
    font-size: unset;
    background-color: unset;
}

article figure {
    text-align: center;
}

article figure img {
    display: block;
    margin: auto;
    max-width: 100%;
}

article figure figcaption {
    line-height: 26px;
    font-size: 14px;
    display: inline-block;
    text-align: center;
    color: grey;
    border-bottom: 1px solid lightgrey;
    padding: 0 1em;
}

article blockquote {
    padding: 13px 20px;
    background-color: #eeeeee;
    border-left: 4px solid lightgrey;
}

article blockquote p {
    margin: 0;
}

article ul,
article ol {
    padding: 0;
    padding-left: 1em;
}

article ul li,
article ol li {
    line-height: 27px;
}

article .table-wrapper {
    overflow-x: auto;
}

article table {
    margin: auto;
    border-collapse: collapse;
}

article table th,
article table td {
    padding: 3px 16px;
}

article table th {
    text-align: left;
    font-weight: normal;
    color: #6b6b6b;
}

article table td {
    border-top: 1px solid #cccccc;
}

article hr {
    background-color: #cccccc;
    border: none;
    height: 1.5px;
    margin: 36px auto;
    min-width: 175px;
    width: 25%;
}

/* responsive */

/* limit "wrapper" width to 900px */
@media screen and (max-width: 1140px) {
    nav .nav-list,
    .content,
    .ft-content {
        width: 900px;
    }

    main {
        width: 610px;
    }

    .header .motto {
        margin-left: calc(50% - 450px);
    }
}

/* limit "wrapper" width to 610px, two-column <aside> under <main> */
@media screen and (max-width: 940px) {
    nav .nav-list,
    .content,
    aside,
    .ft-content {
        width: 100%;
        max-width: 610px;
    }

    .header .motto {
        margin-left: calc(50% - 305px);
    }

    .content {
        flex-direction: column;
    }

    aside {
        width: 610px;
        display: flex;
        flex-wrap: wrap;
        align-items: flex-start;
        justify-content: space-between;
    }

    .side-box {
        width: 290px;
        margin-top: 0;
    }

    .footer {
        padding: 24px 16px;
    }
}

/* "wrapper" width 100%, one-column <aside> under <main> */
@media screen and (max-width: 630px) {
    nav .nav-list,
    main,
    aside,
    .header .motto,
    .ft-content {
        width: 100%;
    }

    .header .motto {
        margin-left: 16px;
    }

    main {
        margin: 0;
    }

    .tag-tip,
    .paper,
    .side-box,
    .pagination {
        margin: 16px;
    }

    .side-box {
        width: calc(100% - 32px);
    }

    .side-box,
    .pagination {
        margin-top: 0;
    }

    .pagination a {
        margin-bottom: 0;
    }

    .footer .ft-content span::after {
        content: '';
        color: transparent;
        display: block;
    }
}
