/**
 * Precision industrial typography layer.
 *
 * Purpose:
 * - keep narrative copy readable in Chinese and English;
 * - distinguish engineering models, specifications and measured values;
 * - improve numeric alignment without adding external font requests.
 *
 * Loaded after tokens.css.
 *
 * @package Tongyi_Automation
 */

:root {
  --font-technical: var(--font-mono);
  --tracking-heading: -.025em;
  --tracking-technical: .015em;
  --tracking-label: .08em;
}

/* Global text rendering and restrained industrial heading rhythm. */
html body[class] {
  font-family: var(--font-sans);
  font-kerning: normal;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html body[class] main#main-content :is(h1, h2, h3):not(.sr-only):not(.screen-reader-text) {
  font-family: var(--font-sans);
  font-kerning: normal;
  text-wrap: balance;
}

html body[class] main#main-content h1:not(.sr-only):not(.screen-reader-text) {
  letter-spacing: var(--tracking-heading);
}

html body[class] main#main-content h2:not(.sr-only):not(.screen-reader-text) {
  letter-spacing: -.018em;
}

html body[class] main#main-content h3:not(.sr-only):not(.screen-reader-text) {
  letter-spacing: -.01em;
}

html body[class] main#main-content :is(
  [class*="eyebrow"],
  [class*="kicker"],
  [class*="overline"]
) {
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
}

/* Engineering numerals: aligned columns and stable widths. */
html body[class] main#main-content :is(
  .counter,
  .error-page__code,
  .case-metrics strong,
  .resource-metrics strong,
  .cert-metric strong,
  .solutions-live-stat strong,
  .solution-metric > strong,
  .kh-hero-stat strong,
  [class*="stat"] > strong,
  [class*="metric"] > strong,
  [class*="fact"] > strong
) {
  font-family: var(--font-technical);
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1, "zero" 1;
  letter-spacing: var(--tracking-technical);
}

/* Product models and series identifiers. */
html body[class] main#main-content :is(
  .related-model-grid strong,
  .selector-model-list b,
  .selector-series-specs strong,
  .series-links span,
  .products-page [class*="model"],
  .product-center [class*="model"]
) {
  font-family: var(--font-technical);
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1, "zero" 1;
  letter-spacing: var(--tracking-technical);
}

/* Quick specifications: human-readable labels, technical values. */
html body.single-product main#main-content .pd-quick-specs dt {
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
  font-family: var(--font-sans);
  color: var(--c-muted);
  font-weight: var(--font-weight-bold);
  letter-spacing: .04em;
}

html body.single-product main#main-content .pd-quick-specs dd {
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
  font-family: var(--font-technical);
  color: var(--c-ink);
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1, "zero" 1;
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--tracking-technical);
}

/* Specification matrix: row labels stay sans; model/value columns become technical. */
html body.single-product main#main-content .pd-parameter-table {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-gutter: stable;
  border: 1px solid var(--c-line);
  border-radius: var(--r-sm);
  background: var(--c-surface);
  box-shadow: var(--shadow-sm);
  scrollbar-width: thin;
  scrollbar-color: var(--c-line-strong) transparent;
  -webkit-overflow-scrolling: touch;
}

html body.single-product main#main-content .pd-parameter-table table {
  min-width: max(720px, var(--pd-spec-min-width, 720px));
  border-collapse: separate;
  border-spacing: 0;
}

html body.single-product main#main-content .pd-parameter-table :is(th, td) {
  border-color: var(--c-line);
  vertical-align: middle;
}

html body.single-product main#main-content .pd-parameter-table :is(thead th:not(:first-child), tbody td) {
  font-family: var(--font-technical);
  overflow-wrap:anywhere;
  white-space:normal;
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1, "zero" 1;
  letter-spacing: var(--tracking-technical);
  white-space: normal;
}

html body.single-product main#main-content .pd-parameter-table :is(thead th:first-child, tbody th) {
  font-family: var(--font-sans);
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  color: var(--c-text);
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0;
}

html body.single-product main#main-content .pd-parameter-table thead th {
  color: var(--c-ink);
  background: var(--c-canvas-2);
  border-bottom: 1px solid var(--c-line-strong);
}

html body.single-product main#main-content .pd-parameter-table tbody tr:nth-child(even) > * {
  background: color-mix(in srgb, var(--c-canvas) 72%, white);
}

html body.single-product main#main-content .pd-parameter-table tbody tr:hover > * {
  background: var(--c-brand-soft);
}

html body.single-product main#main-content .pd-parameter-table :is(th, td).is-current {
  color: var(--c-brand) !important;
  background: var(--c-brand-soft) !important;
  font-weight: var(--font-weight-bold) !important;
}

/* Small screens retain readable engineering columns instead of squeezing data. */
@media (max-width: 680px) {
  html body.single-product main#main-content .pd-parameter-table {
    margin-inline: -2px;
  }

  html body.single-product main#main-content .pd-parameter-table table {
    min-width: max(640px, var(--pd-spec-min-width, 640px));
  }

  html body.single-product main#main-content .pd-parameter-table :is(th, td) {
    padding: 10px 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html body.single-product main#main-content .pd-parameter-table tbody tr > * {
    transition: none;
  }
}
