/*
  "Rezept übernehmen": the source page, the progress steps, the review and the imported meal's marker, after the
  approved mock (docs/mockup/hauswerk-prototyp.html, "Rezept übernehmen"). Built on the tokens of hauswerk.css, so light
  and dark follow the theme.
*/

.hw-recipe-marker .hw-icon {
  width: 16px;
  height: 16px;
}

/* --- source page ------------------------------------------------------------------------ */

.hw-recipe-sources {
  align-self: flex-start;
}

.hw-recipe-form,
.hw-recipe-review {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hw-recipe-privacy p {
  margin: 0 0 10px;
}

.hw-recipe-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hw-recipe-photo {
  position: relative;
  margin: 0;
  width: 96px;
  height: 96px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--hw-surface-2);
  display: block;
}

.hw-recipe-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hw-recipe-photo-remove {
  position: absolute;
  top: 4px;
  right: 4px;
}

.hw-recipe-pickers {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hw-recipe-text {
  resize: vertical;
  min-height: 160px;
}

/* --- progress ----------------------------------------------------------------------------- */

.hw-recipe-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
}

.hw-recipe-step + .hw-recipe-step {
  border-top: 1px solid var(--bsft-color-border);
}

.hw-recipe-step i {
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 2px solid var(--bsft-color-border);
}

.hw-recipe-step i .hw-icon {
  width: 14px;
  height: 14px;
}

.hw-recipe-step.is-done i {
  background: var(--bsft-color-primary);
  border-color: var(--bsft-color-primary);
  color: var(--bsft-color-primary-contrast);
}

.hw-recipe-step.is-running i {
  border-color: var(--bsft-color-primary);
  border-top-color: transparent;
  animation: hw-recipe-spin 0.9s linear infinite;
}

.hw-recipe-step.is-waiting {
  color: var(--bsft-color-muted);
}

@keyframes hw-recipe-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hw-recipe-step.is-running i {
    animation: none;
  }
}

/* --- failure and review --------------------------------------------------------------------- */

.hw-recipe-failed p {
  margin: 0 0 8px;
}

.hw-recipe-flag {
  background: var(--bsft-color-warning-surface);
  border-radius: 12px;
  padding: 10px 12px;
  margin: 6px 0 0;
}

.hw-recipe-flag-label {
  margin: 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--bsft-color-warning);
}

.hw-recipe-hint {
  margin: 4px 0 0;
  font-size: 13.5px;
  color: var(--bsft-color-warning);
}

.hw-recipe-hint small,
.hw-recipe-correction small {
  display: block;
  color: var(--bsft-color-muted);
  font-size: 12.5px;
}

.hw-recipe-correction {
  margin: 0;
  padding: 6px 0;
  font-size: 13.5px;
  border-top: 1px solid var(--bsft-color-border);
}

.hw-recipe-title-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.hw-recipe-title-photo {
  width: 84px;
  height: 84px;
  flex: none;
  border-radius: 14px;
  object-fit: cover;
}

.hw-recipe-field {
  flex: 1;
  min-width: 0;
}

.hw-recipe-numbers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.hw-recipe-group {
  margin: 10px 0 2px;
}

.hw-recipe-ingredient {
  padding: 4px 0;
}

.hw-recipe-ingredient.is-unsure {
  background: var(--bsft-color-warning-surface);
  border-radius: 10px;
  margin: 2px -6px;
  padding: 6px;
}

.hw-recipe-ingredient-line {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hw-recipe-new {
  flex: none;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--hw-meal-soft);
  color: var(--hw-meal);
}

.hw-recipe-ingredient-add {
  margin-top: 8px;
}

.hw-recipe-steps-text {
  resize: vertical;
  margin-top: 8px;
}

.hw-recipe-source-text {
  white-space: pre-wrap;
  word-break: break-word;
  font: inherit;
  font-size: 13.5px;
  margin: 8px 0 0;
  max-height: 320px;
  overflow: auto;
}

.hw-recipe-source-link {
  margin: 8px 0 0;
  word-break: break-all;
}

/* --- imported meal ------------------------------------------------------------------------ */

.hw-recipe-marker {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

.hw-recipe-marker a {
  color: var(--bsft-color-primary);
}

/* The main button of the source page and the way on after an import keep their distance from what is above. */
.hw-recipe-start,
.hw-recipe-next {
  margin-top: 8px;
}

.hw-recipe-next {
  align-self: flex-start;
}
