﻿/* =========================================================================
   guide-index.css
   Giao dien "muc luc huong dan" cho cac bai viet tong hop nhieu lien ket.
   Chi co tac dung khi guide-index.js dung ra cac phan tu .gi-*.
   Bai viet thuong khong dat nguong -> khong co phan tu nao, hien thi y nhu cu.
   ========================================================================= */

/* Khoi thay the the <p> boc ngoai noi dung bai viet (giu nguyen khoang cach cu) */
.blog-content {
    padding-bottom: 25px;
}

/* Tu lo box-sizing cho rieng khoi nay, khong phu thuoc vao reset cua trang chu.
   Thieu dong nay thi width:100% + padding cua o tim se tran ra de len chu ben canh. */
.gi-wrap,
.gi-wrap *,
.gi-wrap *:before,
.gi-wrap *:after {
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}

/* -------------------------------------------------------------------------
   1. Bo cuc cot khi kich hoat
   ------------------------------------------------------------------------- */

/* Cot noi dung chiem tron chieu ngang */
.gi-col-main {
    -ms-flex: 0 0 100%;
    flex: 0 0 100%;
    max-width: 100%;
}

.gi-col-main .p-r-50 {
    padding-right: 0 !important;
}

/* Cot "BAI VIET KHAC" xuong duoi, nam ngang */
.gi-col-side {
    -ms-flex: 0 0 100%;
    flex: 0 0 100%;
    max-width: 100%;
    border-top: 1px solid #e6e6e6;
    padding-top: 30px;
}

.gi-col-side .rightbar ul {
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
    list-style: none;
}

.gi-col-side .rightbar ul > li {
    width: 25%;
    padding-right: 20px;
}

@media (max-width: 767px) {
    .gi-col-side .rightbar ul > li {
        width: 50%;
    }
}

/* -------------------------------------------------------------------------
   2. Thanh cong cu: o tim + nut mo/dong tat ca
   ------------------------------------------------------------------------- */

.gi-toolbar {
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    -ms-flex-align: center;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    margin-bottom: 22px;
    background: #f5f8fb;
    border: 1px solid #dbe4ee;
    border-radius: 4px;
}

/* Vien nam o KHUNG chu khong nam o the <input>, vi main.css co
   "input { border: none !important }" se xoa mat vien cua input. */
.gi-search-box {
    position: relative;
    -ms-flex: 1 1 320px;
    flex: 1 1 320px;
    min-width: 0;
    background: #ffffff;
    border: 1px solid #c9d6e2;
    border-radius: 3px;
}

.gi-search-box:focus-within {
    border-color: #1f5fa8;
    box-shadow: 0 0 0 3px rgba(31, 95, 168, .13);
}

.gi-search-box .fa {
    position: absolute;
    left: 13px;
    top: 50%;
    margin-top: -8px;
    font-size: 15px;
    color: #8c9aa8;
    pointer-events: none;
}

.gi-search {
    display: block;
    width: 100%;
    height: 40px;
    padding: 0 34px 0 36px;
    font-size: 15px;
    font-family: inherit;
    color: #333333;
    background: transparent;
    border: none;
    border-radius: 3px;
    outline: none;
}

.gi-search::-ms-clear {
    display: none;
}

.gi-clear {
    position: absolute;
    right: 6px;
    top: 50%;
    margin-top: -13px;
    width: 26px;
    height: 26px;
    padding: 0;
    line-height: 24px;
    text-align: center;
    font-size: 16px;
    color: #8c9aa8;
    background: none;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
}

.gi-clear:hover {
    color: #333333;
    background: #e8eef5;
}

.gi-search-box.has-value .gi-clear {
    display: block;
}

.gi-stat {
    font-size: 13.5px;
    color: #6a7a89;
    white-space: nowrap;
}

.gi-stat b {
    color: #1f5fa8;
}

.gi-btn {
    height: 42px;
    padding: 0 16px;
    font-size: 14px;
    font-weight: 500;
    color: #1f5fa8;
    background: #ffffff;
    border: 1px solid #c9d6e2;
    border-radius: 3px;
    cursor: pointer;
    white-space: nowrap;
}

