/*
 * Home screen.
 *
 * Almost all reflow here is intrinsic. The one place that genuinely needs a
 * breakpoint is the hero's grid span -- see .m-hero below.
 */

/* ---------------------------------------------------------------------------
 * Hero row: hero (2 tracks) + two promo cards
 * ------------------------------------------------------------------------ */

.m-hero-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 12px;
  padding-top: 14px;
}

.m-hero {
  background: var(--green-700);
  border-radius: var(--r-block);
  overflow: hidden;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}

/*
 * The hero spans two tracks on desktop only. Without the query, span 2 forces a
 * second track at 412px and crushes the adjacent promo card to 68px with
 * horizontal overflow.
 *
 * A container query, not a media query: the type scale already sizes against
 * the shell in cqw units, and mixing the two would let the hero and its own
 * headline disagree about which breakpoint they are on.
 */
@container (min-width: 768px) {
  .m-hero { grid-column: span 2; }
}

.m-hero__copy { padding: 30px 28px; }

.m-hero__tag {
  display: inline-block;
  background: var(--gold-500);
  color: var(--ink-900);
  border-radius: var(--r-badge);
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.m-hero__title {
  font-size: var(--h1-hero);
  line-height: 1.03;
  letter-spacing: -.03em;
  color: #fff;
  margin-bottom: 12px;
}

.m-hero__sub {
  font-size: 15px;
  line-height: 1.6;
  color: var(--mint-300);
  margin-bottom: 20px;
  max-width: 46ch;
}

.m-hero__cta { display: flex; gap: 10px; flex-wrap: wrap; }

.m-hero__panel {
  background: var(--green-800);
  min-height: 230px;
  display: grid;
  place-items: center;
  padding: 22px;
}

.m-hero__card {
  display: block;
  width: 100%;
  max-width: 290px;
  background: var(--surface);
  border-radius: var(--r-card);
  padding: 18px;
  box-shadow: var(--shadow-hero-card);
  color: var(--ink-900);
}
.m-hero__card:hover { color: var(--ink-900); }

.m-hero__card-img {
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1;
  padding-bottom: 14px;
  margin-bottom: 12px;
  border-bottom: 1px solid #EDE7DA;
}
.m-hero__card-img img { width: 100%; height: 100%; object-fit: contain; }

.m-hero__card-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink-500);
  margin-bottom: 4px;
}

.m-hero__card-name {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 8px;
}

.m-hero__card-price {
  display: flex;
  align-items: baseline;
  gap: 7px;
  flex-wrap: wrap;
}
.m-hero__card-price > span:first-child {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
}
.m-hero__card-price .m-strike { font-size: 13.5px; }
.m-hero__card-price .m-off { font-size: 13px; }

/* ---------------------------------------------------------------------------
 * Promo cards
 * ------------------------------------------------------------------------ */

.m-promo {
  display: flex;
  flex-direction: column;
  border-radius: var(--r-block);
  padding: 22px 20px;
  min-height: 150px;
  color: var(--ink-900);
  transition: filter var(--t-fast);
}
.m-promo:hover { filter: brightness(.97); color: var(--ink-900); }

.m-promo--new       { background: var(--cream-300); }
.m-promo--clearance { background: var(--sale-100); }

.m-promo__eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.m-promo--new .m-promo__eyebrow       { color: var(--gold-ink); }
.m-promo--clearance .m-promo__eyebrow { color: var(--sale-800); }

.m-promo__title {
  font-size: 21px;
  letter-spacing: -.02em;
  margin-bottom: 6px;
}

.m-promo__note { font-size: 13.5px; color: var(--ink-500); }

.m-promo__cta {
  margin-top: auto;
  padding-top: 14px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--green-700);
}

/* ---------------------------------------------------------------------------
 * Trust strip
 * ------------------------------------------------------------------------ */

.m-trust {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
  background: var(--surface);
  border: 1px solid var(--border-200);
  border-radius: var(--r-card);
  overflow: hidden;
}

.m-trust__cell {
  padding: 14px 18px;
  border-right: 1px solid var(--border-100);
}
.m-trust__cell:last-child { border-right: 0; }

.m-trust__title {
  font-family: var(--font-display);
  font-size: 14.5px;
  font-weight: 700;
  margin-bottom: 3px;
}
.m-trust__detail { font-size: 13px; color: var(--ink-500); line-height: 1.45; }

/* ---------------------------------------------------------------------------
 * Health concern tiles
 * ------------------------------------------------------------------------ */

/*
 * Explicit column counts rather than auto-fill.
 *
 * There are 16 concerns, and 16 divides evenly only into 2, 4 and 8. The
 * auto-fill floor happened to produce 8 at the 1440 frame the section was
 * drawn against, which is why it looks right there and ragged everywhere
 * else: one tile of five at 768, two of seven at 1280, six of ten at 1760.
 *
 * Every count below is a divisor of 16, so the last row is always full at
 * every width. 3 across is deliberately absent -- it would strand a single
 * tile in a sixth row, which is the thing this is fixing.
 */
