/* ─── Blog live search (single post) ──────────────────────────────────────
   Ported from the srwebsite theme (assets/css/live-search.css) and scoped
   to this site's bar, `.sr-search`, printed in the single.php banner. The
   script (assets/js/live-search.js) wraps the box and the category select
   in one `.sr-pill`; the results panel and the category menu hang from it.
   Brand colours: #735ae5 purple, #0b0757 navy, #f4f2ff hover tint. */

/* the bar: overrides the theme's `.mainBlogFilterButton .search` gap */
.mainBlogFilterButton .search.sr-search {
    display: flex;
    justify-content: flex-end;
    gap: 0;
    flex: 0 1 470px;
    min-width: 340px;
}
.sr-search .widget_searchNew {
    position: relative;
}

/* ─── The pill: box + category button ─────────────────────────────────── */
.sr-pill {
    position: relative;
    display: flex;
    align-items: stretch;
    width: 100%;
    max-width: 100%;
}
.sr-search .sr-pill .widget_searchNew {
    position: static;
    flex: 1 1 auto;
    min-width: 0;
}
.sr-search .widget_searchNew form {
    margin: 0;
}
.sr-search input.js-live-search {
    width: 100%;
    margin: 0;
    padding: 14px 16px 14px 46px;
    border: 1px solid #d3d3d3;
    border-right: 0;
    border-radius: 10px 0 0 10px;
    background: #fff url(https://sr-website-01.shiprocket.in/sr-website/Search-icon-jvgwt2.svg) no-repeat 18px 50% / 16px;
    font-family: 'TWKLausanne', inherit;
    font-size: 15px;
    font-weight: 100;
    line-height: 20px;
    color: #4e4e4e;
    outline: none;
    text-overflow: ellipsis;
    white-space: nowrap;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.sr-search input.js-live-search::placeholder {
    color: #a7a7a7;
}
.sr-search input.js-live-search:focus {
    border-color: #735ae5;
}
/* divider between the box and the category button */
.sr-search .sr-pill .widget_searchNew::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 169px;
    width: 2px;
    height: 24px;
    margin-top: -12px;
    background: #e5e7eb;
    pointer-events: none;
}
/* without script there is no pill: the native select sits beside the box */
.sr-search select.js-live-cat {
    width: 170px;
    margin: 0;
    padding: 14px 40px 14px 16px;
    border: 1px solid #d3d3d3;
    border-left: 0;
    border-radius: 0 10px 10px 0;
    font-size: 14px;
}

/* ─── Results panel ───────────────────────────────────────────────────── */
.sr-search .sr-live {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 60;
    margin-top: 10px;
    padding: 6px;
    background: #fff;
    border: 1px solid #ebebf0;
    border-radius: 16px;
    box-shadow: 0 24px 48px -12px rgba(11, 7, 87, 0.18), 0 2px 6px rgba(11, 7, 87, 0.06);
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
    max-height: min(70vh, 560px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #e3e3ea transparent;
    text-align: left;
}
.sr-search .sr-live.is-open {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}
.sr-search .sr-live.is-loading .sr-live__list {
    opacity: 0.45;
}

/* count and key hints */
.sr-live__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 12px 6px;
    font-size: 12px;
    line-height: 16px;
    color: #9d9d9d;
}
.sr-live__keys kbd {
    display: inline-block;
    min-width: 18px;
    margin-right: 2px;
    padding: 0 4px;
    border: 1px solid #e3e3ea;
    border-radius: 4px;
    background: #f6f6f7;
    font-size: 11px;
    line-height: 16px;
    color: #7f7f7f;
    text-align: center;
    box-shadow: none;
}

