/* =========================================================
   Api News: article search (header icon, blog-page bar, window)
   ========================================================= */

/* ---------- header icon ---------- */

.bs-header-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-right: 4px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #412e03;
    cursor: pointer;
}

.bs-header-button:hover,
.bs-header-button:focus-visible {
    background: rgba(154, 103, 0, .12);
}

.bs-header-button svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

/* ---------- search bar on the blog page ---------- */

.bs-bar-row {
    max-width: 1280px;
    margin: 0 auto 18px;
    padding: 0 16px;
}

.bs-bar {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 640px;
    padding: 0 16px;
    height: 48px;
    background: #fff;
    border: 1.5px solid #d9cfb4;
    border-radius: 999px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}

.bs-bar:focus-within {
    border-color: #9a6700;
    box-shadow: 0 0 0 3px rgba(154, 103, 0, .15);
}

.bs-bar svg {
    flex: none;
    width: 20px;
    height: 20px;
    fill: none;
    stroke: #9a6700;
    stroke-width: 2;
    stroke-linecap: round;
}

.bs-bar input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    font: inherit;
    font-size: 16px;
    color: #2b2100;
}

/* ---------- the window ---------- */

html.bs-open {
    overflow: hidden;
}

.bs-modal[hidden] {
    display: none;
}

.bs-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.bs-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .55);
}

.bs-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(680px, calc(100% - 24px));
    max-height: min(640px, calc(100% - 48px));
    margin-top: 40px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
    overflow: hidden;
}

.bs-form {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid #eee6d0;
}

.bs-form > svg {
    flex: none;
    width: 22px;
    height: 22px;
    fill: none;
    stroke: #9a6700;
    stroke-width: 2;
    stroke-linecap: round;
}

.bs-input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    font: inherit;
    font-size: 17px;
    color: #2b2100;
    -webkit-appearance: none;
    appearance: none;
}

.bs-input::-webkit-search-cancel-button {
    display: none;
}

.bs-clear,
.bs-cancel {
    flex: none;
    border: 0;
    background: transparent;
    color: #6a5a2e;
    font: inherit;
    cursor: pointer;
}

.bs-clear {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 22px;
    line-height: 1;
}

.bs-clear:hover,
.bs-cancel:hover {
    background: #f4eddb;
}

.bs-cancel {
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
}

.bs-body {
    overflow-y: auto;
    padding: 10px 12px 14px;
    -webkit-overflow-scrolling: touch;
}

.bs-status {
    margin: 4px 6px 10px;
    font-size: 13px;
    color: #6a5a2e;
}

.bs-results {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 4px;
}

.bs-result {
    display: flex;
    gap: 12px;
    padding: 8px;
    border-radius: 12px;
    color: inherit;
    text-decoration: none;
}

.bs-result:hover,
.bs-result.is-active {
    background: #faf4e2;
}

.bs-result img {
    flex: none;
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 10px;
    background: #efe8d6;
}

.bs-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.bs-text strong {
    font-size: 15px;
    line-height: 1.3;
    color: #2b2100;
}

.bs-excerpt {
    font-size: 13px;
    line-height: 1.4;
    color: #5b4e2a;
}

.bs-text small {
    font-size: 12px;
    color: #8a7a4e;
}

.bs-text mark {
    background: rgba(154, 103, 0, .22);
    color: inherit;
    border-radius: 3px;
    padding: 0 1px;
}

.bs-topics {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 14px 4px 0;
}

.bs-topics[hidden] {
    display: none;
}

.bs-topics span {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #8a7a4e;
}

.bs-topics button {
    padding: 6px 12px;
    border: 1px solid #e0d5b6;
    border-radius: 999px;
    background: #fff;
    color: #412e03;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}

.bs-topics button:hover {
    background: #faf4e2;
    border-color: #9a6700;
}

@media (max-width: 600px) {

    .bs-panel {
        width: 100%;
        max-height: 100%;
        height: 100%;
        margin-top: 0;
        border-radius: 0;
    }

    .bs-bar-row {
        margin-bottom: 14px;
    }

    .bs-result img {
        width: 64px;
        height: 64px;
    }
}
