:root {
  color-scheme: light dark;

  --solid: light-dark(black, white);
  --grey-heavy: light-dark(#d5d5d5, #373a5d);
  --grey-light: light-dark(#f0f0f0, #292c47);
  --acc-color: light-dark(#053FFF, #50f1c1);
  --error: light-dark(#eb0043, #ff326c);

  scrollbar-gutter: stable;
}

body {
  color: var(--solid);
  background-color: light-dark(white, #1c1e30);
  accent-color: var(--acc-color);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;


  max-width: min(800px, 90vw);
  margin: auto;
}

a, a:visited {
  color: var(--acc-color);
  text-decoration: underline;
}

header {
  background: var(--grey-heavy);
  border: 0.5px solid var(--solid);
  border-top: none;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
  min-height: 64px;

  a {
    text-decoration: none;
  }
  

  .brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    padding-right: 10px;
    text-decoration: none;

    img {
      height: 80px;
      display: block;
    }

    h1 {
      margin: 0;
      font-size: 1.25rem;
      font-weight: 500;
      letter-spacing: -0.01em;
    }
  }

  .brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;

    .brand-name {
      font-size: 1.5rem;
      font-weight: 1000;

      .homo { color: #F5A9B8; }
      .fon  { color: #5BCEFA; }
    }

    .brand-title {
      font-size: 1.5rem;
      color: var(--solid);
    }
  }

  nav {
    margin-left: auto;
    align-self: end;

    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-evenly;

    a, a:visited {
      display: flex;
      flex-direction: column;
      justify-content: center;
      
      border-bottom: 3px solid transparent;
      
      &:hover, &.current {
        border-bottom: 3px solid var(--acc-color);
      }
      
      .nav-align {
        padding: 10px;
        color: var(--solid);
        text-align: center;
      }
    }
  }
}

@supports (flex-wrap: balance) {
  header nav {
    flex-wrap: balance;
  }
}

#converter {
  padding-left: unset;

  display: flex;
  flex-wrap: wrap;
  justify-content: space-evenly;

  li {
    list-style-type: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    column-gap: 10px;

    label, input {
      font-size: 1.4rem;
    }
  }

  #error {
    color: var(--error);
    font-weight: bold;
  }

  li:has(#error) {
    flex-basis: 100%;
  }
}

/* For bottom-aligning the footer */
:root, body {
  height: 100%;
}

footer {
  position: sticky;
  top: 100vh;
}

footer {
  border: solid 1px var(--solid);
  border-bottom: none;
  background: var(--grey-heavy);

  max-width: fit-content;
  margin: auto;
  padding: 0 1rem;

  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  align-items: center;

  > a {
    margin-left: 1em;
    margin-right: 1em;
  }
  .license {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: left;
    align-items: center;
    font-size: small;
    margin: auto;
    width: 100%;
    flex-basis: 100%;

    img {
      margin-right: 0.5em;
    }
  }
}




/* Source: https://wiki.selfhtml.org/wiki/Fu%C3%9Fnoten_mit_CSS#Anmerkungsziffern_automatisch_erstellen */
body {
  counter-reset: footnotes;
}

[role="doc-noteref"] {
  counter-increment: footnotes; 
}


[role="doc-noteref"]::after {
  content: '[' counter(footnotes) ']'; 
  vertical-align: super; 
  font-size: smaller; 
}

foot-note-container {
  counter-reset: footnotes;
  display: block;
  border-top: solid 1px var(--solid);
  margin-block: 1em;
  padding-top: 1em;
}

foot-note {
  counter-increment: footnotes;
  display: block;
}

foot-note::before {
  content: '[' counter(footnotes) ']';
}