/* the results */
.sr-live__list {
    margin: 0;
    padding: 0;
    list-style: none;
    transition: opacity 0.15s ease;
}
.sr-live__list li {
    margin: 0;
    padding: 0;
}
.sr-search .sr-live a.sr-live__item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    color: #0b0757;
    text-decoration: none;
    transition: background-color 0.15s ease;
}
.sr-search .sr-live a.sr-live__item:hover,
.sr-search .sr-live a.sr-live__item.is-active {
    background: #f4f2ff;
}
.sr-live__thumb {
    flex: 0 0 64px;
    width: 64px;
    height: 44px;
    margin-top: 2px;
    border-radius: 8px;
    object-fit: cover;
    background: #f0eefb;
}
.sr-live__thumb--blank {
    display: block;
    background: linear-gradient(135deg, #ece8ff, #f8f6ff);
}
.sr-live__body {
    display: block;
    min-width: 0;
}
.sr-live__title {
    display: block;
    font-size: 14px;
    line-height: 20px;
    font-weight: 600;
    color: #0b0757;
}
.sr-live__excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 2px;
    font-size: 12px;
    line-height: 17px;
    color: #6b6b73;
}
.sr-live__line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
    margin-top: 6px;
    font-size: 11px;
    line-height: 16px;
    color: #9d9d9d;
}
.sr-live__cat {
    padding: 1px 8px;
    border-radius: 999px;
    background: #efeafd;
    color: #735ae5;
    font-weight: 600;
}
.sr-live mark {
    padding: 0;
    background: none;
    color: #735ae5;
    text-decoration: underline;
    text-decoration-color: rgba(115, 90, 229, 0.4);
    text-underline-offset: 2px;
}
.sr-search .sr-live a.sr-live__all {
    display: block;
    margin: 4px 6px 6px;
    padding: 10px 12px;
    border-top: 1px solid #f0f0f3;
    font-size: 13px;
    line-height: 18px;
    font-weight: 600;
    color: #735ae5;
    text-align: center;
    text-decoration: none;
}
.sr-search .sr-live a.sr-live__all:hover {
    background: #f4f2ff;
    border-radius: 10px;
}

