*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 20px;
    color: var(--fg);
    background-color: var(--bg);
    font-family: "Open Sans", sans-serif, system-ui;
    line-height: 1.4;
    --fg: #454545;
    --fg2: #383838;
    --fgcontrast: black;
    --side: rgb(90, 90, 90);
    --bg: white;
    --bg2: #f2f2f2;
    --select: rgb(211, 211, 211);
    --link: #3573ad;
    --linkhover: #0097DC;
    --block: #383838;
    --invert: 0%;
}

body:has(#invert-toggle__checkbox:checked) {
    --fg: #D9D9D9;
    --fg2: #e7e7e7;
    --fgcontrast: white;
    --side: LightGray;
    --select: rgb(59, 59, 59);
    --bg: black;
    --bg2: #1b1b1b;
    --link: #438cd1;
    --linkhover: #33ace4;
    --block: #1b1b1b;
    --invert: 100%;
}

::selection {
    background-color: var(--select);
}

::-webkit-scrollbar-track {
    background-color: var(--bg2);
}

* {
    scrollbar-color: auto var(--bg2);
}

.theme-toggle__checkbox {
    position: absolute;
    opacity: 0;
}

.theme-toggle {
    cursor: pointer;
    color: var(--fg);
    padding: 5px;
    border: 1px solid var(--fgcontrast);
    display: inline-block;
    background-color: var(--bg2);
    position: fixed;
    font-size: 0.9em;
    text-decoration: underline;
    top: 10px;
    right: 10px
}

main {
    width: 100%;
    max-width: 95ch;
    border: 1px solid var(--fg);
    margin: 0 auto;
    padding: 1em;
    word-wrap: break-word;
}

header {
    width: 100%;
    max-width: 95ch;
    margin: 0 auto 1em;
    word-wrap: break-word;
    text-align: center;
}

header h1 {
    font-size: inherit;
    font-weight: normal;
    margin: 20px;
}

h1 {
    margin-top: 0;
    margin-bottom: 10px;
}


.header__row {
    position: relative;
}

.motd {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%)
}

.date {
    float: right;
}

.wordmark__text {
    color: var(--fgcontrast);
    font-family: monospace;
    font-size: 2em;
    font-weight: bold;
    vertical-align: middle;
}

.wordmark__eye {
    width: 100%;
    max-width: 80px;
    vertical-align: middle;
}

.icon {
    filter: invert(var(--invert))
}

.nav span {
    margin: 0 15px;
}

hr {
    border-style: dotted;
    border-width: 1px 0 0 0;
    margin: 8px 0 8px 0;
    color: var(--side);
}

footer {
    width: 100%;
    max-width: 95ch;
    margin: 0 auto;
    text-align: center;
}

a {
    color: var(--link);
    text-decoration: none;
}

a:hover {
    color: var(--linkhover);
    text-decoration: underline;
}

table {
    border-collapse: collapse;
}

small {
    font-size: 0.7em;
    color: var(--side);
}

.top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75em;
}

.top-row__left {
    text-align: left;
    margin-right: 10px;
}

.top-row__center {
    text-align: center;
    margin-left: 10px;
    margin-right: 10px;
}

.top-row__right {
    text-align: right;
    margin-left: 10px;
}

pre.code {
    white-space: pre;
    overflow-x: auto;
    font-family: monospace;
    display: block;
    font-family: monospace;
    background: var(--block);
    color: #D9D9D9;
    font-size: 16px;
    padding: 10px;
    position: relative;
}

.monospaced {
    font-family: monospace;
}

pre.code::before {
    position: sticky;
    top: 0;
    left: 0;
    z-index: 1;
    display: block;
    width: 100%;
    margin-left: -3px;
    margin-top: -3px;
    margin-bottom: 1em;
    padding: 3px;
    text-transform: uppercase;
    content: attr(data-lang);
}

.block {
    background-color: var(--bg2);
    padding: 10px;
}


.calculator * {
    margin-top: 0.5em;
    margin-bottom: 0.5em;
}

form {
    display: flex;
    gap: 10px;
    width: 100%;
}

.directory {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin: 0 auto;
}

.directory a,
.directory a:hover {
    color: inherit;
    text-decoration: underline;
}

.directory__entry:nth-child(even) {
    background-color: var(--bg2);
}

.directory__entry:nth-child(even) p {
    color: var(--fg2);
}

.directory__entry h3 {
    margin: 0 0 5px 0;
    color: var(--fgcontrast)
}

.directory__entry {
    padding: 5px;
}

.directory__entry p {
    margin: 0;
}

#search {
    width: 60%;
    padding: 10px;
    margin-bottom: 10px;
}

#includeTags,
#excludeTags {
    width: 20%;
    padding: 10px;
    margin-bottom: 10px;
}

input {
    background-color: var(--bg);
    color: var(--fg);
    border: 1px solid var(--fg)
}

.extraContainer {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 5px;
}

.extraContainer .share {
    margin-left: auto;
}

.tag {
    background-color: var(--bg);
    border: 1px solid var(--fg);
    color: var(--fg);
    padding: 3px 6px;
    font-size: 0.8em;
    display: inline-block;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1;
    padding-top: 100px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgb(0, 0, 0);
    background-color: rgba(0, 0, 0, 0.9);
}


.modal-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
}


.caption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 10px 0;
    height: 150px;
}

.modal-content,
#caption {
    -webkit-animation-name: zoom;
    -webkit-animation-duration: 0.6s;
    animation-name: zoom;
    animation-duration: 0.2s;
}

@keyframes zoom {
    from {
        transform: scale(0.75)
    }

    to {
        transform: scale(1)
    }
}

.close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: white;
    font-size: 40px;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

.inlineImage {
    height: 2em;
    vertical-align: middle;
}

.content-positioning {
    display: flex;
    flex-wrap: wrap;
    gap: 1em;
}

.content-positioning .content-positioning__content {
    flex: 0 0 40%;
    overflow: hidden;
}

.content-positioning .content-positioning__content img {
    width: 100%;
}

.content-positioning .content-positioning__content figure {
    margin: 10px;
}

.content-positioning .content-positioning__content figure figcaption {
    font-size: 0.7em;
}

div.content-positioning .content-positioning__text {
    flex: 0 0 55%;
}

div.content-positioning .content-positioning__text p:first-child {
    margin-top: 0;
}

li:not(:last-child) {
    margin-bottom: 3px;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1;
    padding-top: 100px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgb(0, 0, 0);
    background-color: rgba(0, 0, 0, 0.9);
}


.modal-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 1000px;
}


.caption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 10px 0;
    height: 150px;
}

.modal-content,
#caption {
    -webkit-animation-name: zoom;
    -webkit-animation-duration: 0.6s;
    animation-name: zoom;
    animation-duration: 0.2s;
}

@keyframes zoom {
    from {
        transform: scale(0.75)
    }

    to {
        transform: scale(1)
    }
}

.close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: white;
    font-size: 40px;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

@media screen and (max-width: 700px) {
    body {
        text-align: left;
    }

    div.content-positioning {
        flex-direction: column;
    }

    div.content-positioning div.content-positioning__content,
    div.content-positioning div.content-positioning__text {
        flex: 0 0 100%;
    }

    .modal-content {
        width: 100%;
    }
}

@media screen and (max-width:1000px) {
    .theme-toggle {
        position: absolute;
    }

    .motd {
        display: block;
        position: static;
        transform: translateY(25%)
    }
}