/* ============================================================
   BH Resources Library Section
   ============================================================ */

.bh-resources-library {
    padding: 60px 0;
    background-color: #f3f4fb !important;
}

.bh-rl__heading {
    font-family: var(--font-family);
    font-weight: 700;
    font-size: 42px;
    line-height: 119%;
    color: var(--text);
    margin: 0 0 40px;
}

/* ── Layout: sidebar + results ── */
.bh-rl__layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
    align-items: start;
}

/* ============================================================
   Sidebar
   ============================================================ */

.bh-rl__sidebar {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Search */
.bh-rl__search-wrap {
    display: flex;
    align-items: center;
    border: 1px solid var(--grey-3);
    border-radius: 8px;
    padding: 10px 14px;
    gap: 8px;
    margin-bottom: 16px;
}

.bh-rl__search-input {
    flex: 1;
    border: none;
    outline: none;
    background: none;
    font-family: var(--font-family);
    font-size: 15px;
    color: var(--text);
}

.bh-rl__search-input::placeholder {
    color: var(--grey-3);
}

.bh-rl__search-icon-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    line-height: 0;
    flex-shrink: 0;
}

/* Filter group */
.bh-rl__filter-group {
    border-bottom: 1px solid var(--grey-2);
    padding-bottom: 16px;
    margin-bottom: 4px;
}

.bh-rl__filter-title {
    width: 100%;
    background: none;
    border: none;
    padding: 12px 0;
    text-align: left;
    font-family: var(--font-family);
    font-weight: 700;
    font-size: 16px;
    color: var(--text);
    cursor: pointer;
}

/* Select */
.bh-rl__select {
    width: 100%;
    border: 1px solid var(--grey-2);
    border-radius: 8px;
    padding: 10px 14px;
    font-family: var(--font-family);
    font-size: 15px;
    color: var(--grey-3);
    background: #fff;
    outline: none;
    cursor: pointer;
}

/* Checkbox labels */
.bh-rl__check-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 0;
    cursor: pointer;
    font-family: var(--font-family);
    font-size: 15px;
    color: var(--text);
}

.bh-rl__filter-extra {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
}

.bh-rl__check-label input[type="checkbox"] {
    display: none;
}

.bh-rl__check-box {
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--grey-3);
    border-radius: 4px;
    flex-shrink: 0;
    position: relative;
    transition: border-color 0.2s, background 0.2s;
}

.bh-rl__check-label input:checked ~ .bh-rl__check-box {
    border-color: var(--blue-1);
    background: var(--blue-1);
}

.bh-rl__check-label input:checked ~ .bh-rl__check-box::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 6px;
    height: 10px;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
}

/* Show more */
.bh-rl__show-more {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    padding: 6px 0 0;
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 600;
    color: var(--blue-1);
    cursor: pointer;
}

.bh-rl__show-more svg {
    transition: transform 0.2s;
}

.bh-rl__show-more.is-open svg {
    transform: rotate(180deg);
}

/* ============================================================
   Results
   ============================================================ */



.bh-rl__total {
font-family: var(--font-family);
font-weight: 600;
font-size: 24px;
line-height: 130%;
color: var(--grey-3);
padding-bottom: 24px;
border-bottom: 1px solid rgba(147, 154, 171, 0.4);
display: block;
width: 100%;
margin-bottom: 24px;
}

/* Grid 3 columns */
.bh-rl__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.bh-rl__no-results {
    grid-column: 1 / -1;
    font-family: var(--font-family);
    font-size: 16px;
    color: var(--grey-3);
}

