/* =============================================================
   KCH Theme — Main Stylesheet
   Prefix: kch-  (CSS classes only)
   ============================================================= */

/* -------------------------------------------------------------
   Skip Link (Accessibility)
   ------------------------------------------------------------- */
.kch-skip-link {
    position: absolute;
    top: -9999px;
    left: 0;
    z-index: 9999;
    padding: 0.5rem 1rem;
    background: var(--kch-primary);
    color: var(--kch-white);
    font-weight: 600;
    border-radius: 0 0 var(--kch-radius) 0;
}

.kch-skip-link:focus {
    top: 0;
}

/* -------------------------------------------------------------
   Header — 2-row editorial layout (matches Mockup A)
   ------------------------------------------------------------- */
.kch-header {
    background: var(--kch-bg);
    border-bottom: 2px solid var(--kch-text);
}

.kch-header-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 24px;
}

.kch-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0 16px;
    border-bottom: 1px solid var(--kch-border);
}

.kch-logo {
    display: inline-block;
    line-height: 0;
    text-decoration: none;
    flex-shrink: 0;
}

.kch-logo img {
    display: block;
    height: 52px;
    width: auto;
}

.kch-logo:hover,
.kch-logo:focus {
    text-decoration: none;
    opacity: 0.85;
}

.kch-header-meta {
    font-family: var(--kch-font-body);
    font-size: 0.75rem;
    color: var(--kch-gray);
    text-align: right;
    line-height: 1.5;
}

/* -------------------------------------------------------------
   Navigation — tab bar below header-top
   ------------------------------------------------------------- */
.kch-nav {
    display: flex;
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
    width: 100%;
}

.kch-nav::-webkit-scrollbar {
    display: none;
}

.kch-nav ul,
.kch-nav-list {
    display: flex;
    gap: 0;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
}

.kch-nav li {
    position: relative;
    flex-shrink: 0;
}

.kch-nav a,
.kch-nav li > a {
    display: block;
    font-family: var(--kch-font-body);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--kch-text);
    text-decoration: none;
    padding: 12px 10px 10px;
    letter-spacing: 0;
    text-transform: uppercase;
    border-bottom: 3px solid transparent;
    transition: border-color 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}

.kch-nav a:hover,
.kch-nav a:focus,
.kch-nav .current-menu-item > a,
.kch-nav .current-menu-ancestor > a,
.kch-nav .current-category-ancestor > a {
    color: var(--kch-primary);
    border-bottom-color: var(--kch-primary);
    text-decoration: none;
    background: none;
}

/* -------------------------------------------------------------
   Main Content Area
   ------------------------------------------------------------- */
.kch-main {
    padding-top: var(--kch-space-lg);
    padding-bottom: var(--kch-space-xl);
}

/* -------------------------------------------------------------
   Breadcrumb
   ------------------------------------------------------------- */
.kch-breadcrumb {
    font-size: 0.8125rem;
    color: var(--kch-gray);
    margin-bottom: var(--kch-space-md);
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    align-items: center;
}

.kch-breadcrumb a {
    color: var(--kch-gray);
    text-decoration: underline;
}

.kch-breadcrumb a:hover {
    color: var(--kch-primary);
}

.kch-breadcrumb span + span::before {
    content: '›';
    margin-right: 0.25rem;
    color: var(--kch-border);
}

/* -------------------------------------------------------------
   Category Label
   ------------------------------------------------------------- */
.kch-cat-label {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--kch-primary);
    background: var(--kch-primary-light);
    padding: 0.2rem 0.55rem;
    border-radius: 3px;
    text-decoration: none;
    margin-bottom: 0.5rem;
}

.kch-cat-label:hover {
    background: var(--kch-primary);
    color: var(--kch-white);
    text-decoration: none;
}

/* -------------------------------------------------------------
   Hero Card (Featured Post)
   ------------------------------------------------------------- */
.kch-hero-section {
    margin-bottom: var(--kch-space-xl);
}

.kch-hero-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border-radius: var(--kch-radius);
    overflow: hidden;
    box-shadow: var(--kch-shadow-md);
    background: var(--kch-white);
    min-height: 360px;
}

.kch-hero-card__image {
    overflow: hidden;
}

