/* =========================================================
   SIDEBAR KINGDOM SEARCH
   ========================================================= */

.sidebar-search-wrapper {
    position: relative;
    width: 100%;
    z-index: 100;
}

/* Search form */
.sidebar-search {
    display: flex;
    align-items: stretch;
    width: 100%;
    height: 58px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    overflow: hidden;
    box-sizing: border-box;
    transition: border-color 0.25s ease,
                box-shadow 0.25s ease,
                background 0.25s ease;
}

.sidebar-search:focus-within {
    background: rgba(255, 255, 255, 0.12);
    border-color: #d4af37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.12);
}

/* Input */
.sidebar-search input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    padding: 0 18px;
    background: transparent;
    color: #ffffff;
    font-family: inherit;
    font-size: 16px;
    font-weight: 500;
}

.sidebar-search input::placeholder {
    color: rgba(255, 255, 255, 0.62);
}

/* Search button */
.sidebar-search button {
    width: 58px;
    min-width: 58px;
    border: 0;
    background: #d4af37;
    color: #ffffff;
    cursor: pointer;
    font-size: 21px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.25s ease,
                transform 0.2s ease;
}

.sidebar-search button:hover {
    background: #b8941f;
}

.sidebar-search button:active {
    transform: scale(0.96);
}


/* =========================================================
   SEARCH RESULTS DROPDOWN
   ========================================================= */

.sidebar-search-wrapper .search-results {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;

    width: 100%;
    max-height: 430px;

    overflow-y: auto;
    overflow-x: hidden;

    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 10px;

    box-shadow:
        0 18px 45px rgba(0, 0, 0, 0.22),
        0 4px 12px rgba(0, 0, 0, 0.08);

    z-index: 9999;

    display: none;
}

/* Show results when JS adds content */
.sidebar-search-wrapper .search-results.has-results {
    display: block;
}


/* =========================================================
   INDIVIDUAL SEARCH RESULT
   ========================================================= */

.sidebar-search-result {
    display: block;
    padding: 16px 18px;
    text-decoration: none;
    color: #222222;

    border-bottom: 1px solid #eeeeee;

    transition:
        background 0.2s ease,
        padding-left 0.2s ease;
}

.sidebar-search-result:last-child {
    border-bottom: none;
}

.sidebar-search-result:hover {
    background: #faf7ed;
    padding-left: 22px;
}


/* Result category */
.sidebar-search-result-category {
    display: block;
    margin-bottom: 5px;

    color: #b38b16;

    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}


/* Result title */
.sidebar-search-result-title {
    display: block;

    color: #222222;

    font-family: Georgia, "Times New Roman", serif;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.35;

    margin-bottom: 5px;
}


/* Result description */
.sidebar-search-result-description {
    display: block;

    color: #666666;

    font-size: 13px;
    line-height: 1.5;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}


/* =========================================================
   EMPTY SEARCH RESULT
   ========================================================= */

.sidebar-search-empty {
    padding: 28px 20px;
    text-align: center;
}

.sidebar-search-empty-icon {
    font-size: 28px;
    margin-bottom: 10px;
    opacity: 0.7;
}

.sidebar-search-empty h4 {
    margin: 0 0 7px;

    color: #333333;

    font-family: Georgia, "Times New Roman", serif;
    font-size: 17px;
}

.sidebar-search-empty p {
    margin: 0;

    color: #777777;

    font-size: 13px;
    line-height: 1.5;
}


/* =========================================================
   SEARCH LOADING
   ========================================================= */

.sidebar-search-loading {
    padding: 22px;
    text-align: center;

    color: #777777;

    font-size: 14px;
}

.sidebar-search-loading::after {
    content: "";
    display: block;

    width: 18px;
    height: 18px;

    margin: 10px auto 0;

    border: 2px solid #dddddd;
    border-top-color: #d4af37;
    border-radius: 50%;

    animation: sidebarSearchSpin 0.7s linear infinite;
}

@keyframes sidebarSearchSpin {
    to {
        transform: rotate(360deg);
    }
}


/* =========================================================
   SEARCH SCROLLBAR
   ========================================================= */

.sidebar-search-wrapper .search-results::-webkit-scrollbar {
    width: 6px;
}

.sidebar-search-wrapper .search-results::-webkit-scrollbar-track {
    background: #f5f5f5;
}

.sidebar-search-wrapper .search-results::-webkit-scrollbar-thumb {
    background: #d4af37;
    border-radius: 10px;
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 768px) {

    .sidebar-search {
        height: 54px;
    }

    .sidebar-search button {
        width: 54px;
        min-width: 54px;
    }

    .sidebar-search-wrapper .search-results {
        max-height: 360px;
    }

    .sidebar-search-result {
        padding: 14px 15px;
    }

    .sidebar-search-result-title {
        font-size: 16px;
    }

}