/* Shared public-site typography, based on the approved Latham reference.
   Avenir Next / Arial cover Latin; PingFang SC is the first Chinese family.
   Use installed fonts, with Chinese sans-serif fallbacks on other systems. */
:root {
  --zh-font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Avenir Next", "Helvetica Neue", sans-serif;
  --zh-font-serif: "Libre Caslon Text", "Times New Roman", Georgia, serif;
  --zh-font-heading: var(--zh-font-sans);
  --zh-font-body: var(--zh-font-sans);
  --zh-font-num: var(--zh-font-serif);
  --zh-font-en: "Avenir Next", Arial, sans-serif;
}

/* Existing pages have several unlayered !important typography overrides.
   This small, named layer gives the shared font policy priority without
   changing their layout, responsive sizes, colors or icon font families. */
@layer zeheng-typography {
  :root {
    --sans: var(--zh-font-sans) !important;
    --serif: var(--zh-font-heading) !important; /* Legacy heading token -> modern sans heading */
    --en: var(--zh-font-en) !important;
    --zp-sans: var(--zh-font-sans) !important;
    --zp-serif: var(--zh-font-heading) !important; /* Legacy polish heading token -> modern sans heading */
  }

  body,
  .font-sans,
  .font-body-md,
  .font-body-lg,
  .font-body-sm,
  .font-label-sm,
  .font-label-xs,
  .font-label-caps,
  #team-directory-header,
  input,
  select,
  textarea,
  button:not(.material-symbols-outlined):not(.material-icons) {
    font-family: var(--zh-font-sans) !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  h1, h2, h3, h4, h5, h6,
  .font-serif,
  .font-display-lg,
  .font-headline-xl,
  .font-headline-lg,
  .font-headline-lg-mobile,
  .font-headline-md,
  .font-headline-sm,
  .site-brand,
  .footer-brand,
  [data-lawyer-name],
  [data-lawyer-name-overlay] {
    font-family: var(--zh-font-heading) !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  h1, h2 {
    font-weight: 600 !important;
    letter-spacing: .03em !important;
    line-height: 1.2 !important;
  }

  h3, h4, h5, h6,
  [data-lawyer-name],
  [data-lawyer-name-overlay] {
    font-weight: 600 !important;
    letter-spacing: .02em !important;
  }

  p, li, dd {
    font-family: var(--zh-font-body) !important;
    line-height: 1.85 !important;
  }

  .font-label-caps,
  .zh-page-eyebrow,
  .zc-eyebrow,
  .pm-chapter-en {
    font-family: var(--zh-font-en) !important;
    letter-spacing: .2em !important;
    text-transform: uppercase !important;
  }

  /* Public inner pages share a title scale and spacing rhythm. */
  :root {
    --zh-page-title: 44px;
    --zh-page-gutter: clamp(24px, 5vw, 64px);
    --zh-page-intro-space: 48px;
    --zh-header-height: 68px;
  }

  .zh-page-intro {
    box-sizing: border-box;
    max-width: 1280px;
    margin: 0 auto;
    padding: var(--zh-page-intro-space) var(--zh-page-gutter) 32px;
    color: #1f2329;
  }
  .zh-page-eyebrow {
    display: block;
    margin-bottom: 12px;
    color: #666b73;
    font-size: 11px;
    line-height: 1.5;
    letter-spacing: .16em;
  }
  #main-content :is(.zh-page-intro, #team-directory-header, .news-editorial-hero, .contact-spotlight-hero, .pro-intro) h1 {
    margin: 0 0 16px !important;
    font-size: var(--zh-page-title) !important;
    line-height: 1.3 !important;
    text-wrap: balance;
  }
  #main-content :is(.zh-page-intro > p, .team-stitch-description, .news-title-copy > p, .contact-spotlight-hero p, .pro-tagline) {
    margin: 0 !important;
    font-size: 15px !important;
    line-height: 1.8 !important;
  }
  #main-content :is(.team-stitch-eyebrow, .news-title-copy .label, .pro-intro .pro-eyebrow) {
    font-size: 11px !important;
    line-height: 1.5 !important;
    letter-spacing: .16em !important;
    margin-bottom: 12px !important;
  }
  #main-content #team-directory-header {
    padding-top: var(--zh-page-intro-space) !important;
  }
  #team-directory-header .team-stitch-inner {
    box-sizing: border-box;
    padding-inline: var(--zh-page-gutter) !important;
  }
  .team-directory-page #main-content > .team-list-sec {
    box-sizing: border-box;
    max-width: 1280px !important;
    padding-inline: var(--zh-page-gutter) !important;
  }
  .pro-intro { padding-block: var(--zh-page-intro-space) 32px !important; }
  #main-content :is(.news-editorial-hero, .contact-spotlight-hero) {
    padding-top: calc(var(--zh-header-height) + var(--zh-page-intro-space)) !important;
    padding-bottom: 32px !important;
  }
  .team-directory-page .site-header { height: var(--zh-header-height) !important; min-height: var(--zh-header-height) !important; max-height: var(--zh-header-height) !important; }
  .team-directory-page #main-content { padding-top: var(--zh-header-height) !important; }
  #main-content[data-news-page] .news-sidebar :is(.news-search-block, .news-category-rail, .news-category-rail-button, .news-sidebar-note) {
    border: 0 !important;
  }
  .zh-practice-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 28px;
    margin-top: 24px;
    padding: 16px 0 0;
    border-top: 1px solid #d7dadd;
  }
  .zh-practice-links a {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 44px;
    color: #454a50;
    font-size: 14px;
    text-decoration: none;
  }
  .zh-practice-links a:hover, .zh-contact-link:hover { color: #79171c; }
  .zh-contact-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    max-width: 100%;
    overflow-wrap: anywhere;
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-color: #a8aeb3;
  }
  :is(.zh-practice-links a, .zh-contact-link):focus-visible {
    outline: 2px solid #79171c;
    outline-offset: 4px;
  }

  @media (max-width: 767px) {
    :root {
      --zh-page-title: 32px;
      --zh-page-gutter: 16px;
      --zh-page-intro-space: 32px;
      --zh-header-height: 64px;
    }
    .zh-practice-links { gap: 4px 24px; }
    #main-content .news-pagination { flex-wrap: wrap; }
    #main-content .news-pagination button { min-width: 44px !important; min-height: 44px !important; }
  }
}