.gi-btn:hover {
    background: #1f5fa8;
    border-color: #1f5fa8;
    color: #ffffff;
}

.gi-btn:focus-visible,
.gi-toc-link:focus-visible,
.gi-head-btn:focus-visible,
.gi-copy:focus-visible {
    outline: 2px solid #1f5fa8;
    outline-offset: 2px;
}

/* -------------------------------------------------------------------------
   3. Bo cuc hai cot: muc luc trai + noi dung phai
   ------------------------------------------------------------------------- */

.gi-layout {
    display: -ms-flexbox;
    display: flex;
    -ms-flex-align: start;
    align-items: flex-start;
    gap: 32px;
}

.gi-toc {
    -ms-flex: 0 0 262px;
    flex: 0 0 262px;
    position: -webkit-sticky;
    position: sticky;
    top: 16px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    padding-right: 4px;
}

.gi-toc-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .11em;
    text-transform: uppercase;
    color: #8c9aa8;
    margin: 0 0 10px;
}

.gi-toc-list {
    margin: 0;
    padding: 0;
    list-style: none;
    border-left: 2px solid #e6e6e6;
}

.gi-toc-link {
    display: -ms-flexbox;
    display: flex;
    -ms-flex-align: baseline;
    align-items: baseline;
    gap: 8px;
    padding: 7px 10px 7px 12px;
    margin-left: -2px;
    border-left: 2px solid transparent;
    font-size: 14px;
    line-height: 1.4;
    color: #4a5765;
    text-decoration: none;
}

.gi-toc-link:hover {
    color: #1f5fa8;
    background: #f2f6fa;
    text-decoration: none;
}

.gi-toc-link.is-active {
    color: #1f5fa8;
    font-weight: 600;
    border-left-color: #1f5fa8;
    background: #f2f6fa;
}

.gi-toc-link.is-empty {
    opacity: .35;
}

.gi-toc-name {
    -ms-flex: 1 1 auto;
    flex: 1 1 auto;
    min-width: 0;
}

.gi-toc-count {
    -ms-flex: 0 0 auto;
    flex: 0 0 auto;
    font-size: 12px;
    color: #8c9aa8;
    font-variant-numeric: tabular-nums;
}

.gi-toc-toggle {
    display: none;
}

.gi-groups {
    -ms-flex: 1 1 auto;
    flex: 1 1 auto;
    min-width: 0;
}

/* -------------------------------------------------------------------------
   4. Nhom gap/mo
   ------------------------------------------------------------------------- */

.gi-group {
    border: 1px solid #e0e6ec;
    border-radius: 4px;
    margin-bottom: 10px;
    background: #ffffff;
}

.gi-group.is-open {
    border-color: #c5d5e6;
}

.gi-group.is-hidden {
    display: none;
}

/* .gi-head là hàng ngang chứa nút tiêu đề + nút sao chép (hai nút anh em) */
.gi-head {
    display: -ms-flexbox;
    display: flex;
    -ms-flex-align: center;
    align-items: center;
    margin: 0;
    padding-right: 8px;
    font-size: inherit;
    font-weight: inherit;
    background: #f7f9fb;
    border-radius: 3px;
}

.gi-group.is-open .gi-head {
    background: #eef4fa;
    border-bottom: 1px solid #dbe4ee;
    border-radius: 3px 3px 0 0;
}

.gi-head:hover {
    background: #eef4fa;
}

