@import url(https://cdn.jsdelivr.net/gh/tonsky/FiraCode@1.207/distr/fira_code.css);
@import url(https://cdn.jsdelivr.net/npm/boxicons@2.1.4/css/boxicons.min.css);

/* Global styles */
* {
    box-sizing: border-box;
}

body {
    font-family: system-ui, sans-serif;
    font-size: 16px;
    color: #d4d4d4;
    background-color: red;
    margin: 0;
    padding-bottom: 26px;
}

/* Navigation */
nav {
    width: 100%;
    height: 60px;
    position: sticky;
    top: 0;
    background-color: black;
    display: flex;
    padding: 0 10px;
    z-index: 1;
}

.nav {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60px;
    background: none;
    text-decoration: none;
    cursor: pointer;
    clear: both;
    margin: 0 20px;
}

/* Main content */
main {
    width: 100%;
    min-height: calc(100vh - 60px - 26px);
    background-color: black;
    overflow-x: hidden;
    padding: 20px 20px;
}

/* Footer */
footer {
    height: 26px;
    background-color: #440729;
    display: flex;
    padding: 0 10px;
    align-items: center;
    overflow-x: hidden;
    position: fixed;
    bottom: 0;
    width: 100%;
}

/* Responsive layout */
@media (min-width: 576px) {
    nav {
        width: 80px;
        padding: 10px 0 0 0;
        position: fixed;
        height: auto;
        flex-direction: column;
    }
    .nav {
        width: 100%;
        margin: 0;
    }
    main {
        width: calc(576px - 80px);
        max-width: 100vw;
        min-height: calc(100vh - 26px);
        margin-left: 80px;
    }
}

@media (min-width: 768px) {
    body {
        padding-left: calc((100vw - 768px) * 0.5);
    }
    main {
        width: calc(768px - 80px * 2);
    }
    footer {
        margin-left: calc((100vw - 768px) * -0.5);
    }
}

@media (min-width: 992px) {
    body {
        padding-left: calc((100vw - 992px) * 0.5);
    }
    main {
        width: calc(992px - 80px * 2);
    }
    footer {
        margin-left: calc((100vw - 992px) * -0.5);
    }
}

/* Headings */
#home h1 {
    text-align: center;
}

h1, h2, h3, h4, h5, h6 {
    margin: 20px 0;
}

h1 + .info, h2 + .info, h3 + .info, h4 + .info, h5 + .info, h6 + .info {
    margin-top: -15px;
    margin-bottom: 20px;
}

/* Image gallery */
div.image-gallery {
    display: flex;
    width: 90%;        /* narrower than full width */
    max-width: 900px;  /* limits width on large screens */
    gap: 5px;
    align-items: start;
    flex-wrap: wrap;
    margin: 0 auto;    /* center the gallery */
}

div.image-gallery img {
    width: 100%;
}

@media (min-width: 768px) {
    div.image-gallery {
        flex-wrap: nowrap;
    }
}

/* Buttons */
div.button-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

div.button-container a,
div.button-container img {
    height: 31px;
    width: 88px;
}

div.button-container img {
    image-rendering: pixelated;
}

/* Links */
a, a:visited {
    color: #7587a6;
    text-decoration: underline;
    text-decoration-color: #7587a6;
}

footer a, footer a:visited {
    color: #d4d4d4;
    text-decoration-color: #d4d4d4;
}

/* Utilities */
.image-rounded {
    border-radius: 50%;
}

.text-center {
    text-align: center;
}

dl dt {
    float: left;
    clear: left;
    text-align: right;
    width: 200px;
    font-weight: 700;
}

dl dd {
    margin-left: calc(200px + 20px);
}

/* Share icons */
.share > a {
    text-align: unset;
    display: inline-block;
    text-decoration: none;
}

.share i {
    color: #333;
    background-color: #d4d4d4;
    padding: 4px;
    font-size: 1.6em;
    border-radius: 4px;
}

/* Section headers and post footers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.post-footer {
    display: flex;
    justify-content: right;
    align-items: center;
}

.post-footer > p {
    margin: 0 5px;
}

/* Info paragraph */
p.info {
    font-size: 0.8rem;
    margin-top: 5px;
}

p.info span {
    display: block;
    margin-right: 20px;
}

p.info span i {
    margin-right: 0.5em;
}

@media (min-width: 768px) {
    p.info span {
        display: inline;
    }
}

/* Code blocks */
code, pre {
    font-size: 0.875em;
    font-family: "Fira Code", monospace;
    font-feature-settings: "calt" 1;
    font-variant-ligatures: normal;
    border-color: #333;
    border-style: solid;
    border-radius: 3px;
}

code {
    border-width: 1px 0;
}

pre {
    border-width: 1px;
    overflow-x: auto;
    padding: 4px 2px;
}

pre > code {
    border-width: 0;
}

h1 code, h2 code, h3 code, h4 code, h5 code, h6 code {
    border-width: 0;
}

/* Forms */
form {
    margin: 10px;
}

.form-group {
    padding: 5px 0;
}

.form-group > input {
    width: 100%;
    padding-top: 2px;
}

.form-group > label {
    display: block;
    font-size: 14px;
}

.form-group > .error {
    color: red;
    font-size: 14px;
}

/* Dollcode */
.dollcode-input {
    width: 200px;
}

.dollcode-output {
    display: inline-flex;
    font-size: 2em;
    padding: 1em 0;
}

.dollcode-output ul {
    margin: 0;
}

.giallo-l {
    display: inline-block;
    min-height: 1lh;
    width: 100%;
}

.giallo-ln {
    display: inline-block;
    user-select: none;
    margin-right: 0.4em;
    padding: 0.4em;
    min-width: 3ch;
    text-align: right;
    opacity: 0.8;
}