.kch-hero-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}

.kch-hero-card:hover .kch-hero-card__image img {
    transform: scale(1.03);
}

/* Image fallback — shown when no featured image is set */
.kch-img-placeholder {
    width: 100%;
    height: 100%;
    min-height: 200px;
    background: linear-gradient(135deg, var(--kch-primary-light) 0%, #bfdbfe 50%, #93c5fd 100%);
    display: block;
}

.kch-article-card__image .kch-img-placeholder {
    aspect-ratio: 16 / 10;
    min-height: unset;
}

.kch-hero-card__image .kch-img-placeholder {
    height: 100%;
    min-height: 320px;
}



.kch-hero-card__body {
    padding: 2rem 2.25rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--kch-white);
}

.kch-hero-card__body .kch-cat-label {
    align-self: flex-start;
}

.kch-hero-card__title {
    font-size: clamp(1.375rem, 2.5vw, 1.875rem);
    margin-bottom: 0.75rem;
    line-height: 1.25;
}

.kch-hero-card__title a {
    color: var(--kch-text);
    text-decoration: none;
}

.kch-hero-card__title a:hover {
    color: var(--kch-primary);
    text-decoration: none;
}

.kch-hero-card__teaser {
    color: var(--kch-gray);
    font-size: 0.9375rem;
    line-height: 1.65;
    margin-bottom: 1.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.kch-hero-card__meta {
    font-size: 0.8125rem;
    color: var(--kch-gray);
}

/* -------------------------------------------------------------
   Section Heading
   ------------------------------------------------------------- */
.kch-section-heading {
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--kch-gray);
    margin-bottom: var(--kch-space-md);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--kch-border);
}

/* -------------------------------------------------------------
   Article Card Grid
   ------------------------------------------------------------- */
.kch-card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

/* -------------------------------------------------------------
   Article Card
   ------------------------------------------------------------- */
.kch-article-card {
    background: var(--kch-white);
    border: 1px solid var(--kch-border);
    border-radius: var(--kch-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow var(--kch-transition), transform var(--kch-transition);
}

.kch-article-card:hover {
    box-shadow: var(--kch-shadow-md);
    transform: translateY(-2px);
}

.kch-article-card__image {
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.kch-article-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s ease;
}

.kch-article-card:hover .kch-article-card__image img {
    transform: scale(1.04);
}

.kch-article-card__body {
    padding: 1.125rem 1.25rem 1.375rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.kch-article-card__title {
    font-size: 1.0625rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.kch-article-card__title a {
    color: var(--kch-text);
    text-decoration: none;
}

.kch-article-card__title a:hover {
    color: var(--kch-primary);
    text-decoration: none;
}

.kch-article-card__teaser {
    font-size: 0.875rem;
    color: var(--kch-gray);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.kch-article-card__meta {
    font-size: 0.75rem;
    color: var(--kch-gray);
    margin-top: 0.875rem;
}

/* -------------------------------------------------------------
   Single Post
   ------------------------------------------------------------- */
.kch-single-wrap {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 3rem;
    align-items: start;
}

.kch-single {
    background: var(--kch-white);
    border-radius: var(--kch-radius);
    padding: 2.5rem 2.75rem;
    box-shadow: var(--kch-shadow);
}

.kch-single__header {
    margin-bottom: 1.75rem;
}

.kch-single__header h1 {
    margin-top: 0.5rem;
    margin-bottom: 0.875rem;
}

.kch-single__meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: var(--kch-gray);
    flex-wrap: wrap;
}

.kch-single__meta > * + *::before {
    content: '\2022';
    margin-right: 0.75rem;
    color: var(--kch-border);
}

.kch-single__meta time {
    display: inline;
}

.kch-single__thumbnail {
    margin: 0 -2.75rem 2rem;
    border-radius: 0;
    overflow: hidden;
}

.kch-single__thumbnail img {
    width: 100%;
    height: auto;
    max-height: 460px;
    object-fit: cover;
}

.kch-single__content {
    font-size: 1.0625rem;
    line-height: 1.8;
    color: var(--kch-text);
}

.kch-single__content h2 {
    font-size: 1.5rem;
    margin-top: 2.25rem;
    margin-bottom: 0.875rem;
}

.kch-single__content h3 {
    font-size: 1.1875rem;
    margin-top: 1.75rem;
    margin-bottom: 0.625rem;
}

.kch-single__content p {
    margin-bottom: 1.375rem;
}

.kch-single__content ul,
.kch-single__content ol {
    list-style: disc;
    padding-left: 1.5rem;
    margin-bottom: 1.375rem;
}

.kch-single__content ol {
    list-style: decimal;
}

.kch-single__content li {
    margin-bottom: 0.375rem;
}

.kch-single__content blockquote {
    border-left: 3px solid var(--kch-primary);
    margin: 1.75rem 0;
    padding: 0.875rem 1.25rem;
    background: var(--kch-primary-light);
    border-radius: 0 var(--kch-radius) var(--kch-radius) 0;
    font-style: italic;
    color: var(--kch-text);
}

.kch-single__content a {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.kch-single__nav {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--kch-border);
    font-size: 0.875rem;
}

/* -------------------------------------------------------------
   Author Box
   ------------------------------------------------------------- */
.kch-author-box {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    background: var(--kch-bg);
    border: 1px solid var(--kch-border);
    border-radius: var(--kch-radius);
    padding: 1.5rem;
    margin-top: 2.5rem;
}

.kch-author-box__avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--kch-primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.625rem;
    color: var(--kch-primary);
    font-family: var(--kch-font-heading);
    font-weight: 700;
}

.kch-author-box__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.kch-author-box__name {
    font-size: 0.9375rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--kch-text);
}

.kch-author-box__label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--kch-primary);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.kch-author-box__bio {
    font-size: 0.875rem;
    color: var(--kch-gray);
    line-height: 1.6;
    margin-bottom: 0;
}

