/* Shared content styles. The header partial loads these after page styles.
   Limit overrides of legacy important declarations to the properties owned here. */
#main-content {
  --cx-content-gutter: clamp(18px, 4vw, 40px);
  --cx-hero-top: clamp(88px, 10vw, 136px);
  --cx-hero-bottom: clamp(40px, 7vw, 88px);
  --cx-hero-heading: clamp(2rem, 5vw, 3.75rem);
  --cx-editorial-heading: clamp(1.875rem, 4vw, 3.25rem);
  --cx-section-heading: clamp(1.5rem, 3.5vw, 2.5rem);
  --cx-lede-size: clamp(1rem, 1.7vw, 1.1875rem);
  --cx-heading-line: 1.11;
  --cx-heading-tracking: -.035em;
  --cx-lede-line: 1.62;
  --cx-copy-muted: #bdb9c6;
  --cx-control-ink: #111015;
  --cx-control-surface: #f5f3fa;
  --cx-control-line: #6c667a;
  --cx-focus: #b9a8ff;
  --cx-action-gap: 12px;
  --cx-card-radius: 16px;
  --cx-card-padding: clamp(18px, 2.4vw, 28px);
  --cx-card-border: rgba(255, 255, 255, 0.11);
  --cx-card-surface: rgba(255, 255, 255, 0.04);
}

html[dir="rtl"] #main-content {
  --cx-heading-line: 1.32;
  --cx-heading-tracking: normal;
  --cx-lede-line: 1.72;
}

/* Set vertical rhythm only on the opening block. Articles and multi-column
   layouts retain their own reading width, imagery, and internal grids. */
#main-content > :is(.hero, .page-header, .case-hero, .contact-page, .saif-hero),
#main-content > :is(.post-header, article) {
  padding-block-start: var(--cx-hero-top) !important;
}

#main-content > :is(.hero, .page-header, .case-hero, .saif-hero) {
  padding-block-end: var(--cx-hero-bottom) !important;
}

#main-content > :is(.hero, .page-header, .case-hero, .contact-page, .saif-hero, .post-header, article) {
  padding-inline: var(--cx-content-gutter) !important;
}

#main-content > :is(.hero, .page-header, .post-header, .case-hero, .contact-page, .saif-hero, article) :is(.breadcrumb, .breadcrumbs) {
  padding-block-start: 0 !important;
}

#main-content > :is(.breadcrumb, .breadcrumbs) + :is(.hero, .page-header, .post-header) {
  padding-block-start: clamp(20px, 3vw, 40px) !important;
}

#main-content > .hero:has(.hero-content, .region-strip) {
  min-block-size: 0 !important;
}

#main-content > .hero:has(.hero-content) {
  padding-block-end: clamp(48px, 8vw, 110px) !important;
}

#main-content .market-hero {
  padding-block: clamp(28px, 6vw, 80px);
}

#main-content :is(.hero, .page-header, .contact-page, .market-hero, .hero-text, .saif-hero) h1,
#main-content :is(.post-header, .case-hero, article) h1 {
  font-size: var(--cx-hero-heading) !important;
  font-weight: 700;
  line-height: var(--cx-heading-line) !important;
  letter-spacing: var(--cx-heading-tracking) !important;
  text-wrap: balance;
  overflow-wrap: anywhere;
  margin-block-end: clamp(14px, 2vw, 24px);
}

#main-content :is(.post-header, .case-hero, article) h1 {
  font-size: var(--cx-editorial-heading) !important;
}

#main-content .hero-content h1 {
  font-size: clamp(2.125rem, 7vw, 5rem) !important;
}

#main-content .market-hero h1 {
  margin-block-start: .75rem;
}

#main-content :is(.hero, .page-header, .post-header, .case-hero, .contact-page, .hero-text, .saif-hero, article)
  :is(.lede, .subtitle, .hero-sub),
