/* ============================================================
   KnowiHealth Theme — Main Stylesheet
   ============================================================ */

/* ------ CSS Custom Properties ------ */
:root {
    --kh-primary: #0F766E;
    --kh-primary-dark: #0D6459;
    --kh-primary-light: #14B8A6;
    --kh-primary-bg: #F0FDFA;
    --kh-accent: #DC4A3C;
    --kh-accent-dark: #C4362A;
    --kh-dark: #1A332E;
    --kh-dark-alt: #0F2622;
    --kh-text: #1A1A1A;
    --kh-text-secondary: #4B5563;
    --kh-text-muted: #9CA3AF;
    --kh-border: #E5E7EB;
    --kh-border-light: #F3F4F6;
    --kh-bg: #FFFFFF;
    --kh-bg-light: #F9FAFB;
    --kh-bg-warm: #F5F3F0;
    --kh-radius: 8px;
    --kh-radius-lg: 12px;
    --kh-radius-xl: 16px;
    --kh-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --kh-shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --kh-shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
    --kh-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --kh-font-display: 'Playfair Display', Georgia, serif;
    --kh-container: 1200px;
    --kh-transition: 250ms ease;
}

/* ------ Reset & Base ------ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
    font-family: var(--kh-font);
    font-size: 16px;
    line-height: 1.7;
    color: var(--kh-text);
    background: var(--kh-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--kh-primary); text-decoration: none; transition: color var(--kh-transition); }
a:hover { color: var(--kh-primary-dark); }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--kh-font);
    font-weight: 700;
    line-height: 1.25;
    color: var(--kh-text);
}

/* ------ Container ------ */
.kh-container {
    max-width: var(--kh-container);
    margin: 0 auto;
    padding: 0 24px;
}

/* ------ Buttons ------ */
.kh-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-family: var(--kh-font);
    font-size: 15px;
    font-weight: 600;
    border-radius: 50px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all var(--kh-transition);
    text-decoration: none;
    line-height: 1.2;
}
.kh-btn svg { width: 16px; height: 16px; }

.kh-btn--primary {
    background: var(--kh-primary);
    color: #fff;
    border-color: var(--kh-primary);
}
.kh-btn--primary:hover {
    background: var(--kh-primary-dark);
    border-color: var(--kh-primary-dark);
    color: #fff;
}

.kh-btn--outline {
    background: transparent;
    color: var(--kh-text);
    border-color: var(--kh-border);
}
.kh-btn--outline:hover {
    border-color: var(--kh-primary);
    color: var(--kh-primary);
}

.kh-btn--accent {
    background: var(--kh-accent);
    color: #fff;
    border-color: var(--kh-accent);
    border-radius: var(--kh-radius);
    padding: 10px 20px;
}
.kh-btn--accent:hover {
    background: var(--kh-accent-dark);
    border-color: var(--kh-accent-dark);
    color: #fff;
}

.kh-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 600;
    color: var(--kh-primary);
}
.kh-link:hover { gap: 8px; }
.kh-link svg { width: 14px; height: 14px; }

/* ============================================================
   HEADER
   ============================================================ */
.kh-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--kh-bg);
    border-bottom: 1px solid var(--kh-border);
}

.kh-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
    gap: 24px;
}

.kh-header__logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--kh-text);
    flex-shrink: 0;
}
.kh-header__logo-img {
    max-height: 48px;
    width: auto;
    object-fit: contain;
}
.kh-header__logo-icon svg { width: 40px; height: 40px; }
.kh-header__logo-name {
    font-size: 20px;
    font-weight: 800;
    display: block;
    line-height: 1.2;
    color: var(--kh-text);
}
.kh-header__logo-tagline {
    font-size: 11px;
    color: var(--kh-text-muted);
    display: block;
    line-height: 1.2;
}

.kh-header__nav { flex: 1; display: flex; justify-content: center; }

.kh-nav__list {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 32px;
}
.kh-nav__list li { position: relative; }
.kh-nav__list a {
    font-size: 15px;
    font-weight: 500;
    color: var(--kh-text-secondary);
    text-decoration: none;
    padding: 8px 0;
    transition: color var(--kh-transition);
}
.kh-nav__list a:hover,
.kh-nav__list .current-menu-item > a,
.kh-nav__list .current_page_item > a {
    color: var(--kh-text);
}
.kh-nav__list .current-menu-item > a::after,
.kh-nav__list .current_page_item > a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--kh-primary);
    border-radius: 1px;
}

.kh-header__actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.kh-header__search-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--kh-text-secondary);
    transition: color var(--kh-transition);
    display: flex;
}
.kh-header__search-toggle:hover { color: var(--kh-text); }

