.nutrition-3-row {
  padding: 50px;
  height: 300px;
  background-color: #222932;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.nutrition-3-row h1 {
  color: #fff;
  font-size: 4rem;
}

.nutrition-3-row p {
  color: #fff;
  font-size: 2rem;
  opacity: 0.8;
}
.background-nutrition {
  background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
    url("../images/salmon-on-bed-of-kale-c.jpg");
  background-size: cover;
}

.font-color-grey {
  color: #222932;
}
.search-nutrition-container {
  /* height: 200vh; */
  background: #171e27;
  padding: 50px;
}
.nutrition-container {
  /* border: 1px solid red; */
  display: grid;
  grid-template-columns: 0.3fr 1fr;
}
.nutrition-filters {
  /* border: 1px solid green; */
  padding: 5px;
}

.nutrition-cards {
  /* border: 1px solid blue; */
  height: fit-content;
}
.selectable-values {
  /* border: 1px solid yellow; */
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  cursor: pointer;
  grid-gap: 5px;
  padding: 10px;
}
.selectable-values-value {
  padding: 5px;
  text-align: center;
  background-color: #333b44;
  color: #fff;
  font-weight: 200;
  /* border: 1px solid white; */
}
.selectable-values-value:hover {
  background-color: #171e27;
  /* border: 1px solid white; */
}
.ant-slider-track {
  background-color: #ff7700 !important;
}
.nutrition-filters-preprationTime {
  padding: 10px 0;
}
.nutrition-filters-calories {
  padding: 10px 0;
}
.reset-all-filters {
  /* border: 1px solid green; */
  display: inline-block;
  margin: 10px;
  color: #ff7700;
  font-size: 18px;
  cursor: pointer;
}

@media screen and (min-width: 2000px) {
  .nutrition-3-row {
    width: 60vw;
    margin-left: 20vw;
    padding: 200px;
  }
}

@media screen and (max-width: 700px) {
  /* .nutrition-filters {
    display: none;
    padding: 5px;
  } */
}

.nutrition-search-input.ant-input-affix-wrapper,
.nutrition-search-input .ant-input {
  background-color: transparent !important;
  color: #fff !important;
  border-color: rgba(255, 255, 255, 0.2);
}
.nutrition-search-input .ant-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

/* ── Theme additions ───────────────────────────────────────────────────────
   Everything above is the app's nutrition.css, copied unchanged. Below is what
   the WordPress version needs: the antd pieces the app got from a component
   library, and one genuine fix. */

/*
 * The filter chips.
 *
 * `.selectable-values` is a grid of `minmax(10rem, 1fr)` tracks and
 * `.selectable-values-value` had no wrapping rule, so a long label — "afternoon
 * snack", a diet like "lacto-ovo vegetarian" — ran straight out of its own
 * coloured box instead of wrapping inside it. The chip has to be able to grow
 * and to break a long word; `min-width: 0` is the part that is easy to miss,
 * without it a grid item refuses to shrink below its content and overflows the
 * track no matter what wrapping is set.
 */
.selectable-values-value {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
  border: 0;
  font-family: inherit;
  font-size: 1.5rem;
  line-height: 1.3;
  cursor: pointer;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.selectable-values-value.is-active {
  background-color: var(--color-orange);
  color: #fff;
}

.selectable-values-value:focus-visible {
  outline: 2px solid var(--color-orange);
  outline-offset: 2px;
}

/*
 * A gutter between the filter rail and the cards. `.nutrition-container` is a
 * two-column grid with no gap declared, so the first card's left edge sat exactly
 * on the rail's right edge - measured 0px - and the two columns read as one block.
 * The app has the same gap-less grid; this is the WP version being better rather
 * than bug-compatible.
 */
.nutrition-container {
  column-gap: 40px;
  row-gap: 30px;
}

.nutrition-filter-group {
  padding-bottom: 10px;
}

.nutrition-filter-group h3 {
  color: #fff;
  font-size: 1.7rem;
  font-weight: 600;
  padding: 0 10px;
}

/* Search box — the app's is an antd <Input>, which is not loaded here. */
.nutrition-search {
  width: 100%;
  padding: 10px 14px;
  margin-bottom: 10px;
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-family: inherit;
  font-size: 1.6rem;
}

.nutrition-search::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.nutrition-search:focus-visible {
  outline: 2px solid var(--color-orange);
  outline-offset: 2px;
}

.reset-all-filters {
  border: 0;
  background: transparent;
  font-family: inherit;
}

/* The card grid the app gets from its own layout. */
.nutrition-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(30rem, 100%), 1fr));
  grid-gap: 20px;
  align-content: start;
}

/*
 * The shared challenge card was built for a horizontal scroller, where it can be
 * as wide as it likes. In a grid it has to obey the track instead, and two of its
 * rules fight that:
 *
 *   min-width: 30rem + margin: 20px  -> a ~318px floor against a narrower track,
 *                                       so the card pushed past the page edge
 *                                       (measured overflow at 1440, 768, 600, 480)
 *   .overlay { width: 110% }         -> a decorative wash that deliberately bleeds
 *                                       10% past the card, which in a scroller is
 *                                       hidden and here reached the document
 *
 * The card goes fluid and the wrapper clips the bleed. Scoped to this grid so the
 * card keeps its original behaviour everywhere else.
 */
.nutrition-cards .rc-recipe {
  min-width: 0;
  overflow: hidden;
}

.nutrition-cards .challenge-card-basic {
  min-width: 0;
  width: 100%;
  margin: 0;
}

.nutrition-empty {
  /* `grid-column: 1 / -1` because .nutrition-cards is a grid: without it the
     message becomes one ~240px track and wraps over three lines in the middle
     of an otherwise empty row, which reads as a broken layout rather than a
     notice. */
  grid-column: 1 / -1;
  width: 100%;
  padding: 40px 20px;
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
  font-size: 16px;
}

/* No rail to sit beside, so the single column spans the container. */
.nutrition-cards--empty {
  grid-column: 1 / -1;
}

/* One column on a phone: a 0.3fr filter rail beside cards is unusable there. */
@media screen and (max-width: 1200px) {
  .nutrition-container {
    column-gap: 24px;
  }
}

@media screen and (max-width: 900px) {
  .nutrition-container {
    grid-template-columns: 1fr;
    column-gap: 0;
  }

  .search-nutrition-container {
    padding: 30px 20px;
  }

  .nutrition-3-row {
    height: auto;
    padding: 40px 20px;
  }
}
