/**
 * Kirby & Co Realty Group — Main Stylesheet
 *
 * Design system extracted from the approved HTML mockup.
 * Navy/gold/cream palette · Playfair Display + DM Sans typography
 *
 * @package KirbyRealty
 * @since 1.0.0
 */

/* ============================================
   RESET & VARIABLES
   ============================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: 'DM Sans', sans-serif;
    color: #2A2A2A;
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
    background: #FFFEFB;
}
ul { list-style: none; }
a { text-decoration: none; }
img { max-width: 100%; height: auto; }

/* Skip Link */
.khp-skip-link {
    position: absolute; top: -100px; left: 16px; z-index: 9999;
    background: var(--kbrand-dark, #1A3E73); color: #fff;
    padding: 12px 24px; border-radius: 0 0 6px 6px;
    font-weight: 600; font-size: 14px;
    transition: top 0.2s;
}
.khp-skip-link:focus { top: 0; outline: 3px solid #F3CA66; outline-offset: 2px; }

/* Global focus indicator (WCAG 2.1 AA) */
*:focus-visible {
    outline: 3px solid #25649D;
    outline-offset: 2px;
}
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
    outline: 3px solid #25649D;
    outline-offset: 2px;
}

:root {
    --kbrand-dark: #1A3E73;
    --kbrand-light: #25649D;
    --kbrand-gold: #F3CA66;
    --knavy: #142F58;
    --kblue-mid: #1F5288;
    --kblue-soft: #6B9DC5;
    --kblue-pale: #E3EDF5;
    --kblue-wash: #F2F6FA;
    --kgold: #D4A83A;
    --kgold-dark: #8A6B0F;
    --kgold-pale: #FBF3DC;
    --kblack: #1A1A1A;
    --kcream: #FDFBF7;
    --kwarm-white: #FFFEFB;
    --ktext: #2A2A2A;
    --ktext-light: #6E6E6E;
    --klight-gray: #E5E2DD;
}

/* ============================================
   CONTAINER
   ============================================ */
.khp-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ============================================
   COMMON ELEMENTS
   ============================================ */
.khp-eyebrow {
    display: block;
    font-size: 12px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--kgold-dark);
    font-weight: 700;
    margin-bottom: 12px;
}
.khp-section-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(28px, 3vw, 40px);
    font-weight: 700;
    color: var(--kbrand-dark);
    line-height: 1.2;
    margin-bottom: 16px;
}
.khp-section-title i {
    font-family: 'Playfair Display', serif;
    font-style: italic;
}
.khp-section-sub {
    font-size: 16px;
    color: var(--ktext-light);
    line-height: 1.7;
    max-width: 560px;
}
.khp-section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 48px;
}
.khp-view-all {
    font-size: 14px;
    font-weight: 600;
    color: var(--kbrand-dark);
    display: flex;
    align-items: center;
    gap: 6px;
    transition: gap 0.3s;
    white-space: nowrap;
}
.khp-view-all:hover { gap: 12px; }

