/* Page layout */

html {
    overflow-wrap: break-word;
    scroll-behavior: smooth;
}

* {
    margin: 0px;
}

header {
    display: none;
}

nav {
    display: none;
}

a:link,
a:visited,
a:hover {
  color: black;
}

/* Metadata */

.header {
    margin-top: 10px;
}

.header .meta {
    margin-top: 10px;
}

.meta {
    font-weight: 400;
    font-size: 11px;
    line-height: 1rem;
    display: flex;
    flex-direction: column;
}

.meta.row {
    flex-direction: row;
    gap: 6px;
}

.meta .meta-item {
    border: 1px solid;
    border-radius: 5px;
    padding: 1px 4px 1px;
}

.meta .timestamp {
    font-size: 1em;
    background: none;
}

#header-figure {
    display: flex;
    align-items: center;
    border: 0.8px solid #aaa;
    min-height: 100px;
    max-height: 150px;
    text-align: center;
    overflow-y: hidden;
}

#header-figure > div {
    margin-left: auto;
    margin-right: auto;
}

/* Foldable */

.foldable:not([open]) {
    box-shadow: -2px 0 0 #5321;
    padding-left: 10px;
}

.foldable:hover:not([open]) {
    box-shadow: -2px 0 0 #5323;
}

/* Headings */

h1, h2, h3, h4, h5, h6 {
    break-after: avoid;
}

h1 {
    font-weight: 400;
    font-size: 30px;
    letter-spacing: -0.20001px;
}

.subtitle {
    margin-top: 5px;
}

h2 {
    font-size: 26px;
    margin-top: 20px;
}

h3 {
    font-size: 22px;
    margin-top: 20px;
}

h4,
h5,
h6 {
    font-size: 20px;
    margin-top: 20px;
}

h1 a, h2 a, h3 a, h4 a, h5 a {
    text-decoration: 2px underline dotted;
}

h1 a:hover, h2 a:hover, h3 a:hover, h4 a:hover, h5 a:hover {
    background: #f5f5dc;
    border-radius: 5px;
}

/* Headlines */

section > details > summary {
    list-style: none;
    cursor: pointer;
}

section > details > summary::-webkit-details-marker {
    display: none;
}

.headline {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.headline .meta {
    text-align: right;
}

.headline .todokw.todo {
    --color: #ce3800;
    --bg-color: #ffcfc9;
}

.headline .todokw.done {
    --color: #008000;
    --bg-color: #bcebbc;
}

.headline .priority.A {
    --color: #e84e00;
    --bg-color: #e84e0033;
}

.headline .priority.B {
    --color: #df9300;
    --bg-color: #eaac3333;
}

.headline .priority.C {
    --color: #90a652;
    --bg-color: #90a65233;
}

/* Paragraphs */

#content p {
    margin-top: 10px;
    margin-bottom: 10px;
    line-height: 1.4em;
    text-align: justify;
    hyphens: auto;
}

/* Figures */

#content img {
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 20px;
    mix-blend-mode: multiply;
}

#content figure {
    overflow: auto hidden;
}

#content figure img {
    display: block;
    max-width: 60%;
}

#content figure object {
    margin-left: auto;
    margin-right: auto;
    display: block;
    overflow-x: auto;
    mix-blend-mode: multiply;
}

/* Lists */

#content ul, #content ol {
    margin: 8px 0px;
    padding-left: 0px;
    margin-left: 30px;
    line-height: 1.3em;
}

#content li {
    margin-bottom: 0.4em;
}

/* Code */

code {
    padding: 1px 4px;
    margin: 0px 1px;
    border-radius: 0.2em;
    font-size: 0.7em;
}

pre.code {
    display: grid;
    overflow-x: auto;
    margin: 10px 0px;
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: 10px;
}

pre code {
    background: none;
}

/* Footnotes */

.fn-tooltip {
    display: none;
    font-style: italic;
}

.fn-container:focus-within .fn-tooltip {
    display: inline;
}

/* page grids */
.grid {
    display:grid;
    position: relative;
    grid-template-rows: masonry;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 15px;
    margin: 10px 0px;
}
.grid .cell {
    display: block;
    border: 1px solid #3333;
    border-radius: 10px;
    background: #fff3;
    overflow: hidden;
    height: fit-content;
}
.grid .excerpt {
    height: 135px;
    border-bottom: 1px solid #0002;
    overflow: hidden;
    text-align: center;
    font-size: 20px;
    display: flex;
    align-items: center;
}
.grid .excerpt img {
    width: 100%;
}
.grid .title {
    padding: 8px 10px 6px;
    font-size: 18px;
    font-weight: 400;
}
.grid a.link {
    text-decoration: none;
}
.grid .mosaic-meta {
    padding: 4px 0px 10px 10px;
}

/* Special blocks */

.note {
    break-inside: avoid;
    margin: 10px 0px;
    border-radius: 10px;
    overflow: hidden;
    font-size: 0.94rem;
    border: 1px solid black;
}

.note .content {
    padding: 0px 15px 4px 15px;
}

.note .heading {
    font-size: 0.8rem;
    color: black;
    height: 20px;
    line-height: 1rem;
    border-bottom: 1px solid black;
    padding: 1px 8px;
}

.transclusion {
    margin: 10px 0px;
    font-size: 0.93rem;
}

.transclusion .source {
    font-style: italic;
    text-align: right;
    padding-right: 30px;
    font-size: 0.85rem;
}

/* Foot */

.page-foot {
    display: none;
}

/* Math-related */

mjx-container {
    overflow-x: auto;
    overflow-y: hidden;
}

.inl {
    display: inline;
    vertical-align: middle;
    margin: 0 6px;
    max-height: 1.5em;
}

.theorem {
    border-radius: 7px;
    /* border: 1px solid #ccc; */
    padding: 0px 15px;
    margin: 15px 0px;
    font-style: italic;
    font-size: 0.97rem;
}

.theorem em {
    font-weight: 500;
    font-style: normal;
}

.theorem-name {
    font-style: normal;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.theorem > p:first-of-type {
    display: inline;
}

.proof {
    position: relative; /* necessary for :after below! */
    border-radius: 7px;
    margin: 15px 0px;
    font-size: 0.97rem;
}

.proof::after {
    content: "■";
    position: absolute;
    right: 20px;
    bottom: -3px;
    font-size: 26px;
}

.proof-name {
    font-style: italic;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.proof > p:first-of-type {
    display: inline;
}
