/* Author: Zheng Zhao 2024 */
/* https://zz.zabemon.com */
/* The MIT License */

html, body {
    background: #fff
}

html {
    height: 100%
}

body {
    color: #000;
    font-family: "JetBrains Mono", monospace;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.4;
    margin: 0;
    min-height: 100%;
    overflow-wrap: break-word;
}

em.pub {
    display: inline-block;
    font-style: normal;
}

em::first-letter {
    background-color: #000;
    color: #fff;
}

blockquote {
    font-style: italic;
    border: 1px solid #000;
    padding: 1rem
}

blockquote p {
    margin: 0
}

.admonition {
    display: block;
    margin: auto 2rem;
}

.admonition p {
    font-style: italic;
}

p.admonition-title {
    font-style: normal;
    font-weight: 700;
}

.footnote hr {
    display: none;
}

.footnote p {
    margin: 2px auto;
}

a,
.pseudo-link,
b.equal-author {
    border-bottom: 2px solid #000;
    color: inherit;
    text-decoration: none;
    position: relative;
}

a:hover,
.pseudo-link:hover,
b.equal-author:hover {
    background-color: #000;
    color: #fff;
    cursor: pointer;
}

a.link-wo-line,
a.footnote-backref {
    border-bottom: none;
}

a.plain-link,
sup a,
mjx-math a {
    border-bottom: none;
}

a.plain-link:hover,
sup a:hover,
mjx-math a:hover {
    background-color: #fff;
    color: #000;
}

u.pub {
    text-decoration: underline;
    text-decoration-style: dashed;
    text-underline-offset: 0.2em;
}

b, strong, h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
}

button {
    font-size: 1rem;
    padding: 0 1rem;
    text-align: center;
    background-color: #eee;
    border: none;
    box-shadow: 5px 5px #000;
    outline: none;
}

button:active {
    box-shadow: 1px 1px #000;
    transform: translate(4px, 4px);
}

button:focus {
    outline: solid;
}

.button-plus {
    cursor: cell;
}

button.up {
    box-shadow: 5px -5px #000;
}

button.up:active {
    box-shadow: 1px -1px #000;
    transform: translate(4px, -4px);
}

code {
    padding: 0.1rem 0.2rem;
    font-size: 90%;
    background: #f1f1f1;
    white-space: nowrap;
}

pre > code {
    display: block;
    padding: 1rem 1rem;
    white-space: pre;
    overflow: auto;
}

table {
    overflow-x: auto
}

th, td {
    padding: 6px 6px;
    text-align: left;
}

table.bio td {
    vertical-align: top;
}

th {
    border-bottom: 2px dashed #666;
}

th:last-child, td:last-child {
    padding-right: 0;
}

table.bio {
    width: 100%;
}

table.bio th, table.bio td {
    padding: 2px;
}

.container {
    max-width: 640px;
    margin: 0 auto;
    padding: 4rem 2rem;
    word-wrap: break-word;
}

header {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    padding: 1rem 0;
    row-gap: 1rem;
}

header .header-left {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
}

header .header-cursor {
    display: inline-block;
    width: 10px;
    height: 1.2rem;
    background: #000;
    border-radius: 1px;
    animation: cursor 1s step-end infinite
}

@keyframes cursor {
    0% {
        opacity: 1
    }

    50% {
        opacity: 0
    }

    100% {
        opacity: 1
    }
}

.content {
    display: block;
}

.footer {
    margin-top: 4rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.5em;
}

.footer img {
    width: 2em;
}

.social {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 1.5em;
    row-gap: 0.2em;
    align-items: center;
    flex-wrap: wrap;
}

.pub-category {
    display: flex;
    flex-direction: column;
    row-gap: 1em;
    margin-top: 2em;
}

.pub-category h1, .pub-category h2, .pub-category h3 {
    margin: auto 0;
}

.pub-entry {
    display: flex;
    flex-direction: column;
}

.pub-entry-right {
    float: right;
}

.teaching-entry, .member-entry {
    display: flex;
    flex-direction: column;
    row-gap: 0.5em;
    margin-top: 2em;
    margin-bottom: 2em;
}

.cards {
    display: grid;
    gap: 1em;
    grid-template-columns: 1fr 1fr;
    margin-top: 2em;
}

.card {
    border: 2px dashed #ddd;
    border-radius: 5px;
    overflow: hidden;
    padding: 10px;
    display: flex;
    flex-direction: column;
    /*gap: 1em;*/
}

.card-title {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}

.card-title-widgets {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    justify-content: flex-end;
    gap: 5px;
    width: 4rem;
}

.card-footer {
    font-size: small;
}

.index-container {
    display: flex;
    flex-direction: column;
    align-content: center;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 1em;
    width: 100%;
    height: 100vh;
    margin: auto;
    max-width: 640px;
    font-size: 1.5em;
}

.profile-photo {
    width: 30%;
    border-radius: 20%;
}

.index-footer {
    margin-top: 1em;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 0.5em;
}

.social img {
    width: 1.5em;
}

.article-header {
    display: flex;
    flex-direction: column;
    margin-top: 1em;
}

.article-title {
    font-size: 1.5em;
    font-weight: 700;
}

.article-date {
    text-align: center;
    margin-top: 1em;
}

time.font-change-trigger {
    cursor: pointer;
}

section {
    margin-top: 1em;
}

.article-footer {
    display: grid;
    grid-template-columns: 17% 83%;
    margin-top: 2rem;
    font-size: min(1rem, 2.7vw);
    justify-items: start;
    align-items: start;
    grid-column-gap: 5px;
}

.article-ul {
    display: grid;
    grid-template-columns: 20% 80%;
    row-gap: 1em;
}

.article-li {
    display: flex;
    flex-direction: row;
    column-gap: 1em;
}

.article-li-date {
    color: #666;
}

.pagination {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 1em;
    margin-top: 2em;
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    display: none;
    background-color: #fff;
    border: 2px solid #000;
    border-top: none;
    position: absolute;
    padding: 2px 2px;
    margin-top: 1px;
    text-align: left;
    z-index: 1;
}

.dropdown:focus-within .dropdown-menu,
.dropdown:hover .dropdown-menu {
    display: block;
}

@media all and (max-width: 480px) {
    .profile-photo {
        width: 50%;
        border-radius: 20%;
    }

    .dropdown-menu {
        margin-top: 2px;
        padding-bottom: 3px;
    }

    .cards {
        grid-template-columns: 1fr;
    }
}

/* Fix Mathjax problems - experimental - it may work only timely */
.mathjax-long-eq {
    /* Make long equation display scroll */
    overflow-x: auto;
    display: block;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.mathjax-long-eq::-webkit-scrollbar {
    width: 0;
    height: 0;
}