/* The TNAS text hierarchy takes precedence over legacy page-specific typography. */
@layer tezel-typography {
  :root {
    --tezel-font-text: Arial, sans-serif;
    --tezel-font-opening: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
    --tezel-text-size: 16px;
    --tezel-text-leading: 1.58;
    --tezel-opening-title: clamp(33px, 4.05vw, 58px);
    --tezel-intro-size: 19px;
    --tezel-section-title: 34px;
    --tezel-subsection-title: 19px;
    --tezel-detail-size: 13px;
    --tezel-caption-size: 12px;
  }

  body {
    font-family: var(--tezel-font-text) !important;
    font-size: var(--tezel-text-size) !important;
    font-weight: 400 !important;
    font-style: normal !important;
    line-height: var(--tezel-text-leading) !important;
    letter-spacing: normal !important;
  }

  /* Body text inherits its role. Shared navigation and footer set their own type. */
  body :where(*):not(:where(header, header *, footer, footer *, svg, svg *,
      [aria-hidden="true"], [aria-hidden="true"] *, #tz-room-prev, #tz-room-next)) {
    font-family: inherit !important;
    font-size: inherit !important;
    font-weight: inherit !important;
    font-style: inherit !important;
    line-height: inherit !important;
    letter-spacing: inherit !important;
  }

  .tz-page-opening {
    font-family: var(--tezel-font-opening) !important;
    line-height: 1.6 !important;
  }

  body h1 {
    font-size: var(--tezel-opening-title) !important;
    font-weight: 700 !important;
    font-style: normal !important;
    line-height: 1.08 !important;
    letter-spacing: -1.8px !important;
    overflow-wrap: anywhere;
  }

  .tz-page-opening .tks-title-name {
    font-size: .70em !important;
    line-height: 1.15 !important;
  }

  .tz-page-opening p:not(:where(.eyebrow, .caption, .imgnote, .breadcrumb)),
  .tz-page-opening .tz-showroom-model-title {
    font-size: var(--tezel-intro-size) !important;
  }

  body h2:not(:where(footer *)) {
    font-size: var(--tezel-section-title) !important;
    font-weight: 700 !important;
    font-style: normal !important;
    line-height: 1.18 !important;
    letter-spacing: normal !important;
  }

  body h3,
  body :where(.card-content, .ref-card, .expertise-card, .cap-card) h2 {
    font-size: var(--tezel-subsection-title) !important;
    font-weight: 700 !important;
    font-style: normal !important;
    line-height: 1.28 !important;
    letter-spacing: normal !important;
  }

  body :where(h4, h5, h6, b, strong, dt, th):not(:where(header *, footer *)),
  body :where(.tz-showroom-model-title, .tz-showroom-code, .code) {
    font-weight: 700 !important;
  }

  body :where(h4, h5, h6) {
    font-size: var(--tezel-text-size) !important;
    font-style: normal !important;
    line-height: 1.35 !important;
  }

  body :where(em, i, cite) {
    font-style: italic !important;
  }

  body :where(h1, h2, h3, h4, h5, h6) :where(em, i, cite) {
    font-style: inherit !important;
  }

  body :where(sup, sub) {
    font-size: .75em !important;
    line-height: 0 !important;
  }

  body :where(small, figcaption, .caption, .imgnote, .breadcrumb):not(:where(header *, footer *)) {
    font-size: var(--tezel-caption-size) !important;
  }

  body :where(.eyebrow, .kicker, .tag, .section-label, .overline, .mini) {
    font-size: var(--tezel-caption-size) !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
    letter-spacing: .08em !important;
  }

  body :where(.notes, .note, .table-note, .technical-notice, .footnote, .table-foot,
      .fine, .quote-disclaimer, .submit-note, .calc-foot, .curve-meta, .ref-source-note,
      .tnas-opening-spec, .chip, .meta > span, .tz-cat-note, .tz-cat-source, .tz-cat-subtext) {
    font-size: var(--tezel-detail-size) !important;
  }

  body :where(th, td) {
    font-size: var(--tezel-detail-size) !important;
    line-height: var(--tezel-text-leading) !important;
    font-style: normal !important;
  }

  body :where(tbody td:first-child, tbody th) {
    font-weight: 700 !important;
  }

  body :where(label, legend):not(:where(header *, footer *)) {
    font-size: var(--tezel-detail-size) !important;
    font-weight: 700 !important;
  }

  body :where(input, select, textarea):not(:where(header *, footer *)) {
    font-size: var(--tezel-text-size) !important;
    font-weight: 400 !important;
    font-style: normal !important;
  }

  body :where(button, a.btn, a.button, a.ghost-link, .tz-showroom-main-button,
      .tz-showroom-outline-button, .tz-showroom-product-link, .tz-video-cta,
      .ref-button, .ref-pdf-link):not(:where(header *, footer *, #tzg-top,
      #tz-room-prev, #tz-room-next, .chip, .tz-video-cover)) {
    font-size: var(--tezel-text-size) !important;
    font-weight: 700 !important;
    font-style: normal !important;
    line-height: 1.6 !important;
  }

  body :where(button.chip) { font-weight: 700 !important; }

  .tz-showroom .tz-showroom-code {
    font-size: var(--tezel-opening-title) !important;
    line-height: 1.08 !important;
  }

  .tz-cat-appendix .tz-cat-label small {
    font-size: 11px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    letter-spacing: .06em !important;
  }

  .tz-cat-appendix .tz-cat-label strong {
    font-size: 15px !important;
    font-weight: 700 !important;
    line-height: 1.35 !important;
  }

  .tz-cat-appendix .tz-cat-pill {
    font-size: var(--tezel-caption-size) !important;
    font-weight: 400 !important;
  }

  .tz-cat-appendix :where(.tz-cat-inner > summary, .tz-cat-transcript > summary) {
    font-size: 14px !important;
    font-weight: 700 !important;
  }

  .tz-cat-transcript pre {
    font-size: var(--tezel-caption-size) !important;
    line-height: 1.55 !important;
  }
}
