/* ----------------------------------------------------------------------
   lgw-browse-by-dmd-heading.css
   CSS cho webpart Library/Webparts/BrowseByDmdHeading + Library/Webparts/MenuHeading
   (khi dùng trong trang BrowseByDmdHeading.aspx).

   Toàn bộ class ở đây dùng tiền tố "bdh-" (BrowseByDmdHeading) để không đụng
   tới class "kps-*" gốc (kps-collection-tree / kps-browse-card, dùng bởi
   CatalogCollections / BrowseByCollection) — tránh 2 tính năng vô tình ảnh
   hưởng chéo lẫn nhau khi 1 trong 2 bên cần chỉnh riêng sau này.

   Cấu trúc HTML mượn lại nguyên bản từ:
   - .bdh-collection-tree: giống CatalogCollections.ascx (asp:TreeView) ->
     Library/Webparts/MenuHeading.ascx đã viết lại dùng asp:TreeView.
   - .bdh-browse-card: giống Files/Templates/vi/kpsdsp_bib_card.xsl ->
     Files/Templates/vi/kpsdsp_thumbtitlesummaryleft.xsl / right.xsl.

   Biến màu (--hanu-*, --archive-brown-dark, --orange-6/700) dùng lại từ
   :root khai báo trong lgw-hanu.css (nạp trước file này trong Bundle.config).
   ---------------------------------------------------------------------- */

/*---------------------------------------------------------------------
  bdh-collection-tree (menu heading bên trái, TreeView-based)
-----------------------------------------------------------------------*/
.bdh-collection-tree {
    background-color: transparent;
    border-radius: 0.5rem;
    padding: 0.25rem 0.5rem;
}

    .bdh-collection-tree > div > table,
    .bdh-collection-tree > div > div > table,
    .bdh-collection-tree > div > div > div > table {
        width: 100%;
        transition: 0.3s;
        padding-top: 8px;
        padding-bottom: 8px;
        cursor: pointer;
        border-width: 0;
        border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
        background-color: transparent;
    }

        .bdh-collection-tree > div > table a,
        .bdh-collection-tree > div > div > table a {
            color: var(--archive-brown-dark);
            transition: color 0.2s ease;
            align-items: center;
            white-space: nowrap;
            display: flex;
        }

    .bdh-collection-tree table tbody tr > td:first-child {
        width: 20px;
    }

    .bdh-collection-tree table tbody tr > td:nth-child(2) a {
        display: block;
    }

    .bdh-collection-tree table tbody tr > td:last-child {
        display: block;
        padding-left: 0;
        padding-top: 8px;
        padding-bottom: 8px;
    }

        .bdh-collection-tree table tbody tr > td:last-child a {
            color: var(--archive-brown-dark);
            white-space: pre-wrap;
        }

            .bdh-collection-tree table tbody tr > td:last-child a:hover {
                color: var(--orange-700);
            }

            /* Icon thư mục (Content/Images/icon-dmd-collection.svg) được nhúng thẳng
               vào Text của node trong code-behind (MenuHeading.ascx.cs), giống hệt
               kỹ thuật của CatalogCollections/kps-collection-tree — không cần CSS icon riêng. */
            .bdh-collection-tree table tbody tr > td:last-child a img {
                vertical-align: text-bottom;
            }

    .bdh-collection-tree > div > div {
        background-color: transparent;
    }

    .bdh-collection-tree > div > table:hover {
        border-radius: 0.45rem;
        background-color: rgba(250, 246, 234, 0.8);
    }

    .bdh-collection-tree > div > div > table:hover,
    .bdh-collection-tree > div > div > div > table:hover {
        background-color: rgba(217, 193, 128, 0.35);
    }

    .bdh-collection-tree > div > table > tbody > tr > td {
        padding-left: 0;
        padding-top: 8px;
        padding-bottom: 8px;
    }

    .bdh-collection-tree > div > div > div > table > tbody > tr > td {
        white-space: pre-wrap !important;
    }

    .bdh-collection-tree .fa.fa-plus:before,
    .bdh-collection-tree .fa.fa-minus:before {
        padding: 6px;
        color: var(--orange-600);
    }

/*---------------------------------------------------------------------
  bdh-browse-card (item bên phải, render bởi kpsdsp_thumbtitlesummaryleft/right.xsl)
-----------------------------------------------------------------------*/
.bdh-browse-card {
    position: relative;
    background: linear-gradient(135deg, var(--hanu-card-bg1), var(--hanu-card-bg2));
    border-radius: .875rem;
    border: 1px solid var(--hanu-border);
    box-shadow: 0 1px 10px rgba(0,0,0,.035);
    padding: .6rem .8rem;
    transition: background .18s ease-out, border-color .18s ease-out, box-shadow .18s ease-out;
}

    .bdh-browse-card .card-body {
        padding: 0;
    }

    .bdh-browse-card:hover {
        background: linear-gradient(135deg, var(--hanu-card-bg-hover1), var(--hanu-card-bg-hover2));
        border-color: var(--hanu-border-hover);
        box-shadow: 0 4px 16px rgba(0,0,0,.06);
    }

    .bdh-browse-card,
    .bdh-browse-card p,
    .bdh-browse-card span {
        color: var(--hanu-text);
    }

    .bdh-browse-card .col-auto {
        padding-right: .75rem;
    }

    .bdh-browse-card .col {
        min-width: 0;
    }

    .bdh-browse-card .bdh-card-meta {
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .bdh-browse-card .bdh-card-publisher {
        display: inline-block;
        max-width: 100%;
        vertical-align: bottom;
    }

/* Title */
.bdh-card-title-link {
    color: var(--hanu-text);
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

    .bdh-card-title-link:hover {
        text-decoration: underline;
    }

/* Meta lines (ngày cập nhật / tóm tắt) */
.bdh-card-meta {
    font-size: .875rem;
    line-height: 1.35;
    color: var(--hanu-meta) !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

    .bdh-card-meta i {
        opacity: .85;
        color: var(--hanu-icon);
    }

/* Thumb trái */
.bdh-card-thumb-left {
    width: 106px;
    height: 146px;
    object-fit: cover;
    border-radius: 8px;
    background: var(--hanu-thumb-bg);
    display: block;
    border: 1px solid rgba(140,108,41,.18);
    flex-shrink: 0;
}

.bdh-card-thumb-left-icon {
    width: 100px;
    height: 100px;
    object-fit: contain;
    padding: 6px;
    border-radius: 8px;
    background: var(--hanu-thumb-bg);
    border: 1px solid rgba(140,108,41,.18);
    flex-shrink: 0;
}

.bdh-browse-card:hover .bdh-card-thumb-left,
.bdh-browse-card:hover .bdh-card-thumb-left-icon {
    background: var(--hanu-thumb-bg-hover);
}

/* Circulation stats badges (890) */
.bdh-card-stats {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    margin-top: .35rem;
}

    .bdh-card-stats .badge {
        border: 0 !important;
        background: rgba(64,45,24,.05) !important;
        color: rgba(64,45,24,.70);
        font-weight: 600;
        padding: .18rem .45rem;
        border-radius: 999px;
        max-width: 100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

        .bdh-card-stats .badge i {
            opacity: .7;
            color: var(--hanu-icon);
        }

@media (max-width: 575.98px) {
    .bdh-browse-card > .row {
        flex-wrap: nowrap;
    }

    .bdh-card-thumb-left {
        width: 88px;
        height: 120px;
        object-fit: cover;
    }

    .bdh-card-thumb-left-icon {
        width: 64px;
        height: 64px;
    }

    .bdh-browse-card .card-body {
        padding: .5rem .5rem;
    }
}
