.recipe-creator--block {
  --headline-font-family: "Luna-Regular", sans-serif;
  --headline-font-size: 2em;
  --sub-headline-font-size: 1.6em;
  --sub-sub-headline-font-size: 1.2em;
  --headline-font-weight: normal;
  --sub-headline-font-weight: normal;
  --sub-sub-headline-font-weight: normal;
  --background: #fefcfc;
  --background-contrast: #000000;
  --secondary: #efefef;
  --secondary-contrast: #000000;
  --primary: #030303;
  --primary-contrast: #ffffff;
  --primary-light: #f7e9e9;
  --primary-light-contrast: #000000;
  --primary-dark: #f7e9e9;

  --border-radius: 0.5em;
  --box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
  --border: 0px;
}

.recipe-creator--block {
  padding: 0;
  margin-bottom: 0 auto 2.5em auto;
  max-width: 730px;
  box-shadow: var(--box-shadow);
  border: var(--border);
  border-radius: var(--border-radius);
  background-color: var(--background);
  color: var(--background-contrast);
  overflow: hidden;
  font-size: 16px;

  * {
    text-align: left;
    padding: 0;
    margin: 0;
  }

  .recipe-creator--block--inner {
    padding: 1em;
  }

  h2,
  h3,
  h4 {
    color: var(--background-contrast);
  }

  .recipe-creator--recipe-block--intro {
    text-align: left;

    > *:not(:last-child) {
      margin-bottom: 1em;
    }
  }

  .recipe-creator--recipe-block--thumbnail {
    width: 100%;
    margin: 0 0 1em 0;
    background-size: cover !important;
    background-repeat: no-repeat !important;
    background-position: center center !important;
    border-radius: calc(var(--border-radius) / 2);

    &::before {
      content: "";
      display: block;
      width: 100%;
      padding-top: 66.6%;
    }
  }

  @media (min-width: 768px) {
    .recipe-creator--recipe-block--thumbnail {
      margin-bottom: 0;
      align-self: flex-start;
    }
  }

  h2 {
    font-size: var(--headline-font-size);
    font-weight: var(--headline-font-weight);
    font-family: var(--headline-font-family);
    line-height: 1.4;
    margin: 0 0 0.5em 0;
  }

  h3 {
    font-size: var(--sub-headline-font-size);
    font-weight: var(--sub-headline-font-weight);
    font-family: var(--headline-font-family);
    line-height: 1.2;
    margin-bottom: 0;
  }

  h4 {
    font-size: var(--sub-sub-headline-font-size);
    font-weight: var(--sub-sub-headline-font-weight);
    font-family: var(--headline-font-family);
    line-height: 1.2;
    margin-bottom: 0;
  }

  .recipe-creator--recipe-block--timings {
    ul {
      font-style: normal;
      list-style: none;
      margin-left: 0;
      margin: 0;
      padding: 0;
      text-align: left;
      position: relative;

      li {
        margin-left: 0;
        white-space: nowrap;
        margin: 0 2em 1em 0;
      }

      header {
        font-size: 0.8em;
        line-height: 1;
        font-family: var(--headline-font-family);
        font-style: normal;
      }

      span {
        font-style: normal;
        font-weight: bold;
      }
    }
  }

  .recipe-creator--recipe-block--notes {
    p {
      margin-bottom: 1em;
    }
  }

  .recipe-creator--recipe-block--headline {
    display: flex;
    justify-content: space-between;
    padding: 0;
    margin: 0.5em 0 1.5em 0;
    align-items: flex-start;

    flex-direction: column;

    @media (min-width: 768px) {
      flex-direction: row;
      align-items: center;
    }
  }

  .recipe-creator--recipe-block--servings-editor {
    display: flex;
    margin-top: 0.5em;
    width: 100%;

    > span,
    button {
      display: block;
      background-color: var(--secondary);
      color: var(--secondary-contrast);
      border: 0;
      border-radius: calc(var(--border-radius) / 2);
      appearance: none;
      padding: 0.5em 1em;
      line-height: 1.4;
      cursor: pointer;

      &[disabled] {
        cursor: default;
      }
    }

    > span {
      margin: 0 0.25em;
      flex-grow: 1;
    }

    @media (min-width: 768px) {
      margin-top: 0;
      width: auto;

      > span {
        flex-grow: unset;
      }
    }
  }

  .recipe-creator--recipe-block--group-title {
    th {
      padding-top: 1em;
      padding-bottom: 0.5em;
      border: 0;
      font-size: var(--sub-sub-headline-font-size);
      font-weight: var(--sub-sub-headline-font-weight);
    }
  }

  .recipe-creator--recipe-block--ingredients-table {
    padding: 0;
    width: 100%;
    border-collapse: collapse;
    border-width: 0;
    box-sizing: border-box;
    border-spacing: 0px;
    margin-bottom: 1.5em;

    tr {
      background-color: transparent;

      td {
        padding: 0.5em;
        margin: 0;
        text-align: left;
        border: none;

        &.recipe-creator--recipe-block--amount {
          text-align: right;
          white-space: nowrap;
          padding-right: 0;
        }

        &.recipe-creator--recipe-block--ingredient {
          width: 100%;
        }
      }
    }
  }

  .recipe-creator--recipe-block--utensils ul {
    padding: 0;
    width: 100%;
    margin: 0 0 1.5em 0;
    list-style: none;

    li {
      padding: 0.5em 0.75em;
    }
  }

  .recipe-creator--recipe-block--preparation-steps {
    h4 {
      margin-bottom: 0.5em;
    }

    ol {
      display: block;
      list-style: none;
      margin: 0 0 1em 0;
      padding: 0;
      counter-reset: recipe-creator-steps;
      text-align: left;

      li {
        display: block;
        padding: 0.5em 0 0.5em 1.9em;
        margin: 0;
        line-height: 1.4;
        position: relative;

        &::before {
          counter-increment: recipe-creator-steps;
          content: counter(recipe-creator-steps);
          text-align: center;
          font-weight: bold;
          display: block;
          width: 1.4em;
          min-width: 1.4em;
          height: 1.4em;
          float: left;
          margin-right: 0.5em;
          background-color: var(--primary-light) !important;
          border-radius: 50%;
          color: var(--primary-light-contrast);
          position: absolute;
          top: 0.5em;
          left: 0;
        }

        img {
          display: block;
          max-width: 100%;
          margin-bottom: 0.5em;
        }
      }
    }
  }

  .recipe-creator--recipe-block--difficulty {
    border-radius: var(--border-radius);
    background-color: var(--primary-light) !important;
    padding: 0.25em 0.75em;
    border: 1px solid var(--primary);
    color: var(--primary-light-contrast);
    display: inline-block;
    font-size: 1em;
    line-height: 1.4;
  }

  .recipe-creator--recipe-block--rating {
    text-align: center;
    margin-bottom: 1.5em;

    ol {
      list-style: none;
      padding: 0;
      font-size: 0;
      line-height: 0;
      margin: 0;
      display: inline-block;
      vertical-align: middle;

      li.recipe-creator--recipe-block--star {
        &::before {
          font-size: 32px;
          line-height: 32px;
          display: block;
        }
      }
    }

    &.recipe-creator--recipe-block--rating--small {
      text-align: left;
      margin-bottom: 1em;

      .recipe-creator--recipe-block--star {
        font-size: 24px;
        line-height: 24px;
      }
    }

    &.recipe-creator--recipe-block--interactive {
      ol {
        &:hover {
          li.recipe-creator--recipe-block--star,
          li.recipe-creator--recipe-block--star.selected,
          li.recipe-creator--recipe-block--star.half-selected {
            &::before {
              font-family: "recipe-creator-icons";
              content: $recipe-creator-icons-star-highlighted;
            }
          }
        }

        li.recipe-creator--recipe-block--star {
          cursor: pointer;

          &:hover,
          &.selected:hover,
          &.half-selected:hover {
            ~ * {
              &::before {
                font-family: "recipe-creator-icons";
                content: $recipe-creator-icons-star;
              }
            }
          }
        }
      }
    }

    p {
      text-align: center;
    }
  }

  .recipe-creator--recipe-block--star {
    margin: 0;
    padding: 0 4px;
    box-sizing: content-box;
    background-repeat: no-repeat;
    display: inline-block;

    &::before {
      font-family: "recipe-creator-icons";
      content: $recipe-creator-icons-star;
      color: var(--primary);
    }

    // TODO: Kann vielleicht weg
    // Enforces the background image to be visible when printing
    -webkit-print-color-adjust: exact;

    &.selected::before {
      content: $recipe-creator-icons-star-filled;
    }

    &.half-selected::before {
      content: $recipe-creator-icons-star-half-filled;
    }
  }

  .recipe-creator--recipe-block--share-buttons {
    list-style: none;
    display: flex;
    justify-content: space-evenly;
    justify-content: flex-start;
    justify-content: center;
    padding: 0;

    li {
      list-style: none;
      margin: 0 0.5em;
    }

    a,
    button {
      display: block;
      border-radius: calc(var(--border-radius) / 2);
      -webkit-appearance: none;
      -moz-appearance: none;
      appearance: none;
      padding: 0.5em 1em;
      border: 1px solid transparent;
      line-height: 1.4;
      cursor: pointer;
    }

    .recipe-creator--recipe-block--print {
      border-color: var(--secondary);
      background-color: var(--secondary);
      color: var(--secondary-contrast);
    }

    .recipe-creator--recipe-block--share-on-pinterest {
      display: flex;
      align-items: center;
      background-color: #ffffff;
      border-color: #e60023;
      color: #e60023;
      padding: calc(0.5em - 2px) 1em;
      text-decoration: none;

      &:hover,
      &:focus {
        text-decoration: none;
      }

      &::before {
        content: "";
        display: block;
        float: left;
        width: 1.5em;
        height: 1.5em;
        background-image: url("../../../assets/pinterest.svg");
        background-size: 1.5em 1.5em;
        background-position: center center;
        background-repeat: no-repeat;
        margin-right: 0.5em;
      }
    }
  }

  .recipe-creator--recipe-block--video-wrapper {
    position: relative;
    margin-bottom: 1.5em;

    &::before {
      content: "";
      display: block;
      width: 100%;
      padding-top: 56.25%;
    }

    iframe {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      width: 100%;
      height: 100%;
    }
  }

  .recipe-creator--recipe-block--call-to-action {
    background-color: var(--primary);
    color: var(--primary-contrast);
    padding: 1.5em 1em;
    display: flex;
    gap: 1em;
    margin-left: -1em;
    margin-right: -1em;
    margin-bottom: -1em;

    .recipe-creator--recipe-block--call-to-action--icon {
      width: 3em;
      height: 3em;
      display: block;
      flex-shrink: 0;

      &:before {
        font-size: 3rem;
        line-height: 3rem;
        font-family: "recipe-creator-icons";
        content: $recipe-creator-icons-instagram;
      }
    }

    .recipe-creator--recipe-block--call-to-action--text {
      width: 0;
      min-width: calc(100% - 4em);
    }

    h3 {
      margin: 0;
      padding: 0;
      font-size: 1.5em;
      line-height: 1.4;
      color: var(--primary-contrast);
    }

    p {
      margin: 0;
      padding: 0;
      font-size: 1em;
      line-height: 1.4;

      a {
        color: var(--primary-contrast);
        text-decoration: none;
      }
    }
  }
}