.kh-header__subscribe {
    padding: 10px 20px;
    font-size: 14px;
}

.kh-header__menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    flex-direction: column;
    gap: 5px;
}
.kh-header__hamburger { display: flex; flex-direction: column; gap: 5px; }
.kh-header__hamburger span {
    width: 24px;
    height: 2px;
    background: var(--kh-text);
    border-radius: 2px;
    transition: all var(--kh-transition);
}

/* Search overlay */
.kh-search-overlay {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--kh-bg);
    border-bottom: 1px solid var(--kh-border);
    padding: 20px 0;
    box-shadow: var(--kh-shadow-md);
}
.kh-search-overlay[hidden] { display: none; }

.kh-search-form {
    display: flex;
    align-items: center;
    gap: 12px;
}
.kh-search-form__input {
    flex: 1;
    padding: 14px 20px;
    border: 2px solid var(--kh-border);
    border-radius: var(--kh-radius);
    font-size: 16px;
    font-family: var(--kh-font);
    outline: none;
    transition: border-color var(--kh-transition);
}
.kh-search-form__input:focus { border-color: var(--kh-primary); }
.kh-search-form__submit {
    background: var(--kh-primary);
    color: #fff;
    border: none;
    padding: 14px;
    border-radius: var(--kh-radius);
    cursor: pointer;
    display: flex;
}
.kh-search-form__close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--kh-text-muted);
    display: flex;
}

/* ============================================================
   HERO (Homepage)
   ============================================================ */
.kh-hero {
    background: linear-gradient(135deg, var(--kh-dark) 0%, var(--kh-dark-alt) 100%);
    color: #fff;
    overflow: hidden;
}

.kh-hero__inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
    min-height: 480px;
}

.kh-hero__title {
    font-family: var(--kh-font-display);
    font-size: 56px;
    font-weight: 800;
    line-height: 1.1;
    color: #fff;
    margin-bottom: 16px;
}

.kh-hero__subtitle {
    font-size: 18px;
    color: rgba(255,255,255,0.8);
    line-height: 1.6;
    margin-bottom: 32px;
    max-width: 460px;
}

.kh-hero__actions { display: flex; gap: 12px; flex-wrap: wrap; }
.kh-hero__actions .kh-btn--outline {
    color: #fff;
    border-color: rgba(255,255,255,0.3);
}
.kh-hero__actions .kh-btn--outline:hover {
    border-color: #fff;
    color: #fff;
}

.kh-hero__image { position: relative; }
.kh-hero__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--kh-radius-lg);
}
.kh-hero__image-placeholder {
    width: 100%;
    height: 400px;
    background: rgba(255,255,255,0.1);
    border-radius: var(--kh-radius-lg);
}

/* ============================================================
   SECTIONS
   ============================================================ */
.kh-section { padding: 64px 0; }

.kh-section__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}

.kh-section__title {
    font-size: 24px;
    font-weight: 700;
}

.kh-section__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--kh-primary);
}
.kh-section__link:hover { gap: 10px; }

/* ------ Trending Topics ------ */
.kh-trending { border-bottom: 1px solid var(--kh-border); }

.kh-trending__grid {
    display: flex;
    gap: 32px;
    justify-content: center;
    flex-wrap: wrap;
}

.kh-trending__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--kh-text);
    transition: transform var(--kh-transition);
}
.kh-trending__item:hover { transform: translateY(-4px); color: var(--kh-text); }

.kh-trending__icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--kh-primary-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--kh-transition);
}
.kh-trending__icon svg { width: 32px; height: 32px; }
.kh-trending__item:hover .kh-trending__icon { background: #D1FAE5; }

.kh-trending__name {
    font-size: 14px;
    font-weight: 500;
    text-align: center;
}

/* ------ Featured Articles ------ */
.kh-featured__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

/* ------ Post Card ------ */
.kh-card {
    background: var(--kh-bg);
    border-radius: var(--kh-radius-lg);
    overflow: hidden;
    transition: box-shadow var(--kh-transition), transform var(--kh-transition);
}
.kh-card:hover {
    box-shadow: var(--kh-shadow-lg);
    transform: translateY(-2px);
}

.kh-card__image {
    aspect-ratio: 16/10;
    overflow: hidden;
}
.kh-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.kh-card:hover .kh-card__image img { transform: scale(1.05); }

.kh-card__body { padding: 20px; }

.kh-card__category {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    color: var(--kh-primary);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 8px;
    text-decoration: none;
}

.kh-card__title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 8px;
}
.kh-card__title a { color: var(--kh-text); text-decoration: none; }
.kh-card__title a:hover { color: var(--kh-primary); }

.kh-card__excerpt {
    font-size: 14px;
    color: var(--kh-text-secondary);
    line-height: 1.5;
    margin-bottom: 16px;
}

