/* Recipe: the Book recipe dialog */

.recipe-dialog {
  width: min(calc(100% - 32px), 790px);
  padding: 34px 36px 30px;
}

.recipe-ribbon {
  position: absolute;
  top: 20px;
  right: 28px;
  display: flex;
  gap: 10px;
  color: var(--gold);
  transform: rotate(4deg);
}

.recipe-ribbon span:nth-child(2) {
  color: var(--coral);
  font-size: 0.6rem;
}

.recipe-ribbon span:nth-child(3) {
  color: var(--violet);
}

.recipe-group {
  padding: 0;
  margin: 0 0 24px;
  border: 0;
}

.recipe-group legend {
  width: 100%;
  margin-bottom: 10px;
  font-family: var(--font-display);
  font-size: 0.96rem;
  font-weight: 900;
}

.choice-grid {
  display: grid;
  gap: 10px;
}

.choice-grid-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.choice-grid-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.recipe-choice {
  position: relative;
  min-width: 0;
  cursor: pointer;
}

.recipe-choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.choice-card {
  display: flex;
  min-height: 116px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 13px 10px;
  border: 2px solid var(--choice-line);
  border-radius: 16px;
  background: var(--surface);
  text-align: center;
  transition:
    border-color 150ms ease,
    background-color 150ms ease,
    box-shadow 150ms ease,
    transform 150ms ease;
}

.recipe-choice:hover .choice-card {
  border-color: var(--choice-line-hover);
  transform: translateY(-2px);
}

.recipe-choice input:focus-visible + .choice-card {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

.recipe-choice input:checked + .choice-card {
  border-color: var(--violet);
  background: var(--choice-checked);
  box-shadow: 0 5px 15px rgba(102, 87, 199, 0.14);
}

.recipe-choice input:checked + .choice-card::after {
  position: absolute;
  top: 8px;
  right: 9px;
  display: grid;
  width: 21px;
  height: 21px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--violet-fill);
  content: "✓";
  font-size: 0.7rem;
  font-weight: 900;
}

.choice-card-compact {
  min-height: 75px;
}

.choice-icon {
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  margin-bottom: 7px;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 900;
}

.choice-icon-coral {
  color: var(--choice-coral-ink);
  background: var(--coral-pale);
}

.choice-icon-blue {
  color: var(--choice-blue-ink);
  background: var(--blue-pale);
}

.choice-icon-violet {
  color: var(--violet-dark);
  background: var(--violet-pale);
}

.choice-icon-teal {
  color: var(--choice-teal-ink);
  background: var(--teal-pale);
}

.choice-icon-gold {
  color: var(--choice-gold-ink);
  background: var(--gold-pale);
}

.choice-icon-green {
  color: var(--choice-green-ink);
  background: var(--green-pale);
}

.choice-title,
.choice-note {
  display: block;
}

.choice-title {
  font-size: 0.86rem;
  font-weight: 900;
  line-height: 1.25;
}

.choice-note {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 0.7rem;
  line-height: 1.25;
}

/* Drawn, not native: WebKit's native select ignores min-height. */
.recipe-language-select {
  display: block;
  width: min(100%, 360px);
  min-height: 46px;
  padding: 9px 40px 9px 14px;
  border: 2px solid var(--choice-line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background:
    var(--select-chevron) right 14px center / 16px 16px no-repeat,
    var(--field);
  font-size: 0.86rem;
  font-weight: 900;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.recipe-language-select:hover {
  border-color: var(--choice-line-hover);
}

.recipe-language-select:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

.recipe-language-note {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 0.76rem;
  line-height: 1.35;
}

.recipe-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
}

.recipe-footer p {
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 700;
}

.recipe-footer-icon {
  color: var(--gold);
}

.recipe-footer-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.recipe-footer-actions [hidden] {
  display: none;
}

@media (max-width: 780px) {
  .recipe-dialog {
    width: 100%;
    max-width: none;
    max-height: 92vh;
    margin: auto 0 0;
    border-radius: 26px 26px 0 0;
  }

  .choice-grid-three,
  .choice-grid-two {
    grid-template-columns: 1fr;
  }

  .choice-card {
    min-height: 72px;
    flex-direction: row;
    justify-content: flex-start;
    gap: 10px;
    padding: 11px 14px;
    text-align: left;
  }

  .choice-icon {
    flex: 0 0 35px;
    margin-bottom: 0;
  }

  .choice-note {
    margin-top: 0;
    margin-left: auto;
    text-align: right;
    white-space: nowrap;
  }

  /* A note too long for the title's line goes under it, and wraps. */
  .choice-card.choice-card-note-below {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 3px;
  }

  .choice-card-note-below .choice-note {
    margin-left: 0;
    text-align: left;
    white-space: normal;
  }

  /* A font under 16px makes iOS zoom in. */
  .recipe-language-select {
    width: 100%;
    min-height: 48px;
    font-size: 1rem;
  }

  .recipe-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .recipe-footer-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .recipe-footer-actions .button {
    width: 100%;
  }
}
