/* =========================================================
   DLD BLOG SEARCH
   Dùng chung:
   - Cẩm nang du lịch
   - Cẩm nang Child

   Search luôn rộng 100% theo container / column cha
   Không phụ thuộc Flatsome Search
========================================================= */


/* =========================================================
   1. SEARCH WRAPPER
========================================================= */

.dld-blog-search {
    position: relative !important;
    z-index: 10 !important;

    width: 100% !important;
    max-width: 100% !important;

    margin-top: 4px !important;
    margin-bottom: 6px !important;

    overflow: visible !important;
}


/* =========================================================
   2. FORM
========================================================= */

.dld-blog-search-form {
    position: relative !important;

    display: flex !important;
    align-items: center !important;

    width: 100% !important;
    height: 56px !important;

    margin: 0 !important;
    padding: 4px !important;

    background: rgba(255,255,255,.96) !important;

    border: 1px solid rgba(28,36,115,.08) !important;
    border-radius: 999px !important;

    box-shadow:
        0 4px 14px rgba(28,36,115,.10) !important;

    overflow: visible !important;
}


/* =========================================================
   3. VÙNG INPUT
========================================================= */

.dld-blog-search-field {
    position: relative !important;

    display: flex !important;
    align-items: center !important;

    flex: 1 1 auto !important;

    min-width: 0 !important;
    height: 48px !important;
}


/* =========================================================
   4. INPUT
========================================================= */

.dld-blog-search-input {
    display: block !important;

    width: 100% !important;
    height: 48px !important;

    margin: 0 !important;

    padding: 0 16px 0 45px !important;

    background: transparent !important;

    border: 0 !important;
    border-radius: 0 !important;

    box-shadow: none !important;
    outline: none !important;

    color: #1C2473 !important;

    font-size: 14px !important;
    font-weight: 500 !important;
}


/* Placeholder */

.dld-blog-search-input::placeholder {
    color: #7A8295 !important;
    opacity: 1 !important;
}


/* Bỏ nút X mặc định của input search */

.dld-blog-search-input::-webkit-search-cancel-button {
    display: none;
}


/* =========================================================
   5. ICON KÍNH LÚP INPUT
========================================================= */

.dld-blog-search-icon {
    position: absolute !important;

    left: 15px !important;
    top: 50% !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    width: 21px !important;
    height: 21px !important;

    color: #1C2473 !important;

    transform: translateY(-50%) !important;

    z-index: 5 !important;

    pointer-events: none !important;
}


.dld-blog-search-icon svg {
    display: block !important;

    width: 21px !important;
    height: 21px !important;
}


/* =========================================================
   6. BUTTON TÌM KIẾM
========================================================= */

.dld-blog-search-submit {
    position: relative !important;

    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;

    flex: 0 0 150px !important;

    width: 150px !important;
    min-width: 150px !important;
    height: 44px !important;

    margin: 0 !important;

    padding: 0 14px 0 53px !important;

    background-color: #EE2D38 !important;

    /* Divider giữa icon và chữ */
    background-image:
        linear-gradient(
            to bottom,
            transparent 0,
            transparent 11px,
            rgba(255,255,255,.55) 11px,
            rgba(255,255,255,.55) 33px,
            transparent 33px,
            transparent 100%
        ) !important;

    background-size: 1px 100% !important;
    background-position: 43px 0 !important;
    background-repeat: no-repeat !important;

    border: 0 !important;
    border-radius: 999px !important;

    box-shadow:
        0 2px 5px rgba(238,45,56,.18) !important;

    color: #fff !important;

    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1 !important;

    text-transform: none !important;
    letter-spacing: 0 !important;

    opacity: 1 !important;

    overflow: hidden !important;

    cursor: pointer !important;

    transition:
        background-color .2s ease,
        box-shadow .2s ease !important;
}


/* =========================================================
   7. ICON KÍNH LÚP BUTTON
========================================================= */

.dld-blog-search-submit-icon {
    position: absolute !important;

    left: 15px !important;
    top: 50% !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    width: 19px !important;
    height: 19px !important;

    color: #fff !important;

    transform: translateY(-50%) !important;

    pointer-events: none !important;
}


.dld-blog-search-submit-icon svg {
    display: block !important;

    width: 19px !important;
    height: 19px !important;
}


/* =========================================================
   8. BUTTON TEXT
========================================================= */

.dld-blog-search-submit-text {
    display: block !important;

    color: #fff !important;

    white-space: nowrap !important;

    line-height: 1 !important;
}


/* =========================================================
   9. HOVER BUTTON
========================================================= */

.dld-blog-search-submit:hover {
    background-color: #D9232E !important;

    color: #fff !important;

    box-shadow:
        0 3px 7px rgba(238,45,56,.24) !important;
}


/* =========================================================
   10. LIVE SEARCH DROPDOWN
========================================================= */

.dld-blog-search-dropdown {
    position: absolute !important;

    top: calc(100% + 7px) !important;
    left: 0 !important;

    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;

    margin: 0 !important;

    background: #fff !important;

    border: 1px solid rgba(28,36,115,.08) !important;
    border-radius: 16px !important;

    box-shadow:
        0 12px 32px rgba(28,36,115,.18) !important;

    overflow: hidden !important;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transform: translateY(-4px);

    transition:
        opacity .16s ease,
        transform .16s ease,
        visibility .16s ease;

    z-index: 99999 !important;
}


.dld-blog-search-dropdown.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;

    transform: translateY(0);
}


/* =========================================================
   11. RESULTS
========================================================= */