.kh-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.kh-card__meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--kh-text-muted);
}

.kh-card__sep { opacity: 0.4; }

.kh-card--compact .kh-card__body { padding: 16px; }
.kh-card--compact .kh-card__title { font-size: 16px; }

/* ------ Explore Categories ------ */
.kh-explore__grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
}

.kh-explore__card {
    text-align: center;
    text-decoration: none;
    color: var(--kh-text);
    transition: transform var(--kh-transition);
}
.kh-explore__card:hover { transform: translateY(-4px); color: var(--kh-text); }

.kh-explore__image {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--kh-radius-lg);
    overflow: hidden;
    margin-bottom: 12px;
}
.kh-explore__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.kh-explore__image-placeholder {
    width: 100%;
    height: 100%;
    background: var(--kh-bg-light);
}

.kh-explore__icon-badge {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 36px;
    background: var(--kh-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--kh-shadow);
}
.kh-explore__icon-badge svg { width: 20px; height: 20px; }

.kh-explore__name {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 2px;
}

.kh-explore__tagline {
    font-size: 13px;
    color: var(--kh-text-muted);
}

/* ============================================================
   NEWSLETTER CTA
   ============================================================ */
.kh-newsletter-cta {
    background: var(--kh-bg-light);
    padding: 40px 0;
}

.kh-newsletter-cta__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    background: var(--kh-bg);
    border: 1px solid var(--kh-border);
    border-radius: var(--kh-radius-xl);
    padding: 32px 40px;
}

.kh-newsletter-cta__content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.kh-newsletter-cta__icon svg { width: 48px; height: 48px; flex-shrink: 0; }

.kh-newsletter-cta__title {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 4px;
}

.kh-newsletter-cta__desc {
    font-size: 15px;
    color: var(--kh-text-secondary);
}

.kh-newsletter-cta__form-wrap { flex: 1; max-width: 420px; }

.kh-newsletter-cta__privacy {
    font-size: 12px;
    color: var(--kh-text-muted);
    margin-top: 8px;
}

/* Newsletter form */
.kh-newsletter-form__row {
    display: flex;
    gap: 8px;
}

.kh-newsletter-form__input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--kh-border);
    border-radius: var(--kh-radius);
    font-size: 14px;
    font-family: var(--kh-font);
    outline: none;
    transition: border-color var(--kh-transition);
}
.kh-newsletter-form__input:focus { border-color: var(--kh-primary); }

.kh-newsletter-form__message {
    font-size: 13px;
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: var(--kh-radius);
}
.kh-newsletter-form__message--success {
    background: #D1FAE5;
    color: #065F46;
}
.kh-newsletter-form__message--error {
    background: #FEE2E2;
    color: #991B1B;
}

/* ============================================================
   FOOTER
   ============================================================ */
.kh-footer {
    background: var(--kh-dark);
    color: rgba(255,255,255,0.8);
    padding: 60px 0 0;
}

.kh-footer__grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
    gap: 40px;
    padding-bottom: 40px;
}

.kh-footer__logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    margin-bottom: 16px;
}
.kh-footer__logo-img {
    max-height: 44px;
    width: auto;
    object-fit: contain;
}
.kh-footer__logo-icon svg { width: 36px; height: 36px; }
.kh-footer__logo-name {
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    display: block;
    line-height: 1.2;
}
.kh-footer__logo-tagline {
    font-size: 11px;
    color: rgba(255,255,255,0.5);
    display: block;
    line-height: 1.2;
}

.kh-footer__desc {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
    color: rgba(255,255,255,0.6);
}

.kh-footer__social {
    display: flex;
    gap: 12px;
}
.kh-footer__social-link {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.7);
    transition: all var(--kh-transition);
}
.kh-footer__social-link:hover {
    background: var(--kh-primary);
    color: #fff;
}
.kh-footer__social-link svg { width: 16px; height: 16px; }

.kh-footer__heading {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 20px;
}

.kh-footer__links {
    list-style: none;
}
.kh-footer__links li { margin-bottom: 10px; }
.kh-footer__links a {
    font-size: 14px;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    transition: color var(--kh-transition);
}
.kh-footer__links a:hover { color: #fff; }

.kh-footer__newsletter-desc {
    font-size: 14px;
    color: rgba(255,255,255,0.6);
    margin-bottom: 16px;
}

.kh-footer .kh-newsletter-form__input {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.2);
    color: #fff;
}
.kh-footer .kh-newsletter-form__input::placeholder { color: rgba(255,255,255,0.4); }
.kh-footer .kh-newsletter-form__input:focus { border-color: var(--kh-primary-light); }

