/**
 * WANDA - homepage "MM2H DATA" statistics band.
 * CR After GoLive 20260807, item 7 (Wanda/Alvin) - mobile layout + style-guide alignment.
 *
 * Scope: body.home + the section that contains Divi number-counter modules.
 * Deliberately NO Divi auto-numbered classes (.et_pb_row_10 etc) - those differ per
 * language (EN 10/11, SC+TC 9/10) and renumber whenever a section is added above.
 *
 * Type roles follow kb/work-ih/wanda-web-styleguide.md: EN scale in block 1,
 * the separate zh (CJK) ladder in block 2. Delete this file + wanda-home-stats.php to revert.
 */

/* ============ 1. TYPE ROLES - EN (style guide S1) ============ */

/* Eyebrow "MM2H DATA" -> .step-eyebrow role: gold, 12px, 600, ls 2.5 */
body.home .et_pb_section:has(.et_pb_number_counter) .et_pb_text .et_pb_text_inner > p:first-child {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 2.5px;
  line-height: 1.4;
  color: #BCAC75;
  padding: 0;
  margin: 0 0 14px;
}

/* Section H2 -> 28px / 800 / ls -.5px. Kept UPPERCASE: this is a dark brand band,
   which the CTA-band standard pins to uppercase. */
body.home .et_pb_section:has(.et_pb_number_counter) .et_pb_text .et_pb_text_inner > h2 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -.5px;
  line-height: 1.2;
  padding: 0;
  margin: 0 0 12px;
}

/* "*Period: ..." -> .wnda-note role: 12.5px, muted */
body.home .et_pb_section:has(.et_pb_number_counter) .et_pb_text .et_pb_text_inner > p:last-child {
  font-size: 12.5px;
  font-weight: 400;
  color: rgba(255, 255, 255, .72);
  padding: 0;
  margin: 0;
}

/* Tile value. The 72px fixed line-height was what made long values collide with the
   title underneath. Weight was inconsistent per language (EN 700 / SC 600 / TC 500). */
body.home .et_pb_number_counter .percent p {
  line-height: 1.15;
  font-weight: 700;
}

/* Tile title -> --fs-card 16px */
body.home .et_pb_number_counter h3.title {
  font-size: 16px;
  line-height: 1.5;
}

/* ============ 2. TYPE ROLES - zh ladder (style guide S3) ============ */
/* Polylang emits lang="sc-CN" / "tc-CN", so :lang(sc) / :lang(tc) match. */

body.home:lang(sc) .et_pb_section:has(.et_pb_number_counter) .et_pb_text .et_pb_text_inner > p:first-child,
body.home:lang(tc) .et_pb_section:has(.et_pb_number_counter) .et_pb_text .et_pb_text_inner > p:first-child {
  font-size: 16px;          /* zh eyebrow / label role */
}

body.home:lang(sc) .et_pb_section:has(.et_pb_number_counter) .et_pb_text .et_pb_text_inner > h2,
body.home:lang(tc) .et_pb_section:has(.et_pb_number_counter) .et_pb_text .et_pb_text_inner > h2 {
  font-size: 36px;          /* zh section H2 */
  font-weight: 700;
  letter-spacing: normal;
}

body.home:lang(sc) .et_pb_section:has(.et_pb_number_counter) .et_pb_text .et_pb_text_inner > p:last-child,
body.home:lang(tc) .et_pb_section:has(.et_pb_number_counter) .et_pb_text .et_pb_text_inner > p:last-child {
  font-size: 13.5px;        /* zh note / caption role */
}

body.home:lang(sc) .et_pb_number_counter h3.title,
body.home:lang(tc) .et_pb_number_counter h3.title {
  font-size: 17px;          /* zh row / card TITLE role */
  line-height: 1.5;
}

@media (max-width: 760px) {
  body.home:lang(sc) .et_pb_section:has(.et_pb_number_counter) .et_pb_text .et_pb_text_inner > h2,
  body.home:lang(tc) .et_pb_section:has(.et_pb_number_counter) .et_pb_text .et_pb_text_inner > h2 {
    font-size: 28px;        /* zh H2 phone step, per the style guide */
  }
}

/* ============ 3. MOBILE + TABLET LAYOUT - 2 tiles per row, no dividers ============ */
/* Divi 5 does not auto-stack rows on phone; it emits a per-row phone Direction rule,
   and the EN + TC homepages never got one - so 4 columns stayed side by side and the
   EN page scrolled sideways (scrollWidth 498 vs 430). Lee's call 2026-08-12: 2 per row,
   and drop the divider lines entirely.
   Extended to 980px (Divi's tablet breakpoint) on 2026-08-12: at 768-980 the four
   columns were ~154px wide and broke values mid-string (">USD $1" / "B"). */

@media (max-width: 980px) {

  body.home .et_pb_section:has(.et_pb_number_counter)
  .et_pb_row:has(> [class*="et_flex_column"] > .et_pb_number_counter) {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 26px 14px;
    max-width: 88% !important;
    border-top: 0;
  }

  body.home .et_pb_section:has(.et_pb_number_counter)
  .et_pb_row:has(> [class*="et_flex_column"] > .et_pb_number_counter)
  > [class*="et_flex_column"] {
    width: auto;
  }

  /* second stats row sits directly under the first */
  body.home .et_pb_section:has(.et_pb_number_counter)
  .et_pb_row:has(> [class*="et_flex_column"] > .et_pb_number_counter)
  + .et_pb_row:has(> [class*="et_flex_column"] > .et_pb_number_counter) {
    margin-top: 26px !important;
  }

  /* the dividers are border-right on the counter modules themselves (0,1,2 and 4,5,6),
     not on the columns - they read as stray hairlines once the grid is 2 wide */
  body.home .et_pb_number_counter {
    border-right: 0;
    margin-bottom: 0;
  }

  /* let the value box grow instead of clipping into the title */
  body.home .et_pb_number_counter .percent {
    height: auto;
    min-height: 0;
  }

}

/* Tablet type step (768-980): the tiles are ~340-430px here, so the value can stay
   bigger than on a phone - it just must not be the 35px desktop size, which wrapped. */
@media (min-width: 768px) and (max-width: 980px) {
  body.home .et_pb_number_counter .percent p {
    font-size: 30px;
  }

  body.home .et_pb_number_counter h3.title {
    font-size: 15px;
    line-height: 1.5;
  }

  body.home:lang(sc) .et_pb_number_counter h3.title,
  body.home:lang(tc) .et_pb_number_counter h3.title {
    font-size: 16px;
  }
}

/* Phone type step */
@media (max-width: 767px) {
  body.home .et_pb_number_counter .percent p {
    font-size: 24px;
  }

  body.home .et_pb_number_counter h3.title {
    font-size: 13px;
    line-height: 1.45;
  }

  body.home:lang(sc) .et_pb_number_counter h3.title,
  body.home:lang(tc) .et_pb_number_counter h3.title {
    font-size: 14px;        /* zh phone step, same ratio as the EN 16 -> 13 drop */
    line-height: 1.5;
  }
}
