:root {
  --bg-color: #fff;
  --font-color: #000;
  --footer-color: #999;
  --link-color: #000;
  --code-bg-color: #f3f3f3;
}

[data-theme="dark"] {
  --bg-color: #1e1e2e;
  --font-color: #fff;
  --footer-color: #fff;
  --link-color: #fff;
  --code-bg-color: #303446;
}

[data-theme="dark"] .form-control {
  background-color: rgba(0, 0, 0, 0.6);
  border-color: rgba(0, 0, 0, 0.6);
  color: var(--text-color) !important;
}

[data-theme="dark"] .form-control:focus {
  color: var(--text-color) !important;
}

[data-theme="light"] .d-block-light,
[data-theme="dark"] .d-block-dark {
  display: block !important;
}

@media (max-width: 40em) {
  table td,
  table td.doc,
  table td.code {
    width: 100%;
    display: block; /* Display as block elements on smaller screens */
    box-sizing: border-box; /* Include padding and border in the width calculation */
    margin-bottom: 1rem;
    border-radius: 0.5rem;
  }
  table td.code["colspan"] {
    width: 100%;
  }
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  background-color: var(--bg-color);
  color: var(--font-color);
}

h1,
h2,
h3 {
  line-height: 1.2;
}

h1 {
  font-size: 2rem;
}

main {
  display: flex;
  flex-grow: 1;
  flex-direction: column;
  max-width: 64rem;
  align-items: center;
  padding: 0 5%;
  margin: 0 auto;
}

article {
  width: 100%;
}

article.intro {
  max-width: 30rem;
}

footer {
  display: flex;
  flex-grow: 1;
  flex-direction: column;
  align-items: center;
  padding: 0 5%;
  margin: 0 auto;
}

footer p {
  align-self: center;
  font-size: 0.8rem;
  color: var(--footer-color);
}

p {
  text-align: justify;
}

table {
  width: 100%;
  border-spacing: 0;
  margin-bottom: 1rem;
}

table td {
  width: 50%;
  vertical-align: top;
}

table td.doc {
  padding: 0.5rem 1.75rem 0.5rem 0rem;
}

table td.doc h1,
h2,
h3,
h4 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

table td.doc p {
  min-width: 20rem;
  text-align: justify;
  margin: 0;
  line-height: 1.25;
}

table td.code {
  min-width: 64ch;
  text-align: left;
  font-family: monospace;
  background-color: var(--code-bg-color);
  padding-left: 0.5rem;
}

table td.doc p code {
  background-color: var(--code-bg-color);
  padding: 0.25rem;
  border-radius: 0.25rem;
  font-size: 85%;
}

tr:first-child td:nth-child(even),
tr.intro + tr td:nth-child(even) {
  border-top-left-radius: 0.5rem;
  border-top-right-radius: 0.5rem;
}

tr:last-child td:nth-child(even) {
  border-bottom-left-radius: 0.5rem;
  border-bottom-right-radius: 0.5rem;
}

tr.intro td:nth-child(even) {
  border-radius: 0;
}

tr.intro td.doc {
  padding: 0;
}

tr.intro td.doc p {
  margin-bottom: 1.5rem;
}

div.horizontal-overflow {
  width: 100%;
}

button.icon {
  float: right;
  font-size: 1rem;
  margin-right: 0.5rem;
  margin-top: 0.5rem;
}

a.controls {
  float: right;
  font-size: 1rem;
  margin-right: 0.5rem;
  margin-top: 0.5rem;
}

a:link {
  color: var(--link-color);
}

a:visited {
  color: var(--link-color);
}

a:hover {
}

a:active {
}

div.intro {
  max-width: 30rem;
}

#toggle-theme {
  position: fixed;
  top: 0;
  right: 0;
  padding: 0.5rem;
  z-index: 1000;
  cursor: pointer;
}

#toggle-theme input[type="checkbox"] {
  display: none;
}
