/* ==========================================================================
   Q&A COMMUNITY HOMEPAGE — BRAINLY STYLE (3-COLUMN)
   Self-contained stylesheet, only enqueued on this template, so it can
   never affect the existing homepage / post page / other templates.
   ========================================================================== */

.qam-bh-wrap {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr) 300px;
    gap: 24px;
    margin-top: 30px;
    margin-bottom: 50px;
    align-items: start;
}

/* ---------------------------------------------------------------------
   Shared box look (kept close to the existing .sidebar-box styling so
   this template feels native to the rest of the theme)
   --------------------------------------------------------------------- */
.qam-bh-box {
    background: var(--sidebar-box-bg, #ffffff);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    border: 1px solid #e2e8f0;
    margin-bottom: 20px;
}
.qam-bh-box-title {
    font-size: 15px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 14px 0;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* ---------------------------------------------------------------------
   LEFT SIDEBAR — Subjects / Categories / Topics navigation
   --------------------------------------------------------------------- */
.qam-bh-left { position: relative; }

.qam-bh-cat-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 70vh;
    overflow-y: auto;
}
.qam-bh-cat-list li { margin-bottom: 2px; }
.qam-bh-cat-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 10px;
    border-radius: 8px;
    color: #334155;
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 600;
    transition: background 0.15s ease, color 0.15s ease;
}
.qam-bh-cat-link:hover { background: #f1f5f9; }
.qam-bh-cat-link.active {
    background: var(--primary-color, #2563eb);
    color: #ffffff;
}
.qam-bh-cat-link.active .qam-bh-cat-count { color: rgba(255,255,255,0.8); }
.qam-bh-cat-count { color: #94a3b8; font-weight: 500; font-size: 12px; }

/* ---------------------------------------------------------------------
   CENTER COLUMN — Hero, CTA, Question Stream
   --------------------------------------------------------------------- */
.qam-bh-center { min-width: 0; }

.qam-bh-hero-box {
    background: linear-gradient(135deg, var(--primary-color, #2563eb), #1e40af);
    color: #ffffff;
    border-radius: 16px;
    padding: 24px 26px;
    margin-bottom: 18px;
}
.qam-bh-hero-box h2 {
    margin: 0 0 8px 0;
    font-size: 22px;
    font-weight: 800;
}
.qam-bh-hero-box p {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: rgba(255,255,255,0.9);
    max-width: 640px;
}

.qam-bh-cta-box {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 16px;
    padding: 22px 26px;
    margin-bottom: 22px;
    text-align: center;
}
.qam-bh-cta-box h3 {
    margin: 0 0 14px 0;
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
}
.qam-bh-cta-btn {
    display: inline-block;
    background: #0f172a;
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
    font-size: 14.5px;
    padding: 12px 30px;
    border-radius: 24px;
    border: none;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
}
.qam-bh-cta-btn:hover { background: #1e293b; color: #ffffff; }
.qam-bh-cta-btn:active { transform: scale(0.98); }

.qam-bh-stream {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.qam-bh-card {
    display: block;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px 18px;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.qam-bh-card:hover {
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
    border-color: #c7d2fe;
}
.qam-bh-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.qam-bh-card-meta { display: flex; flex-direction: column; min-width: 0; }
.qam-bh-card-name {
    font-weight: 700;
    font-size: 13.5px;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.qam-bh-card-sub { font-size: 12px; color: #94a3b8; }
.qam-bh-card-cat {
    color: var(--primary-color, #2563eb);
    font-weight: 600;
}
.qam-bh-card-title {
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.qam-bh-empty, .qam-bh-loading {
    text-align: center;
    color: #94a3b8;
    font-size: 14px;
    padding: 30px 0;
    list-style: none;
}

.qam-bh-loadmore-wrap {
    text-align: center;
    margin-top: 22px;
}
.qam-bh-loadmore-btn {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #334155;
    padding: 11px 30px;
    border-radius: 22px;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease;
}
.qam-bh-loadmore-btn:hover { background: #e2e8f0; }
.qam-bh-loadmore-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ---------------------------------------------------------------------
   RIGHT SIDEBAR — Site Intro / Profile / Leaderboards / Custom widgets
   --------------------------------------------------------------------- */
.qam-bh-right { position: relative; }
.qam-bh-right .qam-bh-intro-text {
    font-size: 13.5px;
    line-height: 1.6;
    color: #475569;
    margin: 0;
}
.qam-bh-right .qam-bh-custom-widget-content {
    font-size: 13.5px;
    line-height: 1.6;
    color: #475569;
}
.qam-bh-right .qam-bh-custom-widget-content a { color: var(--primary-color, #2563eb); }

/* ==========================================================================
   RESPONSIVE — Mobile: sidebars stack below the main feed
   ========================================================================== */
@media (max-width: 992px) {
    .qam-bh-wrap {
        grid-template-columns: 1fr;
    }
    .qam-bh-left { order: 2; }
    .qam-bh-center { order: 1; }
    .qam-bh-right { order: 3; }
    .qam-bh-cat-list {
        max-height: none;
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }
    .qam-bh-cat-list li { margin-bottom: 0; }
    .qam-bh-cat-link { white-space: nowrap; }
}

@media (max-width: 600px) {
    .qam-bh-wrap { margin-top: 16px; gap: 16px; }
    .qam-bh-box, .qam-bh-hero-box, .qam-bh-cta-box { padding: 16px; }
    .qam-bh-hero-box h2 { font-size: 19px; }
    .qam-bh-card { padding: 13px 14px; }
    .qam-bh-card-title { font-size: 14px; }
}
