/**
 * HB-362 — Storefront typography unified like Shopee (clean modern sans).
 * Overlay only. Never edits index-C7BUmI7G.js / index-BN2ZtJyR.css.
 *
 * Stack (Shopee-like, Vietnamese-safe): Helvetica Neue / Helvetica / Arial /
 * Segoe UI / Roboto / Noto Sans. System fonts → no webfont FOUC / LCP hit.
 *
 * CRITICAL (user): unify font-family + base size ONLY for body / paragraph /
 * UI chrome. Do NOT override H1–H6 (or title/heading equivalents) sizes, and
 * do NOT clobber authored CMS/rich-HTML font-size (inline or element styles).
 *
 * Scope: html.storefront-root (+ .unified-site). No admin-root.
 * No layout/sticky (HB-357/360). No backlink recolor (HB-361). Light theme.
 *
 * Specificity intentionally above BN2 `.unified-site body { Be Vietnam … !important }`.
 *
 * Marker: data-safe-overlay="hb362-shopee-fonts"
 *         data-theme-freeze="module:storefront-shopee-fonts"
 */

html.storefront-root,
html.storefront-root.unified-site {
  --giasy-ui-font: "Helvetica Neue", Helvetica, Arial, "Segoe UI", Roboto,
    "Noto Sans", "Liberation Sans", sans-serif;
  --giasy-content-font: "Helvetica Neue", Helvetica, Arial, "Segoe UI", Roboto,
    "Noto Sans", "Liberation Sans", sans-serif;
  --giasy-mono-font: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;

  /* Base sizes for body / UI chrome only (not headings / authored rich HTML) */
  --giasy-fs-ui: 14px;
  --giasy-fs-body: 14px;

  --giasy-fw-normal: 400;
  --giasy-fw-medium: 500;

  --giasy-lh-snug: 1.4;
  --giasy-lh-body: 1.6;
  --giasy-lh-article: 1.7;

  font-family: "Helvetica Neue", Helvetica, Arial, "Segoe UI", Roboto, "Noto Sans",
    "Liberation Sans", sans-serif !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Beat BN2 `.unified-site body|\#root { Be Vietnam !important; font-size:16px }` */
html.storefront-root.unified-site body,
html.storefront-root.unified-site #root,
html.storefront-root body,
html.storefront-root #root,
html.storefront-root #root > div,
html.storefront-root main,
html.storefront-root #main-content {
  font-family: "Helvetica Neue", Helvetica, Arial, "Segoe UI", Roboto, "Noto Sans",
    "Liberation Sans", sans-serif !important;
  font-size: 14px !important;
  font-weight: 400 !important;
  line-height: 1.6 !important;
}

html.storefront-root .font-sans,
html.storefront-root.unified-site .font-sans {
  font-family: "Helvetica Neue", Helvetica, Arial, "Segoe UI", Roboto, "Noto Sans",
    "Liberation Sans", sans-serif !important;
}

/* Header / sticky / HB-357–360 — family only on shell; chrome controls get UI size */
html.storefront-root #site-sticky-header,
html.storefront-root header.saas-sticky-header,
html.storefront-root #hb357-header-host,
html.storefront-root #site-sticky-header[data-hb357-injected="1"],
html.storefront-root #site-sticky-header[data-hb360-injected="1"] {
  font-family: "Helvetica Neue", Helvetica, Arial, "Segoe UI", Roboto, "Noto Sans",
    sans-serif !important;
}

html.storefront-root #site-sticky-header *:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6),
html.storefront-root header.saas-sticky-header *:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6),
html.storefront-root nav,
html.storefront-root nav a,
html.storefront-root nav button,
html.storefront-root #site-sticky-header a,
html.storefront-root #site-sticky-header button,
html.storefront-root #site-sticky-header input {
  font-family: "Helvetica Neue", Helvetica, Arial, "Segoe UI", Roboto, "Noto Sans",
    sans-serif !important;
}

html.storefront-root #site-sticky-header a,
html.storefront-root #site-sticky-header button,
html.storefront-root nav a,
html.storefront-root nav button {
  font-size: 14px !important;
  font-weight: 500 !important;
  line-height: 1.4 !important;
}

html.storefront-root #site-sticky-header input,
html.storefront-root #site-sticky-header input::placeholder {
  font-family: "Helvetica Neue", Helvetica, Arial, "Segoe UI", Roboto, "Noto Sans",
    sans-serif !important;
  font-size: 14px !important;
  font-weight: 400 !important;
}

/* Login / auth UI chrome — family only */
html.storefront-root #main-content form,
html.storefront-root #main-content input,
html.storefront-root #main-content button,
html.storefront-root #main-content label,
html.storefront-root #main-content a {
  font-family: "Helvetica Neue", Helvetica, Arial, "Segoe UI", Roboto, "Noto Sans",
    sans-serif !important;
}

/*
 * Headings (H1–H6) + prose titles: FONT-FAMILY ONLY.
 * Do not set font-size / font-weight / line-height.
 */
