/* =====================================================================
   YWHOLA Font Boost Patch  (2026-08-20)
   Loads LAST via header.html (after style.css, base.css, header-v2.css)
   Fixes: body had no font-family / line-height / color — browser default
   serif 16px made site look "small, dim, hard to read".
   Strategy: only set body-level + element-level typography defaults; do NOT
   override existing class-scoped font-size/color (avoid layout shift).
   ===================================================================== */

/* ---- Root tokens ---- */
:root {
  --yw-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
             "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB",
             "Microsoft YaHei", sans-serif;
  --yw-ink: #1a1a1a;        /* main text — darker than #333 for contrast */
  --yw-ink-soft: #555;       /* secondary text — darker than #666 */
  --yw-link: #004EBB;        /* keep brand blue */
  --yw-line: 1.7;            /* comfortable reading */
}

/* ---- Global body typography (covers every page) ---- */
html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--yw-font);
  font-size: 16px;
  line-height: var(--yw-line);
  color: var(--yw-ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-synthesis: none;
}

/* ---- Default element typography ---- */
p, li, td, th, label, span, a, dd, dt, blockquote, figcaption {
  line-height: 1.65;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--yw-font);
  line-height: 1.25;
  font-weight: 700;
  color: var(--yw-ink);
}

h1 { letter-spacing: -0.02em; }
h2 { letter-spacing: -0.015em; }
h3 { font-weight: 600; }

strong, b { font-weight: 700; }

a { color: var(--yw-link); }
a:hover { color: #003699; }

/* ---- Minimum readable size (lift 12px → 14px) ----
   Only applied to common text elements when their computed size is tiny.
   Class-scoped styles still override via specificity. */
p, li, td, th, label, blockquote, figcaption {
  font-size: 16px;
}

/* ---- Headings keep their original sizes from base.css/style.css ---- */

/* ---- Form inputs inherit font ---- */
input, textarea, select, button {
  font-family: inherit;
  font-size: 16px;       /* prevent iOS zoom-on-focus */
  line-height: 1.5;
}

/* ---- Responsive: scale base on small screens ---- */
@media (max-width: 1024px) {
  html { font-size: 16px; }
}

@media (max-width: 768px) {
  html { font-size: 15.5px; }
  body { line-height: 1.68; }
}

@media (max-width: 480px) {
  html { font-size: 15px; }
  body { line-height: 1.65; }
}

/* ---- Improve text contrast for #666 secondary text ---- */
*[style*="color:#666"],
*[style*="color: #666"],
*[style*="color:#666666"],
*[style*="color: #666666"] {
  color: var(--yw-ink-soft) !important;
}

/* ---- Selection color ---- */
::selection {
  background: #004EBB;
  color: #fff;
}
