/* single element niceties */
a { color: inherit }
img, video { max-width: 100% }
li { list-style: none }

body {
  font-size: medium;
  padding: 1em;
  max-width: 1280px;
  display: flex;

  @media(orientation: landscape) {
    gap: 2em;
  }
}

header {
  background: white;
  position: sticky;
  top: 0;
  & nav {
    background: white;
    position: sticky;
    top: 0;
    display: flex;
    font-size: xx-large;
    & a {
      text-decoration: none;
      &:hover {
        text-decoration: underline;
      }
    }
    & > menu {
      padding: 0;
      margin: 0;
    }
  }
}

main {
  flex: 1;
}

menu { cursor: pointer }

.active {
  pointer-events: none;
  text-decoration: underline;
}

#check { display: none; }

#landing.active {
  display: block;
}

@media (hover: hover) {
  menu:hover li {
    visibility: inherit;
    display: block;
  }
}

/* turn the menu into a dynamic one for highly vertical devices */
@media (orientation: portrait) {
  body {
    flex-direction: column;
  }
  main {
    min-width: fit-content;
  }
  nav {
    top: 1em;
  }
  #check:checked ~ .menu > nav > menu > li {
    visibility: inherit;
    display: block;
  }
  nav > menu > li {
    visibility: collapse;
    display: none;
    &.active {
      visibility: inherit;
      display: block;
    }
  }
}

/* used mostly by .zs/index, should maybe class it? */
ul {
  padding-left: 0;
}

/* lists that have optional dates associated with them */
#post-index + ul li,
#projects + ul li {
  display: flex;
  align-items: baseline;

  & span {
    min-width: 5em;
    text-align: right;
    padding-right: 1rem;
    line-height: 1.5rem;
    font-size: smaller;
  }

  & a {
    font-size: larger;
  }
}

:root {
  --red: #f21332;
  --orange: #f27225;
  --pink: #e20b88;
  --yellow: #f2ad24;
  --green: #00b249;
  --blue: #1844b5;
  --purple: #a033b3;
}

li:nth-of-type(6n + 1):hover,
li.active:nth-of-type(6n + 1) {
  color: var(--red);
}
li:nth-of-type(6n + 2):hover,
li.active:nth-of-type(6n + 2) {
  color: var(--orange);
}
li:nth-of-type(6n + 3):hover,
li.active:nth-of-type(6n + 3) {
  color: var(--pink);
}
li:nth-of-type(6n + 4):hover,
li.active:nth-of-type(6n + 4) {
  color: var(--green);
}
li:nth-of-type(6n + 5):hover,
li.active:nth-of-type(6n + 5) {
  color: var(--blue);
}
li:nth-of-type(6n + 6):hover,
li.active:nth-of-type(6n + 6) {
  color: var(--purple);
}
