/* Based on Sakura.css v1.5.1
 * MIT License - https://github.com/oxalorg/sakura
 */

html {
  font-size: 62.5%;
  font-family: monospace;
}

body {
  font-size: 1.8rem;
  line-height: 1.618;
  max-width: 38em;
  margin: auto;
  color: #000;
  background-color: #fff;
  padding: 13px;
}

body.centered {
  height: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

html:has(body.centered) {
  height: 100%;
}

@media (max-width: 684px) { body { font-size: 1.53rem; } }
@media (max-width: 382px) { body { font-size: 1.35rem; } }

h1, h2, h3, h4, h5, h6 {
  line-height: 1.1;
  font-family: monospace;
  font-weight: 700;
  margin-top: 3rem;
  margin-bottom: 1.5rem;
  overflow-wrap: break-word;
  word-break: break-word;
}

h1 { font-size: 2.35em; }
h2 { font-size: 2em; }
h3 { font-size: 1.75em; }
h4 { font-size: 1.5em; }
h5 { font-size: 1.25em; }
h6 { font-size: 1em; }

p {
  margin-top: 0;
  margin-bottom: 2.5rem;
}

small, sub, sup { font-size: 75%; }

hr {
  border-color: #000;
}

a {
  text-decoration: none;
  color: inherit;
}
a:visited {
  color: inherit;
}
a:hover {
  border-bottom: 1px solid currentColor;
}

ul {
  padding-left: 1.4em;
  margin-top: 0;
  margin-bottom: 2.5rem;
}

li { margin-bottom: 0.4em; }

blockquote {
  margin: 0 0 2.5rem 0;
  padding: 0.8em 0.8em 0.8em 1em;
  border-left: 3px solid #000;
  background-color: #f1f1f1;
}

blockquote p { margin-bottom: 0; }

img, video {
  height: auto;
  max-width: 100%;
  margin-bottom: 2.5rem;
}

pre {
  background-color: #f1f1f1;
  display: block;
  padding: 1em;
  overflow-x: auto;
  margin-bottom: 2.5rem;
  font-size: 0.9em;
}

code, kbd, samp {
  color: #111111;
  font-size: 0.9em;
  padding: 0 0.5em;
  background-color: #f1f1f1;
  white-space: pre-wrap;
}

pre > code {
  padding: 0;
  background-color: transparent;
  white-space: pre;
  font-size: 1em;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 2rem;
}

td, th {
  padding: 0.5em;
  border-bottom: 1px solid #f1f1f1;
}

input, textarea {
  border: 1px solid #000;
}
input:focus, textarea:focus {
  border: 1px solid #000;
  outline: none;
}

textarea { width: 100%; }

.button, button,
input[type=submit],
input[type=reset],
input[type=button] {
  display: inline-block;
  padding: 5px 10px;
  text-align: center;
  white-space: nowrap;
  background-color: #000;
  color: #fff;
  border-radius: 0;
  border: 1px solid #000;
  cursor: pointer;
  box-sizing: border-box;
  font-family: monospace;
}

.button:hover, button:hover,
input[type=submit]:hover,
input[type=reset]:hover,
input[type=button]:hover {
  background-color: #fff;
  color: #000;
}

textarea, select, input {
  color: #000;
  padding: 6px 10px;
  margin-bottom: 10px;
  background-color: #f1f1f1;
  border: 1px solid #000;
  border-radius: 0;
  box-shadow: none;
  box-sizing: border-box;
  font-family: monospace;
}

label, legend, fieldset {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

/* La media query della Dark Mode deve stare alla fine per sovrascrivere correttamente le regole precedenti */
@media (prefers-color-scheme: dark) {
  body {
    color: #fff;
    background-color: #000;
  }
  pre, code, kbd, samp, blockquote {
    background-color: #111;
  }
  code, kbd, samp {
    color: #fff;
  }
  td, th {
    border-bottom: 1px solid #222;
  }
  hr {
    border-color: #fff;
  }
  blockquote {
    border-left-color: #fff;
  }
  input, textarea, select {
    color: #fff;
    background-color: #111;
    border-color: #fff;
  }
  .button, button,
  input[type=submit],
  input[type=reset],
  input[type=button] {
    background-color: #fff;
    color: #000;
    border-color: #fff;
  }
  .button:hover, button:hover,
  input[type=submit]:hover,
  input[type=reset]:hover,
  input[type=button]:hover {
    background-color: #000;
    color: #fff;
  }
}
