/**
 * Site-wide responsive typography accessibility layer.
 * Loaded after the reference design styles so text remains readable without
 * changing the existing component structure or business logic.
 */

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body .bcl-app {
  --bcl-readable-font: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --bcl-readable-display: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-family: var(--bcl-readable-font) !important;
  font-size: 18px;
  line-height: 1.65;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Long-form and card copy: never allow body copy to collapse into tiny text. */
body .bcl-app :where(p, li, dd, dt, address, blockquote) {
  font-family: var(--bcl-readable-font);
  font-size: clamp(1rem, 0.18vw + 0.97rem, 1.125rem) !important;
  line-height: 1.65;
}

/* Clear, consistent heading scale across every template. */
body .bcl-app :where(h1, h2, h3, h4, h5, h6) {
  font-family: var(--bcl-readable-display) !important;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
body .bcl-app h1 {
  font-size: clamp(2.4rem, 5vw, 4.75rem) !important;
  line-height: 1.08 !important;
}
body .bcl-app h2 {
  font-size: clamp(1.9rem, 3.3vw, 3.25rem) !important;
  line-height: 1.14 !important;
}
body .bcl-app h3 {
  font-size: clamp(1.25rem, 1.7vw, 1.65rem) !important;
  line-height: 1.25 !important;
}
body .bcl-app h4 {
  font-size: clamp(1.125rem, 1.25vw, 1.35rem) !important;
  line-height: 1.3 !important;
}
body .bcl-app h5,
body .bcl-app h6 {
  font-size: 1.05rem !important;
  line-height: 1.35 !important;
}

/* Interactive controls remain readable and touch-friendly. */
body .bcl-app :where(button, input, select, textarea) {
  font-family: var(--bcl-readable-font) !important;
  font-size: 1rem !important;
  line-height: 1.4 !important;
}
body .bcl-app :where(label, legend) {
  font-size: 1rem !important;
  line-height: 1.45 !important;
}
body .bcl-app :where(.bcl-button, .button, [class*="button"], input[type="submit"], button) {
  font-size: 1rem !important;
  line-height: 1.25 !important;
}

/* Desktop navigation and nested menus. */
body .bcl-app .bcl-nav-links > li > a,
body .bcl-app .bcl-nav-links .sub-menu a,
body .bcl-app .bcl-mobile-menu a,
body .bcl-app .bcl-mobile-menu-list a {
  font-size: 1rem !important;
  line-height: 1.35 !important;
}

/* Utility, metadata, badges, breadcrumbs and small-print areas. */
body .bcl-app :where(
  small,
  .bcl-eyebrow,
  .bcl-hero-eyebrow,
  .bcl-breadcrumbs,
  .bcl-post-meta,
  .bcl-article-meta,
  .bcl-article-category,
  .bcl-blog-card-kicker,
  .bcl-blog-category-nav a,
  .bcl-ref-kicker,
  .bcl-ref-pill,
  .bcl-ref-privacy-note,
  .bcl-ref-service-badge,
  .bcl-ref-area-list li,
  .bcl-ref-countdown span,
  .bcl-ref-footer-bottom,
  .bcl-ref-footer-menu a,
  .bcl-ref-footer-contact,
  .bcl-toolbar-label
) {
  font-size: 0.94rem !important;
  line-height: 1.45 !important;
}

/* Top announcement bar. */
body .bcl-app :where(.bcl-ref-topbar, .bcl-ref-topbar-message, .bcl-ref-topbar-area, .bcl-ref-topbar-phone) {
  font-size: 0.94rem !important;
  line-height: 1.4 !important;
}

/* Homepage reference-design components that previously used 8–14px text. */
body.home .bcl-app :where(
  .bcl-ref-estimate-heading p,
  .bcl-ref-estimate-fallback p,
  .bcl-ref-benefit-card strong,
  .bcl-ref-benefit-card p,
  .bcl-ref-service-body p,
  .bcl-ref-showcase-overlay > p,
  .bcl-ref-showcase-overlay > span,
  .bcl-ref-process-heading > p,
  .bcl-ref-process-step h3,
  .bcl-ref-process-step p,
  .bcl-ref-pricing-card h3,
  .bcl-ref-service-area-card > p,
  .bcl-ref-area-list li,
  .bcl-ref-countdown-overlay > p,
  .bcl-ref-faq-list details p,
  .bcl-ref-final-cta p,
  .bcl-ref-footer-menu a,
  .bcl-ref-footer-contact,
  .bcl-ref-footer-bottom
) {
  font-size: 1rem !important;
  line-height: 1.6 !important;
}
body.home .bcl-app .bcl-ref-hero-lead {
  font-size: clamp(1.125rem, 1.35vw, 1.3rem) !important;
  line-height: 1.6 !important;
}
body.home .bcl-app .bcl-ref-countdown span {
  font-size: 0.875rem !important;
  line-height: 1.35 !important;
}

/* Interior pages, landing pages and blog/article templates. */
body:not(.home) .bcl-app :where(
  .bcl-landing-lead,
  .bcl-landing-trust-points,
  .bcl-landing-hero-form .bcl-form-heading p,
  .bcl-sidebar-card p,
  .bcl-sidebar-links a,
  .bcl-related-page-card p,
  .bcl-final-cta p,
  .bcl-standard-card .bcl-entry-content,
  .bcl-article-content
) {
  font-size: clamp(1rem, 0.18vw + 0.97rem, 1.125rem) !important;
  line-height: 1.7 !important;
}

body:not(.home) .bcl-app :where(
  .bcl-blog-category-nav a,
  .bcl-blog-card-kicker,
  .bcl-article-category,
  .bcl-article-meta,
  .bcl-post-meta,
  .bcl-ref-footer-menu a,
  .bcl-ref-footer-contact,
  .bcl-ref-footer-bottom
) {
  font-size: 0.94rem !important;
  line-height: 1.45 !important;
}

/* Keep prose widths comfortable when text is enlarged. */
body .bcl-app :where(.bcl-entry-content, .bcl-article-content) {
  overflow-wrap: anywhere;
  word-break: normal;
}
body .bcl-app :where(.bcl-entry-content p, .bcl-article-content p) {
  margin-bottom: 1.15em;
}

/* Tablet typography. */
@media (max-width: 1024px) {
  body .bcl-app {
    font-size: 17px;
  }
  body .bcl-app h1 {
    font-size: clamp(2.25rem, 6.6vw, 4rem) !important;
  }
  body .bcl-app h2 {
    font-size: clamp(1.8rem, 4.7vw, 2.8rem) !important;
  }
  body .bcl-app .bcl-nav-links > li > a,
  body .bcl-app .bcl-nav-links .sub-menu a {
    font-size: 0.98rem !important;
  }
}

/* Mobile: 16px minimum for normal copy and controls to prevent unreadable text/zoom issues. */
@media (max-width: 767px) {
  body .bcl-app {
    font-size: 16px;
    line-height: 1.6;
  }
  body .bcl-app :where(p, li, dd, dt, address, blockquote) {
    font-size: 1rem !important;
    line-height: 1.62 !important;
  }
  body .bcl-app h1 {
    font-size: clamp(2rem, 10vw, 3.05rem) !important;
    line-height: 1.1 !important;
  }
  body .bcl-app h2 {
    font-size: clamp(1.7rem, 7.5vw, 2.35rem) !important;
    line-height: 1.16 !important;
  }
  body .bcl-app h3 {
    font-size: clamp(1.2rem, 5.5vw, 1.5rem) !important;
  }
  body .bcl-app :where(
    .bcl-ref-topbar,
    .bcl-ref-topbar-message,
    .bcl-ref-topbar-area,
    .bcl-ref-topbar-phone,
    .bcl-eyebrow,
    .bcl-hero-eyebrow,
    .bcl-breadcrumbs,
    .bcl-post-meta,
    .bcl-article-meta,
    .bcl-article-category,
    .bcl-blog-card-kicker,
    .bcl-ref-kicker,
    .bcl-ref-pill,
    .bcl-ref-privacy-note,
    .bcl-ref-area-list li,
    .bcl-ref-footer-menu a,
    .bcl-ref-footer-contact,
    .bcl-ref-footer-bottom
  ) {
    font-size: 0.9rem !important;
    line-height: 1.45 !important;
  }
  body .bcl-app :where(button, input, select, textarea, label, legend, .bcl-button, .button, [class*="button"]) {
    font-size: 1rem !important;
  }
  body .bcl-app .bcl-mobile-menu a,
  body .bcl-app .bcl-mobile-menu-list a {
    font-size: 1rem !important;
    line-height: 1.45 !important;
  }
}

/* Very small phones retain full readability without forcing oversized headings. */
@media (max-width: 380px) {
  body .bcl-app h1 {
    font-size: 2rem !important;
  }
  body .bcl-app h2 {
    font-size: 1.65rem !important;
  }
  body .bcl-app h3 {
    font-size: 1.2rem !important;
  }
}
