@import 'colors.css';
@import 'fonts.css';
@import 'elements/blocks.css';
@import 'elements/figure.css';
@import 'elements/pagination.css';
@import 'elements/subscribe.css';
@import 'elements/table.css';
@import 'elements/color-scheme-cycler.css';


* {
    box-sizing: border-box;
}

a:focus { outline: thin dotted; }

code,
kbd,
pre,
samp,
tt {
    font-family: 'Fira Code', monospace;
    font-feature-settings: 'calt', 'ss01', 'ss03', 'ss05', 'ss08';
}

pre {
    font-size: 0.85em;
    line-height: 1.6em;
    overflow-x: auto;
}

sub, sup {
    line-height: 0;
}

/* no underline for the footnote hyperlinks */

sup a.footnote-ref {
    text-decoration: none;
}

/* ==========================================================================
   2. General - Setting up some base styles
   ========================================================================== */

html {
    height: 100%;
    max-height: 100%;
}

body {
    --main-en-font: 'Source Sans 3 VF';
    --main-zh-font: 'Noto Sans TC';
    --font-size: 18px;

    height: 100%;
    max-height: 100%;
    font-size: var(--font-size);
    font-family: var(--main-en-font), var(--main-zh-font), sans-serif;
    line-height: 1.5em;
    color: var(--color-text);
    background: var(--color-background);
    margin: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    line-height: 1.2;
}

h1 {
    font-size: 1.75em;
}

h2 {
    font-size: 1.6em;
    margin-top: 2.5em;
}

h3 {
    font-size: 1.5em;
    margin-top: 2em;
}

h4 {
    font-size: 1.3em;
    margin-top: 2em;
}

h5 {
    font-size: 1.2em;
    margin-top: 1.5em;
}

h6 {
    font-size: 1em;
    margin-top: 1em;
}

a {
    color: var(--color-text);
}

a:hover {
    color: var(--color-link-hover);
    transition: color 0.3s;
}

h1 a,
h2 a,
h3 a,
h4 a,
h5 a,
h6 a {
    text-decoration: none;
}

p, ul, ol, dl {
    margin: 1.5em 0;
    line-height: 1.75em;
}

ol ol,
ul ul,
ul ol,
ol ul {
    margin: 0.4em 0;
}

dl dt {
    float: left;
    width: 180px;
    overflow: hidden;
    clear: left;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: bold;
    margin-bottom: 1em;
}

dl dd {
    margin-left: 200px;
    margin-bottom: 1em;
}

hr {
    display: block;
    height: 1px;
    border: 0;
    border-top: 1px solid var(--color-divider);
    margin: 3.2em 0;
    padding: 0;
}

mark {
    background-color: #ffc336;
}

code, kbd, tt {
    padding: 1px 3px;
    font-size: 0.85em;
    white-space: pre-wrap;
    word-break: break-all;
    border: 1px solid var(--color-code-border);
    background: var(--color-code-background);
    border-radius: 2px;
}

kbd {
    font-weight: bold;
    box-shadow:
        0 1px 0 rgba(0, 0, 0, 0.2),
        0 1px 0 0 #ffffff inset;
}

details p {
    margin: 0.5em 0;
}


/* ==========================================================================
   4. General - The main styles for the the theme
   ========================================================================== */

.post,
.pagination,
.footer {
    width: 80ch;
    max-width: 80vw;
}

/* Big cover image on the home page */

.site-head {
    width: 100%;
    margin: 0 0 4rem 0;
    padding: 2.5rem 0;
    text-align: center;
    background: var(--color-header-footer-background);
}

.blog-logo {
    text-decoration: none;
}

.blog-title {
    padding: 0;
    margin: 0 0 1rem 0;
    font-size: 2em;
    font-weight: bold;
}


.blog-description {
    margin: 0;
    font-size: var(--font-size);
    font-weight: normal;
}

/* Every post, on every page, gets this style on its <article> tag */

.post {
    margin: 1.5rem auto;
    word-break: normal;
    hyphens: auto;
}

