/* ====== KNOWLEDGE HUB PAGE ======
   Page-specific styles only. Global rules (fonts, resets, mobile nav) live in
   style.css and must stay there — see CLAUDE.md.
   Palette is the site's own: primary-dark #13001A, primary-purple #2C003E,
   accent-lavender #C2A5CF, accent-mauve #906E9F, accent-cyan #ABEBF0.
   The source page was blue-themed; nothing from it is carried over. */

/* ====== HERO ====== */
#kh-hero {
    position: relative;
    min-height: 460px;
    background-color: #13001A;
    display: flex;
    align-items: center;
}

#kh-hero-container {
    position: relative;
    z-index: 2;
    min-height: 460px;
    justify-content: center;
    padding-top: 96px;
    padding-bottom: 64px;
}

#kh-hero-bg {
    z-index: 0;
}

#kh-hero-content {
    position: relative;
    z-index: 2;
}

/* ====== INTRO ====== */
#kh-happy-learning {
    background: linear-gradient(90deg, #ABEBF0 0%, #C2A5CF 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    width: max-content;
}

/* ====== TABS ====== */
.kh-tab {
    font-family: 'Galano Grotesque', 'Inter', system-ui, sans-serif;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.4;
    color: #C2A5CF;
    background: transparent;
    border: 1px solid #5E376E;
    border-radius: 999px;
    padding: 10px 24px;
    cursor: pointer;
    transition: background-color .25s ease, color .25s ease, border-color .25s ease;
}

.kh-tab:hover {
    border-color: #C2A5CF;
    color: #FEF9F4;
}

/* Active state carries a filled background AND a weight change, so the
   selected tab is distinguishable without relying on colour alone. */
.kh-tab.is-active {
    background-color: #C2A5CF;
    border-color: #C2A5CF;
    color: #13001A;
    font-weight: 600;
}

.kh-tab:focus-visible {
    outline: 2px solid #ABEBF0;
    outline-offset: 3px;
}

/* ====== BOOK GRID ====== */
.kh-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 28px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.kh-card {
    display: flex;
    flex-direction: column;
    background-color: #1C0426;
    border: 1px solid #2C003E;
    border-radius: 16px;
    padding: 20px;
    transition: border-color .25s ease, transform .25s ease;
}

.kh-card:hover {
    border-color: #5E376E;
    transform: translateY(-3px);
}

.kh-card.is-open {
    border-color: #906E9F;
}

.kh-card-cover {
    width: 100%;
    aspect-ratio: 3 / 4;
    border-radius: 10px;
    overflow: hidden;
    background-color: #13001A;
    margin-bottom: 16px;
}

.kh-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.kh-card-title {
    font-family: 'Galano Grotesque', 'Inter', system-ui, sans-serif;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
    color: #FEF9F4;
    margin-bottom: 10px;
}

.kh-card-desc {
    font-family: 'Galano Grotesque', 'Inter', system-ui, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #D7D7D7;
    margin-bottom: 14px;
}

/* ====== READ MORE ====== */
.kh-readmore {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    font-family: 'Galano Grotesque', 'Inter', system-ui, sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #ABEBF0;
    transition: color .2s ease;
}

.kh-readmore:hover { color: #FEF9F4; }

.kh-readmore:focus-visible {
    outline: 2px solid #ABEBF0;
    outline-offset: 3px;
    border-radius: 4px;
}

.kh-readmore-icon { transition: transform .25s ease; }

.kh-readmore[aria-expanded="true"] .kh-readmore-icon { transform: rotate(180deg); }

/* ====== RESEARCH PAPERS ====== */
.kh-paper {
    background-color: #1C0426;
    border: 1px solid #2C003E;
    border-left: 3px solid #906E9F;
    border-radius: 12px;
    padding: 24px 28px;
    list-style: none;
    transition: border-color .25s ease;
}

.kh-paper:hover { border-color: #5E376E; border-left-color: #C2A5CF; }

.kh-paper-title {
    font-family: 'Galano Grotesque', 'Inter', system-ui, sans-serif;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.3;
    color: #C2A5CF;
    margin-bottom: 10px;
}

.kh-paper-desc {
    font-family: 'Galano Grotesque', 'Inter', system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.65;
    color: #D7D7D7;
}

/* ====== RESPONSIVE ====== */
@media (max-width: 1280px) {
    .kh-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .kh-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
    #kh-hero, #kh-hero-container { min-height: 380px; }
}

@media (max-width: 560px) {
    .kh-grid { grid-template-columns: 1fr; }
    .kh-card { padding: 16px; }
    /* Full-bleed covers look oversized on a phone; cap the height instead. */
    .kh-card-cover { aspect-ratio: auto; height: 220px; }
    .kh-paper { padding: 20px; }
    #kh-hero-container { padding-top: 80px; }
}

/* Respect reduced-motion preferences — the hover lift is decorative. */
@media (prefers-reduced-motion: reduce) {
    .kh-card, .kh-readmore-icon, .kh-tab, .kh-paper { transition: none; }
    .kh-card:hover { transform: none; }
}
