html, body {
  min-height: 100%;
  width: 100%;
  max-width: 90ch;
  margin: 0 auto;
  box-sizing: border-box;
  font-family: sans-serif;

}

*, *:before, *:after {
  box-sizing: inherit;
}

h1 {
  margin: 0;
}

nav {
  display: flex;
  align-items: center;
  gap: 2em;

  .logo  {
    width: 2em;
    height: 2em;
    margin: .25em;
  }

  .menu {
    display: flex;
    gap: 2em;
    a {
      all: inherit;
      font-family: monospace;
      cursor: pointer;
      &.active {
        font-weight: bold;
      }
    }
  }
}

.fragment {
  display: contents;
}

.main {
  padding: .5em;
}

.tags {
  margin: 1em 0;
  display: flex;
  gap: .25em;

  .tag {
    text-decoration: none;
    padding: .125em .3em;
    color: #666;
    border: 1px dotted #666;

    &.active {
      background-color: #000;
      border: 1px dotted #000;
      color: #fff;
    }
  }
}

.method {
  display: grid;
  grid-template-columns: 1.5fr 2fr;
  gap: 0 2em;
  margin-top: 1em;

  .section .title {
    grid-column: 1/-1;
    margin-bottom: 0.5em;
  }

  .text {
    max-width: 60ch;
    line-height: 1.5;

    p {
      margin-top: 0;
    }
    p:hover {
      background-color: #ddd;
    }

    .ingredient {
      font-weight: bold;
    }

    .tool {
      text-decoration: underline;
      text-decoration-thickness: .1em;
    }

    .duration .quantity {
      display: inline-block;
      font-size: 0.75em;
      border: 2px solid #000;
      padding: 0.05em 0.1em;
      font-weight: bold;
    }
  }
}

.summary {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
  font-size: 0.9em;

  & > *:hover {
    background-color: #ddd;
  }

  .ingredient {
    display: flex;
    justify-content: space-between;
    gap: 1em;

    .name {
      color: #333;
    }

    .meta {
      text-align: right;
      .details {
        color: #666;
        font-size: 0.8em;
      }
      .quantity {
        white-space: nowrap;
      }
    }

    .meta:not(:first-of-type) {
      margin-top: 0.5em;
      position: relative;
      &::before {
        left: 0;
        position: absolute;
        margin-left: -1.5ch;
        content: "+";
      }
    }

    &.ref {
      font-style: italic;
    }
  }

  .action {
    display: flex;
    justify-content: space-between;
    gap: 1em;
    color: #999;
    padding-left: 1em;
    .tool {
      font-size: 0.8em;
      color: #666;
    }
    .meta {
      text-align: right;
      .details {
        font-size: 0.8em;
      }
    }
  }

  .env {
    display: grid;
    grid-template-columns: minmax(1em, 1fr) auto minmax(1em, 1fr);
    gap: 1em;
    font-size: 0.75em;
    font-weight: bold;
    &::before, &::after {
      content: "";
      border-top: 0.1rem solid black;
      align-self: center;
    }
  }
}

.components .summary {
  .action {
    display: none;
  }

  .action + .ingredient  {
    padding-top: 0.5em;
    border-top: 2px dotted #ccc;
  }
}

.summaries {
  display: flex;
  font-size: 0.8em;
  gap: 4em;
  overflow: scroll;
}

.index {
  ul {
    padding: 0;
    li {
      display: flex;
      justify-content: space-between;
      list-style-type: none;
      padding: 0.5em;

      a, button {
        all: inherit;
        padding: 0.5em;
        cursor: pointer;
      }

      a { flex-grow: 1; }

      label {
        padding: .5em;
      }
    }
  }

  button {
    all: inherit;
    cursor: pointer;
    border: 1px solid #000;
    padding: 0.25em 0.5em;
  }
}

.overview {
  .meta {
    .head {
      display: flex;
      justify-content: space-between;
      align-items: center;
      border-bottom: 1px dotted #999;
      padding: 0.25em 0;
    }
    .cover {
      width: 100%;
      max-width: 100%;
      height: 40vh;
      object-fit: cover;
    }
    .description {
      font-family: serif;
      color: #333;
      font-size: 1.25em;
    }
  }

  pre {
    width: 100%;
    overflow-x: scroll;
  }
}