/* -------------------------------------------------------------
   Sidebar
   ------------------------------------------------------------- */
.kch-sidebar {
    position: sticky;
    top: calc(60px + var(--kch-space-lg));
}

.kch-sidebar__block {
    background: var(--kch-white);
    border: 1px solid var(--kch-border);
    border-radius: var(--kch-radius);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.kch-sidebar__heading {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--kch-gray);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--kch-border);
}

.kch-sidebar__post-list {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.kch-sidebar__post-item {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.kch-sidebar__post-item img {
    width: 68px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.kch-sidebar__post-title {
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--kch-text);
}

.kch-sidebar__post-title a {
    color: inherit;
    text-decoration: none;
}

.kch-sidebar__post-title a:hover {
    color: var(--kch-primary);
}

/* Widget styles */
.kch-widget {
    margin-bottom: 1.5rem;
}

.kch-widget-title {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--kch-gray);
    margin-bottom: 0.875rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--kch-border);
}

/* -------------------------------------------------------------
   Archive Header
   ------------------------------------------------------------- */
.kch-archive-header {
    margin-bottom: var(--kch-space-lg);
    padding-bottom: var(--kch-space-md);
    border-bottom: 1px solid var(--kch-border);
}

.kch-archive-header h1 {
    margin-bottom: 0.5rem;
}

.kch-archive-header__desc {
    color: var(--kch-gray);
    font-size: 1rem;
    max-width: 640px;
}

/* -------------------------------------------------------------
   Pagination
   ------------------------------------------------------------- */
.kch-pagination {
    margin-top: var(--kch-space-xl);
    text-align: center;
}

.kch-pagination .nav-links {
    display: flex;
    justify-content: center;
    gap: 0.375rem;
    flex-wrap: wrap;
}

.kch-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.625rem;
    border: 1px solid var(--kch-border);
    border-radius: var(--kch-radius);
    font-size: 0.9375rem;
    color: var(--kch-text);
    background: var(--kch-white);
    text-decoration: none;
    transition: background var(--kch-transition), color var(--kch-transition), border-color var(--kch-transition);
}

.kch-pagination .page-numbers:hover,
.kch-pagination .page-numbers.current {
    background: var(--kch-primary);
    color: var(--kch-white);
    border-color: var(--kch-primary);
    text-decoration: none;
}

/* -------------------------------------------------------------
   Footer
   ------------------------------------------------------------- */