.kh-footer .kh-newsletter-form__submit {
    background: var(--kh-primary);
    border-color: var(--kh-primary);
}

.kh-footer__bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 20px 0;
    text-align: center;
    font-size: 13px;
    color: rgba(255,255,255,0.4);
}

/* ============================================================
   BREADCRUMBS
   ============================================================ */
.kh-breadcrumbs {
    background: var(--kh-bg-light);
    border-bottom: 1px solid var(--kh-border);
    padding: 12px 0;
}
.kh-breadcrumbs__list {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}
.kh-breadcrumbs__list a {
    color: var(--kh-text-muted);
    text-decoration: none;
}
.kh-breadcrumbs__list a:hover { color: var(--kh-primary); }
.kh-breadcrumbs__list svg { width: 12px; height: 12px; color: var(--kh-text-muted); opacity: 0.5; }
.kh-breadcrumbs__current {
    color: var(--kh-text-secondary);
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============================================================
   SINGLE POST
   ============================================================ */
.kh-single__layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 48px;
    padding: 40px 0 64px;
}

.kh-single__cats {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}
.kh-single__cat {
    font-size: 13px;
    font-weight: 700;
    color: var(--kh-primary);
    letter-spacing: 0.5px;
    text-decoration: none;
}
.kh-single__cat-sep { color: var(--kh-text-muted); font-size: 10px; }

.kh-single__title {
    font-family: var(--kh-font-display);
    font-size: 42px;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 16px;
}

.kh-single__excerpt {
    font-size: 18px;
    color: var(--kh-text-secondary);
    line-height: 1.6;
    margin-bottom: 24px;
}

.kh-single__meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.kh-single__author {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--kh-text);
}
.kh-single__avatar { width: 40px; height: 40px; border-radius: 50%; }
.kh-single__author-prefix { font-size: 14px; color: var(--kh-text-muted); }
.kh-single__author-name { font-size: 14px; font-weight: 600; color: var(--kh-primary); }
.kh-single__author-info { display: flex; gap: 4px; }

.kh-single__meta-sep { color: var(--kh-text-muted); }
.kh-single__read-time,
.kh-single__date { font-size: 14px; color: var(--kh-text-muted); }

.kh-single__featured-image {
    margin-bottom: 24px;
    border-radius: var(--kh-radius-lg);
    overflow: hidden;
}
.kh-single__featured-image img { width: 100%; }

/* Share / Save */
.kh-single__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-top: 1px solid var(--kh-border);
    border-bottom: 1px solid var(--kh-border);
    margin-bottom: 32px;
}

.kh-share {
    display: flex;
    align-items: center;
    gap: 12px;
}
.kh-share__label {
    font-size: 14px;
    font-weight: 500;
    color: var(--kh-text-secondary);
}
.kh-share__btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--kh-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--kh-text-secondary);
    transition: all var(--kh-transition);
}
.kh-share__btn:hover {
    border-color: var(--kh-primary);
    color: var(--kh-primary);
    background: var(--kh-primary-bg);
}
.kh-share__btn svg { width: 16px; height: 16px; }

.kh-save-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-family: var(--kh-font);
    color: var(--kh-text-secondary);
    padding: 8px;
    transition: color var(--kh-transition);
}
.kh-save-btn:hover { color: var(--kh-primary); }
.kh-save-btn--saved { color: var(--kh-primary); }
.kh-save-btn--small { padding: 4px; }

/* Key Takeaways */
.kh-takeaways {
    background: var(--kh-primary-bg);
    border-radius: var(--kh-radius-lg);
    padding: 28px 32px;
    margin-bottom: 32px;
    border-left: 4px solid var(--kh-primary);
}
.kh-takeaways__title {
    font-size: 14px;
    font-weight: 700;
    color: var(--kh-primary);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 20px;
}
.kh-takeaways__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 32px;
}
.kh-takeaways__list { list-style: none; }
.kh-takeaways__item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 10px;
}
.kh-takeaways__check {
    color: var(--kh-primary);
    flex-shrink: 0;
    margin-top: 2px;
}

/* Post body content */
.kh-content {
    font-size: 17px;
    line-height: 1.8;
    color: var(--kh-text);
}
.kh-content h2 {
    font-size: 28px;
    margin: 48px 0 16px;
    padding-top: 16px;
}
.kh-content h3 {
    font-size: 22px;
    margin: 36px 0 12px;
}
.kh-content p { margin-bottom: 20px; }
.kh-content ul, .kh-content ol {
    margin-bottom: 20px;
    padding-left: 24px;
}
.kh-content li { margin-bottom: 8px; }
.kh-content blockquote {
    border-left: 4px solid var(--kh-primary);
    padding: 16px 24px;
    margin: 32px 0;
    font-style: italic;
    font-size: 18px;
    color: var(--kh-text-secondary);
    background: var(--kh-bg-light);
    border-radius: 0 var(--kh-radius) var(--kh-radius) 0;
}
.kh-content img {
    border-radius: var(--kh-radius);
    margin: 24px 0;
}
.kh-content a { color: var(--kh-primary); text-decoration: underline; }

