@import url("giallo-dark.css") (prefers-color-scheme: dark);
@import url("giallo-light.css") (prefers-color-scheme: light);

:root {
    color-scheme: light dark;
    --color-white: #fff;
    --color-black: #000;
    --color-bg: light-dark(#f8f9fa, #121212);
    --color-text: light-dark(#212529, #c2d4e6);
    --color-link: light-dark(#007bff, #3898ff);
    --color-btn: #343a40;
    --color-border: light-dark(#dee2e6, #343a40);
    --color-selection: #dee2e6;
}

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

html {
    -moz-text-size-adjust: none;
    -webkit-text-size-adjust: none;
    text-size-adjust: none;
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

body {
    margin: 0;
    min-height: 100vh;
    line-height: 1.5;
}

main {
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6, button, input, label {
    line-height: 1.1;
}

h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    margin-bottom: 1rem;
    text-wrap: balance;
}

blockquote, figure {
    margin: 0 0 1rem;
}

ol, ul {
    margin-top: 0;
    margin-bottom: 1rem;
}

ul {
    list-style-type: "\2606  ";
}

ul ul {
    list-style-type: circle;
    margin: 0;
}

li > p {
    margin-bottom: 0;
}

p {
    margin-top: 0;
    margin-bottom: 1rem;
    overflow-wrap: break-word;
    hyphens: auto;
}

hr {
    box-sizing: content-box;
    height: 0;
    overflow: visible;
}

input, button, textarea, select {
    font: inherit;
}

img, picture, video, svg {
    display: block;
    max-width: 100%;
    height: auto;
}

:target {
    scroll-margin-block: 3rem;
}

.btn {
    display: inline-block;
    color: var(--color-white);
    text-align: center;
    vertical-align: middle;
    user-select: none;
    background-color: var(--color-btn);
    border: 1px solid var(--color-btn);
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 1.5rem;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    svg {
        width: 1.25rem;
        display: inline-block;
        vertical-align: text-bottom;
    }
}

.btn:hover {
    color: var(--color-white);
    background-color: color-mix(in srgb, var(--color-btn), var(--color-white) 15%);
    text-decoration: none;
}

@media (prefers-reduced-motion: reduce) {
    .btn {
        transition: none !important;
    }
}

body {
    background-color: var(--color-bg);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    font-size: 1.1rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--color-text);
}

@media (prefers-color-scheme: dark) {
  body {
    font-weight: 350;
  }
}

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

a:hover {
    color: color-mix(in srgb, var(--color-link), var(--color-black) 15%);
}

hr {
    margin-top: 1rem;
    margin-bottom: 1rem;
    border: 0;
    border-top:1px solid var(--color-border);
}

h1 {
    font-size: 2rem;
}
h2 {
    font-size: 1.75rem;
}
h3 {
    font-size: 1.5rem;
}
h4 {
    font-size: 1.25rem;
}
h5 {
    font-size: 1rem;
}
h6 {
    font-size: 1rem;
}
h1, h2, h3, h4 {
    font-weight: 300;
}
h4, h5 {
    font-weight: 400;
}

small {
    font-size: 80%;
    font-weight: 400;
}

.container {
    width: 100%;
    max-width: 900px;
    padding-right: 15px;
    padding-left: 15px;
    margin-right: auto;
    margin-left: auto;
}

.header {
    text-align: center;
    margin-top: 2rem;
    margin-bottom: 2rem;
    a {
        text-wrap: nowrap;
    }
    h1 {
        font-size: 2.5rem;
    }
    h2 {
        font-size: 1.25rem;
    }
    h2 + p {
        margin-top: -1rem;
    }
    > * {
        margin-bottom: 1rem;
    }
    .btn {
        margin: 0.25rem;
    }
}

.logo {
  mix-blend-mode: multiply;
}

@media (prefers-color-scheme: dark) {
  .logo {
    mix-blend-mode: lighten;
    filter: invert();
  }
}

img {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.content {
    h1, h2, h3, h4, h5, h6 {
        margin-top: 2rem;
    }
    p {
        text-align: justify;
    }
    blockquote {
        border-left: 4px solid var(--color-border);
        padding-left: 1rem;
        font-style: italic;
    }
    pre {
        border: 1px solid var(--color-border);
        border-radius: 0.25rem;
        padding: 0.75rem;
        margin-bottom: 1rem;
        display:flex;
        flex-direction:column;
        overflow-x:auto;
        overflow-y:clip;
    }
    h1:has(+ .footnote-definition) {
        font-size: 1.375rem;
    }
}

@media only screen and (min-width: 768px) {
    .content > p, .content > pre, .content > details, .content > ul, .content > ol {
        margin-left: 30px;
    }
}

.article-body {
  margin-left: 2em;
}

.article-authors {
  margin-bottom: 0.2em;
}

.footer {
    margin-top: 1rem;
    opacity: 50%;
    text-align: center;
}

.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;
}
