/* ERKAL typography — screen only. See docs/ERKAL-TYPOGRAPHY.md.
   Loaded last to replace historic component typography without changing semantics.
   Existing Arabic pages deliberately do not load this Latin font layer. */

@media screen {
  :root {
    --erkal-font-heading: "Barlow Semi Condensed", "Arial Narrow", Arial, sans-serif;
    --erkal-font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    --erkal-font-data: var(--erkal-font-body);
    --erkal-size-hero: clamp(3rem, 1.7rem + 2.55vw, 4rem);
    --erkal-size-h1: clamp(2.375rem, 1.875rem + 1.1vw, 3rem);
    --erkal-size-h2: clamp(1.875rem, 1.55rem + .7vw, 2.375rem);
    --erkal-size-card: clamp(1.375rem, 1.2rem + .35vw, 1.625rem);
    --erkal-size-body: 1rem;
    --erkal-size-lead: clamp(1rem, .94rem + .14vw, 1.125rem);
    --erkal-size-ui: .875rem;
    --erkal-size-kicker: .8125rem;
    --erkal-size-data: .9375rem;
    --erkal-line-heading: 1.12;
    --erkal-line-body: 1.62;
    --erkal-heading-gap: 1.25rem;
    --erkal-reading-width: 70ch;
  }

  body.corporate-v2 {
    font-family: var(--erkal-font-body);
    font-size: var(--erkal-size-body);
    font-weight: 400;
    line-height: var(--erkal-line-body);
    font-synthesis: none;
  }

  /* A deliberate, limited !important bridge over historic mobile heading rules. */
  body.corporate-v2 :is(h1,h2,h3,h4,h5,h6) {
    font-family: var(--erkal-font-heading) !important;
    font-weight: 600 !important;
    line-height: var(--erkal-line-heading) !important;
    letter-spacing: -.012em !important;
    text-transform: none !important;
    overflow-wrap: anywhere;
    word-break: normal;
    text-wrap: pretty;
    margin-block-end: var(--erkal-heading-gap);
  }
  body.corporate-v2 h1 { font-size: var(--erkal-size-h1) !important; font-weight: 700 !important; }
  body.corporate-v2 h2 { font-size: var(--erkal-size-h2) !important; }
  body.corporate-v2 :is(h3,h4) { font-size: var(--erkal-size-card) !important; line-height: 1.18 !important; }
  body.corporate-v2 :is(h5,h6) { font-size: 1.25rem !important; line-height: 1.2 !important; }
  body.home-corporate.corporate-v2 .hero h1 {
    font-size: var(--erkal-size-hero) !important;
    line-height: 1.08 !important;
    margin-block-end: 1.5rem;
    letter-spacing: -.016em !important;
  }
  body.home-corporate.corporate-v2 .hero h1 span { display: inline; }
  body.corporate-v2 :is(.section-head,.page-hero,.hero-copy,.contact-form-heading-v3) > :is(p,.lead) {
    max-width: var(--erkal-reading-width);
  }
  body.corporate-v2 :is(.lead,.product-card p,.service-card p,.card p,.hero-card p,.contact-form-heading-v3 p) {
    font-size: var(--erkal-size-body);
    line-height: var(--erkal-line-body);
    font-weight: 400;
  }
  body.corporate-v2 :is(.hero-copy,.page-hero,.section-head) .lead {
    font-size: var(--erkal-size-lead);
    line-height: var(--erkal-line-body);
  }
  body.corporate-v2 :is(.section-head,.content,.corporate-content,.privacy-content) p { max-width: var(--erkal-reading-width); }

  body.corporate-v2 :is(.product-card,.service-card,.card,.technical-card-v2,.why-item-v2,.related-card) :is(h2,h3),
  body.corporate-v2 :is(.hero-card,.technical-card-v2,.why-item-v2,.related-card) > strong {
    font-family: var(--erkal-font-heading) !important;
    font-size: var(--erkal-size-card) !important;
    font-weight: 600 !important;
    line-height: 1.18 !important;
    letter-spacing: -.008em;
    text-transform: none;
    overflow-wrap: anywhere;
  }
  body.corporate-v2 .stat > strong {
    font-family: var(--erkal-font-heading);
    font-size: clamp(1.875rem, 1.3rem + 1vw, 2.625rem);
    font-weight: 600;
    line-height: 1.15;
    text-transform: none;
  }
  body.corporate-v2 :is(strong,b) { font-weight: 600; }
  body.corporate-v2 :is(.product-spec-v2,.hero-facts span,.tag,.finder-chip,.finder-match,.finder-data,.cut-metrics,.contact-card strong) {
    font-family: var(--erkal-font-data);
    font-weight: 500;
    font-variant-numeric: lining-nums tabular-nums;
    text-transform: none;
  }

  body.corporate-v2 :is(button,input,select,textarea,.btn,.main-nav,.footer-title,.footer-links,.breadcrumb,.consent-banner,.consent-dialog,.consent-status) {
    font-family: var(--erkal-font-body);
  }
  body.corporate-v2 :is(.btn,.consent-btn,.field label,.cut-settings label,.cut-row label,.finder-filter,.text-link,.faq summary,.footer-title) {
    font-size: var(--erkal-size-ui) !important;
    font-weight: 600 !important;
    line-height: 1.5;
    letter-spacing: 0 !important;
    text-transform: none !important;
  }
  body.corporate-v2 :is(.btn,.consent-btn) { white-space: normal; overflow-wrap: anywhere; text-align: center; }
  body.corporate-v2 #main :is(button,label) {
    font-family: var(--erkal-font-body);
    font-size: var(--erkal-size-ui) !important;
    font-weight: 600 !important;
    line-height: 1.5 !important;
    letter-spacing: 0;
    text-transform: none;
    white-space: normal !important;
  }
  body.corporate-v2 #main .privacy-toc h2 {
    font-family: var(--erkal-font-body) !important;
    font-size: 1rem !important;
    line-height: 1.5 !important;
  }
  body.corporate-v2 :is(.privacy-meta a,.privacy-back,.privacy-side-contact > a) { font-weight: 600; }
  body.corporate-v2 .breadcrumb { text-transform: none; }
  body.corporate-v2 :is(input,select,textarea) { font-size: 1rem !important; font-weight: 400; line-height: 1.5; }
  body.corporate-v2 .main-nav :is(a,button),
  body.corporate-v2 :is(.language-option,.mobile-cta a,.footer-directory-v2 a) {
    font-family: var(--erkal-font-body);
    font-size: var(--erkal-size-ui) !important;
    font-weight: 500 !important;
    line-height: 1.5;
    text-transform: none !important;
    letter-spacing: 0;
  }
  body.corporate-v2 .main-nav > a,
  body.corporate-v2 .main-nav .nav-dropdown > :is(a,button) { font-weight: 600 !important; }
  body.corporate-v2 :is(.hero-trust,.hero-facts,.footer-links,.form-note,.quote-privacy-note,.contact-request-guide-v3 li) {
    font-size: var(--erkal-size-ui);
    line-height: 1.6;
  }
  body.corporate-v2 :is(.section-kicker,.eyebrow,.mega-menu-title) {
    font-family: var(--erkal-font-body);
    font-size: var(--erkal-size-kicker);
    font-weight: 600;
    line-height: 1.5;
    letter-spacing: .065em;
  }
  body.corporate-v2 .hero-card > small { font-size: var(--erkal-size-ui); line-height: 1.5; }
  body.corporate-v2 :is(.consent-banner,.consent-dialog) h2 {
    font-family: var(--erkal-font-body) !important;
    font-size: 1.25rem !important;
    font-weight: 600 !important;
    line-height: 1.35 !important;
    letter-spacing: 0 !important;
  }
  body.corporate-v2 .consent-category h3 {
    font-family: var(--erkal-font-body) !important;
    font-size: 1rem !important;
    line-height: 1.5 !important;
    letter-spacing: 0 !important;
  }

  /* Technical data never uses the display face. No value reformatting. */
  body.corporate-v2 :is(table,.calc-result-grid,.total-item,.cut-summary,.finder-data) {
    font-family: var(--erkal-font-data);
    font-variant-numeric: lining-nums tabular-nums;
  }
  body.corporate-v2 #main :is(table th,table td,table caption) {
    font-family: var(--erkal-font-data);
    font-size: var(--erkal-size-data) !important;
    line-height: 1.55;
    letter-spacing: 0;
    text-transform: none;
    vertical-align: middle;
  }
  body.corporate-v2 #main table th { font-weight: 600; }
  body.corporate-v2 #main table td { font-weight: 400; }
  body.corporate-v2 #main .erkal-numeric,
  body.corporate-v2 .result-table :is(th,td):nth-child(n+4):not(:last-child),
  body.corporate-v2 :is(.calc-result-grid,.total-item) strong {
    text-align: right;
    font-variant-numeric: lining-nums tabular-nums;
  }
  body.corporate-v2 :is(.table-wrap,.result-table-wrap) { max-width: 100%; overflow-x: auto; }
  /* A wide result table must not establish the tablet grid's minimum width. */
  body.corporate-v2 .calc-shell { grid-template-columns: minmax(0,1fr); }
  body.corporate-v2 .calc-shell > * { min-width: 0; }
  body.corporate-v2 #main .tech-table { table-layout: auto; }

  @media (max-width: 900px) {
    :root {
      --erkal-size-hero: clamp(2.125rem, 1.625rem + 2.1vw, 2.5rem);
      --erkal-size-h1: clamp(1.875rem, 1.4rem + 2vw, 2.25rem);
      --erkal-size-h2: clamp(1.625rem, 1.4rem + 1vw, 1.875rem);
      --erkal-size-card: 1.375rem;
      --erkal-size-data: .875rem;
      --erkal-heading-gap: 1rem;
    }
    body.home-corporate.corporate-v2 .hero-grid { padding-block-start: 2.5rem; }
    body.corporate-v2 .hero-actions { margin-block-start: 1.5rem; }
    body.corporate-v2 .main-nav a { white-space: normal; overflow-wrap: anywhere; }
    body.corporate-v2 .main-nav :is(a,button) { font-size: .9375rem !important; }
    body.corporate-v2 .mobile-cta a { font-size: .8125rem !important; }
    body.corporate-v2 #main .tech-table { min-width: 30rem; }
  }
}