/* Tags */
.kh-single__tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--kh-border);
}
.kh-tag {
    padding: 6px 14px;
    background: var(--kh-bg-light);
    border-radius: 50px;
    font-size: 13px;
    color: var(--kh-text-secondary);
    text-decoration: none;
    transition: all var(--kh-transition);
}
.kh-tag:hover {
    background: var(--kh-primary-bg);
    color: var(--kh-primary);
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.kh-single__sidebar {
    position: sticky;
    top: 96px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* TOC */
.kh-toc {
    background: var(--kh-bg-light);
    border-radius: var(--kh-radius-lg);
    padding: 24px;
    border: 1px solid var(--kh-border);
}
.kh-toc__title {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--kh-text);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--kh-primary);
}
.kh-toc__list {
    list-style: none;
    counter-reset: toc;
}
.kh-toc__item {
    counter-increment: toc;
    margin-bottom: 0;
}
.kh-toc__link {
    display: flex;
    gap: 12px;
    padding: 8px 0;
    font-size: 14px;
    color: var(--kh-text-secondary);
    text-decoration: none;
    border-bottom: 1px solid var(--kh-border-light);
    transition: color var(--kh-transition);
}
.kh-toc__link::before {
    content: counter(toc) ".";
    font-weight: 600;
    color: var(--kh-primary);
    min-width: 24px;
}
.kh-toc__link:hover,
.kh-toc__link--active { color: var(--kh-primary); font-weight: 500; }
.kh-toc__item--sub .kh-toc__link { padding-left: 36px; font-size: 13px; }

/* Author box */
.kh-sidebar-author {
    background: var(--kh-bg-light);
    border-radius: var(--kh-radius-lg);
    padding: 24px;
    border: 1px solid var(--kh-border);
}
.kh-sidebar-author__heading {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--kh-primary);
}
.kh-sidebar-author__card {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.kh-sidebar-author__avatar { width: 48px; height: 48px; border-radius: 50%; }
.kh-sidebar-author__name { font-size: 15px; display: block; }
.kh-sidebar-author__role { font-size: 13px; color: var(--kh-text-muted); display: block; }
.kh-sidebar-author__bio { font-size: 14px; color: var(--kh-text-secondary); line-height: 1.5; margin-bottom: 12px; }

/* Related articles */
.kh-sidebar-related {
    background: var(--kh-bg-light);
    border-radius: var(--kh-radius-lg);
    padding: 24px;
    border: 1px solid var(--kh-border);
}
.kh-sidebar-related__heading {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--kh-primary);
}
.kh-sidebar-related__list { display: flex; flex-direction: column; gap: 16px; margin-bottom: 16px; }
.kh-sidebar-related__item {
    display: flex;
    gap: 12px;
    text-decoration: none;
    color: var(--kh-text);
}
.kh-sidebar-related__item:hover .kh-sidebar-related__title { color: var(--kh-primary); }
.kh-sidebar-related__thumb {
    width: 80px;
    height: 56px;
    border-radius: var(--kh-radius);
    overflow: hidden;
    flex-shrink: 0;
}
.kh-sidebar-related__thumb img { width: 100%; height: 100%; object-fit: cover; }
.kh-sidebar-related__title { font-size: 14px; font-weight: 600; line-height: 1.3; margin-bottom: 4px; transition: color var(--kh-transition); }
.kh-sidebar-related__date { font-size: 12px; color: var(--kh-text-muted); }

/* Sidebar newsletter */
.kh-sidebar-newsletter {
    background: var(--kh-primary);
    color: #fff;
    border-radius: var(--kh-radius-lg);
    padding: 24px;
}
.kh-sidebar-newsletter__title { font-size: 20px; font-weight: 700; color: #fff; margin-bottom: 8px; }
.kh-sidebar-newsletter__desc { font-size: 14px; color: rgba(255,255,255,0.8); margin-bottom: 16px; }
.kh-sidebar-newsletter .kh-newsletter-form__input {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.3);
    color: #fff;
}
.kh-sidebar-newsletter .kh-newsletter-form__input::placeholder { color: rgba(255,255,255,0.5); }
.kh-sidebar-newsletter .kh-newsletter-form__row {
    gap: 8px;
    flex-wrap: wrap;
}
.kh-sidebar-newsletter .kh-newsletter-form__input {
    min-width: 0;
    flex: 1 1 140px;
}
.kh-sidebar-newsletter .kh-newsletter-form__submit {
    flex-shrink: 0;
    white-space: nowrap;
}
.kh-sidebar-newsletter__privacy { font-size: 12px; color: rgba(255,255,255,0.5); margin-top: 8px; }

