/**********************VARS*****************************/

:root {
    --color_background: #faf2f1;
    --color_surface: #ffffff;
    --color_surface_variant: #fddbdd;
    --color_outline: #acacac;
    --color_on_surface: #625453;
    --color_accent: #ff4e58;
    --outline_width: 2px;
    --corner_large: 32px;
    --corner_normal: 16px;
    --corner_small: 8px;
}

/**********************TEXT*****************************/

/* expand letter-spacing for p tag and force NotoSerif font */
p {
    letter-spacing: 0.05em !important;
    /* text-align: justify; */
    font-family: Noto Serif SC !important;
}

/* expand letter-spacing for h1 tag */
h1 {
    letter-spacing: .05em !important;
}

/* expand letter spacing for div tag */
div {
    letter-spacing: .05em !important;
}

li {
    background-color: var(--color_surface) !important;
}


/**********************CODE*****************************/

/* reduce padding for code block */
#post-content .prettyprint {
    padding: 5px !important;
}

/* remove extra padding for post content */
#post-content ol,
#post-content ul {
    padding-left: 40px !important;
}

/* remove extra padding before every code line */
#post-content>pre>ol>li {
    padding-left: 0px !important;
}

/* beautify code block */
.prettyprint.linenums.prettyprinted {
    background-color: var(--color_surface) !important;
    -webkit-border-radius: var(--corner_small) !important;
    border-radius: var(--corner_small) !important;
    outline-offset: -2px;
    outline-style: dashed;
    outline-color: var(--color_outline) !important;
    outline-width: var(--outline_width);
}

.linenums {
    white-space: pre;
    overflow: auto !important;
}
/**********************TIMELINE*****************************/

/* reduce shadow for timeline page */
.md-timeline-content {
    -webkit-box-shadow: 0px 4px 15px 0px rgb(0 0 0 / 7%) !important;
    box-shadow: 0px 4px 15px 0px rgb(0 0 0 / 7%) !important;
}

.md-timeline-date.blue {
    background: #0D395F;
    -webkit-box-shadow: 0px 4px 15px 0px rgb(0 0 0 / 38%) !important;
    box-shadow: 0px 4px 15px 0px rgb(0 0 0 / 38%) !important;
}

/**********************POST ENTRY*****************************/

/* hide unnecessary post content headline */
p.article-headline-p {
    visibility: hidden !important;
}

/* redesign post entry title */
#post_entry_title {
    margin-right: 16px;
    font-family: Roboto !important;
    font-size: 24px;
    line-height: 40px;
    font-weight: 400;
    text-decoration: none;
    color: var(--color_on_surface);
}

/* use flex container */
#post_entry_conatiner {
    display: flex;
    display: -webkit-flex;
    justify-content: space-between;
    align-items: center;
}

/* added: MDU style read all button*/
#post_entry_continue {
    outline-width: 1px;
    outline-style: solid;
    outline-color: var(--color_accent);
    color: var(--color_accent);
    letter-spacing: .1em;
    border-radius: var(--corner_large);
    padding-left: 16px;
    padding-right: 16px;
    flex-shrink: 0;
}

/* align category tag to center*/
#post_entry-info {
    align-items: center;
    display: flex;
    justify-content: space-between;
}

.post_entry-category {
    margin-top: 0 !important;
    margin-right: 4px !important;
}

#post_entry-right-info {
    margin-top: 0 !important;
    margin-right: 0 !important;
}

/* remove padding left for post entry title*/
.mdl-color-text--grey-600.mdl-card__supporting-text.post_entry-content {
    align-items: flex-start;
}

/* larger corner for post content */
.mdl-card.mdl-shadow--4dp.mdl-cell.mdl-cell--12-col {
    -webkit-border-radius: var(--corner_normal) !important;
    border-radius: var(--corner_normal) !important;
}

/* larger corner for post entry (preview) */
.post_entry-module.mdl-card {
    -webkit-border-radius: var(--corner_normal) !important;
    border-radius: var(--corner_normal) !important;
    min-height: 380px !important;
}


/**********************POST CONTENT*****************************/

/* pin footer to the bottom of viewport */
.material-layout__content {
    display: flex;
    justify-content: space-between;
    flex-direction: column;
}

/* add extra margin-right to this button */
#article-functions-qrcode-button {
    margin-right: 20px !important;
}

/* add extra margin-right to this button */
#article-functions-viewtags-button {
    margin-right: 20px !important;
}

/* img align center in post content */
#post-content>img {
    margin-left: auto;
    margin-right: auto;
    display: block;
}

/*  allow overflow for reference tooltips */
.material-post_container>div>div {
    overflow: visible;
}

#post-content {
    overflow: visible !important;
}

#post-content>p {
    overflow: visible !important;
}

/* prevent the thumbnail overflowing */
.post_thumbnail-custom {
    border-top-left-radius: var(--corner_normal);
    border-top-right-radius: var(--corner_normal);
}

/* unify the background color of disqus block */
#disqus-comment {
    background-color: var(--color_surface) !important;
    /* prevent overflowing */
    border-bottom-left-radius: var(--corner_normal);
    border-bottom-right-radius: var(--corner_normal);
}

