/* Shared type scale. This layer is declared before the legacy component layers
   so it can replace their important typography without disturbing layout rules. */
@layer portfolioType {
  :root {
    --home-chapter-size: clamp(32px, 6.6vw, 64px);
    --portfolio-title: 40px;
    --portfolio-section: 32px;
    --portfolio-subtitle: 24px;
    --portfolio-body: 16px;
    --portfolio-meta: 14px;
    --portfolio-serif: Georgia, 'Times New Roman', serif;
    --portfolio-sans: Manrope, Arial, sans-serif;
  }

  @media (max-width: 360px) {
    :root { --home-chapter-size: 30px; }
  }

  @media (min-width: 761px) {
    :root {
      --portfolio-title: 64px;
      --portfolio-section: 40px;
    }
  }

  @media (min-width: 1081px) {
    :root {
      --home-chapter-size: clamp(64px, 6.6vw, 96px);
      --portfolio-title: 96px;
      --portfolio-section: 64px;
    }
  }

  :lang(he) {
    --portfolio-serif: 'OKO Hebrew', Heebo, Arial, sans-serif;
    --portfolio-sans: 'OKO Hebrew', Heebo, Arial, sans-serif;
  }

  :lang(en), :lang(ru) {
    --portfolio-serif: Georgia, 'Times New Roman', serif;
    --portfolio-sans: Manrope, Arial, sans-serif;
  }

  :where(main, header, footer, #site-mobile-menu, #site-end-actions, .site-end-legal, .people-lightbox, .col-zoom)
  :where(p, a, button, li, dd, label, input, textarea, select, summary, blockquote, span, strong, small, b, em):where(:not(body[data-home-discipline] :is(.hero h1 *, .home-chapter h2 *))):where(:not(#site-mobile-menu nav a, #site-mobile-menu nav a *, #site-mobile-menu .site-photo-toggle, #site-mobile-menu .site-photo-toggle *, #site-mobile-menu .header-languages a, #site-mobile-menu .header-languages a *, #site-mobile-menu .site-menu-policy)) {
    font-family: var(--portfolio-sans) !important;
    font-size: var(--portfolio-body) !important;
    line-height: 1.5 !important;
  }

  :where(main) :where(h1, .legal-title-grid h2):not(body[data-home-discipline] .hero h1) {
    font-family: var(--portfolio-serif) !important;
    font-size: var(--portfolio-title) !important;
    font-weight: 700 !important;
    line-height: 1.05 !important;
  }

  :where(main) :where(h2, h3.case-desktop-title, .case-compact-heading h3, .case-chapter-title):not(.legal-title-grid h2, body[data-home-discipline] .home-chapter h2) {
    font-family: var(--portfolio-serif) !important;
    font-size: var(--portfolio-section) !important;
    font-weight: 700 !important;
    line-height: 1.1 !important;
  }

  :where(main) :where(h3, h4, h5, h6, .people-category-title, .project-type-title, .printer-title, .work-link):not(.case-desktop-title, .case-compact-heading h3, .case-chapter-title) {
    font-family: var(--portfolio-sans) !important;
    font-size: var(--portfolio-subtitle) !important;
    font-weight: 600 !important;
    line-height: 1.25 !important;
  }

  :where(main) :where(h1, h2, h3, h4, h5, h6, .people-category-title, .project-type-title, .printer-title, .work-link) :where(span, a, strong, b, em):where(:not(body[data-home-discipline] :is(.hero h1 *, .home-chapter h2 *))) {
    font: inherit !important;
  }

  #works :is(.printer-title, .project-type-title) {
    font-family: var(--portfolio-serif) !important;
    font-weight: 400 !important;
    text-transform: none !important;
    font-size: clamp(28px, 3.6vw, 54px) !important;
    line-height: 1.12 !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
  }

  /* All six project captions use the body scale, including rows 04 and 06. */
  body[data-home-discipline="design"] #works :is(.printer-meta, .printer-meta > span, .printer-meta > strong, .project-type-meta) {
    font-family: var(--portfolio-sans) !important;
    font-size: var(--portfolio-body) !important;
    font-weight: 400 !important;
    line-height: 1.5 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
  }

  main .bb-brand-subtitle {
    font-family: var(--portfolio-sans) !important;
    font-size: var(--portfolio-subtitle) !important;
    font-weight: 600 !important;
    line-height: 1.25 !important;
  }

  :where(main, footer, .site-end-legal, .col-zoom) :where(
    figcaption, figcaption *, dt, .mono, .mono *, .eyebrow, .eyebrow *,
    .case-desktop-number, .case-chapter-number, .col-nav-number, .col-step,
    .people-category-no, .people-category-subtitle, .bb-eyebrow, .bb-number, .bb-swipe,
    .bb-note, .col-note, .col-meta, .col-credit p, .col-caption, .sb-note,
    .node-no, .printer-no, .section-no, .lang-note, .project-type-no, .project-type-meta,
    .commercial-photo-reel-count, .people-album-meta, .ad-colour-captions *,
    .case-opening-label, .col-kicker, .col-role, .col-colours bdi,
    .sb-index-number, .sb-study-note, .sb-neon-collection-note, .sb-collection-label,
    .sp-label, .sp-label *, .sp-presentation-note, .sp-symbol-note,
    .legal-kicker, .legal-tag, .site-end-legal a, .col-zoom-hint, .ad-study-top, .ad-study-top *
  ) {
    font-family: var(--portfolio-sans) !important;
    font-size: var(--portfolio-meta) !important;
    line-height: 1.5 !important;
  }

  :where(main) figcaption:not(.col-sr-only) {
    margin-block-start: 12px !important;
    padding-block-start: 0 !important;
  }

  :where(main) p:has(+ p),
  :where(main) :where(h3, h4, h5, h6):has(+ p) {
    margin-block-end: 0 !important;
  }

  :where(main) p + p {
    margin-block-start: 12px !important;
  }

  :where(main) :where(h3, h4, h5, h6) + p {
    margin-block-start: 16px !important;
  }

  body > .skip {
    font-family: var(--portfolio-sans) !important;
    font-size: var(--portfolio-body) !important;
    line-height: 1.5 !important;
  }
}
