/**
 * Smart Live Search - מינימום סגנון: מיקום שכבה צפה + ירושה מהערכת הנושא.
 */

.sls-search-wrapper {
    position: relative;
    width: 100%;
    z-index: 1;
    font-family: "פולין", sans-serif;
    font-size: 0.8125rem;
    line-height: 1.4;
}

/* תוצאות מעל התוכן - רוחב נדיב (לא רק רוחב העמודה הצרה) */
.sls-results {
    display: none;
    position: absolute;
    top: calc(100% + 0.25em);
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%);
    width: max(100%, min(92vw, 42rem));
    z-index: 100000;
    max-height: min(70vh, 28em);
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
    text-align: start;
    font: inherit;
    line-height: inherit;
    color: inherit;
    /* רקע: מעדיף משתני ערכת נושא של וורדפרס, אחרת Canvas (כולל מצב כהה) */
    background-color: var(--wp--preset--color--base, var(--wp--preset--color--background, Canvas));
    border: 1px solid color-mix(in srgb, currentColor 16%, transparent);
    border-radius: 0.375em;
    box-shadow: 0 0.35em 1.25em color-mix(in srgb, currentColor 14%, transparent);
}

.sls-item {
    display: flex;
    gap: 0.75em;
    padding: 0.75em 0.9em;
    color: inherit;
    align-items: center;
    font: inherit;
    text-align: start;
}

.sls-item__link {
    display: flex;
    flex: 1;
    min-width: 0;
    gap: 0.75em;
    text-decoration: none;
    color: inherit;
    align-items: center;
    font: inherit;
    text-align: start;
}

.sls-item:hover,
.sls-item:focus-within {
    background-color: color-mix(in srgb, currentColor 8%, transparent);
}

.sls-play-btn,
.sls-search-wrapper button.sls-play-btn[type="button"],
.sls-results button.sls-play-btn[type="button"],
.sls-modal button.sls-play-btn[type="button"] {
    -webkit-appearance: none !important;
    appearance: none !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 2.25em !important;
    min-width: 2.25em !important;
    max-width: 2.25em !important;
    height: 2.25em !important;
    min-height: 2.25em !important;
    max-height: 2.25em !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 50% !important;
    background: #fa8504 !important;
    background-color: #fa8504 !important;
    background-image: none !important;
    color: #1a1a1a !important;
    font: inherit !important;
    font-size: inherit !important;
    font-weight: 400 !important;
    line-height: 1 !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    text-decoration: none !important;
    box-shadow: none !important;
    cursor: pointer !important;
    transition: filter 0.15s ease, transform 0.15s ease !important;
}

.sls-play-btn:hover,
.sls-search-wrapper button.sls-play-btn[type="button"]:hover,
.sls-results button.sls-play-btn[type="button"]:hover,
.sls-modal button.sls-play-btn[type="button"]:hover,
.sls-play-btn:focus,
.sls-search-wrapper button.sls-play-btn[type="button"]:focus,
.sls-results button.sls-play-btn[type="button"]:focus,
.sls-modal button.sls-play-btn[type="button"]:focus {
    background: #fa8504 !important;
    background-color: #fa8504 !important;
    background-image: none !important;
    color: #1a1a1a !important;
    border: none !important;
    box-shadow: none !important;
    filter: brightness(1.08);
    transform: translateY(-1px);
}

.sls-play-btn:active,
.sls-search-wrapper button.sls-play-btn[type="button"]:active,
.sls-results button.sls-play-btn[type="button"]:active,
.sls-modal button.sls-play-btn[type="button"]:active {
    background: #fa8504 !important;
    background-color: #fa8504 !important;
    transform: translateY(0) !important;
}

.sls-play-btn:focus-visible,
.sls-search-wrapper button.sls-play-btn[type="button"]:focus-visible,
.sls-results button.sls-play-btn[type="button"]:focus-visible,
.sls-modal button.sls-play-btn[type="button"]:focus-visible {
    outline: 2px solid #38bdf8 !important;
    outline-offset: 2px !important;
}

.sls-play-btn svg,
.sls-search-wrapper button.sls-play-btn[type="button"] svg,
.sls-results button.sls-play-btn[type="button"] svg,
.sls-modal button.sls-play-btn[type="button"] svg,
.sls-play-btn polygon,
.sls-search-wrapper button.sls-play-btn[type="button"] polygon,
.sls-results button.sls-play-btn[type="button"] polygon,
.sls-modal button.sls-play-btn[type="button"] polygon {
    display: block !important;
    width: 0.875em !important;
    height: 0.875em !important;
    fill: #1a1a1a !important;
    stroke: none !important;
    pointer-events: none !important;
}

.sls-thumb {
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 0.25em;
}

.sls-thumb img {
    width: 3.25em;
    height: 3.25em;
    object-fit: cover;
    display: block;
    border-radius: 0.25em;
}

.sls-content {
    min-width: 0;
    flex: 1;
}

.sls-title {
    display: block;
    font: inherit;
    font-weight: bolder;
    font-size: 1.1em;
}

.sls-meta {
    font-size: 0.8125em;
    opacity: 0.85;
    color: inherit;
}

.sls-meta span+span::before {
    content: " · ";
    opacity: 0.7;
}