/* Also like carousel */
.kh-also-like { border-top: 1px solid var(--kh-border); }
.kh-also-like__nav { display: flex; gap: 8px; }
.kh-also-like__prev,
.kh-also-like__next {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--kh-border);
    background: var(--kh-bg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--kh-text-secondary);
    transition: all var(--kh-transition);
}
.kh-also-like__prev:hover,
.kh-also-like__next:hover {
    border-color: var(--kh-primary);
    color: var(--kh-primary);
}
.kh-also-like__track {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* ============================================================
   PAGE HERO
   ============================================================ */
.kh-page-hero {
    background: var(--kh-bg-light);
    padding: 48px 0;
}
.kh-page-hero__inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}
.kh-page-hero__title {
    font-family: var(--kh-font-display);
    font-size: 42px;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 16px;
}
.kh-page-hero__excerpt {
    font-size: 18px;
    color: var(--kh-text-secondary);
    line-height: 1.6;
}
.kh-page-hero__image {
    border-radius: var(--kh-radius-lg);
    overflow: hidden;
}
.kh-page-hero__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    max-height: 400px;
}

/* Centered variant (no featured image) */
.kh-page-hero--centered .kh-page-hero__inner {
    grid-template-columns: 1fr;
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
}

/* Page content */
.kh-page__content {
    padding: 48px 0 80px;
}

/* ============================================================
   BLOG LISTING (home.php)
   ============================================================ */
.kh-blog-header {
    background: var(--kh-bg-light);
    border-bottom: 1px solid var(--kh-border);
    padding: 40px 0 0;
}
.kh-blog-header__inner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}
.kh-blog-header__title {
    font-family: var(--kh-font-display);
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 8px;
}
.kh-blog-header__desc {
    font-size: 16px;
    color: var(--kh-text-secondary);
    max-width: 500px;
}
.kh-blog-search {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--kh-bg);
    border: 1px solid var(--kh-border);
    border-radius: var(--kh-radius);
    padding: 10px 16px;
    min-width: 280px;
}
.kh-blog-search svg { color: var(--kh-text-muted); flex-shrink: 0; }
.kh-blog-search input {
    border: none;
    outline: none;
    font-size: 14px;
    font-family: var(--kh-font);
    width: 100%;
    background: transparent;
}

/* Filter bar */
.kh-blog-filters {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding-bottom: 0;
    -webkit-overflow-scrolling: touch;
}
.kh-blog-filter {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--kh-text-secondary);
    text-decoration: none;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    transition: all var(--kh-transition);
}
.kh-blog-filter:hover {
    color: var(--kh-text);
    border-bottom-color: var(--kh-border);
}
.kh-blog-filter--active {
    color: var(--kh-primary);
    border-bottom-color: var(--kh-primary);
    font-weight: 600;
}

.kh-blog-content { padding: 40px 0 64px; }

/* Featured post (first post on page 1) */
.kh-featured-post {
    margin-bottom: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid var(--kh-border);
}
.kh-featured-post__inner {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 32px;
    align-items: center;
}
.kh-featured-post__image {
    border-radius: var(--kh-radius-lg);
    overflow: hidden;
    display: block;
}
.kh-featured-post__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 16/10;
    transition: transform 0.4s ease;
}
.kh-featured-post:hover .kh-featured-post__image img { transform: scale(1.03); }
.kh-featured-post__title {
    font-family: var(--kh-font-display);
    font-size: 30px;
    font-weight: 800;
    line-height: 1.2;
    margin: 12px 0;
}
.kh-featured-post__title a { color: var(--kh-text); text-decoration: none; }
.kh-featured-post__title a:hover { color: var(--kh-primary); }
.kh-featured-post__excerpt {
    font-size: 16px;
    color: var(--kh-text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
}

/* ============================================================
   ARCHIVE HERO
   ============================================================ */
.kh-archive-hero {
    background: var(--kh-bg-light);
    border-bottom: 1px solid var(--kh-border);
    padding: 40px 0 0;
}
.kh-archive-hero__inner {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 24px;
}
.kh-archive-hero__icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--kh-primary-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}
.kh-archive-hero__icon svg { width: 36px; height: 36px; }
.kh-archive-hero__title {
    font-family: var(--kh-font-display);
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 8px;
}
.kh-archive-hero__desc {
    font-size: 16px;
    color: var(--kh-text-secondary);
    margin-bottom: 8px;
}
.kh-archive-hero__count {
    font-size: 14px;
    color: var(--kh-text-muted);
}