/* ── Load more ── */
.bh-rl__load-more-wrap {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.bh-rl__load-more {
    padding: 10px 32px;
    border-radius: 8px;
    background: linear-gradient(165deg, #fe4377 0%, #f39c12 100%);
    font-family: var(--font-family);
    font-weight: 600;
    font-size: 18px;
    line-height: 144%;
    text-align: center;
    color: var(--white);
    border: none;
    cursor: pointer;
    transition: opacity 0.2s;
}

.bh-rl__load-more:hover {
    opacity: 0.88;
}

.bh-rl__load-more[disabled] {
    display: none;
}

/* ── Pagination ── */
.bh-rl__pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 20px;
}

.bh-rl__page-btn {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 4px;
    border: 1.5px solid var(--grey-2);
    background: none;
    font-family: var(--font-family);
    font-weight: 600;
    font-size: 20px;
    text-align: center;
    color: #0c0c0c;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}

.bh-rl__page-btn.is-active {
    border-color: transparent;
    font-weight: 600;
    font-size: 20px;
    background: linear-gradient(90deg, #f64c72 0%, #ff9f69 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.bh-rl__page-btn.is-active::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 4px;
    background-image: url("data:image/svg+xml,<svg width='36' height='36' viewBox='0 0 36 36' fill='none' xmlns='http://www.w3.org/2000/svg'><rect x='0.75' y='0.75' width='34.5' height='34.5' rx='3.5' stroke='url(%23pg)' stroke-width='1.5'/><defs><linearGradient id='pg' x1='0' y1='18' x2='36' y2='18' gradientUnits='userSpaceOnUse'><stop stop-color='%23F64C72'/><stop offset='1' stop-color='%23FF9F69'/></linearGradient></defs></svg>");
    background-size: 100% 100%;
    pointer-events: none;
}

.bh-rl__page-arrow {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1.5px solid var(--grey-2);
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: border-color 0.2s, opacity 0.2s;
}

.bh-rl__page-arrow[disabled] {
    opacity: 0.3;
    cursor: default;
    pointer-events: none;
}

.bh-rl__page-arrow:hover {
    border-color: #f64c72;
}

.bh-rl__page-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    font-family: var(--font-family);
    font-size: 16px;
    color: #0c0c0c;
    user-select: none;
}

.bh-rl__page-btn:not(.is-active):hover {
    border-color: var(--blue-1);
    color: var(--blue-1);
}

/* Loading overlay */
.bh-rl__grid.is-loading {
    opacity: 0.4;
    pointer-events: none;
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 1024px) {
    .bh-rl__layout {
        grid-template-columns: 220px 1fr;
        gap: 24px;
    }

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

/* ── Mobile filter toggle button (hidden on desktop) ── */
.bh-rl__filter-toggle {
    display: none;
}

/* ── Sidebar mobile head / footer (hidden on desktop) ── */
.bh-rl__sidebar-mob-head,
.bh-rl__sidebar-mob-footer {
    display: none;
}

@media (max-width: 768px) {
    .bh-resources-library {
        padding: 40px 0;
    }

    .bh-rl__heading {
        font-size: 28px;
    }

    .bh-rl__layout {
        grid-template-columns: 1fr;
    }

    .bh-rl__grid {
        grid-template-columns: 1fr;
    }

    /* Hide sidebar by default on mobile — slide-in from right */
    .bh-rl__sidebar {
        display: flex;
        flex-direction: column;
        gap: 8px;
        position: fixed;
        inset: 0;
        z-index: 1000;
        background: #fff;
        overflow-y: auto;
        padding: 0 20px 100px;
        transform: translateX(100%);
        opacity: 0;
        transition: transform 0.35s ease, opacity 0.35s ease;
        pointer-events: none;
    }

    .bh-rl__sidebar.is-open {
        transform: translateX(0);
        opacity: 1;
        pointer-events: auto;
    }

    /* Mobile header inside sidebar */
    .bh-rl__sidebar-mob-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 20px 0 16px;
        border-bottom: 1px solid var(--grey-2);
        margin-bottom: 8px;
        position: sticky;
        top: 0;
        background: #fff;
        z-index: 1;
    }

    .bh-rl__sidebar-mob-title {
        font-family: var(--font-family);
        font-weight: 700;
        font-size: 24px;
        color: var(--text);
    }

    .bh-rl__sidebar-close {
        background: none;
        border: none;
        padding: 0;
        cursor: pointer;
        line-height: 0;
        flex-shrink: 0;
    }

    /* Mobile footer */
    .bh-rl__sidebar-mob-footer {
        display: block;
        padding: 24px 0 8px;
    }

    .bh-rl__apply-btn {
        position: relative;
        width: 100%;
        padding: 12px 24px;
        border: none;
        background: none;
        cursor: pointer;
        font-family: var(--font-family);
        font-weight: 500;
        font-size: 18px;
        line-height: 144%;
        text-align: center;
        background: linear-gradient(90deg, #f64c72 0%, #ff9f69 100%);
        background-clip: text;
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
    }

    .bh-rl__apply-btn::before {
        content: '';
        position: absolute;
        inset: 0;
        border-radius: 8px;
        background-image: url("data:image/svg+xml,<svg width='100%25' height='100%25' viewBox='0 0 343 46' fill='none' xmlns='http://www.w3.org/2000/svg'><path d='M8 0.75H335C339.004 0.75 342.25 3.99593 342.25 8V38C342.25 42.0041 339.004 45.25 335 45.25H8C3.99594 45.25 0.75 42.0041 0.75 38V8C0.75 3.99594 3.99594 0.75 8 0.75Z' stroke='url(%23pg-apply)' stroke-width='1.5'/><defs><linearGradient id='pg-apply' x1='124.842' y1='-6.27273' x2='157.431' y2='85.9834' gradientUnits='userSpaceOnUse'><stop stop-color='%23FE4377'/><stop offset='1' stop-color='%23F39C12'/></linearGradient></defs></svg>");
        background-size: 100% 100%;
        pointer-events: none;
    }

    /* Filter toggle button */
    .bh-rl__filter-toggle {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        padding: 12px 24px;
        margin-bottom: 24px;
        border: none;
        background: none;
        cursor: pointer;
        font-family: var(--font-family);
        font-weight: 500;
        font-size: 18px;
        line-height: 144%;
        text-align: center;
        background: linear-gradient(90deg, #f64c72 0%, #ff9f69 100%);
        background-clip: text;
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
    }

    .bh-rl__filter-toggle::before {
        content: '';
        position: absolute;
        inset: 0;
        border-radius: 8px;
        background-image: url("data:image/svg+xml,<svg width='100%25' height='100%25' viewBox='0 0 343 46' fill='none' xmlns='http://www.w3.org/2000/svg'><path d='M8 0.75H335C339.004 0.75 342.25 3.99593 342.25 8V38C342.25 42.0041 339.004 45.25 335 45.25H8C3.99594 45.25 0.75 42.0041 0.75 38V8C0.75 3.99594 3.99594 0.75 8 0.75Z' stroke='url(%23pg-toggle)' stroke-width='1.5'/><defs><linearGradient id='pg-toggle' x1='124.842' y1='-6.27273' x2='157.431' y2='85.9834' gradientUnits='userSpaceOnUse'><stop stop-color='%23FE4377'/><stop offset='1' stop-color='%23F39C12'/></linearGradient></defs></svg>");
        background-size: 100% 100%;
        pointer-events: none;
    }
}