.kch-footer {
    background: var(--kch-white);
    border-top: 1px solid var(--kch-border);
    padding-top: var(--kch-space-xl);
    padding-bottom: var(--kch-space-lg);
    margin-top: var(--kch-space-xl);
}

.kch-footer__grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: var(--kch-space-lg);
    margin-bottom: var(--kch-space-lg);
    padding-bottom: var(--kch-space-lg);
    border-bottom: 1px solid var(--kch-border);
}

.kch-footer__heading {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--kch-text);
    margin-bottom: 0.875rem;
}

.kch-footer__about-name {
    font-family: var(--kch-font-heading);
    font-weight: 700;
    font-size: 1.0625rem;
    color: var(--kch-text);
    margin-bottom: 0.375rem;
}

.kch-footer__about-desc {
    font-size: 0.875rem;
    color: var(--kch-gray);
    line-height: 1.65;
    margin-bottom: 0;
}

.kch-footer__link-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.kch-footer__link-list a {
    font-size: 0.875rem;
    color: var(--kch-gray);
    text-decoration: none;
    transition: color var(--kch-transition);
}

.kch-footer__link-list a:hover {
    color: var(--kch-primary);
    text-decoration: none;
}

.kch-footer__bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.kch-footer__copyright {
    font-size: 0.8125rem;
    color: var(--kch-gray);
}

/* -------------------------------------------------------------
   Legal Pages
   ------------------------------------------------------------- */
.kch-legal {
    background: var(--kch-white);
    border-radius: var(--kch-radius);
    padding: 2.5rem 2.75rem;
    box-shadow: var(--kch-shadow);
}

.kch-legal h1 {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--kch-border);
}

.kch-legal__content h2 {
    font-size: 1.25rem;
    margin-top: 2rem;
    margin-bottom: 0.625rem;
}

.kch-legal__content p {
    font-size: 0.9375rem;
    color: var(--kch-gray);
    margin-bottom: 1rem;
}

.kch-legal__content ul {
    list-style: disc;
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.kch-legal__content li {
    font-size: 0.9375rem;
    color: var(--kch-gray);
    margin-bottom: 0.25rem;
}

.kch-legal__updated {
    font-size: 0.8125rem;
    color: var(--kch-gray);
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--kch-border);
}

/* -------------------------------------------------------------
   Page Template (generic)
   ------------------------------------------------------------- */
.kch-page {
    background: var(--kch-white);
    border-radius: var(--kch-radius);
    padding: 2.5rem 2.75rem;
    box-shadow: var(--kch-shadow);
    max-width: 720px;
    margin: 0 auto;
}

.kch-page h1 {
    margin-bottom: 1.5rem;
}

.kch-page__content {
    font-size: 1.0625rem;
    line-height: 1.8;
}

/* -------------------------------------------------------------
   Responsive — 768px
   ------------------------------------------------------------- */
@media (max-width: 768px) {
    /* Header */
    .kch-header-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 14px 0 12px;
    }

    .kch-header-meta {
        text-align: left;
    }

    .kch-nav {
        width: 100%;
    }

    .kch-nav a {
        padding: 10px 12px 9px;
        font-size: 0.75rem;
    }

    /* Hero */
    .kch-hero-card {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .kch-hero-card__image {
        aspect-ratio: 16 / 9;
    }

    .kch-hero-card__body {
        padding: 1.375rem 1.5rem 1.75rem;
    }

    /* Cards */
    .kch-card-grid {
        grid-template-columns: 1fr;
    }

    /* Single */
    .kch-single-wrap {
        grid-template-columns: 1fr;
    }

    .kch-single {
        padding: 1.5rem 1.25rem;
    }

    .kch-single__thumbnail {
        margin: 0 -1.25rem 1.5rem;
    }

    /* Sidebar */
    .kch-sidebar {
        position: static;
    }

    /* Footer */
    .kch-footer__grid {
        grid-template-columns: 1fr;
        gap: var(--kch-space-md);
    }

    .kch-footer__bottom {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Author box */
    .kch-author-box {
        flex-direction: column;
    }

    /* Legal */
    .kch-legal {
        padding: 1.5rem 1.25rem;
    }
}

@media (max-width: 480px) {
    .kch-card-grid {
        grid-template-columns: 1fr;
    }
}

.kch-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}
