/* ═══════════════════════════════════════════════════════════════
   Knowledge Hub — Frontend Styles
   Matches the blue/white design from the reference screenshot
═══════════════════════════════════════════════════════════════ */

/* ── Reset & Base ──────────────────────────────────────────────────────────── */
.kh-wrap * { box-sizing: border-box; }
.kh-wrap {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #1E293B;
    --kh-primary: #24417b;   /* theme color 2 */
    --kh-accent:  #883e35;   /* theme color 1 */
}

/* ── HERO ──────────────────────────────────────────────────────────────────── */
.kh-hero {
    background: linear-gradient(135deg, #EFF6FF 0%, #F0F9FF 50%, #EFF6FF 100%);
    border-radius: 16px;
    padding: 48px 32px 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
    margin-bottom: 32px;
    min-height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.kh-hero__deco {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    opacity: .8;
}
.kh-hero__deco--left  { left:  24px; width: 100px; }
.kh-hero__deco--right { right: 24px; width: 110px; }
@media (max-width: 600px) {
    .kh-hero__deco { display: none; }
}

.kh-hero__content { position: relative; z-index: 2; max-width: 680px; }

.kh-hero__badge {
    display: inline-block;
    background: var(--kh-primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .12em;
    padding: 5px 16px;
    border-radius: 20px;
    margin-bottom: 16px;
}
.kh-hero__title {
    font-size: clamp(26px, 4vw, 42px);
    font-weight: 800;
    color: #0F172A;
    line-height: 1.15;
    margin: 0 0 12px;
}
.kh-hero__sub {
    color: #475569;
    font-size: 16px;
    line-height: 1.6;
    margin: 0 0 28px;
}

/* ── Search ─────────────────────────────────────────────────────────────────── */
.kh-search-form { width: 100%; }
.kh-search-inner {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1.5px solid #E2E8F0;
    border-radius: 10px;
    padding: 6px 6px 6px 14px;
    max-width: 620px;
    margin: 0 auto;
    box-shadow: 0 2px 12px rgba(36,65,123,.10);
}
.kh-search-icon { display: flex; align-items: center; margin-right: 8px; flex-shrink: 0; }
.kh-search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;
    color: #374151;
    background: transparent;
    padding: 4px 0;
}
.kh-search-input::placeholder { color: #94A3B8; }
.kh-search-btn {
    background: var(--kh-primary);
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 7px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
    flex-shrink: 0;
}
.kh-search-btn:hover { background: var(--kh-accent); }

/* ── Filter Tabs ─────────────────────────────────────────────────────────────── */
.kh-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 28px;
}
.kh-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 22px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    color: #475569;
    background: #fff;
    border: 1.5px solid #E2E8F0;
    text-decoration: none;
    transition: all .2s;
}
.kh-filter-btn:hover { border-color: #2563EB; color: #2563EB; background: #EFF6FF; }
.kh-filter-btn.active { background: #2563EB; color: #fff; border-color: #2563EB; }

/* ── Grid ─────────────────────────────────────────────────────────────────────── */
.kh-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 36px;
}

/* ── Card ─────────────────────────────────────────────────────────────────────── */
.kh-card {
    background: #fff;
    border: 1.5px solid #E9F0FB;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 8px rgba(36,65,123,.07);
    transition: box-shadow .2s, transform .2s;
}
.kh-card:hover {
    box-shadow: 0 8px 28px rgba(36,65,123,.14);
    transform: translateY(-2px);
}

.kh-card__thumb {
    width: 100%;
    height: auto; min-height: 180px;
    background: #F1F5F9;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.kh-card__img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center top;
    display: block;
}
.kh-card__no-img {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.kh-card__body {
    padding: 16px 18px 8px;
    flex: 1;
}
.kh-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .1em;
    padding: 3px 10px;
    border-radius: 20px;
    margin-bottom: 8px;
}
.kh-badge--ebook { background: #EFF6FF; color: #2563EB; }
.kh-badge--case  { background: #F5F3FF; color: #7C3AED; }

.kh-card__title {
    font-size: 17px;
    font-weight: 700;
    color: #0F172A;
    margin: 0 0 8px;
    line-height: 1.3;
}
.kh-card__desc {
    font-size: 13.5px;
    color: #64748B;
    line-height: 1.55;
    margin: 0;
}

.kh-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px 16px;
    border-top: 1px solid #F1F5F9;
    margin-top: 12px;
    gap: 10px;
    flex-wrap: wrap;
}
.kh-card__meta {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12.5px;
    color: #94A3B8;
    font-weight: 500;
}

/* ── Download Button ─────────────────────────────────────────────────────────── */
.kh-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    color: var(--kh-accent);
    border: 1.5px solid var(--kh-accent);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all .2s;
    white-space: nowrap;
}
.kh-download-btn:hover { background: var(--kh-accent); color: #fff; }
.kh-download-btn--disabled { border-color: #CBD5E1; color: #94A3B8; cursor: default; }

/* ── Pagination ──────────────────────────────────────────────────────────────── */
.kh-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-bottom: 44px;
}
.kh-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    color: #475569;
    background: #fff;
    border: 1.5px solid #E2E8F0;
    transition: all .2s;
}
.kh-page-btn:hover, .kh-page-btn.active {
    background: var(--kh-primary);
    color: #fff;
    border-color: var(--kh-primary);
}
.kh-page-btn--nav { font-size: 18px; }
.kh-page-ellipsis { color: #94A3B8; padding: 0 4px; line-height: 38px; }

/* ── Empty State ─────────────────────────────────────────────────────────────── */
.kh-empty {
    text-align: center;
    padding: 64px 24px;
    color: #94A3B8;
}
.kh-empty p { margin-top: 16px; font-size: 16px; }

/* ── Features Bar ─────────────────────────────────────────────────────────────── */
.kh-features {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    padding: 32px 24px;
    background: #F8FAFC;
    border-radius: 14px;
    margin-top: 8px;
}
.kh-feature {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}
.kh-feature__icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.kh-feature__icon--blue   { background: #EFF6FF; }
.kh-feature__icon--green  { background: #F0FDF4; }
.kh-feature__icon--purple { background: #F5F3FF; }
.kh-feature__icon--yellow { background: #FFFBEB; }
.kh-feature strong { display: block; font-size: 14px; font-weight: 700; color: #1E293B; margin-bottom: 3px; }
.kh-feature p { margin: 0; font-size: 13px; color: #64748B; line-height: 1.4; }

/* ── Responsive ──────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .kh-hero { padding: 36px 20px 32px; }
    .kh-grid { grid-template-columns: 1fr; }
    .kh-features { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
    .kh-features { grid-template-columns: 1fr; }
    .kh-filter-btn { font-size: 13px; padding: 8px 16px; }
}