/* Buttons */
.khp-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    font-family: 'DM Sans', sans-serif;
    transition: all 0.3s;
    cursor: pointer;
    border: none;
}
.khp-btn-gold { background: var(--kbrand-gold); color: var(--knavy); }
.khp-btn-gold:hover { background: #D4A83A; transform: translateY(-2px); box-shadow: 0 8px 25px rgba(243,202,102,0.35); color: var(--knavy); }
.khp-btn-outline { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,0.35); }
.khp-btn-outline:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.6); color: #fff; }
.khp-btn-blue { background: var(--kbrand-dark); color: #fff; }
.khp-btn-blue:hover { background: var(--knavy); transform: translateY(-2px); box-shadow: 0 8px 25px rgba(26,62,115,0.35); color: #fff; }
.khp-btn-white { background: #fff; color: var(--kbrand-dark); }
.khp-btn-white:hover { background: var(--kcream); transform: translateY(-2px); box-shadow: 0 8px 25px rgba(0,0,0,0.15); color: var(--kbrand-dark); }

/* Fade animation */
.khp-fade { opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease, transform 0.6s ease; }
.khp-fade.khp-visible { opacity: 1; transform: translateY(0); }

/* Editor-only empty-state notice (only rendered for logged-in editors) */
.khp-admin-notice { grid-column: 1 / -1; padding: 24px 28px; border: 1px dashed var(--kbrand-light); border-radius: 8px; background: var(--kblue-wash); color: var(--ktext); font-size: 14px; line-height: 1.5; }
.khp-admin-notice strong { display: block; margin-bottom: 4px; color: var(--kbrand-dark); font-family: 'Playfair Display', serif; font-size: 16px; }
.khp-admin-notice a { color: var(--kbrand-light); font-weight: 600; text-decoration: underline; }

/* ============================================
   TOP BAR
   ============================================ */
.khp-top-bar { background: var(--kblack); padding: 8px 0; }
.khp-top-bar .khp-container { display: flex; justify-content: space-between; align-items: center; }
/* Audit 2026-05-07: tap-target padding so the top-bar links clear the WCAG 2.5.8 AA
   minimum of 24×24 CSS pixels. Vertical padding 8px raises the hit-box height
   from ~21px to ~36px without shifting the visual layout. */
.khp-top-bar a { color: rgba(255,255,255,0.75); font-size: 13px; transition: color 0.3s; padding: 8px 4px; display: inline-block; line-height: 1; }
.khp-top-bar a:hover { color: var(--kbrand-gold); }
.khp-top-right { display: flex; gap: 20px; }

/* ============================================
   NAV
   ============================================ */
.khp-nav {
    background: var(--kwarm-white);
    padding: 14px 0;
    position: sticky;
    top: 0;
    z-index: 900;
    border-bottom: 1px solid var(--klight-gray);
    transition: box-shadow 0.3s;
}
.khp-nav.khp-scrolled { box-shadow: 0 2px 20px rgba(0,0,0,0.06); }
.khp-nav .khp-container { display: flex; justify-content: space-between; align-items: center; }
.khp-logo-text { font-family: 'Playfair Display', serif; font-size: 22px; font-weight: 700; color: var(--kbrand-dark); }
.khp-logo-img { height: 52px; width: auto; }
.khp-nav-links { display: flex; gap: 28px; align-items: center; }
/* Audit 2026-05-07: bring nav link hit-boxes to ≥24px tall (WCAG 2.5.8 AA).
   16px vertical padding gives ~46px effective tap height while keeping the
   visual line in line with the brand mark. */
.khp-nav-links a { color: var(--ktext); font-size: 14px; font-weight: 500; position: relative; transition: color 0.3s; padding: 16px 0; display: inline-block; line-height: 1; }
.khp-nav-links a::after { content: ''; position: absolute; bottom: 8px; left: 0; width: 0; height: 2px; background: var(--kbrand-dark); transition: width 0.3s; }
.khp-nav-links a:hover { color: var(--kbrand-dark); }
.khp-nav-links a:hover::after { width: 100%; }
.khp-nav-cta { background: var(--kbrand-gold) !important; color: var(--kbrand-dark) !important; padding: 10px 24px !important; border-radius: 6px; font-weight: 700 !important; box-shadow: 0 2px 8px rgba(193, 154, 107, 0.25); }
.khp-nav-cta::after { display: none !important; }
.khp-nav-cta:hover { background: #b08a5f !important; color: var(--kbrand-dark) !important; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(193, 154, 107, 0.35); }

/* Nav dropdowns — render only when a top-level item has children. */
.khp-nav-item { position: relative; display: inline-flex; align-items: center; }
.khp-nav-caret { margin-left: 4px; font-size: 10px; color: var(--ktext-light); transition: transform 0.2s; display: inline-block; }
.khp-nav-has-children:hover > a > .khp-nav-caret,
.khp-nav-has-children:focus-within > a > .khp-nav-caret { transform: rotate(180deg); }
.khp-submenu { position: absolute; top: calc(100% + 12px); left: 0; min-width: 220px; padding: 10px 0; background: #fff; border: 1px solid var(--klight-gray); border-top: 3px solid var(--kbrand-gold); border-radius: 6px; box-shadow: 0 18px 40px rgba(20,47,88,0.12); list-style: none; margin: 0; opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity 0.18s, transform 0.18s, visibility 0s linear 0.18s; z-index: 100; }
.khp-nav-has-children:hover > .khp-submenu,
.khp-nav-has-children:focus-within > .khp-submenu { opacity: 1; visibility: visible; transform: translateY(0); transition-delay: 0s; }
.khp-submenu-item { margin: 0; position: relative; }
.khp-submenu-item a { display: block; padding: 10px 18px; font-size: 14px; color: var(--ktext); white-space: nowrap; }
.khp-submenu-item a::after { display: none; }
.khp-submenu-item a:hover { background: var(--kblue-wash); color: var(--kbrand-dark); }
/* A small invisible bridge so the dropdown stays open when crossing the gap */
.khp-nav-has-children::after { content: ''; position: absolute; left: 0; right: 0; top: 100%; height: 12px; }

/* 2nd-level submenus (depth 2) — fly out to the LEFT of the parent <li>.
   The walker tags any submenu <li> that itself has children with
   .khp-submenu-has-children, and emits a sideways caret. */
.khp-submenu-has-children > a { padding-left: 28px; position: relative; }
.khp-submenu-caret { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 10px; color: var(--ktext-light); transition: color 0.2s; }
.khp-submenu-has-children:hover > a .khp-submenu-caret,
.khp-submenu-has-children:focus-within > a .khp-submenu-caret { color: var(--kbrand-gold); }
.khp-submenu .khp-submenu { top: -10px; left: auto; right: 100%; margin-right: 4px; transform: translateX(6px); }
.khp-submenu-has-children:hover > .khp-submenu,
.khp-submenu-has-children:focus-within > .khp-submenu { opacity: 1; visibility: visible; transform: translateX(0); transition-delay: 0s; }
/* Hover bridge for the gap between parent <li> and nested submenu */
.khp-submenu-has-children::after { content: ''; position: absolute; right: 100%; top: 0; bottom: 0; width: 8px; }

/* Mobile toggle */
.khp-mobile-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.khp-mobile-toggle span { display: block; width: 24px; height: 2px; background: var(--ktext); margin: 5px 0; transition: all 0.3s; }
.khp-toggle-active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.khp-toggle-active span:nth-child(2) { opacity: 0; }
.khp-toggle-active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ============================================
   HERO
   ============================================ */
.khp-hero { position: relative; min-height: 90vh; display: flex; align-items: center; overflow: hidden; background: var(--knavy); }
.khp-hero-media { position: absolute; inset: 0; z-index: 0; }
.khp-hero-media img { width: 100%; height: 100%; object-fit: cover; }
/* Two stacked layers: a strong left-side gradient that keeps the headline readable
   regardless of the photo, plus a subtle right-side darken so the search card has
   contrast against bright skies. */
.khp-hero-overlay { position: absolute; inset: 0; background: linear-gradient(100deg, rgba(20,47,88,0.96) 0%, rgba(20,47,88,0.82) 35%, rgba(20,47,88,0.55) 65%, rgba(20,47,88,0.78) 100%); z-index: 1; }
.khp-hero-overlay::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 25% 45%, rgba(0,0,0,0.25) 0%, transparent 60%); pointer-events: none; }
.khp-hero-grid { position: relative; z-index: 2; display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 60px; align-items: center; padding: 60px 0; }
.khp-hero .khp-container { position: relative; z-index: 2; }
.khp-hero-content { color: #fff; }
.khp-hero-badge { display: inline-flex; align-items: center; gap: 8px; background: rgba(243,202,102,0.1); backdrop-filter: blur(10px); border: 1px solid rgba(243,202,102,0.25); padding: 8px 18px; border-radius: 100px; font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--kbrand-gold); margin-bottom: 28px; animation: khpFadeUp 0.8s ease both; }
.khp-hero-badge::before { content: ''; width: 6px; height: 6px; background: var(--kbrand-gold); border-radius: 50%; }
.khp-hero h1 { font-family: 'Playfair Display', serif; font-size: clamp(38px, 4.5vw, 60px); font-weight: 700; line-height: 1.08; margin-bottom: 24px; color: #fff; animation: khpFadeUp 0.8s 0.15s ease both; }
.khp-hero h1 em { font-style: italic; color: var(--kbrand-gold); }
.khp-hero-tagline { font-family: 'Playfair Display', serif; font-style: italic; font-size: 16px; color: var(--kbrand-gold); margin-bottom: 16px; animation: khpFadeUp 0.8s 0.22s ease both; letter-spacing: 0.02em; }
.khp-hero-sub { font-size: 17px; line-height: 1.7; color: rgba(255,255,255,0.8); max-width: 500px; margin-bottom: 36px; animation: khpFadeUp 0.8s 0.3s ease both; }
.khp-hero-buttons { display: flex; gap: 16px; animation: khpFadeUp 0.8s 0.45s ease both; }

/* Search Card */
.khp-search-card { background: rgba(255,255,253,0.97); border-radius: 14px; padding: 36px; box-shadow: 0 25px 60px rgba(0,0,0,0.25); animation: khpFadeUp 0.8s 0.3s ease both; border-top: 4px solid var(--kbrand-gold); }
.khp-search-title { font-family: 'Playfair Display', serif; font-size: 22px; font-weight: 600; color: var(--kbrand-dark); margin-bottom: 4px; }
.khp-search-sub { font-size: 14px; color: var(--ktext-light); margin-bottom: 24px; }

/* IMPress IDX Omnibar overrides — IMPress renders bare label/input pairs;
   these rules turn that into a stacked, branded form that matches the rest
   of the search card. */
.khp-search-card .idx-omnibar-form { display: flex; flex-wrap: wrap; gap: 14px; margin: 0; }
.khp-search-card .idx-omnibar-form > .awesomplete,
.khp-search-card .idx-omnibar-form .idx-omnibar-extra { flex: 1 1 calc(50% - 7px); min-width: 0; display: flex; flex-direction: column; gap: 6px; margin: 0; }
.khp-search-card .idx-omnibar-form > .awesomplete { flex-basis: 100%; position: relative; }
.khp-search-card .idx-omnibar-form label:not(.screen-reader-text):not(.visually-hidden) {
    display: block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--kbrand-dark);
    margin: 0;
}
.khp-search-card .idx-omnibar-form input[type="text"],
.khp-search-card .idx-omnibar-form input[type="number"],
.khp-search-card .idx-omnibar-form input[type="email"],
.khp-search-card .idx-omnibar-form select {
    width: 100%;
    padding: 11px 14px;
    font-size: 14px;
    font-family: inherit;
    color: var(--ktext);
    background: #fff;
    border: 1px solid var(--klight-gray);
    border-radius: 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-shadow: none;
    appearance: none;
    -webkit-appearance: none;
}
.khp-search-card .idx-omnibar-form input:focus,
.khp-search-card .idx-omnibar-form select:focus {
    outline: none;
    border-color: var(--kbrand-light);
    box-shadow: 0 0 0 3px rgba(37,100,157,0.12);
}
.khp-search-card .idx-omnibar-form .idx-omnibar-input { font-size: 15px; padding: 13px 16px; }
.khp-search-card .idx-omnibar-form button[type="submit"],
.khp-search-card .idx-omnibar-form input[type="submit"],
.khp-search-card .idx-omnibar-form .idx-omnibar-submit {
    flex: 1 1 100%;
    margin-top: 4px;
    padding: 13px 18px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    background: var(--kbrand-dark);
    color: #fff;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}
.khp-search-card .idx-omnibar-form button[type="submit"]:hover,
.khp-search-card .idx-omnibar-form input[type="submit"]:hover { background: var(--knavy); transform: translateY(-1px); }
/* Awesomplete autocomplete dropdown */
.khp-search-card .awesomplete > ul { position: absolute; left: 0; right: 0; top: 100%; margin: 4px 0 0; background: #fff; border: 1px solid var(--klight-gray); border-radius: 8px; box-shadow: 0 12px 28px rgba(20,47,88,0.12); list-style: none; padding: 4px 0; z-index: 50; }
.khp-search-card .awesomplete > ul li { padding: 8px 14px; font-size: 14px; cursor: pointer; }
.khp-search-card .awesomplete > ul li:hover,
.khp-search-card .awesomplete > ul li[aria-selected="true"] { background: var(--kblue-wash); color: var(--kbrand-dark); }
.khp-search-field { margin-bottom: 14px; }
.khp-search-field label { display: block; font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--kbrand-dark); margin-bottom: 5px; }
.khp-search-field input,
.khp-search-field select { width: 100%; padding: 12px 16px; border: 1.5px solid var(--klight-gray); border-radius: 6px; font-family: 'DM Sans', sans-serif; font-size: 15px; color: var(--ktext); background: #fff; transition: border-color 0.3s; -webkit-appearance: none; appearance: none; }
.khp-search-field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%236E6E6E' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
.khp-search-field input:focus,
.khp-search-field select:focus { border-color: var(--kbrand-light); }
.khp-search-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.khp-search-btn { width: 100%; padding: 14px; background: var(--kbrand-dark); color: #fff; border: none; border-radius: 6px; font-family: 'DM Sans', sans-serif; font-size: 15px; font-weight: 600; cursor: pointer; transition: all 0.3s; margin-top: 8px; }
.khp-search-btn:hover { background: var(--knavy); transform: translateY(-1px); }
.khp-quick-links { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.khp-quick-links a { font-size: 12px; color: var(--kbrand-dark); padding: 4px 12px; border: 1px solid var(--kblue-pale); border-radius: 100px; background: var(--kblue-wash); transition: all 0.2s; }
.khp-quick-links a:hover { background: var(--kbrand-dark); color: #fff; border-color: var(--kbrand-dark); }

/* IDX Compatibility Note */
.khp-idx-note { margin-top: 16px; padding: 12px 16px; background: var(--kgold-pale); border: 1px solid rgba(212,168,58,0.3); border-radius: 8px; font-size: 12px; color: var(--ktext); line-height: 1.6; }
.khp-idx-note strong { color: var(--kbrand-dark); }
.khp-idx-note code { background: rgba(26,62,115,0.08); padding: 1px 5px; border-radius: 3px; font-size: 11px; }
.khp-idx-placeholder { text-align: center; padding: 40px; font-size: 14px; color: var(--ktext-light); background: var(--kblue-wash); border-radius: 8px; }

/* ============================================
   TAGLINE BAR
   ============================================ */
.khp-tagline { background: var(--kbrand-dark); padding: 18px 0; text-align: center; }
.khp-tagline span { font-family: 'Playfair Display', serif; font-size: 14px; letter-spacing: 6px; text-transform: uppercase; color: var(--kbrand-gold); }

/* ============================================
   DREAM HOME CTAs
   ============================================ */
.khp-dream-ctas { background: var(--kblack); }
.khp-dream-grid { display: grid; grid-template-columns: repeat(3, 1fr); }
.khp-dream-card { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 44px 28px; background: var(--kblack); text-align: center; border-right: 1px solid rgba(255,255,255,0.06); transition: all 0.3s; color: inherit; }
.khp-dream-card:last-child { border-right: none; }
.khp-dream-card:hover { background: #222; }
.khp-dream-card:hover .khp-dream-arrow { opacity: 1; transform: translateY(0); }
.khp-dream-icon svg { width: 40px; height: 40px; stroke: var(--kbrand-gold); stroke-width: 1.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.khp-dream-text { display: flex; flex-direction: column; align-items: center; }
.khp-dream-label { font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: rgba(255,255,255,0.65); line-height: 1.4; }
.khp-dream-headline { font-family: 'Playfair Display', serif; font-size: 22px; font-weight: 700; color: var(--kbrand-gold); line-height: 1.2; }
.khp-dream-arrow { font-size: 18px; color: var(--kbrand-gold); opacity: 0; transform: translateY(-6px); transition: all 0.3s; }

/* ============================================
   FEATURED LISTINGS
   ============================================ */
.khp-featured { padding: 80px 0 100px; background: var(--kwarm-white); }
.khp-listing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.khp-listing-card { background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 2px 12px rgba(26,62,115,0.08); transition: transform 0.3s, box-shadow 0.3s; text-decoration: none; color: inherit; display: block; }
.khp-listing-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(26,62,115,0.14); }
.khp-listing-img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.khp-listing-img-wrap { position: relative; }
.khp-listing-body { padding: 16px 20px 20px; }
.khp-listing-price { font-family: 'Playfair Display', Georgia, serif; font-size: 22px; font-weight: 700; color: var(--kgold); margin-bottom: 4px; }
.khp-listing-address { font-size: 14px; font-weight: 600; color: var(--kbrand-dark); margin-bottom: 2px; line-height: 1.3; }
.khp-listing-city { font-size: 13px; color: var(--ktext-light); margin-bottom: 10px; }
.khp-listing-details { display: flex; gap: 14px; font-size: 13px; color: var(--ktext); flex-wrap: wrap; }
.khp-listing-details span { white-space: nowrap; }
.khp-listing-badge { position: absolute; top: 12px; left: 12px; background: var(--kbrand-dark); color: #fff; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; padding: 4px 10px; border-radius: 4px; }

/* ============================================
   VALUE PROPS
   ============================================ */
.khp-values { padding: 100px 0; background: var(--kblue-wash); }
.khp-values-header { text-align: center; margin-bottom: 60px; }
.khp-values-header .khp-section-sub { margin: 0 auto; }
.khp-values-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.khp-value-card { background: var(--kblack); border-radius: 12px; padding: 40px 32px; border: 1px solid rgba(255,255,255,0.06); transition: all 0.4s; position: relative; overflow: hidden; }
.khp-value-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--kbrand-gold); transform: scaleX(0); transition: transform 0.4s; transform-origin: left; }
.khp-value-card:hover { transform: translateY(-4px); box-shadow: 0 15px 40px rgba(0,0,0,0.2); }
.khp-value-card:hover::before { transform: scaleX(1); }
.khp-value-icon { margin-bottom: 24px; }
.khp-value-icon svg { width: 42px; height: 42px; stroke: var(--kbrand-gold); stroke-width: 1.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.khp-value-card h3 { font-family: 'Playfair Display', serif; font-size: 20px; font-weight: 600; color: #fff; margin-bottom: 12px; }
.khp-value-card p { font-size: 15px; line-height: 1.7; color: rgba(255,255,255,0.6); }

/* ============================================
   CUSTOM HOMES
   ============================================ */
.khp-custom-homes { padding: 100px 0; background: var(--kwarm-white); }
.khp-custom-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.khp-custom-visual { position: relative; }
.khp-custom-img { border-radius: 12px; overflow: hidden; box-shadow: 0 20px 50px rgba(0,0,0,0.12); }
.khp-custom-img img { width: 100%; height: auto; display: block; border-radius: 12px; }

/* On the Our Team page, align each member's photo with the top of their bio
   instead of vertically centering against the (much taller) text column. */
.page-template-page-team .khp-custom-grid { align-items: start; }
.page-template-page-team .khp-custom-visual { position: sticky; top: 24px; align-self: start; }
.khp-custom-placeholder { width: 100%; aspect-ratio: 4/3; background: linear-gradient(135deg, var(--kbrand-light), var(--kbrand-dark)); border-radius: 12px; }
.khp-custom-badge { position: absolute; bottom: -16px; right: -16px; background: var(--kbrand-dark); color: #fff; padding: 20px 28px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,0.2); }
.khp-custom-badge-num { font-family: 'Playfair Display', serif; font-size: 28px; font-weight: 700; color: var(--kbrand-gold); line-height: 1; }
.khp-custom-badge-txt { font-size: 12px; color: rgba(255,255,255,0.6); margin-top: 4px; }
.khp-custom-content h2 { font-family: 'Playfair Display', serif; font-size: clamp(28px,3vw,38px); font-weight: 700; color: var(--kbrand-dark); line-height: 1.2; margin-bottom: 20px; }
.khp-custom-content h2 i { font-style: italic; color: var(--kbrand-light); }
.khp-custom-content > p { font-size: 16px; line-height: 1.8; color: var(--ktext-light); margin-bottom: 16px; }
.khp-gallery-strip { display: flex; gap: 8px; margin: 28px 0; }
.khp-gallery-strip img { width: 25%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; transition: transform 0.3s, box-shadow 0.3s; cursor: pointer; }
.khp-gallery-strip img:hover { transform: scale(1.04); box-shadow: 0 8px 20px rgba(0,0,0,0.12); }

/* ============================================
   COMMUNITIES
   ============================================ */
.khp-communities { padding: 100px 0; background: var(--kcream); }
.khp-communities-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.khp-community-card { border-radius: 10px; overflow: hidden; position: relative; display: block; transition: transform 0.4s; }
.khp-community-card:hover { transform: translateY(-4px); }
.khp-community-card:nth-child(1),
.khp-community-card:nth-child(2) { grid-column: span 2; }
.khp-community-img { width: 100%; aspect-ratio: 16/10; background-size: cover; background-position: center; }
.khp-community-card:nth-child(1) .khp-community-img,
.khp-community-card:nth-child(2) .khp-community-img { aspect-ratio: 16/9; }
.khp-community-overlay { position: absolute; bottom: 0; left: 0; right: 0; padding: 24px; background: linear-gradient(transparent, rgba(0,0,0,0.75)); color: #fff; }
.khp-community-name { font-family: 'Playfair Display', serif; font-size: 20px; font-weight: 600; margin-bottom: 4px; }
.khp-community-meta { font-size: 13px; opacity: 0.8; }
.khp-community-meta span { color: var(--kbrand-gold); }

/* ============================================
   HEROES BANNER
   ============================================ */
.khp-heroes-banner { padding: 80px 0; position: relative; overflow: hidden; }
.khp-heroes-bg { position: absolute; inset: 0; z-index: 0; }
.khp-heroes-bg img { width: 100%; height: 100%; object-fit: cover; }
.khp-heroes-bg-overlay { position: absolute; inset: 0; background: linear-gradient(135deg, rgba(20,47,88,0.92) 0%, rgba(20,47,88,0.82) 50%, rgba(26,62,115,0.88) 100%); }
.khp-heroes-banner::before { content: ''; position: absolute; top: -50%; right: -10%; width: 500px; height: 500px; background: radial-gradient(circle, rgba(243,202,102,0.08) 0%, transparent 70%); z-index: 1; }
.khp-heroes-inner { position: relative; z-index: 2; }
.khp-heroes-content { max-width: 620px; }
.khp-heroes-logo { height: 60px; width: auto; margin-bottom: 20px; display: block; }
.khp-heroes-badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 16px; border-radius: 100px; background: rgba(243,202,102,0.1); border: 1px solid rgba(243,202,102,0.25); font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--kbrand-gold); margin-bottom: 20px; }
.khp-heroes-content h2 { font-family: 'Playfair Display', serif; font-size: clamp(24px,2.8vw,34px); font-weight: 700; color: #fff; line-height: 1.2; margin-bottom: 16px; }
.khp-heroes-content p { font-size: 16px; line-height: 1.7; color: rgba(255,255,255,0.65); margin-bottom: 28px; }
.khp-heroes-tags { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 28px; }
.khp-heroes-tags span { padding: 6px 16px; border-radius: 100px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); color: rgba(255,255,255,0.75); font-size: 13px; }

/* ============================================
   TESTIMONIALS
   ============================================ */
.khp-testimonials { padding: 100px 0; background: var(--kwarm-white); }
.khp-testimonials-grid {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-padding: 0 24px;
    -webkit-overflow-scrolling: touch;
    /* Bleed slightly past the container so cards can scroll edge-to-edge */
    padding: 8px 4px 24px;
    margin: 0 -4px;
    scrollbar-color: var(--kbrand-light) var(--kblue-wash);
    scrollbar-width: thin;
}
.khp-testimonials-grid::-webkit-scrollbar { height: 8px; }
.khp-testimonials-grid::-webkit-scrollbar-track { background: var(--kblue-wash); border-radius: 4px; }
.khp-testimonials-grid::-webkit-scrollbar-thumb { background: var(--kbrand-light); border-radius: 4px; }
.khp-testimonials-grid::-webkit-scrollbar-thumb:hover { background: var(--kbrand-dark); }
.khp-testimonial-card {
    flex: 0 0 360px;
    max-width: 360px;
    scroll-snap-align: start;
    background: var(--kblue-wash);
    border-radius: 12px;
    padding: 36px;
    border: 1px solid var(--kblue-pale);
    position: relative;
}
.khp-tquote { position: absolute; top: 16px; right: 28px; font-family: 'Playfair Display', serif; font-size: 64px; color: var(--kbrand-light); opacity: 0.12; line-height: 1; }
.khp-tstars { color: var(--kbrand-gold); font-size: 15px; letter-spacing: 2px; margin-bottom: 16px; }
.khp-ttext { font-size: 15px; line-height: 1.8; color: var(--ktext-light); font-style: italic; margin-bottom: 20px; }
.khp-tauthor { font-size: 14px; font-weight: 600; color: var(--kbrand-dark); }
.khp-tauthor a { color: inherit; text-decoration: none; border-bottom: 1px solid transparent; transition: border-color 0.2s; }
.khp-tauthor a:hover { border-bottom-color: var(--kbrand-light); }
.khp-tmeta { margin-top: 4px; font-size: 12px; color: var(--ktext-light); letter-spacing: 0.2px; }
.khp-testimonial-cta { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; background: var(--kbrand-dark); color: #fff; text-decoration: none; transition: transform 0.25s, box-shadow 0.25s; }
.khp-testimonial-cta:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(26,62,115,0.18); }
.khp-testimonial-cta .khp-tstars { color: var(--kbrand-gold); margin-bottom: 18px; }
.khp-tcta-title { font-family: 'Playfair Display', serif; font-size: 22px; line-height: 1.25; margin-bottom: 10px; color: #fff; }
.khp-tcta-sub { font-size: 14px; line-height: 1.6; color: rgba(255,255,255,0.78); margin: 0 0 20px; }
.khp-tcta-link { font-size: 13px; font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase; color: var(--kbrand-gold); }

/* Generic IDX CTA card (used by kirby_idx_valuation / kirby_idx_calculator). */
.khp-idx-cta-card { padding: 32px; border-radius: 12px; background: var(--kblue-wash); border: 1px solid var(--kblue-pale); border-top: 4px solid var(--kbrand-gold); }
.khp-idx-cta-card h3 { font-family: 'Playfair Display', serif; font-size: 22px; color: var(--kbrand-dark); margin: 0 0 8px; }
.khp-idx-cta-card p { color: var(--ktext-light); margin: 0 0 20px; }

/* Featured Properties fallback — drives traffic to the live IDX feed
   when no on-page listings are available. */
.khp-listings-cta { display: grid; grid-template-columns: 1.6fr 1fr; gap: 32px; align-items: center; padding: 36px; background: var(--kblue-wash); border: 1px solid var(--kblue-pale); border-top: 4px solid var(--kbrand-gold); border-radius: 12px; }
.khp-listings-cta .khp-eyebrow { display: block; margin-bottom: 8px; }
.khp-listings-cta h3 { font-family: 'Playfair Display', serif; font-size: clamp(22px, 2.4vw, 28px); color: var(--kbrand-dark); line-height: 1.25; margin: 0 0 12px; }
.khp-listings-cta p { color: var(--ktext-light); margin: 0; line-height: 1.6; }
.khp-listings-cta-buttons { display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
.khp-listings-cta-buttons .khp-btn { justify-content: center; text-align: center; }
@media (max-width: 768px) {
    .khp-listings-cta { grid-template-columns: 1fr; padding: 28px; }
}

/* ============================================
   TEAM
   ============================================ */
.khp-team { padding: 100px 0; background: var(--kcream); }
.khp-team-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: center; }
.khp-team-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.khp-team-card { border-radius: 10px; overflow: hidden; transition: transform 0.3s; display: block; }
.khp-team-card:hover { transform: translateY(-4px); }
.khp-team-photo { width: 100%; aspect-ratio: 3/4; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding-bottom: 20px; background-size: cover; background-position: center top; }
.khp-team-info { text-align: center; }
.khp-team-name { font-family: 'Playfair Display', serif; font-size: 15px; color: #fff; font-weight: 600; margin-bottom: 2px; text-shadow: 0 1px 6px rgba(0,0,0,0.5); }
.khp-team-role { font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; color: rgba(255,255,255,0.85); text-shadow: 0 1px 4px rgba(0,0,0,0.5); }
.khp-team-content .khp-section-sub { margin-bottom: 16px; }
.khp-team-content p { font-size: 15px; line-height: 1.8; color: var(--ktext-light); margin-bottom: 28px; }

/* ============================================
   AREA CTA
   ============================================ */
.khp-area-cta { padding: 80px 0; text-align: center; background: var(--kbrand-light); position: relative; overflow: hidden; }
.khp-area-cta-bg { position: absolute; inset: 0; z-index: 0; }
.khp-area-cta-bg img { width: 100%; height: 100%; object-fit: cover; opacity: 0.12; mix-blend-mode: luminosity; }
.khp-area-cta .khp-container { position: relative; z-index: 1; }
.khp-area-cta h2 { font-family: 'Playfair Display', serif; font-size: clamp(28px,3vw,40px); color: #fff; margin-bottom: 16px; }
.khp-area-cta p { font-size: 17px; color: rgba(255,255,255,0.92); max-width: 600px; margin: 0 auto 32px; line-height: 1.7; }

/* ============================================
   AREA MAP (community + city + relocation pages)
   ============================================ */
.khp-area-map-section { padding: 60px 0; background: var(--kwarm-white); }
.khp-area-map-section + .khp-area-map-section { padding-top: 0; }
.khp-area-map-header { text-align: center; max-width: 720px; margin: 0 auto 32px; }
.khp-area-map-header .khp-eyebrow { display: block; margin-bottom: 8px; color: var(--kbrand-gold); }
.khp-area-map-header .khp-section-sub { font-size: 15px; line-height: 1.7; color: var(--ktext-light); margin-top: 12px; }
.khp-area-map { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; box-shadow: 0 8px 28px rgba(20, 47, 88, 0.12); border: 1px solid var(--kblue-pale); background: var(--kblue-wash); }
.khp-area-map iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
@media (max-width: 600px) {
    .khp-area-map { aspect-ratio: 4 / 3; border-radius: 8px; }
    .khp-area-map-section { padding: 40px 0; }
}

/* ============================================
   DATA TABLES (answer-first content blocks)
   Used in pillar pages, community pages, blog posts
   for comparison tables and quick-fact lists.
   ============================================ */
.khp-post-content .khp-data-table,
.khp-data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-size: 15px;
    line-height: 1.6;
    background: var(--kwarm-white);
    border: 1px solid var(--kblue-pale);
    border-radius: 8px;
    overflow: hidden;
}
.khp-data-table thead th {
    background: var(--kbrand-dark);
    color: #fff;
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    font-size: 14px;
    text-align: left;
    padding: 14px 16px;
    border-bottom: 2px solid var(--kbrand-gold);
}
.khp-data-table tbody th[scope="row"] {
    background: var(--kblue-wash);
    color: var(--kbrand-dark);
    font-weight: 600;
    text-align: left;
    width: 38%;
    padding: 12px 16px;
    border-bottom: 1px solid var(--kblue-pale);
}
.khp-data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--kblue-pale);
    color: var(--ktext);
    vertical-align: top;
}
.khp-data-table tr:last-child td,
.khp-data-table tr:last-child th { border-bottom: none; }
.khp-data-table tbody tr:nth-child(even) td { background: rgba(232, 238, 245, 0.35); }
.khp-data-table a { color: var(--kbrand-light); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.khp-data-table a:hover { color: var(--kbrand-dark); }

/* Lead paragraph treatment for answer-first content. The first <p> in a post
   leads with the AEO answer; we set it apart so the eye lands there first. */
.khp-post-content > p:first-of-type {
    font-size: 19px;
    line-height: 1.75;
    color: var(--kbrand-dark);
    margin-bottom: 48px;
    padding: 28px 32px;
    background: linear-gradient(135deg, var(--kblue-wash) 0%, rgba(232,238,245,0.3) 100%);
    border-left: 4px solid var(--kbrand-gold);
    border-radius: 0 8px 8px 0;
}
.khp-post-content > p:first-of-type strong { color: var(--kbrand-dark); font-weight: 700; }

/* H2 sections get a clear visual break: gold accent bar + top border + bigger
   top margin so the eye registers each new section. Without this, long pillar
   pages read as a single wall of text. */
.khp-post-content > h2 {
    position: relative;
    margin-top: 72px;
    padding-top: 28px;
    border-top: 1px solid var(--kblue-pale);
    font-size: clamp(24px, 2.5vw, 32px);
}
.khp-post-content > h2::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 0;
    width: 64px;
    height: 4px;
    background: var(--kbrand-gold);
    border-radius: 2px;
}
.khp-post-content > h2:first-of-type { margin-top: 56px; }

/* H3 questions tighten with their answer; bigger size to read as headings.
   Scoped to direct children only so cards (featured-comm, listing-agent,
   testimonials) keep their own scoped H3 styling. */
.khp-post-content > h3 { font-size: 19px; letter-spacing: -0.01em; margin-top: 32px; }
.khp-post-content > h3 + p { margin-top: 4px; }

/* Tighten H2 spacing when followed immediately by a data table or map. */
.khp-post-content h2 + .khp-data-table { margin-top: 16px; }
.khp-post-content h2 + .khp-area-map-section { margin-top: 0; }

/* Data tables in pillar content get a card feel (shadow + lift) so the eye
   lands on them as visual anchors between text blocks. */
.khp-post-content > .khp-data-table {
    box-shadow: 0 8px 24px rgba(20, 47, 88, 0.10);
    margin: 32px 0 40px;
}

/* Ordered list (process steps) gets stronger visual treatment - numbered
   pillar pages run long lists, and styled markers guide the reader through. */
.khp-post-content > ol {
    counter-reset: kirby-step;
    list-style: none;
    margin-left: 0;
    padding-left: 0;
}
.khp-post-content > ol > li {
    counter-increment: kirby-step;
    position: relative;
    padding: 16px 16px 16px 64px;
    margin-bottom: 12px;
    background: var(--kwarm-white);
    border: 1px solid var(--kblue-pale);
    border-radius: 8px;
    list-style: none;
}
.khp-post-content > ol > li::before {
    content: counter(kirby-step);
    position: absolute;
    left: 16px;
    top: 16px;
    width: 36px;
    height: 36px;
    line-height: 36px;
    text-align: center;
    background: var(--kbrand-dark);
    color: var(--kbrand-gold);
    border-radius: 50%;
    font-family: 'Playfair Display', serif;
    font-size: 16px;
    font-weight: 700;
}

/* Inline figures (photos in body content) get more lift and breathing room. */
.khp-post-content > figure {
    margin: 40px 0;
}
.khp-post-content > figure img {
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(20, 47, 88, 0.14);
    width: 100%;
    height: auto;
    display: block;
    margin: 0;
}

/* Featured communities grid inside post content goes 2-up so cards don't
   crush at the 800px content max-width. */
.khp-post-content > .khp-featured-comms-grid {
    grid-template-columns: repeat(2, 1fr);
    margin: 32px 0 40px;
}
@media (max-width: 540px) {
    .khp-post-content > .khp-featured-comms-grid { grid-template-columns: 1fr; }
}

/* Marketing gallery + listing-agent-grid inside .khp-post-content already
   render at full content width; just ensure they have generous spacing. */
.khp-post-content > .khp-marketing-gallery { margin: 24px 0 48px; }
.khp-post-content > .khp-listing-agent-grid {
    margin: 48px 0;
    padding: 32px;
    background: var(--kblue-wash);
    border-radius: 12px;
    grid-template-columns: 220px 1fr;
    gap: 32px;
}
.khp-post-content > .khp-listing-agent-grid h3 {
    margin-top: 0;
}
.khp-post-content > .khp-listing-agent-grid h3::before {
    content: none;
}

/* Pull-quote callout for high-density key sentences. Apply with
   <p class="khp-pullquote">...</p> in v2 content. */
.khp-post-content .khp-pullquote {
    font-family: 'Playfair Display', serif;
    font-size: 22px;
    line-height: 1.5;
    color: var(--kbrand-dark);
    font-style: italic;
    border-left: 4px solid var(--kbrand-gold);
    padding: 8px 0 8px 28px;
    margin: 40px 0;
}

@media (max-width: 700px) {
    .khp-post-content > .khp-listing-agent-grid {
        grid-template-columns: 1fr;
        padding: 24px;
    }
    .khp-post-content > ol > li { padding-left: 56px; }
    .khp-post-content > ol > li::before { width: 30px; height: 30px; line-height: 30px; font-size: 14px; }
}

/* Buttons in body content get a little breathing room. */
.khp-post-content p .khp-btn { margin: 4px 8px 4px 0; display: inline-block; }

/* Testimonial blockquote variant for the /testimonials/ page.
   Inherits the gold-left + blue-wash blockquote base; just refines
   the cite (attribution) line so it reads as caption, not body. */
.khp-post-content .khp-testimonial-quote { margin: 24px 0; }
.khp-post-content .khp-testimonial-quote p { font-size: 16px; line-height: 1.7; }
.khp-post-content .khp-testimonial-quote cite {
    display: block;
    margin-top: 14px;
    font-style: normal;
    font-size: 13px;
    letter-spacing: 0.02em;
    color: var(--kbrand-light);
    font-weight: 600;
}
.khp-post-content .khp-testimonial-quote cite a {
    color: inherit;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

/* ============================================
   CARD GRID RESETS inside .khp-post-content
   The legacy post-content rules add margin to every img and underline +
   brand-color to every <a>. Without these resets, images inside cards get
   32px of internal margin pushing them around, and entire card links get
   underlined and colored. Reset for known card patterns.
   ============================================ */
.khp-post-content .khp-featured-comm,
.khp-post-content .khp-featured-comm:hover {
    text-decoration: none;
    color: inherit;
}
.khp-post-content .khp-featured-comm img,
.khp-post-content .khp-mg-item img,
.khp-post-content .khp-listing-agent-photo img,
.khp-post-content .khp-team-photo img {
    margin: 0;
    border-radius: 0;
    box-shadow: none;
}
.khp-post-content .khp-featured-comm-body h3 {
    margin-top: 0;
    margin-bottom: 4px;
    padding-top: 0;
    border-top: none;
    font-size: 18px;
    line-height: 1.25;
}
.khp-post-content .khp-featured-comm-body h3::before {
    content: none;
}
.khp-post-content .khp-featured-comm-body p {
    font-size: 13px;
    line-height: 1.5;
    color: var(--ktext-light);
    margin: 0;
}

/* ============================================
   STAT ROW (Buying + Selling pages)
   Four-up row of headline stats. Used to convey
   credibility quickly without requiring photos.
   ============================================ */
.khp-statrow { padding: 50px 0; background: var(--kbrand-dark); color: #fff; }
.khp-statrow-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    text-align: center;
}
.khp-stat { padding: 8px 12px; }
.khp-stat-num {
    display: block;
    font-family: 'Playfair Display', serif;
    font-size: clamp(28px, 3vw, 40px);
    font-weight: 700;
    color: var(--kbrand-gold);
    line-height: 1.1;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}
.khp-stat-label {
    display: block;
    font-size: 13px;
    line-height: 1.5;
    color: rgba(255,255,255,0.85);
    letter-spacing: 0.01em;
}
@media (max-width: 800px) {
    .khp-statrow-grid { grid-template-columns: repeat(2, 1fr); gap: 32px 16px; }
}
@media (max-width: 460px) {
    .khp-statrow-grid { grid-template-columns: 1fr; gap: 28px; }
}

/* ============================================
   TEAM GRID (Buying page "Meet Your Buying Team")
   Three-up team cards with circular headshots.
   ============================================ */
.page-template-page-team .khp-team-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    margin-top: 12px;
}
.page-template-page-team .khp-team-card {
    background: var(--kwarm-white);
    border: 1px solid var(--kblue-pale);
    border-radius: 12px;
    padding: 36px 28px 32px;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
}
.page-template-page-team .khp-team-card:hover { transform: translateY(-4px); box-shadow: 0 12px 30px rgba(20,47,88,0.10); }
.page-template-page-team .khp-team-photo {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 20px;
    box-shadow: 0 6px 20px rgba(20,47,88,0.15);
    border: 3px solid var(--kbrand-gold);
}
.page-template-page-team .khp-team-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.page-template-page-team .khp-team-card h3 {
    font-family: 'Playfair Display', serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--kbrand-dark);
    margin: 0 0 6px;
}
.page-template-page-team .khp-team-role {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--kbrand-gold);
    font-weight: 600;
    margin: 0 0 14px;
}
.page-template-page-team .khp-team-creds {
    font-size: 14px;
    line-height: 1.6;
    color: var(--ktext-light);
    margin: 0;
}
@media (max-width: 900px) { .page-template-page-team .khp-team-grid { grid-template-columns: 1fr; max-width: 420px; margin: 0 auto; } }

/* ============================================
   FEATURED COMMUNITIES GRID (Buying page)
   Four-up image cards linking to community pages.
   ============================================ */
.khp-featured-comms-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 12px;
}
.khp-featured-comm {
    display: flex;
    flex-direction: column;
    background: var(--kwarm-white);
    border: 1px solid var(--kblue-pale);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s, box-shadow 0.3s;
    height: 100%;
}
.khp-featured-comm:hover { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(20,47,88,0.12); }
.khp-featured-comm img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
    flex-shrink: 0;
}
.khp-featured-comm-body {
    padding: 16px 18px 20px;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}
.khp-featured-comm-body h3 {
    font-family: 'Playfair Display', serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--kbrand-dark);
    margin: 0 0 4px;
    line-height: 1.25;
}
.khp-featured-comm-body p { font-size: 13px; color: var(--ktext-light); margin: 0; line-height: 1.5; }
.khp-featured-comms-grid { align-items: stretch; }
@media (max-width: 900px) { .khp-featured-comms-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .khp-featured-comms-grid { grid-template-columns: 1fr; max-width: 360px; margin: 0 auto; } }

/* ============================================
   MARKETING GALLERY (Selling page)
   Mixed grid: one large hero photo + four supporting.
   ============================================ */
.khp-marketing-gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 180px;
    gap: 12px;
    margin-top: 12px;
}
.khp-mg-item { margin: 0; overflow: hidden; border-radius: 10px; box-shadow: 0 4px 14px rgba(20,47,88,0.10); }
.khp-mg-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.4s; }
.khp-mg-item:hover img { transform: scale(1.04); }
.khp-mg-large { grid-column: span 2; grid-row: span 2; }
@media (max-width: 800px) {
    .khp-marketing-gallery { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 160px; }
    .khp-mg-large { grid-column: span 2; grid-row: span 1; }
}

/* ============================================
   COMPARE TABLE (Selling page Kirby vs FSBO vs Other)
   Extends the .khp-data-table base with checkmark colors.
   ============================================ */
.khp-compare-table th { text-align: center; }
.khp-compare-table td { text-align: center; vertical-align: middle; }
.khp-compare-table td:first-child { text-align: left; font-weight: 500; color: var(--kbrand-dark); }
.khp-compare-table .khp-yes { color: #1f7a4f; font-weight: 700; font-size: 18px; }
.khp-compare-table .khp-no { color: #b13c3c; font-weight: 600; font-size: 14px; }

/* ============================================
   LISTING AGENT CARD (Selling page Stephanie callout)
   ============================================ */
.khp-listing-agent-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 48px;
    align-items: center;
    max-width: 980px;
    margin: 0 auto;
}
.khp-listing-agent-photo {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 12px 32px rgba(20,47,88,0.18);
    border: 4px solid var(--kbrand-gold);
}
.khp-listing-agent-photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; display: block; }
.khp-listing-agent-body h2 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(28px, 3vw, 36px);
    color: var(--kbrand-dark);
    margin: 8px 0 12px;
    line-height: 1.2;
}
.khp-listing-agent-role {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--kbrand-gold);
    font-weight: 600;
    margin: 0 0 20px;
}
.khp-listing-agent-body p { font-size: 16px; line-height: 1.8; color: var(--ktext); margin: 0 0 14px; }
@media (max-width: 800px) {
    .khp-listing-agent-grid { grid-template-columns: 1fr; gap: 28px; max-width: 460px; }
    .khp-listing-agent-photo { max-width: 280px; margin: 0 auto; }
}

/* Strip the article link underline from buttons - they're not text links. */
.khp-post-content a.khp-btn,
.khp-post-content a.khp-btn:hover { text-decoration: none; }
.khp-post-content a.khp-btn-blue,
.khp-post-content a.khp-btn-blue:hover { color: #fff; }

/* The default .khp-btn-outline is styled for the dark hero CTA (white text on
   translucent white border) which is invisible on the warm-white body content
   background. Re-skin it for the light context. */
.khp-post-content a.khp-btn-outline {
    background: transparent;
    color: var(--kbrand-dark);
    border: 1.5px solid var(--kbrand-dark);
}
.khp-post-content a.khp-btn-outline:hover {
    background: var(--kbrand-dark);
    color: #fff;
    border-color: var(--kbrand-dark);
}

@media (max-width: 700px) {
    .khp-data-table { font-size: 14px; }
    .khp-data-table thead th,
    .khp-data-table tbody th[scope="row"],
    .khp-data-table td { padding: 10px 12px; }
    /* Allow horizontal scroll on narrow screens for comparison tables. */
    .khp-post-content .khp-data-table { display: block; overflow-x: auto; white-space: nowrap; }
    .khp-post-content .khp-data-table tbody th[scope="row"],
    .khp-post-content .khp-data-table td { white-space: normal; }
}

/* ============================================
   BLOG
   ============================================ */
.khp-blog { padding: 100px 0; background: var(--kblue-wash); }
.khp-blog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.khp-blog-card { background: var(--kwarm-white); border-radius: 12px; overflow: hidden; border: 1px solid var(--klight-gray); transition: all 0.3s; display: block; color: inherit; }
.khp-blog-card:hover { transform: translateY(-4px); box-shadow: 0 12px 30px rgba(0,0,0,0.06); }
/* 1:1 so the same Instagram graphic works as the blog hero. */
.khp-blog-img { width: 100%; aspect-ratio: 1/1; background-size: cover; background-position: center; }
.khp-blog-body { padding: 24px; }
.khp-blog-tag { display: inline-block; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--kbrand-light); font-weight: 700; margin-bottom: 10px; }
.khp-blog-title { font-family: 'Playfair Display', serif; font-size: 18px; font-weight: 600; color: var(--kbrand-dark); line-height: 1.3; margin-bottom: 10px; }
.khp-blog-excerpt { font-size: 14px; line-height: 1.7; color: var(--ktext-light); }

/* ============================================
   ABOUT ENTITY (SEO)
   ============================================ */
.khp-about-entity { padding: 80px 0; background: var(--kcream); text-align: center; }
.khp-about-entity .khp-container { max-width: 900px; }
.khp-entity-text { font-size: 17px; line-height: 1.9; color: var(--ktext-light); margin-top: 20px; }
.khp-entity-text strong { color: var(--ktext); }

/* ============================================
   FAQ
   ============================================ */
.khp-faq { padding: 100px 0; background: var(--kwarm-white); }
.khp-faq-container { max-width: 800px; }
.khp-faq-list { display: flex; flex-direction: column; }
.khp-faq-item { border-bottom: 1px solid var(--klight-gray); }
.khp-faq-q { width: 100%; background: none; border: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; padding: 24px 0; font-family: 'DM Sans', sans-serif; font-size: 16px; font-weight: 600; color: var(--kbrand-dark); text-align: left; transition: color 0.3s; }
.khp-faq-q:hover { color: var(--kbrand-light); }
.khp-faq-toggle { font-size: 22px; color: var(--kbrand-gold); transition: transform 0.3s; flex-shrink: 0; margin-left: 16px; font-weight: 300; }
.khp-faq-item.khp-active .khp-faq-toggle { transform: rotate(45deg); }
.khp-faq-a { max-height: 0; overflow: hidden; transition: max-height 0.4s ease, padding 0.4s ease; font-size: 15px; line-height: 1.8; color: var(--ktext-light); }
.khp-faq-item.khp-active .khp-faq-a { max-height: 300px; padding-bottom: 24px; }

/* ============================================
   AREAS SERVED TAGS
   ============================================ */
.khp-areas-served { padding: 60px 0 80px; background: var(--kwarm-white); border-top: 1px solid var(--klight-gray); }
.khp-area-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; max-width: 900px; margin: 0 auto; }
.khp-area-tag { display: inline-block; padding: 8px 18px; border-radius: 100px; background: var(--kblue-wash); border: 1px solid var(--kblue-pale); font-size: 13px; color: var(--kbrand-dark); font-weight: 500; transition: all 0.2s; }
.khp-area-tag:hover { background: var(--kbrand-dark); color: #fff; border-color: var(--kbrand-dark); }

/* ============================================
   FOOTER
   ============================================ */
.khp-footer { background: var(--kblack); color: rgba(255,255,255,0.65); }
.khp-footer-accent { height: 3px; background: linear-gradient(90deg, var(--kbrand-gold), var(--kbrand-dark), var(--kbrand-gold)); }
.khp-footer .khp-container { padding-top: 72px; padding-bottom: 0; }

/* Top row: 3 nav columns */
.khp-footer-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px; margin-bottom: 56px; }
.khp-footer h3 { font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--kbrand-gold); margin: 0 0 18px; font-weight: 700; }
.khp-footer ul { list-style: none; margin: 0; padding: 0; }
.khp-footer li { margin-bottom: 10px; }
.khp-footer li a { color: rgba(255,255,255,0.65); font-size: 14px; transition: color 0.3s; }
.khp-footer li a:hover { color: #fff; }

/* Brand band — sits below the columns to fill the dead space */
.khp-footer-brand-band { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; align-items: center; padding: 36px 0; border-top: 1px solid rgba(255,255,255,0.08); border-bottom: 1px solid rgba(255,255,255,0.08); margin-bottom: 0; }
.khp-footer-logo { height: 56px; width: auto; margin-bottom: 14px; display: block; }
.khp-footer-wordmark { color: #fff; display: block; margin-bottom: 14px; font-size: 24px; }
.khp-footer-tagline { font-family: 'Playfair Display', serif; font-style: italic; font-size: 16px; color: var(--kbrand-gold); margin: 0 0 14px; max-width: 480px; line-height: 1.4; }
.khp-footer-nap { font-size: 13px; color: rgba(255,255,255,0.55); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.khp-footer-nap-sep { color: rgba(255,255,255,0.25); }
.khp-footer-trec { margin-top: 16px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,0.06); display: flex; flex-direction: column; gap: 4px; font-size: 12px; line-height: 1.5; color: rgba(255,255,255,0.55); letter-spacing: 0.2px; }
.khp-footer-trec-line { display: block; }
.khp-footer-phone { font-family: 'Playfair Display', serif; font-size: 18px; color: #fff; transition: color 0.3s; }
.khp-footer-phone:hover { color: var(--kbrand-gold); }
.khp-footer-brand-right { text-align: right; }
.khp-footer-partners-label { display: block; font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: rgba(255,255,255,0.45); margin-bottom: 12px; }
.khp-footer-partners { display: flex; gap: 24px; align-items: center; justify-content: flex-end; }
.khp-partner-logo { height: 34px; width: auto; opacity: 0.6; transition: opacity 0.3s; }
.khp-partner-logo:hover { opacity: 1; }

/* Social media row in footer brand band */
.khp-footer-social { list-style: none; margin: 0; padding: 0; display: flex; gap: 12px; justify-content: flex-end; }
.khp-footer-social li { margin: 0; }
.khp-footer-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.7);
    transition: background 0.2s, color 0.2s, transform 0.2s;
}
.khp-footer-social a:hover { background: var(--kbrand-gold); color: var(--knavy); transform: translateY(-2px); }
.khp-footer-social svg { width: 18px; height: 18px; display: block; }

/* Legal row + site credit */
.khp-footer-bottom { padding: 22px 0 8px; display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: rgba(255,255,255,0.6); flex-wrap: wrap; gap: 12px; }
.khp-footer-legal a { color: rgba(255,255,255,0.6); margin-left: 20px; transition: color 0.3s; }
.khp-footer-legal a:hover { color: rgba(255,255,255,0.9); }
.khp-footer-credit { padding: 10px 0 24px; font-size: 11px; letter-spacing: 0.5px; color: rgba(255,255,255,0.42); text-align: center; border-top: 1px solid rgba(255,255,255,0.05); margin-top: 8px; }
.khp-footer-credit a { color: rgba(255,255,255,0.65); transition: color 0.3s; }
.khp-footer-credit a:hover { color: var(--kbrand-gold); }

/* ============================================
   WORDPRESS SPECIFIC
   ============================================ */

/* Pagination */
.nav-links { display: flex; justify-content: center; gap: 8px; }
.nav-links a,
.nav-links span { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; padding: 0 12px; border-radius: 6px; font-size: 14px; font-weight: 600; transition: all 0.3s; }
.nav-links a { color: var(--kbrand-dark); background: var(--kblue-wash); border: 1px solid var(--kblue-pale); }
.nav-links a:hover { background: var(--kbrand-dark); color: #fff; }
.nav-links .current { background: var(--kbrand-dark); color: #fff; }

/* WP Default alignments */
.alignleft { float: left; margin: 0 24px 24px 0; }
.alignright { float: right; margin: 0 0 24px 24px; }
.aligncenter { display: block; margin: 24px auto; }
.alignwide { max-width: 1200px; margin-left: auto; margin-right: auto; }
.alignfull { width: 100%; max-width: 100%; }

/* Screen reader text */
.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
    word-wrap: normal !important;
}
.screen-reader-text:focus {
    clip: auto !important;
    display: block;
    height: auto;
    left: 5px;
    top: 5px;
    width: auto;
    z-index: 100000;
    background: #fff;
    padding: 15px 23px 14px;
    font-size: 14px;
    font-weight: 600;
}

/* Single post content */
.khp-post-content { max-width: 800px; margin: 0 auto; padding: 60px 24px 100px; }
.khp-post-content h1 { font-family: 'Playfair Display', serif; font-size: clamp(28px,3.5vw,42px); font-weight: 700; color: var(--kbrand-dark); line-height: 1.2; margin-bottom: 16px; }
.khp-post-content h2 { font-family: 'Playfair Display', serif; font-size: clamp(22px,2.5vw,30px); font-weight: 700; color: var(--kbrand-dark); line-height: 1.3; margin: 48px 0 16px; }
.khp-post-content h3 { font-family: 'Playfair Display', serif; font-size: 20px; font-weight: 600; color: var(--kbrand-dark); margin: 36px 0 12px; }
.khp-post-content p { font-size: 17px; line-height: 1.9; color: var(--ktext); margin-bottom: 24px; }
.khp-post-content ul,
.khp-post-content ol { margin: 0 0 24px 28px; }
.khp-post-content li { font-size: 17px; line-height: 1.9; color: var(--ktext); margin-bottom: 8px; list-style: disc; }
.khp-post-content ol li { list-style: decimal; }
.khp-post-content img { border-radius: 10px; margin: 32px 0; }
.khp-post-content blockquote { border-left: 4px solid var(--kbrand-gold); padding: 20px 28px; margin: 32px 0; background: var(--kblue-wash); border-radius: 0 8px 8px 0; }
.khp-post-content blockquote p { font-style: italic; color: var(--kbrand-dark); margin-bottom: 0; }
.khp-post-content a { color: var(--kbrand-light); text-decoration: underline; text-underline-offset: 2px; transition: color 0.3s; }
.khp-post-content a:hover { color: var(--kbrand-dark); }

/* Author bio card on single posts (E-E-A-T visible signal). */
.khp-author-bio { padding: 56px 0; background: var(--kblue-wash); border-top: 1px solid var(--kblue-pale); border-bottom: 1px solid var(--kblue-pale); }
.khp-author-bio-inner { display: grid; grid-template-columns: 180px 1fr; gap: 32px; align-items: start; max-width: 800px; margin: 0 auto; }
.khp-author-bio-photo { width: 180px; height: 180px; border-radius: 50%; background-size: cover; background-position: center; box-shadow: 0 12px 30px rgba(20,47,88,0.12); flex-shrink: 0; }
.khp-author-bio-body .khp-eyebrow { display: block; margin-bottom: 8px; }
.khp-author-bio-name { font-family: 'Playfair Display', serif; font-size: 28px; font-weight: 700; color: var(--kbrand-dark); margin: 0 0 4px; line-height: 1.2; }
.khp-author-bio-name a { color: inherit; text-decoration: none; }
.khp-author-bio-name a:hover { color: var(--kbrand-light); }
.khp-author-bio-role { font-size: 14px; color: var(--ktext-light); font-style: italic; margin: 0 0 16px; }
.khp-author-bio-text { font-size: 15px; line-height: 1.7; color: var(--ktext); margin: 0 0 20px; }
@media (max-width: 768px) {
    .khp-author-bio-inner { grid-template-columns: 1fr; text-align: center; }
    .khp-author-bio-photo { margin: 0 auto; width: 140px; height: 140px; }
}

/* Post meta */
.khp-post-meta { display: flex; gap: 16px; align-items: center; font-size: 14px; color: var(--ktext-light); margin-bottom: 32px; padding-bottom: 24px; border-bottom: 1px solid var(--klight-gray); }

/* Page template base */
.khp-page-hero { padding: 60px 0 80px; background: var(--knavy); text-align: center; }
.khp-page-hero h1 { font-family: 'Playfair Display', serif; font-size: clamp(32px,4vw,48px); font-weight: 700; color: #fff; margin-bottom: 16px; }
.khp-page-hero p { font-size: 17px; color: rgba(255,255,255,0.75); max-width: 600px; margin: 0 auto; line-height: 1.7; }

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes khpFadeUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .khp-hero-grid { grid-template-columns: 1fr; gap: 40px; }
    .khp-search-card { max-width: 500px; }
    .khp-custom-grid,
    .khp-team-grid { grid-template-columns: 1fr; gap: 48px; }
    .khp-footer-cols { grid-template-columns: repeat(3, 1fr); gap: 32px; }
    .khp-footer-brand-band { grid-template-columns: 1fr; gap: 24px; text-align: left; }
    .khp-footer-brand-right { text-align: left; }
    .khp-footer-partners { justify-content: flex-start; }
    .khp-blog-grid { grid-template-columns: repeat(2, 1fr); }
    .khp-listing-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .khp-nav-links { display: none; }
    .khp-mobile-toggle { display: block; }
    .khp-nav-links.khp-nav-open {
        display: flex; flex-direction: column; position: absolute;
        top: 100%; left: 0; right: 0; background: var(--kwarm-white);
        padding: 20px 24px; gap: 16px; box-shadow: 0 10px 30px rgba(0,0,0,0.1);
        border-top: 1px solid var(--klight-gray);
    }
    .khp-nav-links.khp-nav-open a::after { display: none; }
    /* Inside the mobile drawer, submenus stack vertically beneath their parent
       — no fly-out, no absolute positioning. 2nd-tier indents under 1st-tier. */
    .khp-nav-links.khp-nav-open .khp-submenu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        border-top: 1px solid var(--klight-gray);
        border-radius: 0;
        padding: 0;
        min-width: 0;
        margin-top: 4px;
    }
    .khp-nav-links.khp-nav-open .khp-submenu .khp-submenu {
        margin-left: 16px;
        border-top: none;
        border-left: 2px solid var(--kbrand-gold);
    }
    .khp-nav-links.khp-nav-open .khp-submenu-caret { display: none; }
    .khp-nav-links.khp-nav-open .khp-nav-has-children::after,
    .khp-nav-links.khp-nav-open .khp-submenu-has-children::after { display: none; }
    .khp-values-grid,
    .khp-blog-grid { grid-template-columns: 1fr; }
    .khp-testimonial-card { flex-basis: 280px; max-width: 280px; padding: 28px; }
    .khp-communities-grid { grid-template-columns: 1fr; }
    .khp-community-card:nth-child(1),
    .khp-community-card:nth-child(2) { grid-column: span 1; }
    .khp-search-row { grid-template-columns: 1fr; }
    .khp-hero-buttons { flex-direction: column; }
    .khp-dream-grid { grid-template-columns: 1fr; }
    .khp-dream-card { border-right: none; border-bottom: 1px solid rgba(255,255,255,0.06); padding: 32px 28px; }
    .khp-dream-card:last-child { border-bottom: none; }
    .khp-dream-arrow { opacity: 1; transform: translateY(0); }
    .khp-gallery-strip { flex-wrap: wrap; }
    .khp-gallery-strip img { width: 48%; }
    .khp-heroes-inner { text-align: center; }
    .khp-heroes-tags { justify-content: center; }
    .khp-footer-cols { grid-template-columns: 1fr; gap: 36px; }
    .khp-footer-bottom { flex-direction: column; gap: 12px; text-align: center; }
    .khp-footer-legal a { margin: 0 8px; }
    .khp-section-header-row { flex-direction: column; gap: 16px; align-items: flex-start; }
    .khp-listing-grid { grid-template-columns: 1fr; }
}

/* ============================================
   BREADCRUMBS (global, rendered from header.php)
   ============================================ */
/* Breadcrumb: rendered above the hero as a no-JS fallback (centered navy bar),
   then relocated by main.js to the bottom of the hero, centered. */
.khp-breadcrumbs { background: var(--knavy); text-align: center; }
.khp-breadcrumbs .khp-container { padding: 14px 24px; font-size: 14px; color: rgba(255,255,255,0.7); }
.khp-breadcrumbs a { color: rgba(255,255,255,0.85); text-decoration: none; }
.khp-breadcrumbs a:hover,
.khp-breadcrumbs a:focus { color: #fff; text-decoration: underline; }
.khp-breadcrumbs [aria-current="page"] { color: #fff; font-weight: 600; }
.khp-bc-sep { color: var(--kbrand-gold); margin: 0 4px; }
/* Once moved inside the hero, blend into the navy and sit centered near the bottom. */
.khp-page-hero .khp-breadcrumbs { background: transparent; margin-top: 30px; }
.khp-page-hero .khp-breadcrumbs .khp-container { padding: 0 24px; }

/* ============================================
   DEFAULT PAGE SHELL (page.php content band)
   Frames content pages (guides, FAQ, pillars, resources, policies) as a
   contained card on a warm-white band so they read as designed pages, not a
   bare column floating on white.
   ============================================ */
.khp-page-body { background: var(--kwarm-white); padding: 64px 0 88px; }
.khp-page-body .khp-post-content {
    max-width: 940px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid var(--kblue-pale);
    border-radius: 16px;
    box-shadow: 0 18px 48px rgba(20,47,88,0.08);
    padding: 56px 60px 64px;
}
.khp-page-body .khp-post-content > h2:first-of-type,
.khp-page-body .khp-post-content > h1:first-child { margin-top: 0; }

@media (max-width: 768px) {
    .khp-page-body { padding: 32px 0 48px; }
    .khp-page-body .khp-post-content { padding: 30px 22px 40px; border-radius: 12px; }
}

/* ============================================
   GUIDE TEMPLATE BANDS (page-guide.php)
   Content split at each H2 into full-width alternating bands.
   ============================================ */
.khp-guide-band { padding: 0; }
.khp-guide-band--warm { background: var(--kwarm-white); }
.khp-guide-band--white { background: #fff; }
.khp-guide-band:last-of-type { border-bottom: 1px solid var(--kblue-pale); }
.khp-post-content--guide {
    max-width: 1040px;
    margin: 0 auto;
    padding: 64px 24px;
    background: none;
    border: none;
    box-shadow: none;
}
/* In banded mode the lead paragraph reads as a lede, not a repeated callout box. */
.khp-post-content--guide > p:first-of-type {
    background: none;
    padding: 0;
    font-size: 18px;
    line-height: 1.8;
    color: var(--ktext);
    margin-bottom: 28px;
}
/* The first heading of each band sits flush at the band top (no double divider). */
.khp-post-content--guide > h2:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.khp-post-content--guide > h2:first-child::before { display: none; }
@media (max-width: 768px) {
    .khp-post-content--guide { padding: 40px 20px; }
}

/* ============================================
   FEATURE ROWS (kirby_render_content_features)
   Each H2 section is a full-width two-column row: heading left, body right,
   on alternating backgrounds. Turns one-column content into a designed layout.
   ============================================ */
.khp-feature-row--a { background: var(--kwarm-white); }
.khp-feature-row--b { background: #fff; }
.khp-feature-grid {
    display: grid;
    grid-template-columns: 0.78fr 1.22fr;
    gap: 56px;
    align-items: start;
    padding: 72px 0;
}
.khp-feature-head { position: sticky; top: 96px; }
.khp-feature-head h2 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(26px, 3vw, 38px);
    font-weight: 700;
    color: var(--kbrand-dark);
    line-height: 1.15;
    margin: 0;
    padding: 0;
    border: none;
}
.khp-feature-head h2::before { content: none; }
.khp-feature-head h2::after {
    content: '';
    display: block;
    width: 54px;
    height: 4px;
    background: var(--kbrand-gold);
    margin-top: 18px;
}
.khp-post-content--feature {
    max-width: none;
    margin: 0;
    padding: 0;
    background: none;
    border: none;
    box-shadow: none;
}
.khp-post-content--feature > *:first-child { margin-top: 0; }
.khp-post-content--feature > p:first-of-type {
    background: none;
    padding: 0;
    font-size: 17px;
    line-height: 1.9;
    color: var(--ktext);
    margin-bottom: 24px;
}
.khp-feature-lead {
    max-width: 860px;
    margin: 0 auto;
    text-align: center;
}
.khp-feature-lead > p:first-of-type {
    background: none;
    padding: 0;
    font-size: 19px;
    line-height: 1.85;
    color: var(--ktext);
}
@media (max-width: 860px) {
    .khp-feature-grid { grid-template-columns: 1fr; gap: 16px; padding: 44px 0; }
    .khp-feature-head { position: static; }
    .khp-feature-head h2::after { margin-top: 14px; }
}

/* ============================================
   CONTENT BANDS  (page-guide.php / page.php)
   Full-width alternating sections with centered
   headings on top, card grids for Q&A and quotes,
   contextual photo bands. Added 2026-06-10.
   Drives: specialty, relocation, resources, testimonials.
   ============================================ */
.khp-band { padding: 64px 0; }
.khp-band--a { background: var(--kcream); }
.khp-band--b { background: var(--kblue-pale); }
.khp-band-head { text-align: center; max-width: 760px; margin: 0 auto 38px; }
.khp-band-head h2 { font-family: 'Playfair Display', serif; font-size: clamp(26px,3vw,34px); font-weight: 700; color: var(--kbrand-dark); margin: 0; }
.khp-band-rule { display: block; width: 64px; height: 3px; background: var(--kgold); border-radius: 2px; margin: 16px auto 0; }
.khp-band-text { text-align: center; max-width: 860px; margin: 0 auto; font-size: 19px; line-height: 1.7; color: var(--ktext); }
.khp-band-text p { margin: 0 0 16px; }
.khp-band-text p:last-child { margin-bottom: 0; }
.khp-band-text strong { color: var(--kbrand-dark); }
.khp-band-body { max-width: 1040px; margin: 0 auto; }
.khp-band-body > p:first-child { margin-top: 0; }
.khp-band-body p { line-height: 1.7; }
.khp-qa-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px,1fr)); gap: 22px; max-width: 1100px; margin: 0 auto; }
.khp-qa-card { background: #fff; border: 1px solid var(--klight-gray); border-radius: 14px; padding: 24px 26px; box-shadow: 0 6px 20px rgba(20,47,88,0.05); }
.khp-qa-card h3 { font-family: 'Playfair Display', serif; font-size: 20px; color: var(--kbrand-dark); margin: 0 0 10px; }
.khp-qa-card p { margin: 0; color: var(--ktext); font-size: 15.5px; line-height: 1.65; }
.khp-qa-card p + p { margin-top: 10px; }
.khp-quote-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px,1fr)); gap: 22px; max-width: 1100px; margin: 0 auto; }
.khp-quote-grid .khp-testimonial-quote { margin: 0; height: 100%; }
.khp-band-body table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 6px 22px rgba(20,47,88,0.07); margin: 0 0 8px; }
.khp-band-body th { background: var(--kbrand-dark); color: #fff; text-align: left; padding: 13px 16px; font-size: 14px; }
.khp-band-body td { padding: 13px 16px; border-top: 1px solid var(--klight-gray); font-size: 15px; vertical-align: top; }
.khp-band-body tr:nth-child(even) td { background: var(--kcream); }
.khp-band-body ul, .khp-band-body ol { padding-left: 22px; margin: 0 auto; max-width: 900px; }
.khp-band-body li { margin: 0 0 10px; line-height: 1.6; }
.khp-band-figure { margin: 0 auto; max-width: 1040px; }
.khp-band-figure img { width: 100%; max-height: 460px; object-fit: cover; border-radius: 16px; display: block; box-shadow: 0 12px 30px rgba(20,47,88,0.12); }
.khp-band-figure figcaption { text-align: center; font-size: 14px; color: var(--ktext-light); margin-top: 12px; }
.khp-band--photo { padding: 48px 0; }
@media (max-width: 760px) { .khp-band { padding: 48px 0; } .khp-band-text { font-size: 17px; } }

/* Rich band wrapper: centered intro prose + full-width premium card grids */
.khp-band-rich { max-width: 1180px; margin: 0 auto; }
.khp-band-rich > p { max-width: 840px; margin: 0 auto 18px; text-align: center; font-size: 17px; line-height: 1.75; color: var(--ktext); }
.khp-band-rich > p strong { color: var(--kbrand-dark); }
.khp-band-rich .khp-values-grid,
.khp-band-rich .khp-communities-grid { margin-top: 10px; }
@media (max-width: 900px) {
    .khp-band-rich .khp-values-grid { grid-template-columns: 1fr; }
    .khp-band-rich .khp-communities-grid { grid-template-columns: repeat(2,1fr); }
    .khp-band-rich .khp-community-card:nth-child(1),
    .khp-band-rich .khp-community-card:nth-child(2) { grid-column: span 1; }
}

/* Wide Q&A card (contains a table): span the full grid row and let wide
   tables scroll horizontally on small screens instead of overflowing. */
.khp-qa-card--wide { grid-column: 1 / -1; }
.khp-qa-card { overflow-x: auto; }
.khp-qa-card table { min-width: 520px; }
.khp-band-body { overflow-x: auto; }
.khp-band-body table { min-width: 520px; }
@media (max-width: 600px) {
    .khp-qa-card table, .khp-band-body table { font-size: 13px; }
    .khp-band-body th, .khp-band-body td, .khp-qa-card th, .khp-qa-card td { padding: 10px 12px; }
}

/* Links inside content bands: brand colors, never default blue/purple.
   Buttons (.khp-btn*) keep their own styling; heading links inherit. */
.khp-band a:not([class*="khp-btn"]) { color: var(--kbrand-light); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; transition: color 0.2s; }
.khp-band a:not([class*="khp-btn"]):visited { color: var(--kbrand-light); }
.khp-band a:not([class*="khp-btn"]):hover { color: var(--kgold-dark); }
.khp-qa-card h3 a, .khp-band-head a { color: inherit; text-decoration: none; }
.khp-qa-card h3 a:hover, .khp-band-head a:hover { color: var(--kgold-dark); }
.khp-value-card a:not([class*="khp-btn"]),
.khp-value-card a:not([class*="khp-btn"]):visited { color: var(--kbrand-gold); }
.khp-community-card,
.khp-community-card:visited { color: #fff; }

/* Band card grids must FILL their row (no empty columns on partial rows). */
.khp-band-rich .khp-values-grid,
.khp-band-rich .khp-communities-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.khp-band-rich .khp-community-card:nth-child(1),
.khp-band-rich .khp-community-card:nth-child(2) { grid-column: auto; }
.khp-band-rich .khp-community-img { aspect-ratio: 16 / 10; }
/* Table pulled out of the Q&A grid: full width, no grid hole. */
.khp-band-stack { max-width: 1040px; margin: 28px auto 0; overflow-x: auto; }
.khp-band-stack h3 { font-family: 'Playfair Display', serif; font-size: 20px; color: var(--kbrand-dark); margin: 0 0 12px; text-align: center; }
.khp-band-stack table { width: 100%; min-width: 520px; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 6px 22px rgba(20,47,88,0.07); }
.khp-band-stack th { background: var(--kbrand-dark); color: #fff; text-align: left; padding: 13px 16px; font-size: 14px; }
.khp-band-stack td { padding: 13px 16px; border-top: 1px solid var(--klight-gray); font-size: 15px; vertical-align: top; }
.khp-band-stack tr:nth-child(even) td { background: var(--kcream); }

/* Home team cards: rectangular portrait, name/role BELOW the photo (not overlaid). */
.khp-team-photo { aspect-ratio: 3 / 4; background-size: cover; background-position: center top; border-radius: 10px; padding: 0; display: block; }
.khp-team-info { text-align: center; padding: 12px 4px 0; }
.khp-team-name { color: var(--knavy); text-shadow: none; font-size: 14px; margin-bottom: 2px; }
.khp-team-role { color: var(--kgold-dark); text-shadow: none; }

/* Even column counts so partial last rows don't leave gaps. */
.khp-qa-grid[class*="khp-cols"],
.khp-band-rich .khp-values-grid[class*="khp-cols"],
.khp-band-rich .khp-communities-grid[class*="khp-cols"] { display: grid; gap: 22px; }
.khp-qa-grid.khp-cols-1,.khp-values-grid.khp-cols-1,.khp-communities-grid.khp-cols-1 { grid-template-columns: minmax(0,560px); justify-content: center; }
.khp-qa-grid.khp-cols-2,.khp-values-grid.khp-cols-2,.khp-communities-grid.khp-cols-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.khp-qa-grid.khp-cols-3,.khp-values-grid.khp-cols-3,.khp-communities-grid.khp-cols-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
@media (max-width: 760px) {
  .khp-qa-grid[class*="khp-cols"],.khp-values-grid[class*="khp-cols"],.khp-communities-grid[class*="khp-cols"] { grid-template-columns: 1fr; }
}
