/* Montserrat/Open Sans are enqueued natively via wp_enqueue_style() in
   functions.php (with preconnect hints) instead of @import here — @import
   is render-blocking (the browser can't discover it until this whole
   stylesheet downloads and parses), whereas a <link> in <head> is
   discovered immediately and loads in parallel. */

/* ── Skip-to-content link (WCAG 2.4.1 Bypass Blocks) ──────────────────────
   Output via wp_body_open() in functions.php, before the Theme Builder
   header, so it's the first focusable element on every page. Off-screen
   until focused, then pinned to the top-left so keyboard users can jump
   past the header/nav straight to #main-content. */
.kkc-skip-link {
    position: absolute; top: -100px; left: 0; z-index: 10000;
    background: #000; color: #fff; padding: 14px 24px;
    font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: .92rem;
    text-decoration: none; border-radius: 0 0 8px 0;
    transition: top .2s ease;
}
.kkc-skip-link:focus { top: 0; }

/* ── FontAwesome icon font (force-load) ───────────────────────────────────
   Divi only enqueues its bundled includes/builder/feature/dynamic-assets/
   assets/css/icons_fa_all.css when its per-page dynamic-asset scan detects
   FA icon usage in post_content. That scan never fires for content pushed
   via $wpdb->update() (see Bug 1, deployment_prompt.md), so every blurb
   icon's font-family:FontAwesome CSS rule is correctly generated but has no
   font to point to — it renders as a missing-glyph box instead of the icon
   glyph (this is what showed up as a stray character in front of blurb
   titles, e.g. on /neck-pain-treatment/). Loading the two weights Divi
   itself ships fixes it regardless of that detection working. */
@font-face {
    font-family: 'FontAwesome';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/wp-content/themes/Divi/core/admin/fonts/fontawesome/fa-regular-400.woff2') format('woff2'),
         url('/wp-content/themes/Divi/core/admin/fonts/fontawesome/fa-regular-400.woff') format('woff');
}
@font-face {
    font-family: 'FontAwesome';
    font-style: normal;
    font-weight: 900;
    font-display: swap;
    src: url('/wp-content/themes/Divi/core/admin/fonts/fontawesome/fa-solid-900.woff2') format('woff2'),
         url('/wp-content/themes/Divi/core/admin/fonts/fontawesome/fa-solid-900.woff') format('woff');
}

:root {
    --primary:       #000000;
    --primary-light: #333333;
    --accent:        #FF9002;
    --accent-light:  #FFB84D;
    --bg:            #FFFFFF;
    --text-dark:     #000000;
    --text-medium:   #4A4A4A;
    /* Darker than --accent — #FF9002 only measures 2.27:1 against white (and
       white text on #FF9002 measures the same 2.27:1, contrast being
       symmetric), well under the WCAG AA 4.5:1 minimum for normal text
       (1.4.3 Contrast Minimum). --accent-safe clears 4.5:1 against both
       white (4.61:1) and black (4.55:1) as TEXT, and white text on
       --accent-safe as a BACKGROUND is the same 4.61:1 — so one value
       covers .kkc-eyebrow (text) and every CTA button (background) that
       used to sit on plain #FF9002. --accent-safe-dark is a further-
       darkened hover/pressed shade (6.56:1 with white text) used in place
       of the old --accent-light hover state, which measured only 1.72:1.
       --accent itself is left unchanged since it still drives the
       decorative hero-accent-span/stat-number text that's always on a dark
       background (and is fine there), plus the brand reference color. */
    --accent-safe:      #B35F00;
    --accent-safe-dark: #8F4C00;
}

body, p, li, a, .et_pb_text_inner {
    font-family: 'Open Sans', sans-serif;
    color: var(--text-medium);
    
}
h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', sans-serif;
    color: var(--text-dark);
}

.et_pb_text_inner p {
    padding-bottom:2% !important;

}

/* ── Dual-mode content-area text color ────────────────────────────────────
   The sitewide default (body, p, li, a { color: var(--text-medium) }) is a
   dark gray that reads fine on white/light section backgrounds but is
   unreadable on black ones (that gray wins over the black-bg ancestor's
   inherited white, since an explicit rule on the element beats inherited
   color regardless of specificity). Apply .kkc-theme-dark to any wrapper
   sitting on a black/dark section (footer, CTA banners, stat bands) so its
   own text — including plain <p> tags — reads correctly; .kkc-theme-light
   is the explicit opposite, for symmetry and self-documenting markup on
   light sections that need to override something more specific. */