.m-concerns {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

@container (min-width: 560px) {
  .m-concerns { grid-template-columns: repeat(4, 1fr); }
}

.m-concern {
  display: flex;
  flex-direction: column;
  border-radius: var(--r-card);
  padding: 15px 14px;
  /* 104px left 25px of dead air between the name and the count in every tile,
     at every width. The count is still bottom-pinned, so a two-line name
     grows the tile rather than colliding. */
  min-height: 88px;
  transition: filter var(--t-fast);
}
.m-concern:hover { filter: brightness(.96); }

.m-concern__name {
  font-family: var(--font-display);
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.01em;
}

.m-concern__count {
  margin-top: auto;
  padding-top: 10px;
  font-size: 13px;
  font-weight: 600;
}

.m-concern--bone      { background: var(--c-bone-bg); }
.m-concern--bone      .m-concern__name  { color: var(--c-bone-fg); }
.m-concern--bone      .m-concern__count { color: var(--c-bone-meta); }
.m-concern--immune    { background: var(--c-immune-bg); }
.m-concern--immune    .m-concern__name  { color: var(--c-immune-fg); }
.m-concern--immune    .m-concern__count { color: var(--c-immune-meta); }
.m-concern--digestion { background: var(--c-digestion-bg); }
.m-concern--digestion .m-concern__name  { color: var(--c-digestion-fg); }
.m-concern--digestion .m-concern__count { color: var(--c-digestion-meta); }
.m-concern--hair      { background: var(--c-hair-bg); }
.m-concern--hair      .m-concern__name  { color: var(--c-hair-fg); }
.m-concern--hair      .m-concern__count { color: var(--c-hair-meta); }
.m-concern--brain     { background: var(--c-brain-bg); }
.m-concern--brain     .m-concern__name  { color: var(--c-brain-fg); }
.m-concern--brain     .m-concern__count { color: var(--c-brain-meta); }
.m-concern--joint     { background: var(--c-joint-bg); }
.m-concern--joint     .m-concern__name  { color: var(--c-joint-fg); }
.m-concern--joint     .m-concern__count { color: var(--c-joint-meta); }
.m-concern--eye       { background: var(--c-eye-bg); }
.m-concern--eye       .m-concern__name  { color: var(--c-eye-fg); }
.m-concern--eye       .m-concern__count { color: var(--c-eye-meta); }
.m-concern--liver     { background: var(--c-liver-bg); }
.m-concern--liver     .m-concern__name  { color: var(--c-liver-fg); }
.m-concern--liver     .m-concern__count { color: var(--c-liver-meta); }

/* ---------------------------------------------------------------------------
 * Subscribe band
 * ------------------------------------------------------------------------ */

.m-subscribe {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr));
  gap: 24px;
  align-items: center;
}

.m-subscribe__tag {
  display: inline-block;
  background: var(--green-700);
  color: var(--gold-200);
  border-radius: var(--r-badge);
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.m-subscribe__body {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink-700);
  margin: 10px 0 18px;
  max-width: 52ch;
}

.m-subscribe__cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 130px), 1fr));
  gap: 10px;
}
.m-subscribe__cards li {
  background: var(--surface);
  border-radius: 10px;
  padding: 14px;
}
.m-subscribe__card-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 3px;
}
.m-subscribe__card-note { font-size: 13px; color: var(--ink-500); line-height: 1.4; }

/* ---------------------------------------------------------------------------
 * Brands
 * ------------------------------------------------------------------------ */

.m-brands {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(max(150px, 18%), 1fr));
  gap: 11px;
}

.m-brand {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border-200);
  border-radius: var(--r-card);
  padding: 18px 16px;
  color: var(--ink-900);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.m-brand:hover {
  border-color: var(--green-700);
  box-shadow: var(--shadow-card);
  color: var(--ink-900);
}

.m-brand__name {
  font-family: var(--font-display);
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: -.01em;
  margin-bottom: 5px;
}
.m-brand__note { font-size: 13px; color: var(--ink-500); line-height: 1.45; }
.m-brand__count {
  margin-top: auto;
  padding-top: 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--green-700);
}

/* ---------------------------------------------------------------------------
 * Reviews
 * ------------------------------------------------------------------------ */

.m-reviews {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  gap: 11px;
}

.m-review {
  background: var(--surface);
  border: 1px solid var(--border-200);
  border-radius: var(--r-card);
  padding: 18px;
}
.m-review .m-stars { font-size: 14px; }
.m-review__quote {
  font-size: 14.5px;
  line-height: 1.55;
  margin: 10px 0 14px;
}
.m-review__who { display: flex; align-items: center; gap: 10px; }
.m-review__avatar {
  flex: none;
  width: 29px;
  height: 29px;
  border-radius: 50%;
  background: var(--green-700);
  color: var(--gold-200);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
}
.m-review__name { display: block; font-size: 13.5px; font-weight: 600; }
.m-review__verified { display: block; font-size: 13px; color: var(--ink-500); }

.m-section--last { padding-bottom: var(--section-gap); }

/* ---------------------------------------------------------------------------
 * Wide screens
 *
 * Concern tiles and brand cards grow their column count above the breakpoint,
 * for the same reason as the product grids: the handoff's percentage floor
 * pins the count and inflates the tiles instead.
 * ------------------------------------------------------------------------ */

@container (min-width: 1200px) {
  .m-concerns { grid-template-columns: repeat(8, 1fr); }
  .m-brands   { grid-template-columns: repeat(auto-fill, minmax(var(--col-tile), 1fr)); }

  /* The subscribe band's copy would otherwise run to a 900px measure. */
  .m-subscribe__body { max-width: 62ch; }
}
