* {
  box-sizing: border-box;
}

html {
  font-family: system-ui, sans-serif;
  background: white;
}

a {
  text-decoration: none;

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

.not-published {
  text-decoration: line-through;
}

body.index {
  max-width: 72em;
  margin: 0 auto;
  display: grid;
  gap: 0.5em;

  h1 {
    font-size: 1.75em;
  }

  h1, p {
    margin: 0;
  }

  > p {
    text-align: center;
  }

  header, footer {
    a {
      text-wrap: nowrap;
    }
  }

  header {
    display: grid;
    align-items: center;
    padding: 0.5em 0.5em 0;
    gap: 1em;

    @media(min-width: 42em) {
      & {
        grid: auto-flow / 1fr 1fr;
      }

      p.count {
        justify-self: end;
      }

      div.check-and-logos {
        div {
          justify-content: end;
        }

        p {
          text-align: right;
        }
      }
    }

    div.check-and-logos {
      div {
        display: flex;
        gap: 0.5em;
        padding: 0.125em;
      }

      p {
        font-style: italic;
      }
    }

    h1 a {
      color: inherit;
    }

    search {
      margin-right: auto;
      display: grid;
      gap: 0.5em;
    }
  }

  @media (max-width: 42em) {
    main {
      overflow-x: auto;
    }
  }

  table {
    display: grid;

    thead {
      position: sticky;
      z-index: 1;
      top: 0;
      background: white;
      border-bottom: 2px solid black;

      th {
        text-align: left;
        text-wrap: nowrap;
      }

      a {
        color: black;
      }
    }

    tr {
      display: grid;
      grid-template-columns: 3fr repeat(4, 1fr);
      align-items: center;
      gap: 1em;
      padding: 0.5em 0.75em;
      min-width: 40em;

      td {
        font-size: 0.9375rem;
      }
    }

    tr.latest {
      background: hsl(187 51.9% 93%);
    }

    tr.now:not(:first-child) {
      position: relative;

      > :first-child::after {
        content: '';
        position: absolute;
        display: block;
        width: 100%;
        left: 0;
        border-top: 4px dashed red;
        top: -3px;
        opacity: 0.5;
      }
    }

    tbody tr {
      border-bottom: 1px solid grey;
    }
  }

  footer {
    display: flex;
    align-items: start;
    padding: 0 0.5em 1em;

    :first-child {
      margin-right: auto;
    }

    p {
      margin: 0;
    }
  }

  span[data-tt][data-copy] {
    cursor: pointer;

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

body.detail {
  display: grid;
  place-items: center;
  max-width: 50em;
  margin: 0 auto;

  h1{
    margin: 0;
  }

  section {
    width: 100%;
    padding: 0.75em;
  }

  > p {
    padding: 0 1.25em;
  }

  dl {
    overflow-wrap: anywhere;
    border-top: 1px solid black;
    border-bottom: 1px solid black;
    padding: 1em 0;
    margin: 0.5em 0;
  }

  dt {
    font-weight: bold;
    margin-bottom: 0.25em;
  }

  dd {
    margin-left: 1.25em;

    p {
      margin-top: 0;
    }
  }

  dd:has(+ dt) {
    margin-bottom: 1.5em;
  }
}

/* taken from UnoCSS, MIT license */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}