/* ============================================================
   TOPICS PAGE
   ============================================================ */
.kh-topics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
.kh-topic-card {
    background: var(--kh-bg);
    border: 1px solid var(--kh-border);
    border-radius: var(--kh-radius-lg);
    overflow: hidden;
    text-decoration: none;
    color: var(--kh-text);
    transition: box-shadow var(--kh-transition), transform var(--kh-transition);
}
.kh-topic-card:hover {
    box-shadow: var(--kh-shadow-lg);
    transform: translateY(-3px);
    color: var(--kh-text);
}
.kh-topic-card__image {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: var(--kh-bg-light);
}
.kh-topic-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.kh-topic-card:hover .kh-topic-card__image img { transform: scale(1.05); }
.kh-topic-card__placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--kh-primary-bg) 0%, var(--kh-bg-light) 100%);
}
.kh-topic-card__icon {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 44px;
    height: 44px;
    background: var(--kh-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--kh-shadow-md);
}
.kh-topic-card__icon svg { width: 24px; height: 24px; }
.kh-topic-card__body { padding: 20px; }
.kh-topic-card__name {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}
.kh-topic-card__tagline {
    font-size: 14px;
    color: var(--kh-primary);
    font-weight: 500;
    margin-bottom: 8px;
}
.kh-topic-card__desc {
    font-size: 14px;
    color: var(--kh-text-secondary);
    line-height: 1.5;
    margin-bottom: 12px;
}
.kh-topic-card__count {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--kh-text-muted);
}
.kh-topic-card__count svg { width: 14px; height: 14px; }
.kh-topic-card:hover .kh-topic-card__count { color: var(--kh-primary); }

@media (max-width: 768px) {
    .kh-topics-grid { grid-template-columns: 1fr; }
}
@media (min-width: 769px) and (max-width: 1024px) {
    .kh-topics-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   AUTHOR HERO
   ============================================================ */
.kh-author-hero {
    background: var(--kh-bg-light);
    border-bottom: 1px solid var(--kh-border);
    padding: 48px 0;
}
.kh-author-hero__inner {
    display: flex;
    gap: 32px;
    align-items: flex-start;
    max-width: 720px;
    margin: 0 auto;
}
.kh-author-hero__avatar { flex-shrink: 0; }
.kh-author-hero__img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid var(--kh-bg);
    box-shadow: var(--kh-shadow-md);
}
.kh-author-hero__name {
    font-family: var(--kh-font-display);
    font-size: 30px;
    font-weight: 800;
    margin-bottom: 4px;
}
.kh-author-hero__title {
    font-size: 15px;
    font-weight: 600;
    color: var(--kh-primary);
    margin-bottom: 12px;
}
.kh-author-hero__bio {
    font-size: 15px;
    color: var(--kh-text-secondary);
    line-height: 1.6;
    margin-bottom: 12px;
}
.kh-author-hero__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--kh-text-muted);
    margin-bottom: 12px;
}
.kh-author-hero__sep { opacity: 0.4; }
.kh-author-hero__link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--kh-primary);
    font-weight: 500;
}
.kh-author-hero__link svg { width: 14px; height: 14px; }
.kh-author-hero__social {
    display: flex;
    gap: 8px;
}
.kh-author-hero__social-link {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--kh-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--kh-text-secondary);
    transition: all var(--kh-transition);
}
.kh-author-hero__social-link:hover {
    border-color: var(--kh-primary);
    color: var(--kh-primary);
    background: var(--kh-primary-bg);
}
.kh-author-hero__social-link svg { width: 14px; height: 14px; }

@media (max-width: 600px) {
    .kh-author-hero__inner {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .kh-author-hero__social { justify-content: center; }
    .kh-author-hero__meta { justify-content: center; }
}

/* ============================================================
   ARCHIVE / SEARCH (shared)
   ============================================================ */
.kh-page-header {
    margin-bottom: 32px;
}
.kh-page-title {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 8px;
}
.kh-page-desc {
    font-size: 16px;
    color: var(--kh-text-secondary);
}

.kh-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.kh-pagination {
    display: flex;
    justify-content: center;
    margin-top: 48px;
}
.kh-pagination .nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}
.kh-pagination a, .kh-pagination span {
    padding: 10px 16px;
    border-radius: var(--kh-radius);
    font-size: 14px;
    font-weight: 500;
}
.kh-pagination a {
    color: var(--kh-text-secondary);
    text-decoration: none;
    border: 1px solid var(--kh-border);
    transition: all var(--kh-transition);
}
.kh-pagination a:hover {
    border-color: var(--kh-primary);
    color: var(--kh-primary);
}
.kh-pagination .current {
    background: var(--kh-primary);
    color: #fff;
    border: 1px solid var(--kh-primary);
}

