/* Six text roles, two existing typefaces. This layer deliberately wins over
   legacy unlayered !important rules without escalating selector specificity.
   Existing layout modules retain ownership; narrow text columns get focused refinements. */
@layer astera-typography {
  @media screen {
    :root {
      --type-serif: "IBM Plex Serif", Georgia, serif;
      --type-sans: "IBM Plex Sans", Arial, sans-serif;
      --type-display: clamp(2rem, 4.7vw, 4.5rem);
      --type-section: clamp(1.875rem, 3.1vw, 2.75rem);
      --type-title: clamp(1.375rem, 1.95vw, 1.75rem);
      --type-lead: clamp(1.25rem, 1.53vw, 1.375rem);
      --type-body: 1.125rem;
      --type-caption: 0.875rem;
      --type-ink: #eee9dd;
      --type-copy: #bec7bd;
      --type-accent: #e4c67e;
      --type-measure: 72ch;
    }

    body {
      font-family: var(--type-sans) !important;
      font-size: var(--type-body) !important;
      font-weight: 400 !important;
      line-height: 1.65 !important;
      color: var(--type-copy) !important;
    }

    /* No automatic or discretionary hyphens, including dynamically added text. */
    body, body * {
      -webkit-hyphens: none !important;
      hyphens: none !important;
    }
    :where(h1, h2, h3, h4, p, li, dd, blockquote, address, summary) {
      word-break: normal !important;
      overflow-wrap: normal !important;
    }

    /* Body copy: identical rhythm and color across pages and components. */
    :where(p, li, dd, blockquote, address),
    :where(#v105-search-results a > span, .v136-service-summary-copy, .v136-direction-row > span,
      .v155-lawyer-detail-value, .article-callout,
      .career-vacancy-aside-v139, .career-vacancy-note-v127,
      .v100-footer-contacts a, .astera-menu-documents a, .astera-menu address a,
      .astera-legal-contact-links a) {
      font-family: var(--type-sans) !important;
      font-size: var(--type-body) !important;
      font-weight: 400 !important;
      line-height: 1.65 !important;
      letter-spacing: 0 !important;
      color: var(--type-copy) !important;
      text-wrap: pretty !important;
      text-align: start !important;
      text-align-last: start !important;
    }
    p { max-inline-size: min(100%, var(--type-measure)) !important; }
    :where(p, li, dd) :is(strong, b) {
      color: inherit !important;
      font-weight: 600 !important;
    }
    :where(p, li, dd) a {
      color: var(--type-accent) !important;
      text-underline-offset: 0.2em;
    }

    /* Display / section / title. All text within a heading shares its role. */
    :where(h1, h2, h3, h4),
    :where(.v136-service-title, .career-vacancy-title-v127 strong, .astera-menu-link) {
      font-family: var(--type-serif) !important;
      font-weight: 400 !important;
      letter-spacing: -0.02em !important;
      text-wrap: balance !important;
      color: var(--type-ink) !important;
    }
    :where(h1) {
      font-size: var(--type-display) !important;
      line-height: 1.15 !important;
    }
    :where(h2) {
      font-size: var(--type-section) !important;
      line-height: 1.2 !important;
      color: var(--type-accent) !important;
    }
    :where(h3, h4),
    :where(.v136-service-title, .career-vacancy-title-v127 strong,
      .v131-team-person h2, .v97-footer-form h2, .astera-menu-link,
      .v137-service-chapter-heading h2, .article-body h2,
      .astera-legal-section > h2, .astera-legal-sidebar h2) {
      font-size: var(--type-title) !important;
      line-height: 1.3 !important;
      color: var(--type-ink) !important;
    }
    :where(h1, h2, h3, h4) :is(span, em, strong, a) {
      font-family: inherit !important;
      font-size: inherit !important;
      font-weight: inherit !important;
      line-height: inherit !important;
      letter-spacing: inherit !important;
      color: inherit !important;
    }
    .bq-statement-copy h3 {
      font-size: var(--type-section) !important;
      line-height: 1.2 !important;
      color: var(--type-accent) !important;
    }

    :where(#practice.v136-service-detail h1, .material-article > h1) {
      font-size: var(--type-section) !important;
      line-height: 1.2 !important;
    }

    #practice.v136-service-detail h1 { max-inline-size: 100% !important; }

    /* Introductions: one restrained step above the body. */
    :where(.bq-lead, .v149-about-hero-lead, .v156-hero-intro,
      .v50-hero-sub, .pagehead .lede, .v120-lawyer-role,
      .article-excerpt, .article-lead, .astera-legal-intro,
      .v136-service-hero-grid > div > p, .astera-menu-contacts > a) {
      font-family: var(--type-sans) !important;
      font-size: var(--type-lead) !important;
      font-weight: 400 !important;
      line-height: 1.55 !important;
      letter-spacing: 0 !important;
      color: var(--type-ink) !important;
      text-wrap: pretty !important;
      text-align: start !important;
      text-align-last: start !important;
    }
    .v136-direction-row > strong {
      font-family: var(--type-sans) !important;
      font-size: var(--type-lead) !important;
      font-weight: 400 !important;
      line-height: 1.45 !important;
      color: var(--type-ink) !important;
    }

    /* A shared reading measure; narrower columns keep their responsive grids. */
    :where(.bq-statement-body, .v140-prose, .v131-team-editorial-grid > p,
      .materials-intro-copy-v128, .article-body, .v120-lawyer-bio,
      .v120-lawyer-matter-content ul, .v137-service-chapter-body,
      .career-copy-v127, .career-closing-v127 > div) {
      font-size: var(--type-body) !important;
      max-inline-size: var(--type-measure) !important;
    }
    .bq-statement-body { gap: 1.4em !important; }
    :where(.v137-service-list li, .v120-lawyer-matter-content li) {
      max-inline-size: var(--type-measure) !important;
    }
    :where(.v140-intro-copy h2, .v150-outcomes-heading h2) {
      max-inline-size: 21ch !important;
    }

    /* Captions, navigation, metadata and form guidance share one small size. */
    :where(small, .bq-kicker, .bq-compass-label, .bq-stage-mark,
      .v140-kicker, .v140-stage-top > span, .v140-infra-path > li > span,
      .v120-lawyer-kicker, .v120-lawyer-label, .v120-lawyer-back a,
      .v136-service-index, .v136-service-back, .v137-service-meta,
      .v136-service-contact, .v97-footer-label, .material-meta, .article-meta,
      .article-relations, .read, .backpill, .foot-legal-link, .form-status,
      .lead-consent, .astera-legal-form-note, .astera-legal-meta,
      .astera-legal-file-link small, .astera-legal-toolbar :is(a, button),
      .career-vacancy-group-v127 h3, .career-vacancy-meta-v127,
      .astera-menu h2, .astera-menu-utility, .astera-menu-languages a,
      .v52-nav-link, .v66-language-trigger, .v66-language-option,
      #v66-language-popover > a, #v66-language-popover > span,
      .materials-practice-filter button, .materials-practice-list [role="option"],
      .phone-row .btn, .contact-method-card span, .contact-methods span,
      .skip-link, .v88-phone-label, .v66-language-trigger span,
      .foot-bottom > span, .v140-work-number, .v120-lawyer-practices a,
      .breadcrumbs, .breadcrumbs > *, .article-relations a,
      .v54-back-home, .astera-legal-file-link, .astera-legal-contact) {
      font-family: var(--type-sans) !important;
      font-size: var(--type-caption) !important;
      font-weight: 400 !important;
      line-height: 1.5 !important;
      letter-spacing: 0 !important;
      color: var(--type-copy) !important;
    }
    :where(.bq-kicker, .v140-kicker, .v120-lawyer-kicker,
      .v120-lawyer-label, .v97-footer-label, .astera-menu h2,
      .career-vacancy-group-v127 h3) {
      color: var(--type-accent) !important;
      letter-spacing: 0.07em !important;
    }
    :where(.lead-consent, .astera-legal-form-note) a,
    :where(.v52-nav-link.active, .astera-menu-link.active,
      .astera-menu-link[aria-current="page"], .astera-menu-languages [aria-current]) {
      color: var(--type-accent) !important;
    }
    :where(.v153-team-role, .v153-team-email) {
      font-family: var(--type-sans) !important;
      font-size: var(--type-caption) !important;
      font-weight: 400 !important;
      line-height: 1.5 !important;
      color: var(--type-copy) !important;
    }
    #v66-language-popover > [aria-current],
    .phone-row .btn.gold,
    .contact-methods input:checked + span,
    .materials-practice-list [role="option"].is-selected { color: #17271f !important; }
    .skip-link { color: #17271f !important; }
    :where(.phone-error, .contact-method-error, .consent-error) { color: #f0ab9d !important; }
    :where(.carousel-arrow, .backpill .ic) {
      font-size: var(--type-body) !important;
      line-height: 1 !important;
    }
    :where(.materials-intro-title-v128 span) { white-space: normal !important; }
    .astera-no-break {
      all: unset !important;
      white-space: nowrap !important;
      font: inherit !important;
      letter-spacing: inherit !important;
      color: inherit !important;
    }
    .astera-no-break::before, .astera-no-break::after { content: none !important; }
    :where(input:not([type="checkbox"]):not([type="radio"]), textarea, select) {
      font-family: var(--type-sans) !important;
      font-size: var(--type-body) !important;
      font-weight: 400 !important;
      line-height: 1.5 !important;
    }

    .not-found-page .code {
      font-family: var(--type-serif) !important;
      font-size: var(--type-display) !important;
      font-weight: 400 !important;
      line-height: 1.15 !important;
      color: var(--type-accent) !important;
    }
    .not-found-links b {
      font-family: var(--type-serif) !important;
      font-size: var(--type-title) !important;
      font-weight: 400 !important;
      line-height: 1.3 !important;
      color: var(--type-ink) !important;
    }
    .not-found-links span, .not-found-page .btn {
      font-family: var(--type-sans) !important;
      font-size: var(--type-caption) !important;
      line-height: 1.5 !important;
    }
    .not-found-links span { color: var(--type-copy) !important; }

    /* Addresses may contain an unbroken URL; ordinary prose wraps at spaces. */
    :where(a[href^="mailto:"], a[href^="tel:"], .v153-team-email,
      .astera-legal-contact-links a, .article-body a[href^="http"]) {
      overflow-wrap: anywhere !important;
      word-break: normal !important;
    }

    /* Equivalent roles on the existing light document surface. */
    :is(#page-legal.astera-legal-page, #astera-legal-modal) {
      --type-ink: #173d2c;
      --type-copy: #385344;
      --type-accent: #785812;
    }
    #page-legal.astera-legal-page[data-astera-legal-document="consent"] {
      --type-ink: #eee9dd;
      --type-copy: #bec7bd;
      --type-accent: #e4c67e;
    }
    .astera-legal-title {
      font-size: var(--type-section) !important;
      line-height: 1.2 !important;
      color: var(--type-ink) !important;
    }
    .astera-legal-clause > div { overflow-wrap: normal !important; }
    .astera-legal-clause-number {
      font-size: inherit !important;
      color: var(--type-copy) !important;
    }

    @media (max-width: 48rem) {
      :root {
        --type-body: 1.0625rem;
        --type-display: clamp(1.875rem, 8.2vw, 2.5rem);
        --type-section: clamp(1.5rem, 7.5vw, 2.125rem);
      }
      :where(.bq-statement-copy h3, .materials-intro-title-v128) {
        max-inline-size: 100% !important;
      }
      :where(.materials-intro-title-v128 span, .v54-full-title, .v54-mobile-title) {
        white-space: normal !important;
      }
    }
  }
}
/* Geometry only: preserve all six shared type roles on narrow phones. */
@layer astera-typography {
  @media screen and (max-width: 23.75rem) {
    #page-team .v131-team-grid {
      grid-template-columns: minmax(0, 1fr) !important;
    }

    #page-about .v140-infra-path {
      padding-inline-start: 0 !important;
    }
    #page-about .v140-infra-path::before {
      inset-inline-start: 1.5rem !important;
    }
    #page-about .v140-infra-path li {
      display: grid !important;
      grid-template-columns: 3rem minmax(0, 1fr) !important;
      column-gap: 1rem !important;
    }
    #page-about .v140-infra-path li > span {
      grid-column: 1 !important;
      grid-row: 1 / span 2 !important;
      inline-size: 3rem !important;
      block-size: 3rem !important;
      margin: 0 !important;
    }
    #page-about .v140-infra-path :is(h3, p) {
      grid-column: 2 !important;
      margin-inline-start: 0 !important;
      margin-block-start: 0 !important;
    }

    #page-practices .v136-service-summary {
      grid-template-columns: 1.25rem minmax(0, 1fr) 2.5rem !important;
      column-gap: 0.625rem !important;
    }
    #partner .v120-lawyer-matter summary {
      column-gap: 0.4375rem !important;
    }
    .v106-related-materials .material-card,
    #partner .v105-lawyer-materials .material-card {
      flex-basis: 100% !important;
    }
    #practice .astera-service-benefit {
      column-gap: 0.625rem !important;
    }
  }
}

@layer astera-typography {
  @media screen and (min-width: 48.001rem) and (max-width: 80rem) {
    #page-about .v140-infra-path {
      grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
      gap: 2.5rem 1.5rem !important;
    }
    #page-about .v140-infra-path::before { content: none !important; }
    #page-about .v140-infra-path li {
      min-block-size: 0 !important;
      padding: 0 !important;
    }
    #page-about .v140-infra-path li > span { margin-block-end: 1.25rem !important; }
  }
}

@layer astera-typography {
  @media screen and (max-width: 48rem) {
    .not-found-page > .wrap {
      grid-template-columns: minmax(0, 1fr) !important;
    }
    .not-found-links {
      inline-size: 100% !important;
      grid-template-columns: minmax(0, 1fr) !important;
    }
  }
}