.kkc-theme-dark, .kkc-theme-dark p, .kkc-theme-dark li {
    color: rgba(255,255,255,.82);
}
.kkc-theme-dark a:not(.kkc-btn) { color: rgba(255,255,255,.82); }
.kkc-theme-dark h1, .kkc-theme-dark h2, .kkc-theme-dark h3,
.kkc-theme-dark h4, .kkc-theme-dark h5, .kkc-theme-dark h6 {
    color: #fff;
}
.kkc-theme-light, .kkc-theme-light p, .kkc-theme-light li {
    color: var(--text-medium);
}
.kkc-theme-light a:not(.kkc-btn) { color: var(--text-medium); }
.kkc-theme-light h1, .kkc-theme-light h2, .kkc-theme-light h3,
.kkc-theme-light h4, .kkc-theme-light h5, .kkc-theme-light h6 {
    color: var(--text-dark);
}



/* ── Divi 5 block-render layout fixes ─────────────────────────────────────
   Content pushed via $wpdb->update() (see Bug 1, deployment_prompt.md) skips
   the save-time pass that normally generates per-column flex/grid CSS and
   section positioning, so these three things never make it into the page's
   dynamic stylesheet on their own. Supplied here as base theme CSS instead. */

/* Sections need a positioning context or absolutely-positioned decoration
   divs (e.g. .kkc-hero-bg) escape their section and lay out against the
   page root instead. */
.et_pb_section { position: relative; }

/* Header and footer are now native Divi Theme Builder layouts (et_header_layout
   post 197 / et_footer_layout — see functions.php). Divi's own classic #main-header/
   #main-footer (theme's header.php/footer.php default markup, independent of the
   Theme Builder override) still gets built in some request paths — kept hidden as a
   safety net so it can never visually duplicate the Theme Builder version, same as
   when this rule was guarding against the old static-HTML-partial approach (Bug 4,
   deployment_prompt.md Phase 13). */
#main-header { display: none !important; }
#page-container { padding-top: 0 !important; }
#main-footer { display: none !important; }

/* Theme Builder header: reproduce the original static header's sticky/shadow
   chrome at the wrapper Divi renders around et_header_layout content. */
.et_pb_section_1_tb_heade {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #fff;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
}

/* Rows: constrain to a centered content column instead of true 100% width.
   Column widths/gutters themselves come from Divi's own gutters3.css + the
   float:left below — this is just the outer row's max-width, same as the
   .container convention used elsewhere on classic (non-block) Divi content. */
.et_pb_row.et_block_row {
    width: 80%;
    max-width: 1080px;
    margin-left: auto;
    margin-right: auto;
}

/* Base column rule from Divi's own style-static.min.css (not enqueued on
   this build — see the enqueue block in functions.php for why) — restoring
   just this one declaration rather than loading the whole static bundle. */
.et_pb_column {
    float: left;
    position: relative;
    z-index: 2;
    min-height: 1px;
}

/* ── Equal-height blurb-grid cards ─────────────────────────────────────────
   Matches the equal-height card behavior set by hand in the Visual Builder
   on the homepage's "Three Focused Areas of Care" row — but applied as our
   own presentational CSS on top of the stable float-based .et_block_row,
   instead of Divi's own layout:{display:"flex"} JSON attribute. That JSON
   attribute switches Divi's PHP renderer to its et_flex_row code path,
   which we confirmed (via a live test push + Divi's own changelog noting
   still-active flex-row bugs) drops the blurb icon glyph entirely — a
   Divi 5 bug, not a missing attribute on our end. This approach never
   touches that JSON, so Divi keeps rendering et_block_row/et_pb_column_1_3
   as normal (icons + gutters3.css widths keep working) and only the visual
   stretch is added, scoped to rows that actually contain a blurb card so
   ordinary 2-col text/photo sections keep their natural content height. */
.et_pb_row.et_block_row:has(.et_pb_blurb) {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
}
.et_pb_row.et_block_row:has(.et_pb_blurb) > .et_pb_column {
    display: flex;
    flex-direction: column;
}
.et_pb_row.et_block_row:has(.et_pb_blurb) > .et_pb_column > .et_pb_blurb {
    flex: 1;
}

/* ── Eyebrow / hero / section heading utility classes ────────────────────── */
.kkc-eyebrow {
    display: inline-block;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--accent-safe);
    margin-bottom: 14px;
}
.kkc-hero-h1 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: clamp(2.5rem, 5vw + 1rem, 5.5rem);
    line-height: 1.05;
    letter-spacing: -0.03em;
    color: #ffffff;
    margin: 0 0 24px;
}
.kkc-hero-h1 .word { display: inline-block; opacity: 0; transform: translateY(100%);
    animation: kkc-word-up .7s cubic-bezier(.16,1,.3,1) forwards; padding-right: none;}