.gi-head-btn {
    display: -ms-flexbox;
    display: flex;
    -ms-flex-align: center;
    align-items: center;
    gap: 10px;
    -ms-flex: 1 1 auto;
    flex: 1 1 auto;
    min-width: 0;
    padding: 13px 14px;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.gi-caret {
    -ms-flex: 0 0 auto;
    flex: 0 0 auto;
    width: 16px;
    font-size: 13px;
    color: #1f5fa8;
    text-align: center;
}

.gi-name {
    -ms-flex: 1 1 auto;
    flex: 1 1 auto;
    min-width: 0;
    font-size: 15.5px;
    font-weight: 600;
    color: #24313d;
    line-height: 1.35;
}

.gi-badge {
    -ms-flex: 0 0 auto;
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 600;
    color: #1f5fa8;
    background: #e3edf8;
    border-radius: 10px;
    padding: 2px 10px;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.gi-copy {
    -ms-flex: 0 0 auto;
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    padding: 0;
    font-size: 13px;
    color: #8c9aa8;
    background: none;
    border: 1px solid transparent;
    border-radius: 3px;
    cursor: pointer;
}

.gi-copy:hover {
    color: #1f5fa8;
    border-color: #c9d6e2;
    background: #ffffff;
}

.gi-copy.is-done {
    color: #1b6440;
}

.gi-body {
    padding: 12px 16px 6px 40px;
}

/* Bootstrap co "[hidden]{display:none!important}". Voi nhom dang dong binh thuong
   thi dung, nhung no de bep ca hidden="until-found" -> Ctrl+F cua trinh duyet
   se KHONG tim thay chu ben trong nhom dang dong nua. Tra lai dung hanh vi. */
.gi-body[hidden="until-found"] {
    display: block !important;
    content-visibility: hidden;
    /* content-visibility chi bo qua PHAN NOI DUNG, cai hop van con padding
       -> moi nhom dang dong se thua mot vet trong ~18px. Dep padding di. */
    padding: 0;
    border: none;
}

.gi-body > p {
    margin-bottom: 9px;
    line-height: 1.55;
}

.gi-body a {
    color: #1f5fa8;
}

.gi-body a:hover {
    color: #14406f;
    text-decoration: underline;
}

.gi-item.is-hidden {
    display: none;
}

/* Doan ghi chu (khong phai bai huong dan) an di khi dang loc,
   de ket qua tra ra chi con dung nhung dong khop tu khoa. */
.gi-wrap.is-filtering .gi-note {
    display: none;
}

.gi-mark {
    background: #ffe9a8;
    color: inherit;
    padding: 0 1px;
    border-radius: 2px;
}

.gi-empty {
    padding: 26px 16px;
    text-align: center;
    color: #6a7a89;
    font-size: 15px;
    border: 1px dashed #d5dee7;
    border-radius: 4px;
}

.gi-empty b {
    color: #333333;
}

/* -------------------------------------------------------------------------
   5. Man hinh nho: muc luc thanh nut tha xuong
   ------------------------------------------------------------------------- */

@media (max-width: 991px) {
    .gi-layout {
        display: block;
    }

    .gi-toc {
        position: static;
        max-height: none;
        overflow: visible;
        margin-bottom: 18px;
        padding-right: 0;
        border: 1px solid #dbe4ee;
        border-radius: 4px;
    }

    .gi-toc-title {
        display: none;
    }

    .gi-toc-toggle {
        display: block;
        width: 100%;
        padding: 12px 14px;
        text-align: left;
        font-size: 14.5px;
        font-weight: 600;
        color: #1f5fa8;
        background: #f5f8fb;
        border: none;
        border-radius: 3px;
        cursor: pointer;
        font-family: inherit;
    }

    .gi-toc-list {
        display: none;
        border-left: none;
        border-top: 1px solid #dbe4ee;
        padding: 6px 0;
    }

    .gi-toc.is-open .gi-toc-list {
        display: block;
    }

    .gi-body {
        padding-left: 20px;
    }
}

@media (max-width: 575px) {
    .gi-toolbar {
        padding: 12px;
    }

    .gi-stat {
        -ms-flex: 1 1 100%;
        flex: 1 1 100%;
    }

    .gi-btn {
        -ms-flex: 1 1 auto;
        flex: 1 1 auto;
    }

    .gi-name {
        font-size: 14.5px;
    }

    .gi-body {
        padding-left: 14px;
        padding-right: 12px;
    }
}
