/*===========================================================================*/
/* General */
/*===========================================================================*/
:root {
  color-scheme: light dark;
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  font-family: helvetica;
  line-height: 1.4;
}

body {
  display: flex;
  flex-direction: column;
  height: 100%;
  margin: 0;
  background: light-dark(#fff, #000);
  color: light-dark(#222, #ccc);
}

main {
  display: block;
  flex-grow: 1;
  padding: 1rem;
  width: 600px;
  max-width: 100%;
  margin: auto;
}

h1,
h2 {
  font-weight: normal;
  margin: 1.5rem 0 0.5rem;
}

h1 {
  font-size: 2rem;
}

.subtitle {
  margin: 0.5rem 0;
  color: light-dark(#555, #aaa);
}

h2 {
  font-size: 1.5rem;
}

a {
  color: light-dark(#3865a3, #5e9cf1);
}

pre {
  border: 1px solid light-dark(#ccc, #828fa1);
  padding: 0.2rem 0.5rem;
  background: light-dark(#d5e2e9, #3b4757);
  font-size: 1rem;
  line-height: 160%;
  overflow: auto;
}

code {
  background: light-dark(#d5e2e9, #3b4757);
  padding: 0.15rem 0.25rem;
  border-radius: 0.25rem;
}

img {
  width: 100%;
}

li {
  margin: 0.5rem 0;
}

table {
  border-collapse: collapse;
}

td, th {
  padding: 0.5rem;
  border: 1px solid light-dark(#aaa, #555);
}

th {
  text-align: left;
  background: light-dark(#eee, #222);
}

.button {
  background: #3865A3;
  color: #fff;
  border: none;
  border-radius: 0.25rem;
  padding: 0.5rem;
  text-decoration: none;
  cursor: pointer;
  margin-bottom: 1rem;
  font-size: 1rem;
}

.button:hover {
  background: #3162A6;
}

.alert {
  background: light-dark(#dfe5ed, #393d43);
  padding: 1rem;
  border-radius: 0.5rem;
}

.alert a {
  color: light-dark(#3865a3, #70acff);
}

.alert code {
  background: light-dark(#b0c9d9, #3e526d);
}

/*===========================================================================*/
/* Header */
/*===========================================================================*/

header {
  border-bottom: 1px solid light-dark(#aaa, #333);
  background: light-dark(#eee, #111);
}

header > nav > ul {
  max-width: 600px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
  display: flex;
}

header > nav > ul > li {
  display: flex;
  margin: 0;
}

header > nav > ul > li > a {
  padding: 1rem;
  text-decoration: none;
}

header > nav > ul > li > a:hover {
  background: light-dark(#ccc, #333);
}

/*===========================================================================*/
/* Footer */
/*===========================================================================*/

footer {
  display: flex;
  justify-content: center;
  background: light-dark(#eee, #111);
  color: light-dark(#555, #888);
  border-top: 1px solid light-dark(#aaa, #333);
}

footer > div,
footer ul,
footer li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
footer > div {
  width: 600px;
  max-width: 100%;
  padding: 2rem 1rem;
}

footer ul {
  margin: 0;
  padding: 0;
}

footer li {
  margin: 0;
  list-style: none;
}

footer li span {
  opacity: 0.5;
}

small {
  font-size: inherit;
}

/*===========================================================================*/
/* Modal */
/*===========================================================================*/

#modal-container {
  display: none;
  position: fixed;
  z-index: 1;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  justify-content: center;
  align-items: center;
}

#modal {
  background: light-dark(#fff, #222);
  position: relative;
  width: 30rem;
  max-width: calc(100% - 2rem);
  padding: 2rem;
  box-shadow: 0 0.2rem 0.3rem 0.2rem rgba(0,0,0,0.3);
  max-height: calc(100% - 2rem);
  overflow: auto;
}

#modal-close-button {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  font-size: 2rem;
  width: 2.5rem;
  height: 2.5rem;
  background: none;
  border: none;
  color: light-dark(#333, #ccc);
  cursor: pointer;
}

#modal h2 {
  margin-top: 0;
}

#modal-close-button:hover {
  color: #983333;
}