.kkc-accent { color: var(--accent); }
.kkc-section-h2 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: clamp(2rem, 3vw + 1rem, 3.2rem);
    letter-spacing: -0.02em;
    line-height: 1.15;
}
.kkc-body-measure { max-width: 68ch; line-height: 1.7; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.kkc-btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 16px 32px; border-radius: 4px;
    font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: .92rem;
    letter-spacing: .04em; text-decoration: none; white-space: nowrap; flex-shrink: 0;
    transition: transform .3s cubic-bezier(.16,1,.3,1), box-shadow .3s cubic-bezier(.16,1,.3,1), background .3s ease, color .3s ease;
}
.kkc-btn-primary { background: var(--accent-safe); color: #fff; }
.kkc-btn-primary:hover { transform: translateY(-3px); box-shadow: 0 14px 28px -8px rgba(255,144,2,.55); background: var(--accent-safe-dark); color:#fff; }
.kkc-btn-outline {
    position: relative; overflow: hidden; z-index: 1;
    border: 1.5px solid rgba(255,255,255,.5); color: #fff; background: transparent;
    transition: color .35s ease, border-color .35s ease;
}
.kkc-btn-outline-light {
    position: relative; overflow: hidden; z-index: 1;
    border: 1.5px solid rgba(0, 0, 0, 0.85); color: #000; background: transparent;
    transition: color .35s ease, border-color .35s ease;
}
.kkc-btn-outline::before, .kkc-btn-outline-light::before  {
    content: ''; position: absolute; inset: 0; background: var(--accent-safe);
    transform: scaleX(0); transform-origin: left; z-index: -1;
    transition: transform .35s cubic-bezier(.16,1,.3,1);
}
.kkc-btn-outline:hover, .kkc-btn-outline-light:hover  { color: #fff; border-color: var(--accent-safe); }
.kkc-btn-outline:hover::before, .kkc-btn-outline-light:hover::before { transform: scaleX(1); }
.kkc-hero-btns { display: flex; gap: 18px; flex-wrap: wrap; }

/* ── Header logo + CTA ───────────────────────────────────────────────────
   These lived only in the old partials/header.html's own inline <style>
   block (retired along with the wp_body_open partial-injection hook — see
   HANDOFF.md, "Rebuild header/footer as native Divi Theme Builder
   templates") — carried forward here so the Theme Builder header keeps the
   same look now that its content has nowhere else to source them from. */
.kkc-logo {
    font-family: 'Montserrat', sans-serif; font-weight: 800; font-size: 1.2rem;
    color: var(--text-dark); text-decoration: none; letter-spacing: -0.01em;
}
.kkc-logo span { color: var(--accent); }
.kkc-header-cta { display: flex; align-items: center; gap: 18px; flex-shrink: 0; }
.kkc-header-phone {
    font-family: 'Montserrat', sans-serif; font-weight: 700; color: var(--text-dark);
    text-decoration: none; font-size: .92rem;
}

/* ── Hero gradient-mesh background (Phase 16) ────────────────────────────── */
.kkc-hero-bg {
    background:
        radial-gradient(ellipse 60% 50% at 20% 20%, rgba(255,144,2,.35) 0%, transparent 60%),
        radial-gradient(ellipse 50% 40% at 80% 70%, rgba(255,184,77,.22) 0%, transparent 60%),
        radial-gradient(ellipse 70% 60% at 50% 100%, rgba(51,51,51,.5) 0%, transparent 65%),
        #000000;
    background-size: 200% 200%;
    animation: kkc-aurora 18s ease-in-out infinite;
}

/* ── Dark-section glow overlay ────────────────────────────────────────────
   Content pushed via $wpdb->update() drops any advanced.htmlAttributes
   className set on the wp:divi/section block (confirmed: never renders),
   so dark sections can't be targeted by a class on the section itself.
   Instead, build_pages.py's dark_glow_placeholder() drops this div in as
   the section's first child (same pattern as .kkc-hero-bg) and it's
   positioned via .et_pb_section's now-relative containing block. */
.kkc-dark-glow {
    background-image:
        radial-gradient(ellipse 80% 55% at 50% -5%, rgba(255,144,2,.13) 0%, transparent 65%),
        radial-gradient(ellipse 45% 35% at 95% 100%, rgba(255,184,77,.08) 0%, transparent 60%);
}

/* ── Cards / blurbs — lift on hover ──────────────────────────────────────── */
.et_pb_blurb, .kkc-trust-card, .kkc-service-card {
    transition: transform .35s cubic-bezier(.16,1,.3,1), box-shadow .35s cubic-bezier(.16,1,.3,1);
    box-shadow: 0 2px 8px rgba(0,0,0,.06), 0 20px 40px -12px rgba(0,0,0,.10);
}
.et_pb_blurb:hover, .kkc-trust-card:hover, .kkc-service-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 2px 8px rgba(0,0,0,.08), 0 24px 48px -12px rgba(0,0,0,.22);
}

/* ── Animated underline links ────────────────────────────────────────────── */
.kkc-link-underline { position: relative; text-decoration: none; }
.kkc-link-underline::after {
    content: ''; position: absolute; left: 0; bottom: -2px; width: 100%; height: 1.5px;
    background: currentColor; transform: scaleX(0); transform-origin: right;
    transition: transform .35s cubic-bezier(.16,1,.3,1);
}
.kkc-link-underline:hover::after { transform: scaleX(1); transform-origin: left; }

/* ── Stat band / count-up ────────────────────────────────────────────────── */
.kkc-stat { text-align: center; padding: 20px; }
.kkc-stat-num { font-family:'Montserrat',sans-serif; font-weight:800; font-size: 3rem; color: var(--accent); display:block; }
.kkc-stat-label { font-size: .82rem; letter-spacing:.08em; text-transform:uppercase; color: rgba(255,255,255,.75); margin-top: 5%;}

/* ── Pill links (nearby-area, service tags) ──────────────────────────────── */
.kkc-pill {
    display: inline-block; padding: 8px 18px; margin: 4px; border-radius: 999px;
    border: 1.5px solid rgba(0,0,0,.12); color: var(--text-dark); text-decoration: none;
    font-size: .85rem; font-weight: 600; transition: background .3s ease, color .3s ease, border-color .3s ease;
}
.kkc-pill:hover { background: var(--accent-safe); border-color: var(--accent-safe); color: #fff; }

/* ── FAQ accordion ────────────────────────────────────────────────────────── */
.kkc-faq-item { border-bottom: 1px solid rgba(0,0,0,.1); }
.kkc-faq-q {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 22px 4px; cursor: pointer; font-family:'Montserrat',sans-serif; font-weight:700;
    color: var(--text-dark);
}
.kkc-faq-q:focus-visible { outline: 2px solid var(--text-dark); outline-offset: 2px; border-radius: 4px; }
.kkc-faq-q::after {
    content: '+'; font-size: 1.6rem; font-weight: 400; color: var(--accent);
    transition: transform .3s ease; flex-shrink: 0;
}
.kkc-faq-item.is-open .kkc-faq-q::after { transform: rotate(45deg); }
.kkc-faq-a { max-height: 0; overflow: hidden; transition: max-height .35s cubic-bezier(.16,1,.3,1); }
.kkc-faq-item.is-open .kkc-faq-a { max-height: 400px; }
.kkc-faq-a p { padding: 0 4px 22px; margin: 0; }

/* ── Marquee (trust / cert strip) ────────────────────────────────────────── */
.kkc-marquee { overflow: hidden; -webkit-mask-image: linear-gradient(90deg,transparent,#000 10%,#000 90%,transparent); mask-image: linear-gradient(90deg,transparent,#000 10%,#000 90%,transparent); }
.kkc-marquee-track { display: flex; gap: 64px; width: max-content; animation: kkc-marquee 26s linear infinite; align-items: center; }
.kkc-marquee:hover .kkc-marquee-track { animation-play-state: paused; }
.kkc-marquee-track span {color:#000000 !important;}
/* ── Before/after slider ─────────────────────────────────────────────────── */
.kkc-ba-slider { position: relative; overflow: hidden; border-radius: 12px; --pos: 50%; }
.kkc-ba-before-wrap { position: absolute; inset: 0; width: var(--pos); overflow: hidden; }
.kkc-ba-before { width: 100vw; max-width: none; }
.kkc-ba-range { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: ew-resize; }

/* ── Scroll reveal ────────────────────────────────────────────────────────── */
.kkc-reveal { opacity: 0; transform: translateY(28px);
    transition: opacity .65s cubic-bezier(.16,1,.3,1), transform .65s cubic-bezier(.16,1,.3,1); }
.kkc-reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ── Mobile sticky CTA bar ───────────────────────────────────────────────── */
.kkc-mobile-cta {
    display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 9999;
    background: #000000; padding: 12px 16px; gap: 12px;
    box-shadow: 0 -4px 20px rgba(0,0,0,.25);
}
.kkc-mobile-cta a { flex: 1; text-align: center; padding: 12px; border-radius: 4px; font-weight: 700; text-decoration: none; font-family:'Montserrat',sans-serif; font-size: .85rem; }
.kkc-mobile-cta a:first-child { color: #fff; display: flex; align-items: center; justify-content: center; gap: 8px; }
.kkc-mcta-btn { background: var(--accent-safe); color: #fff !important; }
@media (max-width: 767px) { .kkc-mobile-cta { display: flex; } }

/* ── Ninja Forms restyle ──────────────────────────────────────────────────── */
.nf-form-cont { border-radius: 16px; box-shadow: 0 2px 8px rgba(0,0,0,.06), 0 20px 48px -12px rgba(0,0,0,.16); padding: 40px 36px; position: relative; overflow: hidden; background:#fff; }
.nf-field-label label { font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--text-dark); }
.nf-field-element input, .nf-field-element textarea, .nf-field-element select {
    border: 1.5px solid #DDE6EF; border-radius: 8px; padding: 14px 16px;
    transition: border-color .2s, box-shadow .2s;
}
.nf-field-element input:focus, .nf-field-element textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(255,144,2,.14); outline: none; }
.nf-field-element input[type="submit"] {
    width: 100%; background: var(--accent-safe); color: #fff; font-weight: 700; border: none;
    border-radius: 4px; padding: 16px; transition: background .3s ease, transform .3s ease;
}
.nf-field-element input[type="submit"]:hover { background: var(--accent-safe-dark); transform: translateY(-2px); }
.nf-error .nf-field-element input { border-color: #E53E3E; box-shadow: 0 0 0 3px rgba(229,62,62,.12); }

/* ── Keyframes ────────────────────────────────────────────────────────────── */
@keyframes kkc-fade-up   { from{opacity:0;transform:translateY(28px)} to{opacity:1;transform:translateY(0)} }
@keyframes kkc-word-up   { to { opacity:1; transform:translateY(0); } }
@keyframes kkc-aurora    { 0%{background-position:0% 50%} 50%{background-position:100% 50%} 100%{background-position:0% 50%} }
@keyframes kkc-marquee   { from{transform:translateX(0)} to{transform:translateX(-50%)} }
@keyframes kkc-float     { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-7px)} }

/* ── Reduced motion guard ────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
.fa.fa-info-circle.nf-help {margin-right: 15px !important;}

/* ── Blog post content (single.php's .kkc-blog-content wrapper) ─────────────
   Blog posts (`*-blog-post_content.txt`) use their own kkc-blog-* classes
   instead of the sitewide kkc-section-h2/kkc-body-measure/kkc-link-underline/
   kkc-btn classes, so blog typography/CTA styling can be edited here without
   touching any other page's styling. Values below currently mirror the
   sitewide classes 1:1 (no visual change on introduction) — edit freely. */
.kkc-blog-h2 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: clamp(2rem, 3vw + 1rem, 3.2rem);
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin-top: 5% !important;
}
.kkc-blog-body { max-width: 100%; line-height: 1.7; }
ul.kkc-blog-body {
    list-style: none;
    margin: 20px 0 28px;
    padding: 0;
}
ul.kkc-blog-body li {
    position: relative;
    padding-left: 30px;
    margin-bottom: 16px;
}
ul.kkc-blog-body li:last-child { margin-bottom: 0; }
ul.kkc-blog-body li::before {
    content: '';
    position: absolute;
    left: 2px;
    top: .65em;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--accent-safe);
}
.kkc-blog-link { position: relative; text-decoration: none; }
.kkc-blog-link::after {
    content: ''; position: absolute; left: 0; bottom: -2px; width: 100%; height: 1.5px;
    background: currentColor; transform: scaleX(0); transform-origin: right;
    transition: transform .35s cubic-bezier(.16,1,.3,1);
}
.kkc-blog-link:hover::after { transform: scaleX(1); transform-origin: left; }
.kkc-blog-btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 16px 32px; border-radius: 4px;
    font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: .92rem;
    letter-spacing: .04em; text-decoration: none; white-space: nowrap; flex-shrink: 0;
    transition: transform .3s cubic-bezier(.16,1,.3,1), box-shadow .3s cubic-bezier(.16,1,.3,1), background .3s ease, color .3s ease;
}
.kkc-blog-btn-primary { background: var(--accent-safe); color: #fff; }
.kkc-blog-btn-primary:hover { transform: translateY(-3px); box-shadow: 0 14px 28px -8px rgba(255,144,2,.55); background: var(--accent-safe-dark); color:#fff; }
.kkc-blog-cta { margin-top: 32px; padding: 28px; background: #FFF6EC; border-radius: 12px; text-align: center; }
.kkc-blog-cta-text { margin: 0 0 16px; max-width: none; line-height: 1.7; }