:root {
  --font-family: system-ui, sans-serif;
  --font-size: 1rem;
  --fg-color: #030303;
  --bg-color: #fcfcfc;
  --offset-bg-color: #dcdcdc;

  /* default link colors as per w3c (?) */
  --link-color: #0000ee;
  --link-hover-color: #0000ee;
  --link-visited-color: #551a8b;
  --link-active-color: #ff0000;

  --page-max-width: 50rem;

  --border-radius: 0;
}
/* flex layout */
body {
  display: flex;
  flex-direction: column;
}
main {
  flex: 1 0 auto;
}
footer {
  flex-shrink: 0;
}

/* media query for dark mode preference */
@media (prefers-color-scheme: dark) {
  html {
    filter: invert(1);
  }
}

/* nice default margin between elements (owl) */
* + * {
  margin-top: 1.5rem;
}

main > div {
  margin-top: 1.5rem; /* fixes missing gap, pages with p has it by default... */
}

body, html {
  margin: 0;
  height: 100dvh;

  color: var(--fg-color);
  background: var(--bg-color);

  font-family: var(--font-family);
  font-weight: normal;
}

body {
  padding: 0 1rem;
}

body { font-size: var(--font-size); }
h1 { font-size: calc(var(--font-size) + .7rem); }
h2 { font-size: calc(var(--font-size) + .3rem); }
h3 { font-size: calc(var(--font-size) + .1rem); }

header, main, footer {
  margin: auto;
  max-width: var(--page-max-width, 50rem);
  width: 100%;
  padding: 0rem;
}

/* fix padding/margin for header/main/footer */
header {
  margin: 2rem auto;
  margin-bottom: 1rem;
}
main {
  padding-bottom: 1rem;
}
footer {
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  text-align: center;
}

nav {
  margin-top: 0; /* reset * + * margin-top */
  justify-content: space-between
}

nav .small-menu a {
  display: block;
  text-align: left;
  width: 100%;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--offset-bg-color);
}

.breadcrumbs {
  a:first-child {
    text-decoration: none;
  }
}

.button,
input,
button,
textarea,
select,
label {
  display: block;
  width: 100%;
}
.button,
input,
button,
textarea,
select {
  box-sizing: border-box;
  padding: 0.5rem;
  font-size: inherit; /* safari will lower the font-size otherwise */
  border: 0.1rem solid var(--offset-bg-color);
  border-radius: var(--border-radius);
}

input[readonly=""] {
  border: 0px;
  border-radius: var(--border-radius);
  background: var(--offset-bg-color);
}

input[type="checkbox"],
input[type="radio"] {
  display: inline;
  width: auto;
  margin-right: 1rem;
}
.button,
button,
input[type="submit"] {
  border: 0.15rem solid var(--fg-color);
  border-radius: var(--border-radius);
  cursor: pointer;
  width: auto;
  font-weight: bold;
  display: inline-block;
}
.button,
button,
select,
input[type="submit"] {
  /* must set background explicitly for html{filter: invert(1)} to work on buttons */
  background: var(--bg-color);
  /* ios needs this because... */
  color: var(--fg-color);
}

button.inline,
.button.inline,
input[type="submit"].inline {
  display: inline;
}

.segmented-control {
  margin-top: 2rem; /* unknown why not 1.5 is enough... */
  input[type="radio"] {
    display: none;
  }
  label {
    cursor: pointer;
    padding: 0.5rem 1rem;
    border: 0.1rem solid var(--offset-bg-color);
    border-left-width: 0;
    border-right-width: 0;
  }
  label.selected {
    background: var(--offset-bg-color);
  }
  label:first-child {
    border-left-width: 0.1rem;
    padding-left: 1rem;
  }
  label:last-child {
    border-right-width: 0.1rem;
    padding-right: 1rem;
  }
}

/* no text-decoration on a.button */
a.button {
  text-decoration: none;
}


/* revert * + * margin-top on input below label */
label {
  margin-bottom: -1.5rem;
}

hr {
  margin-bottom: 1rem;
}

form {
  max-width: 40rem;
}

table {
  width: 100%;
  border-spacing: 0;
}
table td {
  padding: 1rem;
}
tr {
  margin: 0;
}
tr:nth-child(even) {
  background: var(--offset-bg-color);
}

a {
  &:link { color: var(--link-color); }
  &:visited { color: var(--link-visited-color); }
  &:link:active,
  &:visited:active { color: var(--link-active-color); }
  &:hover { color: var(--link-hover-color); }
}

/* generic flex container */
.flex {
  display: flex;
  flex-wrap: wrap;
  gap: 0rem;
}
.flex * + * {
  margin-top: 0;
}
.flex-col {
  flex: 0;
}
.flex-col-main {
  flex: 1;
}

.card {
  border: 0.1rem solid var(--offset-bg-color);
  border-radius: var(--border-radius);
  padding: 1rem;
  h3 {
    padding: 0;
    margin: 0;
  }
  .card-footer {
    margin-top:1.5rem;
  }
}

/* changes stuff in media query */
.responsive-table { }
@media (max-width: 50rem) {
  .responsive-table {
    td {
      display: block;
      border: 0;
      padding: 0.5rem;
    }
    td.top {
      padding-top:3rem;
      border-top: 1px solid var(--offset-bg-color);
    }
    td.bottom {
      padding-bottom: 3rem;
    }
    td.side {
      display: table-cell;
      vertical-align: top;
    }
    thead { display: none; }
    tr:nth-child(even) {
      background: inherit;
    }
  }
}

/* utility classes */
.hidden { display: none !important; }
.inline { display: inline; }
.no-owl { margin-top: 0; }
.nowrap { white-space: nowrap; }
.left { text-align: left; }
.right { text-align: right; }

.button.input-suffix,
button.input-suffix,
input[type="submit"].input-suffix {
  border-left-width: 0;
}

/* media queries and hide/show classes for desktop / mobile */
.wide-screen {
  display: block;
}
.small-screen {
  display: none;
}
/* Media queries and other overrides */
@media (max-width: 50rem) {
  .wide-screen {
    display: none;
  }
  .small-screen {
    display: block;
  }
}

/* only supported by chromium based browsers */
@view-transition {
    navigation: auto;
}
