/* ================================================================
   Library Search Tool – Frontend Styles
   All colors driven by CSS custom properties set inline per widget.
   Default palette matches the reference image (navy search button,
   plain radio toggles beneath a large pill input).
================================================================ */

/* --- Wrapper -------------------------------------------------- */
.lst-widget-wrapper {
    display: inline-block;
    width: 100%;
    max-width: 680px;
    background-color: var(--lst-wrapper-bg, transparent);
    box-sizing: border-box;
    font-family: inherit;
    padding: 0;
}

/* --- Form ----------------------------------------------------- */
.lst-search-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

/* Input row must still stretch full width */
.lst-search-form .lst-input-row {
    width: 100%;
}

/* --- Input Row (pill shape) ----------------------------------- */
.lst-input-row {
    display: flex;
    align-items: stretch;
    background-color: var(--lst-search-bg, #ffffff);
    border: 1.5px solid var(--lst-search-border, #e0e0e0);
    border-radius: 50px;           /* full pill */
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.10);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
    min-height: 54px;
}

.lst-input-row:focus-within {
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.15);
    border-color: var(--lst-search-border, #d0d0d0);
}

/* --- Text Input ---------------------------------------------- */
.lst-search-input {
    flex: 1;
    border: none !important;
    outline: none !important;
    padding: 14px 24px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--lst-search-text, #222222);
    background: transparent;
    box-shadow: none !important;
    min-width: 0;
    text-align: center;           /* centered placeholder as in reference */
}

/* Placeholder: lighter weight, centered */
.lst-search-input::placeholder {
    color: var(--lst-search-text, #222222);
    font-weight: 600;
    opacity: 1;
}

/* When user is typing, left-align the text naturally */
.lst-search-input:not(:placeholder-shown) {
    text-align: left;
    padding-left: 28px;
}

/* Remove default browser search clear / decoration */
.lst-search-input::-webkit-search-cancel-button,
.lst-search-input::-webkit-search-decoration {
    -webkit-appearance: none;
    appearance: none;
}

/* --- Submit Button ------------------------------------------- */
/*  Solid colored square block flush to the right end of the pill,
    with a rounded right side matching the pill border-radius.      */
.lst-search-btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    min-height: 100%;
    background-color: var(--lst-icon-color, #1a2e5a);   /* navy block */
    border: none;
    border-radius: 0 50px 50px 0;                        /* right side rounded */
    cursor: pointer;
    color: #ffffff;                                       /* white icon */
    padding: 0;
    transition: opacity 0.18s ease;
    line-height: 0;
}

.lst-search-btn:hover {
    opacity: 0.88;
}

.lst-search-btn svg {
    display: block;
    pointer-events: none;
    stroke: #ffffff;              /* always white regardless of icon_color var */
}

/* --- Toggles Row (plain radio style) ------------------------- */
.lst-toggles-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0 28px;
    padding-left: 0;
}

/* Show native radio — do NOT hide it (matches reference image) */
.lst-toggle-label input[type="radio"] {
    width: 16px;
    height: 16px;
    margin: 0 6px 0 0;
    cursor: pointer;
    accent-color: var(--lst-btn-active-bg, #1a2e5a);
    flex-shrink: 0;
}

.lst-toggle-label {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    padding: 2px 0;
}

/* Toggle text: plain label, no pill background */
.lst-toggle-text {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--lst-btn-text, #333333);
    user-select: none;
    white-space: nowrap;
    transition: color 0.15s ease;
}

/* Active/checked: slightly bolder label text */
.lst-toggle-label input[type="radio"]:checked + .lst-toggle-text,
.lst-toggle-label.lst-toggle-active .lst-toggle-text {
    color: var(--lst-btn-active-bg, #1a2e5a);
    font-weight: 600;
}

/* Focus ring for keyboard nav */
.lst-toggle-label input[type="radio"]:focus-visible {
    outline: 2px solid var(--lst-btn-active-bg, #1a2e5a);
    outline-offset: 2px;
    border-radius: 2px;
}

/* --- Responsive ---------------------------------------------- */
@media (max-width: 520px) {
    .lst-input-row {
        min-height: 48px;
    }

    .lst-search-input {
        font-size: 0.9rem;
        padding: 12px 18px;
    }

    .lst-search-btn {
        width: 50px;
    }

    .lst-toggles-row {
        gap: 0 18px;
    }

    .lst-toggle-text {
        font-size: 0.82rem;
    }
}
