/* =====================================================================
   READABILITY LAYER — loads last
   Improves text size, line-height, spacing, button tap targets,
   and mobile vertical structure across all pages.
   ===================================================================== */

/* ===== 1. Base typography (mobile-first) ===== */
html { -webkit-text-size-adjust: 100%; }

body {
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: -0.01em;
  color: #1a1a1a;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

@media (min-width: 641px) and (max-width: 992px) {
  body { font-size: 17px; line-height: 1.78; }
}
@media (max-width: 640px) {
  body { font-size: 16px; line-height: 1.78; }
  html, body { word-break: keep-all; overflow-wrap: break-word; }
}

/* ===== 2. Heading hierarchy — clear, consistent ===== */
h1, h2, h3, h4 { word-break: keep-all; letter-spacing: -0.025em; }

/* Hero titles */
.hero h1,
.hero-content h1,
.pasan-hero-title,
.about-hero .hero-title,
.contact-hero-title {
  font-weight: 800 !important;
  line-height: 1.25 !important;
  word-break: keep-all;
}

/* Section titles — keep visually consistent */
.section-title,
.section-heading,
.pasan-card-title,
.consult-title,
.form-title,
.about-certs-header .section-heading,
.corp-lead-title,
.mid-cta-title,
.blog-promo-title,
.credentials-section .section-title {
  font-weight: 800 !important;
  line-height: 1.35 !important;
  letter-spacing: -0.025em !important;
  word-break: keep-all;
}

/* h3/h4 inside cards */
.sol-title, .case-head, .check-content h3, .check-content h4,
.cred-text h3, .diff-title, .step-title, .p-title {
  font-weight: 800 !important;
  letter-spacing: -0.02em;
  line-height: 1.4 !important;
}

/* ===== 3. Body paragraphs — line length limit ===== */
p { line-height: 1.85; word-break: keep-all; overflow-wrap: break-word; }
.section-desc,
.pasan-card-desc,
.hero-desc,
.pasan-hero-desc,
.contact-hero-desc,
.profile-quote + .profile-body-cols p,
.consult-desc,
.mid-cta-desc,
.blog-promo-desc,
.corp-lead-desc {
  max-width: 64ch;
  line-height: 1.85 !important;
}

/* Centered section header descriptions — center them with max-width */
.section-header .section-desc,
.about-certs-header .section-desc,
.credentials-header .section-desc {
  margin-left: auto;
  margin-right: auto;
}

/* ===== 4. Emphasis ===== */
strong, b { font-weight: 800; }
.hero-content h1 strong, .hero h1 strong { font-weight: 800; }
.highlight { font-weight: 800; }

/* In-body strong/highlight: subtle gold underline tint */
.section-desc strong,
.consult-desc strong,
.mid-cta-desc strong,
.pasan-hero-desc strong,
.hero-content p strong {
  color: var(--navy);
  font-weight: 800;
  background: linear-gradient(180deg, transparent 60%, rgba(184,146,74,0.22) 60%);
  padding: 0 2px;
}
.consult-card .consult-desc strong,
.mid-cta-block--rehab .mid-cta-desc strong,
.mid-cta-block--pasan .mid-cta-desc strong,
.mid-cta-block--about .mid-cta-desc strong,
.hero p strong {
  color: var(--gold-light);
  background: none;
  padding: 0;
}

/* ===== 5. Section padding — comfortable vertical rhythm ===== */
@media (max-width: 992px) {
  .section-py { padding: 76px 0; }
}
@media (max-width: 640px) {
  .section-py { padding: 56px 0; }
  .hero { padding-top: calc(var(--header-h, 72px) + 56px); padding-bottom: 72px; }
}

/* Section header bottom space */
.section-header { margin-bottom: 48px; }
@media (max-width: 640px) {
  .section-header { margin-bottom: 36px; }
  .credentials-header { margin-bottom: 36px !important; }
}

/* ===== 6. Container — better gutters ===== */
@media (max-width: 640px) {
  .container, .inner, body .container, body .inner { padding-left: 20px; padding-right: 20px; }
}

/* ===== 7. Buttons — large tap targets ===== */
.btn, .consult-btn, .cta-btn, .submit-btn,
.pasan-hero-btn, .about-hero-btn, .corp-lead-btn,
.mid-cta-btn, .blog-promo-btn, .corp-site-banner-btn,
.btn-big, .nav-cta, .situation-link, .sol-link {
  min-height: 48px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.btn { height: auto; padding: 14px 28px; }
.consult-btn { padding: 16px 32px; }

/* Mobile: full-width stacked buttons */
@media (max-width: 640px) {
  .btn-group,
  .cta-box-actions,
  .pasan-hero-actions,
  .about-hero-actions,
  .corp-lead-actions,
  .mid-cta-actions,
  .btn-action-group {
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
  }
  .btn-group .btn,
  .cta-box-actions .cta-btn,
  .pasan-hero-actions .pasan-hero-btn,
  .about-hero-actions .about-hero-btn,
  .corp-lead-actions .corp-lead-btn,
  .mid-cta-actions .mid-cta-btn,
  .btn-action-group .btn-big {
    width: 100%;
    min-height: 52px;
    justify-content: center;
    font-size: 16px;
  }
}

/* ===== 8. Hero — readable on mobile ===== */
@media (max-width: 640px) {
  .hero-content h1,
  .hero h1 {
    font-size: clamp(30px, 8vw, 38px) !important;
    line-height: 1.22 !important;
    margin-bottom: 18px;
  }
  .hero-content p,
  .hero p,
  .hero-desc,
  .pasan-hero-desc {
    font-size: 16px !important;
    line-height: 1.78 !important;
    margin-bottom: 28px;
  }
  .pasan-hero-title {
    font-size: clamp(26px, 7vw, 32px) !important;
    line-height: 1.28 !important;
  }
  .hero-kicker, .pasan-hero-kicker {
    font-size: 11px !important;
    letter-spacing: 0.16em !important;
  }
}

/* ===== 9. Section titles on small screens ===== */
@media (max-width: 640px) {
  .section-title,
  .section-heading,
  .consult-title,
  .mid-cta-title,
  .corp-lead-title,
  .blog-promo-title,
  .form-title {
    font-size: 24px !important;
    line-height: 1.35 !important;
  }
  .pasan-card-title {
    font-size: 22px !important;
    line-height: 1.4 !important;
  }
  .quote-text, .profile-quote {
    font-size: 24px !important;
    line-height: 1.45 !important;
  }
}

/* ===== 10. Cards — comfortable touch padding ===== */
@media (max-width: 640px) {
  .check-card, .sol-card, .case-card, .review-card,
  .cred-card, .diff-card, .info-item, .service-item,
  .pasan-section-card, .corp-lead-card, .acc-panel-inner {
    padding: 22px 20px !important;
  }
  .cred-card { gap: 14px !important; }
  .cred-text h3 { font-size: 16.5px !important; }
  .cred-text p { font-size: 14px !important; line-height: 1.75 !important; }
}

/* ===== 11. Lists — better spacing ===== */
.rehab-list li,
.acc-panel ul li,
.corp-lead-points li,
.pasan-hero-trust li,
.hero-trust-list li {
  word-break: keep-all;
}
.rehab-list li,
.acc-panel ul li {
  padding-left: 4px;
  margin-bottom: 10px;
  line-height: 1.78;
}
@media (max-width: 640px) {
  .rehab-list li, .acc-panel ul li { font-size: 15px; line-height: 1.78; }
}

/* Hero trust badges */
@media (max-width: 640px) {
  .hero-trust-list, .pasan-hero-trust {
    gap: 6px;
    margin-bottom: 22px;
  }
  .hero-trust-list li, .pasan-hero-trust li {
    font-size: 12px !important;
    padding: 6px 11px;
  }
}

/* ===== 12. Form inputs — readable & touch-friendly ===== */
.form-input, .form-select, .form-textarea,
.consult-form .form-input, .consult-form .form-select, .consult-form .form-textarea {
  min-height: 48px;
  font-size: 15px;
  line-height: 1.5;
}
.form-label, .consult-form .form-label {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 6px;
}
.form-textarea, .consult-form .form-textarea { min-height: 130px; }
@media (max-width: 640px) {
  .form-input, .form-select, .form-textarea,
  .consult-form .form-input, .consult-form .form-select, .consult-form .form-textarea {
    font-size: 16px;
    min-height: 52px;
    padding: 14px 14px;
  }
  .form-label, .consult-form .form-label { font-size: 14px; }
  .privacy-check, .consult-form .privacy-check { font-size: 14px; line-height: 1.7; gap: 10px; }
  .privacy-check input, .consult-form .privacy-check input { width: 18px; height: 18px; flex-shrink: 0; }
}

/* ===== 13. Stats bar — keep visible & legible ===== */
@media (max-width: 640px) {
  .stat-item { padding: 22px 12px !important; gap: 6px !important; }
  .stat-num { font-size: 22px !important; }
  .stat-label { font-size: 12px !important; line-height: 1.5 !important; }
}

/* ===== 14. Cards grid — vertical stack on mobile ===== */
@media (max-width: 640px) {
  .solution-grid,
  .cases-grid,
  .review-grid,
  .diff-grid,
  .service-list,
  .overview-grid,
  .credentials-grid,
  .blog-promo-grid,
  .corp-lead-points {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }
  .credentials-images.credentials-images--single {
    max-width: 280px !important;
  }
}

/* ===== 15. Sub-navigation (sticky) — comfortable on mobile ===== */
@media (max-width: 640px) {
  .pasan-nav { gap: 4px; padding: 8px 16px; flex-wrap: wrap; }
  .pasan-nav-link { font-size: 13px; padding: 8px 10px; }
}

/* ===== 16. Footer — easier scanning ===== */
@media (max-width: 640px) {
  .footer-inner { gap: 28px; }
  .footer-desc, .footer-contact, .footer-links { font-size: 14px; line-height: 1.85; }
  .footer-quick a { font-size: 13px; padding: 10px 12px; min-height: 44px; }
  .footer-col h4 { font-size: 15px; margin-bottom: 14px; }
}

/* ===== 17. Color contrast tweaks ===== */
.section-desc, .pasan-card-desc, .hero-desc { color: #3a3a3a; }
.text-muted, .case-meta, .review-text { color: #555; }
.consult-card .consult-desc,
.credentials-section .section-desc,
.process-section .section-desc {
  color: rgba(255,255,255,0.78);
}

/* ===== 18. Process and consult cards bottom space on mobile ===== */
@media (max-width: 640px) {
  .consult-card { padding-left: 24px !important; padding-right: 24px !important; }
  .consult-form-card { padding: 22px !important; }
}

/* ===== 19. About hero stats-bar — readable ===== */
@media (max-width: 640px) {
  .about-hero .stats-bar { grid-template-columns: 1fr 1fr; gap: 0; }
  .about-hero .stat-item { border-bottom: 1px solid var(--border-subtle); padding: 18px 12px !important; }
}

/* ===== 20. Mid CTA mobile — vertical with breathing room ===== */
@media (max-width: 640px) {
  .mid-cta-block { padding: 40px 0; }
  .mid-cta-copy { text-align: center; }
  .mid-cta-kicker { margin-left: auto; margin-right: auto; }
  .mid-cta-title { font-size: 22px !important; }
  .mid-cta-desc { font-size: 15px; }
}

/* ===== 21. Cert frames mobile sizing ===== */
@media (max-width: 640px) {
  .cert-frame, .about-cert-frame { padding: 12px 12px 14px !important; }
  .cert-cap-title, .about-cert-title { font-size: 14px !important; }
  .cert-cap-eyebrow, .about-cert-eyebrow { font-size: 10.5px !important; }
}

/* ===== 22. Sticky-CTA-bar / fixed-cta-bar text legibility on mobile ===== */
@media (max-width: 640px) {
  .fixed-cta-bar--compact .cta-label-main,
  .fixed-cta-bar--light .cta-label-main,
  .fixed-cta-bar--dark .cta-label-main { font-size: 11.5px !important; font-weight: 800; }
  .fixed-cta-bar .cta-btn { min-height: 60px !important; padding: 10px 0 !important; }
}

/* ===== 23. Accordion items - readability ===== */
@media (max-width: 640px) {
  .acc-btn { padding: 16px 18px !important; font-size: 15px !important; }
  .acc-btn-label { gap: 10px; }
  .acc-badge { font-size: 10.5px !important; padding: 3px 9px !important; }
}

/* ===== 24. Visited link + focus states for accessibility ===== */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.consult-btn:focus-visible,
.cta-btn:focus-visible {
  outline: 3px solid rgba(184,146,74,0.55);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ===== 25. Sitewide finishing pass - alignment, contrast, and responsive flow ===== */
:root {
  --layout-gutter: clamp(20px, 3vw, 28px);
  --text-secondary: #3d4652;
  --text-muted: #5b6470;
  --text-light: #68717c;
  --border-light: #ddd8d0;
  --border-subtle: #e9e4dd;
}

.container,
.inner,
.header-inner {
  padding-left: var(--layout-gutter);
  padding-right: var(--layout-gutter);
}

.site-footer {
  padding-left: 0;
  padding-right: 0;
}
.footer-inner,
.footer-notice,
.footer-bottom {
  width: 100%;
  padding-left: var(--layout-gutter);
  padding-right: var(--layout-gutter);
}
.footer-line {
  width: calc(100% - (2 * var(--layout-gutter)));
  max-width: calc(var(--max-width) - (2 * var(--layout-gutter)));
}

.about-hero .hero-title,
.pasan-hero-title,
.contact-hero-title,
.faq-hero-title,
.cases-title,
.loc-title,
.hero-area .hero-title {
  font-weight: 800 !important;
  line-height: 1.27 !important;
  letter-spacing: -0.03em;
  text-wrap: balance;
  word-break: keep-all;
}

.about-hero .hero-desc,
.pasan-hero-desc,
.contact-hero-desc,
.faq-hero-desc,
.cases-desc,
.loc-desc,
.hero-area .hero-desc {
  max-width: 62ch;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.85 !important;
  text-wrap: pretty;
  word-break: keep-all;
}

.cases-head-title,
.faq-group-title,
.sec-title,
.q-title-lg,
.info-title,
.board-title {
  color: var(--navy);
  font-weight: 800;
  line-height: 1.42;
  letter-spacing: -0.02em;
  text-wrap: balance;
  word-break: keep-all;
}

.form-desc,
.cases-head-sub,
.faq-group-desc,
.case-text,
.overview-text,
.step-desc,
.review-text,
.board-note {
  color: var(--text-secondary) !important;
  line-height: 1.8;
}

body.ksl-page-index .credentials-section .section-header,
body.ksl-page-index .solutions .section-header,
body.ksl-page-index .process-section .section-header,
body.ksl-page-index .cases-section .section-header,
body.ksl-page-index .reviews-section .section-header {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}
body.ksl-page-index .credentials-section .section-desc,
body.ksl-page-index .solutions .section-desc,
body.ksl-page-index .process-section .section-desc,
body.ksl-page-index .cases-section .section-desc,
body.ksl-page-index .reviews-section .section-desc {
  margin-left: auto;
  margin-right: auto;
}

.pasan-hero-desc,
.contact-hero-desc,
.faq-hero-desc,
.cases-desc,
.about-hero .hero-desc,
.hero-area .hero-desc,
.credentials-section .section-desc,
.process-section .section-desc,
.consult-card .consult-desc,
.corp-lead-desc,
.mid-cta-block--rehab .mid-cta-desc,
.mid-cta-block--pasan .mid-cta-desc,
.mid-cta-block--about .mid-cta-desc {
  color: rgba(255,255,255,0.84) !important;
}

.btn,
.consult-btn,
.submit-btn,
.pasan-hero-btn,
.about-hero-btn,
.corp-lead-btn,
.mid-cta-btn,
.blog-promo-btn,
.corp-site-banner-btn,
.btn-big,
.btn-action {
  border-radius: var(--radius-md, 10px);
  align-items: center;
  justify-content: center;
  line-height: 1.35;
  text-align: center;
}
.btn-primary,
.consult-btn,
.pasan-hero-btn--primary,
.about-hero-btn--primary,
.corp-lead-btn--primary,
.mid-cta-btn--primary,
.desktop-right-cta--dark .desktop-right-cta-btn.primary {
  color: var(--navy) !important;
}

.case-result strong,
.faq-highlight {
  color: var(--navy);
  font-weight: 800;
  background: linear-gradient(180deg, transparent 58%, rgba(184,146,74,0.2) 58%);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.highlight-box {
  border-left: 3px solid var(--gold);
  line-height: 1.8;
}

.footer-desc { color: #b6becb; }
.footer-contact,
.footer-links a { color: #d9dee6; }
.footer-notice,
.footer-bottom { color: #a5adba; }

/* Default WordPress content, post lists, and error pages use the same reading rail. */
.page-main,
.ksl-page,
body.error404 #main {
  padding: clamp(64px, 7vw, 88px) 0 clamp(76px, 8vw, 104px);
}
.page-main .container,
.ksl-page .container,
body.error404 #main > .container {
  max-width: 900px;
}
.page-head,
.ksl-page > .container > .ksl-page-head {
  max-width: 720px;
  margin: 0 auto clamp(34px, 4vw, 48px);
  text-align: center;
}
.page-title,
.ksl-page-title {
  margin: 0 0 14px;
  color: var(--navy);
  font-family: var(--font-serif);
  font-size: clamp(30px, 4vw, 42px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.3;
  text-wrap: balance;
  word-break: keep-all;
}
.page-excerpt,
.ksl-page-excerpt {
  max-width: 62ch;
  margin: 0 auto;
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.85;
  word-break: keep-all;
}
.wp-content {
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.85;
}
.wp-content :where(h2, h3, h4) {
  margin: 1.8em 0 0.65em;
  color: var(--navy);
  font-family: var(--font-serif);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.42;
}
.wp-content :where(ul, ol) {
  margin: 1.1em 0;
  padding-left: 1.35em;
}
.wp-content ul > li { list-style: disc; }
.wp-content ol > li { list-style: decimal; }
.wp-content li {
  margin-bottom: 0.45em;
  line-height: 1.75;
}
.wp-content a {
  color: var(--navy);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: rgba(184,146,74,0.5);
  text-underline-offset: 0.2em;
}
.ksl-post {
  margin-bottom: 24px;
  padding: clamp(24px, 4vw, 34px);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg, 14px);
}
.ksl-post .ksl-page-head {
  margin-bottom: 16px;
  text-align: left;
}
.ksl-post .ksl-page-title {
  font-size: clamp(22px, 3vw, 27px);
}
.ksl-post .ksl-page-excerpt {
  margin-left: 0;
}
.ksl-404-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.ksl-404-actions .wp-block-button__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 13px 25px;
  background: var(--navy);
  border: 1px solid var(--navy);
  border-radius: var(--radius-md, 10px);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}
.ksl-404-actions .wp-block-button__link.is-style-outline {
  background: var(--bg-card);
  border-color: var(--border-light);
  color: var(--navy);
}

@media (max-width: 992px) {
  body.ksl-page-index .section-header {
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
  }
  body.ksl-page-index .section-header .section-desc {
    margin-left: auto;
    margin-right: auto;
  }
}

@media (max-width: 640px) {
  :root { --layout-gutter: 20px; }

  .hero-content h1 br,
  .about-hero .hero-title br,
  .pasan-hero-title br,
  .contact-hero-title br,
  .faq-hero-title br,
  .cases-title br,
  .loc-title br,
  .section-title br,
  .section-heading br,
  .corp-lead-title br,
  .blog-promo-title br,
  .consult-title br,
  .hero-desc br,
  .pasan-hero-desc br,
  .contact-hero-desc br,
  .faq-hero-desc br,
  .cases-desc br,
  .corp-lead-desc br,
  .blog-promo-desc br,
  .consult-desc br {
    display: none;
  }

  .about-hero .hero-title,
  .contact-hero-title,
  .faq-hero-title,
  .cases-title,
  .loc-title,
  .hero-area .hero-title {
    font-size: clamp(26px, 7.3vw, 31px) !important;
    line-height: 1.34 !important;
  }
  .about-hero .hero-desc,
  .contact-hero-desc,
  .faq-hero-desc,
  .cases-desc,
  .loc-desc,
  .hero-area .hero-desc {
    font-size: 15.5px !important;
    line-height: 1.8 !important;
  }

  .pasan-nav {
    flex-wrap: nowrap !important;
    justify-content: flex-start;
    gap: 4px;
    padding: 8px var(--layout-gutter);
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }
  .pasan-nav::-webkit-scrollbar { display: none; }
  .pasan-nav-link {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    white-space: nowrap;
    scroll-snap-align: start;
  }

  .consult-card .consult-btn,
  .submit-btn,
  .blog-promo-btn,
  .sec-actions .btn-action {
    width: 100%;
    min-height: 52px;
    justify-content: center;
  }
  .sec-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .corp-lead-points li {
    width: 100%;
    justify-content: flex-start;
  }

  .site-footer {
    padding-top: 44px;
    padding-bottom: 26px;
  }
  .footer-bottom {
    align-items: flex-start;
    gap: 8px;
  }

  .fixed-cta-bar .cta-btn {
    gap: 4px;
    padding-left: 4px !important;
    padding-right: 4px !important;
  }
  .fixed-cta-bar .cta-label-main {
    font-size: clamp(10px, 3vw, 11.5px) !important;
    line-height: 1.3;
    white-space: normal;
    word-break: keep-all;
  }
  .fixed-cta-bar .cta-label-sub {
    display: none;
  }

  .page-main,
  .ksl-page,
  body.error404 #main {
    padding-top: 52px;
    padding-bottom: 68px;
  }
  .page-title,
  .ksl-page-title {
    font-size: clamp(27px, 8vw, 32px);
    line-height: 1.38;
  }
  .page-excerpt,
  .ksl-page-excerpt,
  .wp-content {
    font-size: 15.5px;
  }
  .ksl-post {
    padding: 22px 20px;
  }
  .ksl-404-actions {
    flex-direction: column;
    align-items: stretch;
  }
}
