/*
 * Recommended varieties after an offline conversation (VarietySuggestionsController): the filters
 * the conversation led to, then the varieties as a list that fits an iPhone in portrait.
 */

.variety-suggestions__count,
.variety-suggestions__facts {
  margin: 0;
  color: var(--ink-muted);
}

.variety-suggestions__needs-title {
  margin: 0 0 var(--space-2);
  font-size: 1rem;
}

.variety-suggestions__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.variety-suggestions__tags li {
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.875rem;
}

/* The number of fitting varieties closes the list. */
.variety-suggestions__count {
  margin-block-start: var(--space-4);
}

.variety-suggestions__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* The varieties beyond the first few: a button until it is pressed, then the rest of the list. */
.variety-suggestions__rest > summary {
  margin-block-start: var(--space-3);
  list-style: none;
  cursor: pointer;
}

.variety-suggestions__rest > summary::-webkit-details-marker {
  display: none;
}

.variety-suggestions__rest[open] > summary {
  display: none;
}

.variety-suggestions__item {
  padding: var(--space-3) 0;
  border-top: 1px solid var(--line);
}

.variety-suggestions__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
}

.variety-suggestions__name {
  margin: 0;
  font-size: 1.125rem;
  overflow-wrap: anywhere;
}

/* "S 230" stays in one piece where the line of facts breaks. */
.variety-suggestions__maturity {
  white-space: nowrap;
}

/* The filters a variety only fits without: the pills of the active filters, struck through. */
.variety-suggestions__dropped {
  margin-block-start: var(--space-2);
}

.variety-suggestions__dropped li {
  border-style: dashed;
  color: var(--ink-muted);
}

/* What sets the variety apart: one selling point per property it has beyond the filters, the
   property in front. */
.variety-suggestions__arguments {
  margin: var(--space-2) 0 0;
  padding: 0;
  list-style: none;
}

.variety-suggestions__arguments li + li {
  margin-block-start: var(--space-2);
}

/* The selling points beyond the first few: a small button until it is pressed, then the rest. */
.variety-suggestions__more > summary {
  margin-block-start: var(--space-2);
  padding: var(--space-1) var(--space-3);
  font-size: 0.875rem;
  list-style: none;
  cursor: pointer;
}

.variety-suggestions__more > summary::-webkit-details-marker {
  display: none;
}

.variety-suggestions__more[open] > summary {
  display: none;
}

.variety-suggestions__property {
  margin-inline-end: var(--space-1);
  padding: 0 var(--space-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
}

.variety-suggestions__benefits {
  margin: var(--space-2) 0 0;
  padding-inline-start: 1.25rem;
}

.variety-suggestions__benefits li + li {
  margin-block-start: var(--space-1);
}

/* Waiting: a large moving symbol, no text until it has taken a while. */
.variety-suggestions__waiting {
  display: grid;
  justify-items: center;
  gap: var(--space-3);
  padding-block: var(--space-6, 3rem);
  text-align: center;
}

.variety-suggestions__symbol {
  width: 6rem;
  height: 6rem;
  color: var(--ink-muted);
}

.variety-suggestions__hint {
  margin: 0;
  color: var(--ink-muted);
  opacity: 0;
  animation: variety-suggestions-hint 0.8s ease 5s forwards;
}

@keyframes variety-suggestions-hint {
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .variety-suggestions__hint {
    animation-duration: 0.01s;
  }
}

/* --- Wide screens: an iPad, a desktop --------------------------------------------------------- */

/*
 * On a screen at least 44rem wide and 40rem high (the condition of the price list, price_list.css:
 * every iPad in either orientation, no phone) the person's page takes the width it gets and the
 * varieties stand side by side as cards, two in a row. The first view is SHOWN_AT_FIRST varieties,
 * two rows of them, so they can be compared on one screen. The same list inside the backend page
 * of a conversation (.runner-results) stays a list: it sits in a narrow section there.
 */
@media (min-width: 44rem) and (min-height: 40rem) {
  .home-page:has(.home-content.variety-suggestions) .home-header__inner,
  .home-page:has(.home-content.variety-suggestions) .home-shell,
  .application-body > .home-content.variety-suggestions {
    width: min(calc(100% - (2 * var(--space-6))), 80rem);
  }

  .home-content .variety-suggestions__list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-4);
  }

  .home-content .variety-suggestions__item {
    padding: var(--space-4);
    border: 1px solid var(--line);
    border-radius: var(--radius-l);
    background: var(--surface);
  }

  .home-content .variety-suggestions__name {
    font-size: 1.25rem;
  }

  /* The rest continues the rows of the first view, at the distance of a row. */
  .home-content .variety-suggestions__rest > summary,
  .home-content .variety-suggestions__rest > .variety-suggestions__list {
    margin-block-start: var(--space-4);
  }
}

/*
 * In landscape from 72rem on (an iPad of 11 inches or more; the smaller ones keep two in a row)
 * the first view stands in one row, the varieties as four columns to compare. A column is
 * narrower than a phone, so the property stands above its selling point instead of in front.
 */
@media (min-width: 72rem) and (min-height: 40rem) and (orientation: landscape) {
  .home-content .variety-suggestions__list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .home-content .variety-suggestions__property {
    display: block;
    width: fit-content;
    margin: 0 0 var(--space-1);
  }
}
