/* Basic */
html {
    font-size: 1.25rem;
}

.container {
    margin: 1rem;
}

.sr-only {
  position: absolute;
  white-space: nowrap;
  width: 1px;
  height: 1px;
  overflow: hidden;
  border: 0;
  padding: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  margin: -1px;
}

/* Links */

a:hover,
a:focus,
a:active {
    text-decoration-style: dashed;
}

a:active,
a:hover {
    outline: 1px;
}

a:active {
    opacity: 0.9;
}

a.hidden {
    left:-999px;
    position:absolute;
    top:auto;
    width:1px;
    height:1px;
    overflow:hidden;
    z-index:-999;
}

a.hidden:focus, 
a.hidden:active {
    left: auto;
    top: 0px;
    width: auto;
    height: auto;
    overflow:auto;
    z-index:999;
    padding: 4px 6px 4px 6px;
}

nav a, a.heading {
    color: unset;
}

/* Table */
table {
    display: block;
    max-width: 100%;
    border-collapse: collapse;
    overflow: auto;
}


th, td {
    padding: 0.5em 1em;
    border: 1px double;
}

/* Code */
pre {
    padding: 1em;
    max-width: 100%;
    overflow: auto;
}

code,
pre {
    font-family: monospace, monospace;
}

kbd {
    border-radius: 5px;
    padding: 0.1rem;
}

/* Styles */

blockquote {
    border-left: 2px solid;
    padding: 0.1em 1em;
    margin-left: 0.75em;
}

p {
    margin-top: 0.5em;
    margin-bottom: 0.5em;
}

hr {
    border: none;
    height: 1px;
    border-bottom: thin solid;
}

/* Header */

header {
    margin-top: 1em;
    font-size: 1.25em;
}

header .site-title {
    margin-bottom: 0;
    font-weight: normal;
}

header nav:not(:empty){
    margin-top: 1em;
    max-width: 100%;
    padding: 0.5em 0;
}

header nav ul li {
    display: inline-block;
    margin: 0 1rem;
}

/* Pages */
main h1 {
    margin-top: 1em;
    font-weight: normal;
    line-height: 1.1em;
    margin-bottom: 0.5em;
    font-weight: 600;
}

/* Articles */

.footnotes * {
    font-size: 1rem;
    margin-top: 0;
}

.post-title.draft::after {
    content: "✎";
    display: inline-block;
    margin-left: 0.2em;
}

article.embedded {
    border: 1px dashed red;
    padding: 1rem;
}

header h1, header .post-translations {
    margin-left: 2.5rem;
}

.post-info {
    font-size: 0.75em;
    margin-top: 1em;
}

.post-taxonomies {
    display: inline;
}

.post-terms {
    display: inline;
    list-style-type: none;
    padding: 0;
}

.post-terms li {
    display: inline;
    margin-left: 1em;
}

main img, article img {
    max-width: 100%;
    display: block;
    height: auto;
    margin: 0 auto .5em;
}

article figcaption {
    text-align: center;
    margin-bottom: 2em;
}

/* Other pages */
.terms {
    list-style-type: none;
    padding: 0;
    line-height: 2em;
}

/* Footer */

footer {
    max-width: 80rem;
    margin: 0 auto;
    border-top: thin solid var(--hr-color);
    padding-top: 1.5em;
    margin-top: 3em;
    align-items: center;
    justify-content: space-between;
}

/* Media Queries */

@media screen, print {
    h2 .decorative::before {
        content: '# ';
    }

    h3 .decorative::before {
        content: '## ';
    }

    h4 .decorative::before {
        content: '### ';
    }
    .decorative::before {
        color: gray;
    }
}

@media speech {
    .decorative::before {
        display: none;
    }
}

@media print {
    aside, .language-select, .post-translations {
        display: None;
    }
    .webring {
        display: none;
    }
}


/* Webring---doesn't make sense if you don't use openring */

.ring {
    margin-bottom: 1rem;
}

.ring :not(:last-child) {
    border-right: none;
}

.webring h2 {
    font-size: 1.2rem;
}

.webring .articles {
    width: 95%;
}

.webring .title {
    margin: 0;
}

.webring .article {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #333;
}
.webring .article {
    margin: 0.25rem 0.5rem;
}

.webring .summary {
    flex: 1 1 0;
}

.webring .attribution {
    float: right;
    font-size: 0.8rem;
    color: #555;
    line-height: 3;
}
@media (width > 900px) {
    .container {
        display: grid;
        grid-template-columns: 3fr 1fr;
        grid-gap: 1.5rem;
    }
}

@media (900px > width > 550px) {
    .webring div.articles {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-gap: 0 1.5rem;
    }
}

@media (width > 550px) {
    footer {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
}

dl dt {
    font-weight: bold;
}
dl dd {
    text-indent: 1em;
}

/* Book data format */

dl.data {
    border: 3px double #ccc;
    padding: 0.5em;
}
dl.data dt {
    float: left;
    clear: left;
    max-width: 40%;
    text-align: right;
    font-weight: bold;
}
dl.data dd {
    margin: 0 0 0 110px;
    padding: 0 0 0.5em 0;
}

.text-red {
    color: var(--red);
}

.text-green {
    color: var(--green);
}

details {
    margin-top: 1em;
    margin-bottom: 1em;
    border: 1px solid #aaa;
    border-radius: 4px;
    padding: .5em .5em 0;
}

summary {
    font-weight: bold;
    margin: -.5em -.5em 0;
    padding: .5em;
}

details[open] {
    padding: .5em;
}

details[open] summary {
    border-bottom: 1px solid #aaa;
    margin-bottom: .5em;
}

a.site-title::before {
    content: "[";
}

a.site-title::after {
    content: "]";
}

a.prev-link::before {
    content: "← ";
}

a.webring-nav {
    border: 1px solid;
    text-decoration: none;
    padding: 0.2rem;
    color: unset;
}

a.next-link.float {
    float: right;
}

a.random-link::before {
    content: "🎲 ";
}

a.next-link::after {
    content: " →";
}

/* Calendar */
#month-year-row, #weekday-row {
    text-align: center;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    padding-top: 0.5rem;
}

#lunar-solar-cal #solar-day {
    font-size: 5em;
    text-align: center;
}

#solar-year, #solar-weekday-vi {
    font-size: 1.2em;
}

#lunar-day {
    font-size: 3em;
    text-align: center;
}

#lunar-day-zh {
    font-size: 1.5em;
}

#lunar-cal-vi, #lunar-cal-zh {
    text-align: center;
}

#lunar-solar-cal #lunar-cal {
    display: grid;
    grid-template-columns: 2fr 1fr 2fr;
    margin-top: 1rem;
}

button#nav-day-before::before {
    content: "←";
    font-size: 3rem
}
button#nav-day-after::before {
    content: "→";
    font-size: 3rem
}

#day-area {
    display: grid;
    grid-template-columns: 1fr 5fr 1fr;
    height: 14rem;
}

#special-day-vi, #special-day-en {
    text-align: center;
    line-height: 1rem;
}

#lunar-solar-cal {
    border: 1px solid;
    margin: 1rem auto;
    max-width: 25rem;
}

#lunar-solar-cal.holiday {
    border: 1px solid var(--red);
    color: var(--red);
}
