:root {
  --primary: oklch(0.3843 0.1412 306.49);
  --on-primary: oklch(0.9676 0.0192 306.49);
  --border-primary: oklch(0.65 0.1412 306.49);
  --hover-primary: oklch(0.3071 0.1412 306.49);
  --on-bg: oklch(0.0559 0.0291 306.49);
  --interact: oklch(0.3635 0.136 258.36);
}

* {
  box-sizing: border-box;
}

body {
  background-color: #fff;
  color: var(--on-bg);
  font-family: Inter, Roboto, 'Helvetica Neue', 'Arial Nova', 'Nimbus Sans', Arial, sans-serif; 
  font-size: 16px;
}

main {
  color: var(--on-bg);
  max-width: 1200px;
  margin: auto;
}

input, button {
  font-size: 24px;
  border-radius: 8px;
}

*:focus-visible {
  outline: 2px dashed black !important;
  box-shadow: 0 0 0 2px white !important;
}

input[type=text] {
  padding: .5em .75em;
  border: 1px solid var(--border-primary);

  &:hover {
    border: 1px solid var(--hover-primary);
  }
}

.accordion-toggle {
  background-color: white;
  border: none;
  cursor: pointer;
  color: var(--interact);

  &::before {
    content: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="oklch(0.3635 0.136 258.36)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-chevron-up"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M6 15l6 -6l6 6" /></svg>');
    vertical-align: sub;
    padding-right: .25em;
  }

  &.closed::before {
    content: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="oklch(0.3635 0.136 258.36)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-chevron-down"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M6 9l6 6l6 -6" /></svg>');
  }

  &.closed + .accordion-content {
    display: none !important;
  }

  &.closed + .accordion-tags-content .tag {
    display: none !important;
  }
}

.primary {
  background-color: var(--primary);
  color: var(--on-primary);
  border: none;
  outline: none;
  font-weight: bold;
  padding: .5em .75em;
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  &:hover {
    background-color: var(--hover-primary);
  }
}

.link-list a {
  text-decoration: none;
  color: var(--interact);

  &:hover {
    text-decoration: underline;
  }
}

.search-index {
  display: flex;
  gap: 1em;
  flex-wrap: wrap;

  button {
    flex: 1;
  }

  input[type=text] {
    flex-grow: 10000;
    min-width: 240px;
  }
}

.tag-list {
  font-size: 20px;
  margin-left: 1em;
  margin-top: .5em;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em .5em;

  a:not(:last-child)::after {
    content: ",";
  }
}

.tag-selection-index {
  .category {
    margin-bottom: 1em;

    h2 {
      font-weight: normal;
      font-size: 1.5em;
    }
  }
}

.link-card {
  text-decoration: none;
  display: block;

  .title {
    color: var(--interact);
  }

  &:hover .title {
    text-decoration: underline;
  }

  .desc {
    color: var(--on-bg);
  }
}

@media(min-width: 900px) {
  .catalogue {
    display: flex;
    gap: 0 1em;
  }

  .song .desc {
    display: flex;
    flex-wrap: wrap;
    gap: 0 1em;

    p {
      flex: 1;
      min-width: 34%;
    }
  }
}

.catalogue {
  .songs {
    flex: 2;
    display: flex;
    flex-direction: column;
    gap: 1.5em 0;
  }

  .song {
    p, h2 {
      margin: 8px 0;
    }

    .desc {
    }
  }

  .song-tag:not(:last-child) {
    margin-right: .25em;
    &::after {
      content: ",";
    }
  }

  .tag-selection {
    flex: 1;

    .accordion-toggle {
      display: block;
      margin-top: 1em;
      margin-bottom: .5em;
    }

    input[type=text], button.primary {
      width: 100%;
    }

    .tag.selected {
      display: block !important;
      font-weight: bold;
    }

    .tag {
      font-size: 20px;

      input[type=checkbox] {
        appearance: none;
        width: 1em;
        height: 1em;
        border: 1px solid var(--border-primary);
        border-radius: 6px;
        margin: 0 .25em;
        vertical-align: -16%;

        &:hover {
          border-color: var(--on-bg);
        }

        &:checked {
          background-color: var(--primary);
          background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-check"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M5 12l5 5l10 -10" /></svg>');
          border-color: var(--primary);
        }
      }
    }
  }
}

.detail {
  .song-tag:not(:last-child) {
    margin-right: .25em;
    &::after {
      content: ",";
    }
  }

  .pdf {
    font-size: 24px;
    border-radius: 8px;
    text-decoration: none;
    width: fit-content;
  }
}