.dld-blog-search-results {
    width: 100%;

    max-height: 420px;

    overflow-x: hidden;
    overflow-y: auto;
}


/* =========================================================
   12. RESULT ITEM
========================================================= */

.dld-blog-search-item {
    display: flex;
    align-items: center;

    gap: 12px;

    width: 100%;

    padding: 10px 14px;

    background: #fff;

    border-bottom:
        1px solid rgba(28,36,115,.06);

    text-decoration: none !important;

    transition:
        background-color .18s ease;
}


.dld-blog-search-item:last-child {
    border-bottom: 0;
}


.dld-blog-search-item:hover {
    background: #F5F7FC;
}


/* =========================================================
   13. IMAGE
========================================================= */

.dld-blog-search-result-image {
    flex: 0 0 82px;

    width: 82px;
    height: 58px;

    overflow: hidden;

    background: #F2F3F7;

    border-radius: 8px;
}


.dld-blog-search-result-image img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;
}


.dld-blog-search-no-image {
    display: block;

    width: 100%;
    height: 100%;

    background:
        linear-gradient(
            135deg,
            #F4F5F9,
            #E8EAF2
        );
}


/* =========================================================
   14. CONTENT
========================================================= */

.dld-blog-search-result-content {
    flex: 1 1 auto;

    min-width: 0;
}


/* Title */

.dld-blog-search-result-title {
    display: -webkit-box;

    margin: 0 0 6px;

    overflow: hidden;

    color: #1C2473;

    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;

    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}


.dld-blog-search-item:hover
.dld-blog-search-result-title {
    color: #EE2D38;
}


/* =========================================================
   15. META
========================================================= */

.dld-blog-search-result-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    gap: 0;

    margin-top: 1px;

    font-size: 11.5px;
    line-height: 1.3;
}


/* Category */

.dld-blog-search-result-category {
    display: inline-flex;
    align-items: center;

    color: #5E6680;

    font-weight: 600;
}


/* Gạch đỏ trước Category */

.dld-blog-search-result-category::before {
    content: "";

    display: inline-block;

    width: 2px;
    height: 12px;

    margin-right: 8px;

    background: #EE2D38;

    border-radius: 999px;
}


/* Dấu phân cách giữa Category và ngày */

.dld-blog-search-result-dot {
    display: inline-block;

    width: 3px;
    height: 3px;

    margin: 0 7px;

    background: #C6CAD6;

    border-radius: 50%;

    font-size: 0;
    line-height: 0;
}


/* Ngày đăng */

.dld-blog-search-result-date {
    color: #9AA0B2;

    font-weight: 400;
}


/* =========================================================
   16. KEYWORD HIGHLIGHT
========================================================= */

.dld-blog-search-highlight {
    padding: 0 2px;

    background:
        rgba(238,45,56,.08);

    border-radius: 3px;

    color: #EE2D38;

    font-weight: 800;
}


/* =========================================================
   17. LOADING / EMPTY
========================================================= */

.dld-blog-search-loading,
.dld-blog-search-empty {
    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 64px;

    padding: 14px;

    color: #6F758A;

    font-size: 13px;
    font-weight: 500;

    text-align: center;
}


/* Spinner */

.dld-blog-search-loading {
    gap: 9px;
}


.dld-blog-search-spinner {
    width: 16px;
    height: 16px;

    border:
        2px solid rgba(28,36,115,.15);

    border-top-color:
        #1C2473;

    border-radius: 50%;

    animation:
        dld-blog-search-spin .65s linear infinite;
}


@keyframes dld-blog-search-spin {

    to {
        transform: rotate(360deg);
    }

}


/* =========================================================
   18. MOBILE
========================================================= */

@media (max-width: 549px) {

    /* Form */

    .dld-blog-search-form {
        height: 52px !important;

        padding: 4px !important;
    }


    /* Input area */

    .dld-blog-search-field,
    .dld-blog-search-input {
        height: 44px !important;
    }


    /* Input */

    .dld-blog-search-input {
        padding-left: 41px !important;

        font-size: 12px !important;
    }


    /* Icon input */

    .dld-blog-search-icon {
        left: 13px !important;

        width: 20px !important;
        height: 20px !important;
    }


    .dld-blog-search-icon svg {
        width: 20px !important;
        height: 20px !important;
    }


    /* Button */

    .dld-blog-search-submit {
        flex-basis: 110px !important;

        width: 110px !important;
        min-width: 110px !important;
        height: 44px !important;

        padding-left: 39px !important;

        font-size: 12px !important;

        background-position: 37px 0 !important;
    }


    /* Icon button */

    .dld-blog-search-submit-icon {
        left: 12px !important;

        width: 18px !important;
        height: 18px !important;
    }


    .dld-blog-search-submit-icon svg {
        width: 18px !important;
        height: 18px !important;
    }


    /* Dropdown */

    .dld-blog-search-dropdown {
        border-radius: 13px !important;
    }


    /* Results */

    .dld-blog-search-results {
        max-height: 360px;
    }


    /* Item */

    .dld-blog-search-item {
        gap: 10px;

        padding: 9px 11px;
    }


    /* Image */

    .dld-blog-search-result-image {
        flex-basis: 72px;

        width: 72px;
        height: 52px;

        border-radius: 7px;
    }


    /* Title */

    .dld-blog-search-result-title {
        margin-bottom: 4px;

        font-size: 12.5px;
    }


    /* Meta */

    .dld-blog-search-result-meta {
        gap: 5px;

        font-size: 10.5px;
    }

}