@import url("https://cdn.geheimesite.nl/punkt.css");

/* Site-specific */

body {
  max-width: 750px;
  padding: 7px;
  margin: 4em auto;
  min-height: fit-content;
  hyphens: manual;
}

img,
video {
  aspect-ratio: 12/5;
  object-fit: contain;
  width: 100%;
  background: #fafafa;
  /* box-shadow: 0 0 200px -70px gray; */
}

.language-mermaid svg {
  margin: 0 auto;
  display: block;
}

p:has(mjx-container[jax="CHTML"][display="true"]) {
  margin: 2.5em 0 2.5em;
}

ins {
  text-decoration: none;
}

/* Header */

header nav a {
  text-decoration: none;
  font-size: 0.8em;
}

/* Footer */

footer {
  color: light-dark(rgb(87, 87, 87), rgb(168, 168, 168));
  font-size: 80%;
  font-family: sans-serif;
  margin-top: 30px;
}

footer {
  line-height: 23px;
}

footer a {
  color: light-dark(rgb(69, 69, 69), rgb(205, 205, 205));
}

footer svg {
  height: 1em;
  vertical-align: middle;
  fill: light-dark(black, white);
}

footer .author {
  line-height: 40px;
}

footer .license-icon {
  float: right;
}

/* Help boxes */

details.li {
  margin-left: 1.25em;
}

details:not(.li) {
  margin-left: 0.5em;
  padding: 0.5em;
  background: light-dark(#ededed, #16151b);
  font-style: normal;
  margin-bottom: 0.2em;

  & summary {
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    font-weight: bolder;
  }

  & :last-child {
    margin-bottom: 0;
  }
}

li:has(details.li) {
  list-style: none;
  margin-left: -2em;
}

summary {
  cursor: pointer;
}

/* Table of contents */

.toc {
  max-width: 240px;
  width: 100%;
  background: light-dark(#ededed, #16151b);
  padding: 18px;
  float: right;
  margin-left: 15px !important;
  margin-bottom: 15px !important;
}
.toc h3 {
  display: inline;
}
.toc + h1 {
  margin-top: 0.65em;
}
.toc ul {
  padding-left: 1em;
  padding-inline-start: 1em;
}

/* Fix for tables */

tbody tr:last-of-type,
table > tr:last-of-type {
  border-bottom: 0;
}

/* Print */
@media print {
  body > header {
    display: none;
  }

  body > footer {
    display: none;
  }
}

h1:not(:first-child) {
  margin-top: 2.5em;
}

summary h2, summary h3, summary h4, summary h5, summary h6 {
  display: inline;
}

/* Search form on homepage */

.search-form {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.2em;
  margin-top: 1.5em;
  margin-bottom: 3em;
}

.search-form label {
  width: 100%;
}

.search-form input {
  width: auto !important;
  flex-grow: 1;
}

/* Forms */
form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

textarea, input, select, button {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

button,
input[type="submit"],
input[type="button"],
.button {
  background: black;
  color: white;
  border: none;
  font-size: 0.8em;
  line-height: 1.5;
  padding: 0.5em 1em;
  text-transform: lowercase;
  text-decoration: none;
  cursor: default;

  /* Hack center vertically in link (a) elements */
  display: flex;
  justify-content: center;
  align-items: center;
}

button:hover,
input[type="submit"]:hover,
input[type="button"]:hover {
  opacity: 0.8;
}

input[type="url"],
input[type="text"],
input[type="email"],
input[type="password"] {
  padding: 0.2em 0.4em;
  font-size: 1em;
}

input,
textarea,
select,
iframe
{
  border: 1px solid light-dark(#dedede, #3d3d3d);
  outline: none;
}

/* select is just special like that :shrug: */
select {
  padding: 6px;
}

input:focus,
textarea:focus {
  border-color: light-dark(#bbb, #777);
}

input:user-invalid {
  border-color: red;
}

input[type="url"],
input[type="text"],
input[type="email"],
input[type="password"],
select {
  width: 100%;
}

input[type="file"] {
  display: block;
  border: none;
  padding: 110px 1em;
  background: light-dark(#f1f1f1, #2b2b33);
  border: 2px dashed currentColor;
  border-color: inherit;
  border-radius: 7px;
  text-align: center;
  width: 100%;
  height: 250px;
  transition: filter 75ms;
}

label:not(:has(input)) {
  font-weight: bold;
}

input[type="date"] {
  margin-left: 1em;
}

textarea {
  padding: 7px;
  width: 100%;
  resize: vertical;
}