/* recent searches and topics */
.sr-live__section {
    padding: 10px 12px 8px;
}
.sr-live__section + .sr-live__section {
    border-top: 1px solid #f0f0f3;
}
.sr-live__label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 11px;
    line-height: 16px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9d9d9d;
}
.sr-search .sr-live a.sr-live__clear {
    font-size: 11px;
    letter-spacing: 0;
    text-transform: none;
    color: #9d9d9d;
    text-decoration: none;
}
.sr-search .sr-live a.sr-live__clear:hover {
    color: #735ae5;
}
.sr-live__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.sr-search .sr-live a.sr-live__chip {
    display: inline-block;
    max-width: 100%;
    padding: 5px 12px;
    border: 1px solid #e6e6ec;
    border-radius: 999px;
    background: #fff;
    font-size: 13px;
    line-height: 18px;
    color: #50504c;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}
.sr-search .sr-live a.sr-live__chip:hover {
    border-color: #735ae5;
    background: #f4f2ff;
    color: #735ae5;
}
.sr-search .sr-live a.sr-live__chip--topic::before {
    content: "#";
    margin-right: 2px;
    color: #b3a6f2;
}

/* empty and loading states */
.sr-live__empty {
    padding: 18px 12px 12px;
    text-align: center;
}
.sr-live__empty-title {
    margin: 0 0 4px;
    font-size: 14px;
    line-height: 20px;
    font-weight: 600;
    color: #0b0757;
}
.sr-live__empty-hint {
    margin: 0;
    font-size: 12px;
    line-height: 17px;
    color: #9d9d9d;
}
.sr-live__skeleton {
    padding: 6px;
}
.sr-live__bone {
    height: 44px;
    margin: 6px 0;
    border-radius: 10px;
    background: linear-gradient(90deg, #f3f3f6 25%, #ebebf0 50%, #f3f3f6 75%);
    background-size: 200% 100%;
    animation: sr-live-shimmer 1.2s ease-in-out infinite;
}
@keyframes sr-live-shimmer {
    from { background-position: 200% 0; }
    to   { background-position: -200% 0; }
}

/* ─── Category menu ───────────────────────────────────────────────────── */
.sr-cat {
    position: relative;
    display: flex;
    flex: 0 0 auto;
    align-self: stretch;
}
.sr-search .sr-cat select.sr-cat__native {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    border: 0;
    opacity: 0;
    pointer-events: none;
}
.sr-search .sr-cat__btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 170px;
    margin: 0;
    padding: 0 14px 0 16px;
    border: 1px solid #d3d3d3;
    border-left: 0;
    border-radius: 0 10px 10px 0;
    background: #fff;
    font-family: 'TWKLausanne', inherit;
    font-size: 14px;
    font-weight: 100;
    line-height: 1.2;
    color: #4e4e4e;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.15s ease;
}
.sr-search .sr-cat__btn:hover,
.sr-cat.is-open .sr-cat__btn {
    background: #faf9ff;
}
.sr-search .sr-cat__btn:focus-visible {
    outline: 2px solid #735ae5;
    outline-offset: -2px;
}
.sr-cat__label {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.sr-cat__chev {
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    color: #141413;
    transition: transform 0.2s ease;
}
.sr-cat.is-open .sr-cat__chev {
    transform: rotate(180deg);
}
.sr-cat__panel {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 60;
    width: min(300px, calc(100vw - 32px));
    margin-top: 10px;
    padding: 6px;
    background: #fff;
    border: 1px solid #ebebf0;
    border-radius: 16px;
    box-shadow: 0 24px 48px -12px rgba(11, 7, 87, 0.18), 0 2px 6px rgba(11, 7, 87, 0.06);
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
    text-align: left;
}
.sr-cat.is-open .sr-cat__panel {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}
.sr-cat__find {
    padding: 4px 4px 8px;
}
.sr-search .sr-cat__input {
    width: 100%;
    padding: 9px 12px 9px 34px;
    border: 1px solid #e6e6ec;
    border-radius: 10px;
    background: #fafafb url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%239d9d9d' stroke-width='1.6' stroke-linecap='round'%3E%3Ccircle cx='7' cy='7' r='4.5'/%3E%3Cpath d='M10.5 10.5L14 14'/%3E%3C/svg%3E") no-repeat 11px center / 15px;
    font-size: 13px;
    line-height: 18px;
    color: #0b0757;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}
.sr-search .sr-cat__input:focus {
    border-color: #735ae5;
    background-color: #fff;
}
.sr-cat__list {
    max-height: 320px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #e3e3ea transparent;
}
.sr-search a.sr-cat__opt {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 18px;
    color: #0b0757;
    text-decoration: none;
    transition: background-color 0.15s ease;
}
/* display:flex above would otherwise beat the hidden attribute the filter sets */
.sr-search a.sr-cat__opt[hidden] {
    display: none;
}
.sr-search a.sr-cat__opt:hover,
.sr-search a.sr-cat__opt.is-active {
    background: #f4f2ff;
}
.sr-search a.sr-cat__opt.is-current {
    color: #735ae5;
    font-weight: 600;
}
.sr-cat__opt.is-current .sr-cat__name::after {
    content: "";
    display: inline-block;
    width: 7px;
    height: 11px;
    margin-left: 8px;
    border-right: 2px solid #735ae5;
    border-bottom: 2px solid #735ae5;
    transform: rotate(45deg) translateY(-2px);
}
.sr-cat__opt--all {
    margin-bottom: 4px;
    border-bottom: 1px solid #f0f0f3;
}
.sr-cat__count {
    flex: none;
    min-width: 26px;
    padding: 1px 7px;
    border-radius: 999px;
    background: #f3f3f6;
    font-size: 11px;
    line-height: 16px;
    font-weight: 500;
    color: #7f7f7f;
    text-align: center;
}
.sr-cat__opt.is-current .sr-cat__count {
    background: #efeafd;
    color: #735ae5;
}
.sr-cat__none {
    margin: 0;
    padding: 14px 12px 10px;
    font-size: 13px;
    color: #9d9d9d;
    text-align: center;
}

/* ─── Narrow screens ──────────────────────────────────────────────────── */
@media (max-width: 991px) {
    .mainBlogFilterButton .search.sr-search {
        flex: 1 1 auto;
        min-width: 0;
        width: 100%;
    }
    .sr-search input.js-live-search {
        padding: 12px 10px 12px 36px;
        font-size: 14px;
        background-size: 14px;
        background-position: 14px 50%;
    }
}
@media (max-width: 767px) {
    /* the pill carries the category menu, so the theme's filter drawer
       button is not needed on a post */
    .single-post .mainBlogFilterButton .toogleFilter {
        display: none;
    }
    .single-post .blogBanner .mainBlogFilterButton {
        width: 100%;
    }
    .sr-live__keys {
        display: none;
    }
    .sr-search .sr-cat__btn {
        width: 140px;
        padding: 0 10px;
    }
    .sr-search .sr-pill .widget_searchNew::after {
        right: 139px;
    }
    .sr-cat__list {
        max-height: 260px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sr-search .sr-live,
    .sr-cat__panel,
    .sr-cat__chev {
        transition: none;
    }
    .sr-live__bone {
        animation: none;
    }
}