.sls-no-results {
    padding: 0.75em;
    font: inherit;
    color: inherit;
    opacity: 0.9;
}

.sls-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65em;
    padding: 1.1em 0.9em;
    font: inherit;
    color: inherit;
    opacity: 0.95;
}

.sls-spinner {
    width: 1.1em;
    height: 1.1em;
    border-radius: 999px;
    border: 2px solid color-mix(in srgb, currentColor 25%, transparent);
    border-top-color: currentColor;
    animation: sls-spin 0.8s linear infinite;
}

@keyframes sls-spin {
    to {
        transform: rotate(360deg);
    }
}

input#sls-search-input,
input#sls-search-input-modal,
.sls-search-wrapper input.sls-search-input[type="text"] {
    -webkit-appearance: none !important;
    appearance: none !important;
    box-sizing: border-box !important;
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0.7rem 1rem !important;
    font-family: "פולין", sans-serif !important;
    font-size: 0.95rem !important;
    line-height: 1.4 !important;
    font-weight: 400 !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    color: #1a1a2e !important;
    background: rgba(255, 255, 255, 0.95) !important;
    background-color: rgba(255, 255, 255, 0.95) !important;
    background-image: none !important;
    border: 1px solid #20215A !important;
    border-radius: 999px !important;
    box-shadow: none !important;
    outline: none !important;
}

input#sls-search-input:focus,
input#sls-search-input-modal:focus,
.sls-search-wrapper input.sls-search-input[type="text"]:focus {
    outline: none !important;
    border-color: #cb1e53 !important;
    box-shadow: 0 0 0 3px rgba(203, 30, 83, 0.35) !important;
}

input#sls-search-input::placeholder,
input#sls-search-input-modal::placeholder,
.sls-search-wrapper input.sls-search-input[type="text"]::placeholder {
    font-family: "פולין", sans-serif !important;
    color: rgba(32, 33, 90, 0.45) !important;
    opacity: 1 !important;
}

/* כפיית עיצוב במודל מובייל - דריסות Elementor / WP */
.sls-modal input#sls-search-input-modal.sls-search-input[type="text"],
.sls-modal .sls-search-wrapper--modal input.sls-search-input[type="text"] {
    -webkit-appearance: none !important;
    appearance: none !important;
    box-sizing: border-box !important;
    display: block !important;
    width: 100% !important;
    min-height: unset !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0.7rem 1rem !important;
    font-family: "פולין", sans-serif !important;
    font-size: 0.95rem !important;
    line-height: 1.4 !important;
    font-weight: 400 !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    color: #1a1a2e !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
    background-image: none !important;
    border: 1px solid #20215A !important;
    border-radius: 999px !important;
    box-shadow: none !important;
    outline: none !important;
}

.sls-modal input#sls-search-input-modal.sls-search-input[type="text"]:focus,
.sls-modal .sls-search-wrapper--modal input.sls-search-input[type="text"]:focus {
    outline: none !important;
    border-color: #cb1e53 !important;
    box-shadow: 0 0 0 3px rgba(203, 30, 83, 0.35) !important;
}

.sls-footer {
    padding: 0.75em 0.9em;
    border-top: 1px solid color-mix(in srgb, currentColor 12%, transparent);
    background-color: color-mix(in srgb, currentColor 2.5%, transparent);
}

.sls-all-results {
    display: block;
    width: 100%;
    text-align: center;
    text-decoration: none;
    padding: 0.75em 1em;
    border-radius: 0.5em;
    border: 1px solid color-mix(in srgb, currentColor 18%, transparent);
    background-color: color-mix(in srgb, currentColor 6%, transparent);
    color: inherit;
    font-weight: 700;
}

.sls-all-results:hover,
.sls-all-results:focus-visible {
    background-color: color-mix(in srgb, currentColor 10%, transparent);
}

/* Modal for mobile header search */
.sls-modal {
    position: fixed;
    inset: 0;
    z-index: 1000000;
    display: none;
}

.sls-modal.is-open {
    display: block;
}

.sls-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.sls-modal__panel {
    position: absolute;
    left: 50%;
    top: 10vh;
    transform: translateX(-50%);
    width: min(92vw, 42rem);
    max-height: 80vh;
    overflow: auto;
    box-sizing: border-box;
    padding: 1rem 1rem 1.25rem;
    border-radius: 0.75rem;
    background-color: var(--wp--preset--color--base, var(--wp--preset--color--background, Canvas));
    border: 1px solid color-mix(in srgb, currentColor 16%, transparent);
    box-shadow: 0 1.5rem 3.5rem rgba(0, 0, 0, 0.35);
}

.sls-modal__close {
    position: absolute;
    top: 0.5rem;
    inset-inline-end: 0.5rem;
    z-index: 2;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 999px !important;
    border: 1px solid color-mix(in srgb, currentColor 18%, transparent);
    /* background: color-mix(in srgb, currentColor 6%, transparent); */
    background: #FFFFFF !important;
    color: #000000 !important;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
}

.sls-search-wrapper--modal {
    z-index: 0;
}

.sls-search-wrapper--modal .sls-results {
    position: static;
    transform: none;
    width: 100%;
    max-height: min(60vh, 26em);
    margin-top: 0.5rem;
}