/* fix mal-laid formulas*/
.math > span {
    display: inline !important;
    position: static !important;
}

.math > span > span {
    position: static !important;
}

/* allow the formula to scroll when overflow */
.MathJax_Display {
    overflow: auto;
}


/**********************INDEX*****************************/

/* fix 'something else' bottom radius */
.mdl-card__supporting-text.meta.meta--fill {
    -webkit-border-radius: inherit !important;
    border-radius: inherit !important;
    background-color: var(--color_surface) !important;
}

/* fix 'something else' background color */
.something-else-logo.mdl-color--white.mdl-color-text--grey-600 {
    background-color: var(--color_surface) !important;
}

/* add extra margin-right to this btn */
#show-pages-button {
    margin-right: 10px;
}

/* MDU style search result popup */
#local-search-result {
    -webkit-border-radius: var(--corner_normal) !important;
    border-radius: var(--corner_normal) !important;
    background-color: var(--color_surface) !important;
}

/**********************DRAWER*****************************/

/* config backgroud color related to drawer */
.mdl-menu.mdl-js-menu {
    background-color: var(--color_surface) !important;
}

.dropdown {
    background-color: var(--color_background) !important;
}

#sidebar {
    background-color: var(--color_surface) !important;
}

/* disable drawer scrim */
.sidebar-overlay.active {
    opacity: 0 !important;
}

/* add drawer right border */
.sidebar {
    border-width: 0px !important;
    border-right-width: var(--outline_width) !important;
    border-color: var(--color_outline) !important;
    border-style: solid !important;
}

/* MDU style dropdown item */
#sidebar-main>ul>li>a {
    -webkit-border-radius: var(--corner_large) !important;
    border-radius: var(--corner_large) !important;
    margin-top: 8px;
    margin-left: 8px;
    margin-right: 8px;
}

/* MDU style dropdown menu */
.dropdown {
    -webkit-border-radius: var(--corner_large);
    border-radius: var(--corner_large);
    margin: 8px;
}

/* dropdown menu is a special item,  remove duplicated margin */
.dropdown>a {
    margin: 0px !important;
}

/* when dropdown opened, remove its bottom corners */
#sidebar-main>ul>li.dropdown.open>a {
    border-bottom-right-radius: 0px !important;
    border-bottom-left-radius: 0px !important;
}

/* round dropdown post counter */
.dropdown>ul>li>a>span {
    -webkit-border-radius: var(--corner_normal);
    border-radius: var(--corner_normal);
}

/* round total post counter */
#sidebar-main>ul>li>a>span {
    -webkit-border-radius: var(--corner_normal);
    border-radius: var(--corner_normal);
}

/* change dropdown li background whe open */
#sidebar-main>ul>li.dropdown.open>ul>li {
    background-color: var(--color_background) !important;
}

/* change dropdown bottom corner when open */
#sidebar-main>ul>li.dropdown.open>ul {
    border-bottom-left-radius: var(--corner_large) !important;
    border-bottom-right-radius: var(--corner_large) !important;
    overflow: hidden;
}

/* use rounded rect for sidebar avatar */
.sidebar-image img {
    -webkit-border-radius: var(--corner_small) !important;
    border-radius: var(--corner_small) !important;
}

/* disable drawer shadow */
.sidebar-fixed-left {
    box-shadow: 0px 0 0px rgb(0 0 0 / 0%) !important;
}

/**********************MENU*****************************/

/* MDU style menu */
.mdl-menu__outline.mdl-menu--bottom-right {
    -webkit-border-radius: var(--corner_normal) !important;
    border-radius: var(--corner_normal) !important;
}

/* MDU style popup menu */
.mdl-menu__container.is-upgraded.is-visible>ul {
    -webkit-border-radius: var(--corner_normal) !important;
    border-radius: var(--corner_normal) !important;
    overflow: hidden;
}

.sidebar-colored .sidebar-nav>.dropdown>.dropdown-menu {
    background-color: var(--color_surface) !important;
}

/**********************OTHERS*****************************/

.ripple-effect {
    -webkit-border-radius: var(--corner_large) !important;
    border-radius: var(--corner_large) !important;
}

/* MDU style card */
.mdl-card {
    -webkit-border-radius: var(--corner_normal) !important;
    border-radius: var(--corner_normal) !important;
    /* outline-style: solid; */
    /* outline-width: var(--outline_width); */
    /* outline-color: var(--color_outline); */
    background-color: var(--color_surface) !important;
    box-shadow: 0 2px 2px 0 rgb(0 0 0 / 8%), 0 3px 1px -2px rgb(0 0 0 / 8%), 0 1px 5px 0 rgb(0 0 0 / 8%) !important;
}

/* mobile device */
@media screen and (max-width: 480px) {
    #scheme-Paradox .material-layout .something-else {
        margin-bottom: 0px !important;
    }
    .post_entry-module.mdl-card {
        width: 100%;
        margin:0px !important;
        border-radius: 0px !important;
        padding: 0px !important;
    }
    .post_thumbnail-custom {
        border-radius: 0px !important;
        height: fit-content !important;
        max-height: 280px;
    }
    #post_entry_title {
        font-size: 18px;
        line-height: 1.5em;
    }
    #post_entry_continue {
        display: none;
    }

}