/*
    Live Search (header search modal)
    Markup: inc/live-search.php, behaviour: assets/js/live-search.js
*/
.search-modal {
    --ls-bg: #F7F9FB;
    --ls-surface: #FFFFFF;
    --ls-ink: #161616;
    --ls-body: #4A5363;
    --ls-muted: #8A94A6;
    --ls-line: #E6EAF0;
    --ls-blue: #0658FC;
    --ls-gradient: linear-gradient(90deg, #B7FF00 0%, #2BF06A 50%, #3EEFFB 100%);
    --ls-gradient-border: linear-gradient(100deg, #B7FF00 0%, #00F24A 40%, #3EEFFB 75%, #0658FC 100%);
    --ls-shadow: 0 1px 2px rgba(22, 22, 22, .04), 0 8px 24px rgba(22, 22, 22, .06);
    --ls-radius: 20px;

    background-color: var(--ls-bg);
    overflow-y: auto;
    overscroll-behavior: contain;
}
html.ls-locked {
    overflow: hidden;
}
.search-modal .search-head {
    margin-bottom: 24px;
}

.search-modal .ls {
    box-sizing: border-box;
    color: var(--ls-ink);
    display: grid;
    gap: 56px;
    grid-template-columns: 240px minmax(0, 1fr);
    margin: 0 auto;
    max-width: 1520px;
    padding: 0 80px 80px;
}
.search-modal .ls *,
.search-modal .ls *::before,
.search-modal .ls *::after {
    box-sizing: border-box;
}
.search-modal .ls [hidden] {
    display: none !important;
}

/* Sidebar */
.search-modal .ls-sidebar {
    position: sticky;
    top: 24px;
    align-self: start;
}
.search-modal .ls-eyebrow {
    border-bottom: 1px solid var(--ls-line);
    color: var(--ls-muted);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .2em;
    line-height: 1;
    margin: 18px 0 32px;
    padding-bottom: 14px;
    text-transform: uppercase;
}
.search-modal .ls-filters {
    border: 0;
    margin: 0;
    min-width: 0;
    padding: 0;
}
.search-modal .ls-filters__title {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .14em;
    margin-bottom: 16px;
    padding: 0;
    text-transform: uppercase;
}
.search-modal .ls-filter {
    align-items: center;
    cursor: pointer;
    display: flex;
    font-size: 16px;
    font-weight: 600;
    gap: 12px;
    padding: 6px 0;
    user-select: none;
}
.search-modal .ls-filter input {
    appearance: none;
    -webkit-appearance: none;
    background: var(--ls-surface) no-repeat center / 12px;
    border: 1.5px solid #B9C1CE;
    border-radius: 4px;
    cursor: pointer;
    flex: none;
    height: 20px;
    margin: 0;
    transition: background-color .15s ease, border-color .15s ease;
    width: 20px;
}
.search-modal .ls-filter input:checked {
    background-color: var(--ls-blue);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 6.2 5 8.5l4.5-5'/%3E%3C/svg%3E");
    border-color: var(--ls-blue);
}
.search-modal .ls-filter input:focus-visible {
    outline: 2px solid var(--ls-blue);
    outline-offset: 2px;
}
.search-modal .ls-filter:hover input:not(:checked) {
    border-color: var(--ls-blue);
}
.search-modal .ls-count {
    color: var(--ls-muted);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
    margin-left: auto;
}

/* Search field */
.search-modal .ls-form {
    align-items: center;
    display: flex;
    gap: 16px;
    margin: 0 0 40px;
}
.search-modal .ls-field {
    flex: 1;
    position: relative;
}
.search-modal .ls-field__icon {
    color: var(--ls-muted);
    left: 22px;
    pointer-events: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}
.search-modal .ls-input {
    background: var(--ls-surface);
    border: 1px solid var(--ls-line);
    border-radius: 999px;
    box-shadow: var(--ls-shadow);
    color: var(--ls-ink);
    font-size: 17px;
    height: 56px;
    outline: none;
    padding: 0 52px 0 56px;
    transition: border-color .15s ease, box-shadow .15s ease;
    width: 100%;
    -webkit-appearance: none;
}
.search-modal .ls-input::placeholder {
    color: var(--ls-muted);
}
.search-modal .ls-input:focus {
    border-color: var(--ls-blue);
    box-shadow: 0 0 0 4px rgba(6, 88, 252, .12);
}
.search-modal .ls-input::-webkit-search-cancel-button {
    cursor: pointer;
}
.search-modal .ls-spinner {
    animation: ls-spin .7s linear infinite;
    border: 2px solid var(--ls-line);
    border-radius: 50%;
    border-top-color: var(--ls-blue);
    height: 18px;
    opacity: 0;
    position: absolute;
    right: 44px;
    top: calc(50% - 9px);
    transition: opacity .15s ease;
    width: 18px;
}
.search-modal.is-loading .ls-spinner {
    opacity: 1;
}
@keyframes ls-spin {
    to { transform: rotate(360deg); }
}

.search-modal .ls-submit,
.search-modal .ls-btn {
    align-items: center;
    background: var(--ls-gradient);
    border: 0;
    border-radius: 999px;
    color: var(--ls-ink);
    cursor: pointer;
    display: inline-flex;
    font-size: 16px;
    font-weight: 700;
    height: 56px;
    justify-content: center;
    padding: 0 48px;
    text-decoration: none;
    transition: filter .15s ease, transform .15s ease;
}
.search-modal .ls-submit:hover,
.search-modal .ls-btn:hover {
    color: var(--ls-ink);
    filter: brightness(1.04) saturate(1.1);
    transform: translateY(-1px);
}

/* Intro (before typing) */
.search-modal .ls-intro strong {
    color: var(--ls-muted);
    display: block;
    font-size: 13px;
    letter-spacing: .2em;
    margin-bottom: 14px;
    text-transform: uppercase;
}
.search-modal .ls-intro__links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.search-modal .ls-intro__links a {
    background: var(--ls-surface);
    border: 1px solid var(--ls-line);
    border-radius: 999px;
    color: var(--ls-ink);
    font-size: 15px;
    font-weight: 600;
    padding: 10px 20px;
    text-decoration: none;
    transition: border-color .15s ease, color .15s ease;
}
.search-modal .ls-intro__links a:hover {
    border-color: var(--ls-blue);
    color: var(--ls-blue);
}

/* Results */
.search-modal .ls-heading {
    color: var(--ls-ink);
    font-size: 40px;
    font-weight: 700;
    letter-spacing: -.01em;
    line-height: 1.15;
    margin: 0 0 6px;
}
.search-modal .ls-status {
    color: var(--ls-muted);
    font-size: 15px;
    margin: 0 0 28px;
    min-height: 1.4em;
}

.search-modal .ls-featured:empty {
    display: none;
}
.search-modal .ls-featured {
    margin-bottom: 40px;
}
.search-modal .ls-featured__card {
    align-items: center;
    background:
        radial-gradient(circle at 92% 20%, rgba(183, 255, 0, .14), transparent 40%) padding-box,
        linear-gradient(var(--ls-surface), var(--ls-surface)) padding-box,
        var(--ls-gradient-border) border-box;
    border: 4px solid transparent;
    border-top-width: 16px;
    border-radius: 28px;
    display: flex;
    gap: 40px;
    justify-content: space-between;
    padding: 40px 48px;
}
.search-modal .ls-featured__body {
    min-width: 0;
}
.search-modal .ls-featured__label {
    background: var(--ls-ink);
    border-radius: 999px;
    color: #fff;
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .14em;
    line-height: 1;
    margin-bottom: 18px;
    padding: 7px 11px;
    text-transform: uppercase;
}
.search-modal .ls-featured__title {
    font-size: 34px;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 16px;
}
.search-modal .ls-featured__title a,
.search-modal .ls-card__title a {
    color: inherit;
    text-decoration: none;
}
.search-modal .ls-featured__title a:hover,
.search-modal .ls-card__title a:hover {
    color: var(--ls-blue);
}
.search-modal .ls-featured__desc {
    color: var(--ls-body);
    font-size: 17px;
    line-height: 1.7;
    margin: 0 0 28px;
    max-width: 620px;
}
.search-modal .ls-featured .ls-btn {
    height: 48px;
    padding: 0 32px;
}
.search-modal .ls-featured__media {
    align-items: center;
    background: var(--ls-bg);
    border-radius: 22px;
    box-shadow: inset 0 0 0 1px var(--ls-line);
    color: var(--ls-blue);
    display: flex;
    flex: none;
    height: 168px;
    justify-content: center;
    overflow: hidden;
    width: 168px;
}
.search-modal .ls-featured__media:has(img) {
    height: auto;
    width: 280px;
}
.search-modal .ls-featured__media img {
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.search-modal .ls-grid {
    display: grid;
    gap: 32px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.search-modal .ls-card {
    background: var(--ls-surface);
    border-radius: var(--ls-radius);
    box-shadow: var(--ls-shadow);
    display: flex;
    flex-direction: column;
    padding: 26px 26px 22px;
    transition: box-shadow .2s ease, transform .2s ease;
}
.search-modal .ls-card:hover {
    box-shadow: 0 2px 4px rgba(22, 22, 22, .04), 0 16px 40px rgba(22, 22, 22, .10);
    transform: translateY(-2px);
}
.search-modal .ls-card__top {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 22px;
}
.search-modal .ls-card__icon {
    align-items: center;
    background: var(--ls-bg);
    border-radius: 12px;
    color: var(--ls-type, var(--ls-blue));
    display: flex;
    height: 52px;
    justify-content: center;
    width: 52px;
}
.search-modal .ls-badge {
    background: var(--ls-bg);
    border-radius: 6px;
    color: var(--ls-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .14em;
    padding: 6px 10px;
    text-transform: uppercase;
}
.search-modal .ls-card__title {
    font-size: 21px;
    font-weight: 700;
    line-height: 1.4;
    margin: 0 0 12px;
}
.search-modal .ls-card__desc {
    color: var(--ls-body);
    display: -webkit-box;
    font-size: 15px;
    line-height: 1.65;
    margin: 0;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}
.search-modal .ls-card__footer {
    align-items: center;
    border-top: 1px solid var(--ls-line);
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 18px;
}
.search-modal .ls-card__desc,
.search-modal .ls-card__title:has(+ .ls-card__footer) {
    margin-bottom: 24px;
}
.search-modal .ls-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 20px;
}
.search-modal .ls-card__action {
    color: var(--ls-blue);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .12em;
    text-decoration: none;
    text-transform: uppercase;
}
.search-modal .ls-card__action--secondary {
    color: var(--ls-ink);
    font-weight: 600;
}
.search-modal .ls-card__action:hover {
    color: var(--ls-blue);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.search-modal .ls-card__go {
    color: #A9B2C0;
    display: flex;
    flex: none;
    transition: color .15s ease, transform .15s ease;
}
.search-modal .ls-card:hover .ls-card__go {
    color: var(--ls-blue);
    transform: translateX(2px);
}

/* Per-type accent colours */
.ls-card--solutions { --ls-type: #12B76A; }
.ls-card--case-studies { --ls-type: #12C65A; }
.ls-card--pdfs { --ls-type: #0BBBD6; }
.ls-card--blogs { --ls-type: #0658FC; }
.ls-card--news { --ls-type: #6CC400; }
.ls-featured__card .ls-featured__media { color: var(--ls-type, var(--ls-blue)); }

/* Empty / load more / skeleton */
.search-modal .ls-empty {
    background: var(--ls-surface);
    border-radius: var(--ls-radius);
    box-shadow: var(--ls-shadow);
    color: var(--ls-body);
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 48px;
    text-align: center;
}
.search-modal .ls-empty strong {
    color: var(--ls-ink);
    font-size: 20px;
}
.search-modal .ls-more-wrap {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}
.search-modal .ls-more {
    background: var(--ls-surface);
    border: 1px solid var(--ls-line);
    border-radius: 999px;
    color: var(--ls-ink);
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    padding: 14px 36px;
    transition: border-color .15s ease, color .15s ease;
}
.search-modal .ls-more:hover {
    background: var(--ls-surface);
    border-color: var(--ls-blue);
    color: var(--ls-blue);
}
.search-modal .ls-more:disabled {
    cursor: progress;
    opacity: .6;
}
.search-modal .ls-skeleton {
    animation: ls-pulse 1.2s ease-in-out infinite;
    background: linear-gradient(90deg, #EEF1F5 0%, #F6F8FA 50%, #EEF1F5 100%) 0 0 / 200% 100%;
    border-radius: var(--ls-radius);
    height: 260px;
}
.search-modal .ls-skeleton--featured {
    border-radius: 28px;
    height: 300px;
}
@keyframes ls-pulse {
    to { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
    .search-modal .ls-skeleton,
    .search-modal .ls-spinner {
        animation-duration: 3s;
    }
    .search-modal .ls-card,
    .search-modal .ls-card:hover {
        transform: none;
    }
}

/* Responsive */
@media (max-width: 1280px) {
    .search-modal .ls {
        gap: 40px;
        grid-template-columns: 200px minmax(0, 1fr);
        padding: 0 40px 64px;
    }
    .search-modal .ls-grid {
        gap: 24px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 960px) {
    .search-modal .ls {
        display: block;
        padding: 0 16px 48px;
    }
    .search-modal .ls-sidebar {
        margin-bottom: 20px;
        position: static;
    }
    .search-modal .ls-eyebrow {
        display: none;
    }
    .search-modal .ls-filters {
        display: flex;
        gap: 8px;
        margin: 0 -16px;
        overflow-x: auto;
        padding: 0 16px 4px;
        scrollbar-width: none;
    }
    .search-modal .ls-filters::-webkit-scrollbar {
        display: none;
    }
    .search-modal .ls-filters__title {
        display: none;
    }
    .search-modal .ls-filter {
        background: var(--ls-surface);
        border: 1px solid var(--ls-line);
        border-radius: 999px;
        flex: none;
        font-size: 14px;
        gap: 8px;
        padding: 8px 14px;
    }
    .search-modal .ls-filter:has(input:checked) {
        border-color: var(--ls-blue);
        color: var(--ls-blue);
    }
    .search-modal .ls-filter input {
        height: 16px;
        width: 16px;
    }
    .search-modal .ls-count {
        margin-left: 0;
    }
    .search-modal .ls-form {
        flex-direction: column;
        gap: 12px;
    }
    .search-modal .ls-field,
    .search-modal .ls-submit {
        width: 100%;
    }
    .search-modal .ls-input {
        font-size: 16px;
        height: 52px;
    }
    .search-modal .ls-submit {
        display: none;
    }
    .search-modal .ls-heading {
        font-size: 28px;
    }
    .search-modal .ls-featured__card {
        border-top-width: 10px;
        border-radius: 22px;
        flex-direction: column-reverse;
        align-items: flex-start;
        gap: 20px;
        padding: 24px;
    }
    .search-modal .ls-featured__media {
        border-radius: 18px;
        height: 72px;
        width: 72px;
    }
    .search-modal .ls-featured__media svg {
        height: 32px;
        width: 32px;
    }
    .search-modal .ls-featured__title {
        font-size: 24px;
    }
    .search-modal .ls-featured__desc {
        font-size: 15px;
        margin-bottom: 20px;
    }
}

@media (max-width: 640px) {
    .search-modal .ls-grid {
        gap: 16px;
        grid-template-columns: minmax(0, 1fr);
    }
    .search-modal .ls-card {
        padding: 20px;
    }
}