#main-content .market-intro,
#main-content .page-header > p:only-of-type {
  color: var(--cx-copy-muted);
  font-size: var(--cx-lede-size) !important;
  line-height: var(--cx-lede-line) !important;
  text-wrap: pretty;
}

#main-content :is(.market-hero, .hero, .page-header) :is(.lede, .hero-sub, .market-intro) {
  margin-block-end: clamp(14px, 2.5vw, 28px);
}

#main-content :is(.market-section > h2, .section-block > h2, .section-title) {
  font-size: var(--cx-section-heading) !important;
  line-height: var(--cx-heading-line) !important;
  letter-spacing: var(--cx-heading-tracking);
  text-wrap: balance;
}

#main-content :is(.hero-cta, .hero-actions, .market-actions, .cta-row, .cta-buttons) {
  gap: var(--cx-action-gap) !important;
}

#main-content :is(
  a.btn-primary, a.btn-secondary, a.cta-primary, a.market-button, a.init-btn, a.playbook-jump,
  a.download-btn, a.book-btn, button.btn-primary, button.submit-btn,
  .contact-form button[type="submit"], #contact-form button[type="submit"]
) {
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-block-size: 44px;
  max-inline-size: 100%;
  padding: 10px 20px !important;
  border: 1px solid transparent;
  border-radius: 999px !important;
  font: inherit;
  font-size: .9375rem !important;
  font-weight: 650;
  line-height: 1.35 !important;
  text-align: center;
  text-decoration: none !important;
  text-wrap: balance;
  overflow-wrap: anywhere;
  cursor: pointer;
}

#main-content :is(
  a.btn-primary, a.btn-secondary, a.cta-primary, a.market-button, a.init-btn,
  a.download-btn, a.book-btn, button.btn-primary, button.submit-btn,
  .contact-form button[type="submit"], #contact-form button[type="submit"]
) {
  display: inline-flex;
}

#main-content :is(
  a.btn-primary, a.cta-primary, a.market-button, a.init-btn:not(.outline), a.playbook-jump,
  a.download-btn, button.btn-primary, button.submit-btn,
  .contact-form button[type="submit"], #contact-form button[type="submit"]
) {
  color: var(--cx-control-ink) !important;
  background: var(--cx-control-surface) !important;
}

#main-content :is(a.btn-secondary, a.init-btn.outline, a.book-btn) {
  color: var(--cx-control-surface) !important;
  background: transparent !important;
  border-color: var(--cx-control-line) !important;
}

#main-content :is(
  a.btn-primary, a.cta-primary, a.market-button, a.init-btn:not(.outline), a.playbook-jump,
  a.download-btn, button.btn-primary, button.submit-btn,
  .contact-form button[type="submit"], #contact-form button[type="submit"]
):hover {
  background: #ddd5f5 !important;
}

#main-content :is(a.btn-secondary, a.init-btn.outline, a.book-btn):hover {
  background: #211b2c !important;
  border-color: var(--cx-focus) !important;
}

#main-content :is(
  a.btn-primary, a.btn-secondary, a.cta-primary, a.market-button, a.init-btn, a.playbook-jump,
  a.download-btn, a.book-btn, button.btn-primary, button.submit-btn,
  .contact-form button[type="submit"], #contact-form button[type="submit"]
):focus-visible {
  outline: 2px solid var(--cx-focus);
  outline-offset: 3px;
}

#main-content :is(button.btn-primary, button.submit-btn, button[type="submit"]):disabled {
  cursor: wait;
  opacity: .65;
}

@media (max-width: 600px) {
  #main-content {
    --cx-hero-top: 4.5rem;
    --cx-hero-bottom: 2.25rem;
    --cx-hero-heading: clamp(1.875rem, 6.8vw, 2.5rem);
    --cx-action-gap: 9px;
  }

  #main-content :is(.hero, .page-header, .post-header, .contact-page) .region-strip {
    margin-block-start: 16px;
  }
}