html.storefront-root h1,
html.storefront-root h2,
html.storefront-root h3,
html.storefront-root h4,
html.storefront-root h5,
html.storefront-root h6,
html.storefront-root .prose :is(h1, h2, h3, h4, h5, h6),
html.storefront-root [class*="prose"] :is(h1, h2, h3, h4, h5, h6) {
  font-family: "Helvetica Neue", Helvetica, Arial, "Segoe UI", Roboto, "Noto Sans",
    sans-serif !important;
}

/* Rich content containers: family + default body size; children keep authored sizes */
html.storefront-root .news-article-content,
html.storefront-root .tutorial-content,
html.storefront-root .unified-content,
html.storefront-root .product-description-content,
html.storefront-root .html-content-light,
html.storefront-root .backlink-processed-body,
html.storefront-root .product-long-form {
  font-family: "Helvetica Neue", Helvetica, Arial, "Segoe UI", Roboto, "Noto Sans",
    sans-serif !important;
  font-size: 14px !important;
  font-weight: 400 !important;
  line-height: 1.7 !important;
  text-align: justify;
  text-justify: inter-word;
}

/* Plain nodes inherit family only — never force font-size (CMS authored sizes win) */
html.storefront-root .news-article-content :where(p, li, td, th, dd, dt, blockquote, span, div, a, font),
html.storefront-root .tutorial-content :where(p, li, td, th, dd, dt, blockquote, span, div, a, font),
html.storefront-root .unified-content :where(p, li, td, th, dd, dt, blockquote, span, div, a, font),
html.storefront-root .product-description-content :where(p, li, td, th, dd, dt, blockquote, span, div, a, font),
html.storefront-root .html-content-light :where(p, li, td, th, dd, dt, blockquote, span, div, a, font),
html.storefront-root .backlink-processed-body :where(p, li, td, th, span, div, a, font) {
  font-family: inherit !important;
}

/* In-article headings: family only */
html.storefront-root .news-article-content :is(h1, h2, h3, h4, h5, h6),
html.storefront-root .tutorial-content :is(h1, h2, h3, h4, h5, h6),
html.storefront-root .unified-content :is(h1, h2, h3, h4, h5, h6),
html.storefront-root .product-description-content :is(h1, h2, h3, h4, h5, h6),
html.storefront-root .html-content-light :is(h1, h2, h3, h4, h5, h6) {
  font-family: "Helvetica Neue", Helvetica, Arial, "Segoe UI", Roboto, "Noto Sans",
    sans-serif !important;
}

/* Captions: family + italic; size left to cascade / HB-332 */
html.storefront-root .giasy-image-caption,
html.storefront-root figcaption,
html.storefront-root .news-article-content figcaption,
html.storefront-root .tutorial-content figcaption,
html.storefront-root .product-description-content figcaption {
  font-family: "Helvetica Neue", Helvetica, Arial, "Segoe UI", Roboto, "Noto Sans",
    sans-serif !important;
  font-style: italic !important;
  text-align: center !important;
}

/* Product card titles: family only (size = article-title-size overlay) */
html.storefront-root #main-content h3.sf-product-name,
html.storefront-root #main-content .sf-product-name.line-clamp-2,
html.storefront-root #main-content h3.line-clamp-2.font-bold,
html.storefront-root #main-content a[class*="min-h-[308px]"] > p.line-clamp-2,
html.storefront-root #main-content a[class*="min-h-[316px]"] > p.line-clamp-2 {
  font-family: "Helvetica Neue", Helvetica, Arial, "Segoe UI", Roboto, "Noto Sans",
    sans-serif !important;
}

html.storefront-root #main-content .sf-price,
html.storefront-root #main-content .sf-product-price,
html.storefront-root #main-content .text-xs,
html.storefront-root #main-content time {
  font-family: "Helvetica Neue", Helvetica, Arial, "Segoe UI", Roboto, "Noto Sans",
    sans-serif !important;
}

/* Lead/excerpt UI chrome under title — body size OK */
html.storefront-root #main-content p.border-l-2.text-slate-600,
html.storefront-root #main-content p.leading-relaxed.text-slate-600 {
  font-family: "Helvetica Neue", Helvetica, Arial, "Segoe UI", Roboto, "Noto Sans",
    sans-serif !important;
  font-size: 14px !important;
  font-weight: 400 !important;
  line-height: 1.6 !important;
}

/* Normalize mismatched font-family from pasted Word/HTML — never touch font-size */
html.storefront-root .news-article-content [style*="font-family"],
html.storefront-root .tutorial-content [style*="font-family"],
html.storefront-root .unified-content [style*="font-family"],
html.storefront-root .product-description-content [style*="font-family"],
html.storefront-root .html-content-light [style*="font-family"],
html.storefront-root .backlink-processed-body [style*="font-family"] {
  font-family: inherit !important;
}

html.storefront-root code,
html.storefront-root pre,
html.storefront-root kbd,
html.storefront-root samp,
html.storefront-root .font-mono,
html.storefront-root [class*="font-mono"] {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace !important;
}

html.storefront-root [style*="Nunito"],
html.storefront-root [style*="Arial Black"] {
  font-family: "Helvetica Neue", Helvetica, Arial, "Segoe UI", Roboto, "Noto Sans",
    sans-serif !important;
}