.post-title::before {
    content: '§';
    margin-left: -1em;
    position: absolute;
}

.post-title {
    margin: 0;
    font-size: 1.75em;
}

.post-title a:hover,
.post-title::before:hover {
    color: var(--color-link-hover);
}

.post-excerpt p {
    margin: 1rem 0;
}

.post-excerpt h1,
.post-excerpt h2,
.post-excerpt h3,
.post-excerpt h4,
.post-excerpt h5,
.post-excerpt h6,
.post-excerpt h6,
.post-excerpt .figure,
.post-excerpt .toc {
    display: none;
}

.read-more {
    text-decoration: none;
}

.post-meta {
    display: inline-block;
    margin: 0 0 5px 0;
    color: var(--color-text-muted);
}

.post-meta a {
    color: var(--color-text-muted);
    text-decoration: none;
}

.post-meta a:hover {
    color: var(--color-link-hover);
    text-decoration: underline;
}


/* For /tags.html */

#tags-columns {
    column-count: 2;
    -moz-column-count: 2;
    -webkit-column-count: 2;
    padding: 1em 0;
}

#tags-columns ul {
    padding: 0;
    margin: 0;
    list-style-type: none;
}


/* ==========================================================================
   5. Single Post - When you click on an individual post
   ========================================================================== */

/* Tweak the .post wrapper style */

.post-template .post {
    margin-top: 0;
    border-bottom: none;
    padding-bottom: 0;
}


/* Give post-header some top padding */

.post-template article:not(:first-child) .post-header {
    padding-top: 40px;
}

/* Language specific line height */

html[lang='zh'] p,
html[lang='zh'] ul,
html[lang='zh'] ol,
html[lang='zh'] dl {
    line-height: 2em;
    margin: 1.5em 0;
}

html[lang='zh'] details p {
    margin: 0.75em 0;
}


/* Comment section (utterances) */

.post-footer {
    margin: 4rem 0 0 0;
    padding: 2rem 0 0 0;
    border-top: var(--color-divider) 1px solid;
}

/* utterances GitHub issue based comments widget
 * https://utteranc.es/ */

.utterances {
    max-width: 100%;
}

.utterances-frame {
    margin: 0;
}


/* ==========================================================================
   9. Footer - The bottom of every page
   ========================================================================== */

.site-footer {
    position: relative;
    margin: 2rem 0 0 0;
    padding: 4rem 0;
    font-family: var(--main-en-font), sans-serif;
    line-height: 1.7em;
    text-align: center;
    color: var(--color-text);
    background: var(--color-header-footer-background);
}


/* Accessibility */

/* Follow Bootstrap's .sr-only style
 * Ref: https://kittygiraudel.com/2016/10/13/css-hide-and-seek/
 */

.sr-only {
    /* stylelint-disable declaration-no-important */
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;

    /* stylelint-enable */
}


/* ==========================================================================
   Media Queries
   ========================================================================== */

@media only screen and (max-width: 500px) {

    /* Archive post list */

    dl dt {
        width: 120px;
    }

    dl dd {
        margin-left: 140px;
    }

    .inner,
    .pagination,
    .post {
        width: auto;
        max-width: unset;
        margin-left: 1.5rem;
        margin-right: 1.5rem;
    }

    .site-head {
        padding: 2rem 0;
    }

    .post-template .post {
        padding-bottom: 0;
        margin-bottom: 0;
    }

    .post-template article:not(:first-child) .post-header {
        padding-top: 60px;
    }

    .post-template .site-footer {
        margin-top: 0;
    }

    .post-header {
        font-size: 1em;
    }

    .post-meta {
        font-size: 1rem;
    }

    .post-title {
        font-size: 1.5rem;
        text-indent: 0;
    }

    .post-title::before {
        content: none;
    }

    .post-footer {
        padding: 1rem 0;
        text-align: center;
    }

    .site-footer {
        margin-top: 6rem;
    }
}