.kh-no-posts {
    text-align: center;
    padding: 80px 0;
}
.kh-no-posts h2 { margin-bottom: 12px; }
.kh-no-posts p { color: var(--kh-text-muted); margin-bottom: 24px; }

/* 404 */
.kh-404 { text-align: center; padding: 100px 0; }
.kh-404__code { font-size: 120px; font-weight: 800; color: var(--kh-primary-bg); line-height: 1; }
.kh-404__title { font-size: 32px; margin: 16px 0; }
.kh-404__desc { color: var(--kh-text-muted); margin-bottom: 32px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .kh-hero__inner { grid-template-columns: 1fr; }
    .kh-hero__image { display: none; }
    .kh-hero__title { font-size: 42px; }

    .kh-single__layout { grid-template-columns: 1fr; gap: 40px; }
    .kh-single__sidebar { position: static; max-height: none; }

    .kh-explore__grid { grid-template-columns: repeat(3, 1fr); }
    .kh-featured__grid { grid-template-columns: repeat(2, 1fr); }
    .kh-also-like__track { grid-template-columns: repeat(2, 1fr); }
    .kh-posts-grid { grid-template-columns: repeat(2, 1fr); }

    .kh-footer__grid { grid-template-columns: repeat(2, 1fr); }

    .kh-featured-post__inner { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .kh-header__nav { display: none; }
    .kh-header__menu-toggle { display: flex; }
    .kh-header__subscribe { display: none; }

    /* Mobile nav */
    .kh-header__nav--open {
        display: block;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--kh-bg);
        border-bottom: 1px solid var(--kh-border);
        padding: 16px 24px 24px;
        box-shadow: var(--kh-shadow-lg);
    }
    .kh-header__nav--open .kh-nav__list {
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
    }
    .kh-header__nav--open .kh-nav__list li { width: 100%; }
    .kh-header__nav--open .kh-nav__list a {
        display: block;
        padding: 12px 0;
        border-bottom: 1px solid var(--kh-border-light);
    }

    .kh-hero { padding: 40px 0; }
    .kh-hero__title { font-size: 36px; }
    .kh-hero__subtitle { font-size: 16px; }
    .kh-hero__actions { flex-direction: column; }

    .kh-section { padding: 40px 0; }

    .kh-trending__grid { gap: 20px; }
    .kh-trending__icon { width: 52px; height: 52px; }
    .kh-trending__icon svg { width: 26px; height: 26px; }

    .kh-featured__grid { grid-template-columns: 1fr; }
    .kh-explore__grid { grid-template-columns: repeat(2, 1fr); }
    .kh-also-like__track { grid-template-columns: 1fr; }
    .kh-posts-grid { grid-template-columns: 1fr; }

    .kh-newsletter-cta__inner {
        flex-direction: column;
        padding: 24px;
        text-align: center;
    }
    .kh-newsletter-cta__content { flex-direction: column; }
    .kh-newsletter-cta__form-wrap { max-width: 100%; width: 100%; }

    .kh-single__title { font-size: 30px; }
    .kh-single__excerpt { font-size: 16px; }

    .kh-takeaways__grid { grid-template-columns: 1fr; }

    .kh-page-hero__inner { grid-template-columns: 1fr; }
    .kh-page-hero--split .kh-page-hero__image { order: -1; }
    .kh-page-hero__title { font-size: 32px; }

    .kh-blog-header__inner { flex-direction: column; }
    .kh-blog-search { min-width: 100%; }
    .kh-blog-header__title { font-size: 28px; }
    .kh-archive-hero__title { font-size: 28px; }

    .kh-footer__grid { grid-template-columns: 1fr; gap: 32px; }
}

@media (max-width: 480px) {
    .kh-container { padding: 0 16px; }
    .kh-hero__title { font-size: 28px; }
    .kh-single__title { font-size: 26px; }
    .kh-newsletter-form__row { flex-direction: column; }
    .kh-trending__grid { gap: 12px; }
    .kh-trending__icon { width: 44px; height: 44px; }
    .kh-trending__icon svg { width: 22px; height: 22px; }
    .kh-trending__name { font-size: 12px; }
}

/* ============================================================
   KADENCE BLOCKS COMPATIBILITY
   ============================================================ */
.kh-content .wp-block-kadence-rowlayout,
.kh-content .kt-row-layout-inner,
.kh-content .wp-block-kadence-column {
    margin-left: auto;
    margin-right: auto;
}

.kh-content .alignwide {
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}

.kh-content .alignfull {
    max-width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    width: 100vw;
}
