.posts-filters {
    padding: clamp(1.25rem, 3vw, 2rem);
    margin-bottom: 1.5rem;
    border: 1px solid #dce3ec;
    border-radius: 1.4rem;
    background: #fff;
    scroll-margin-top: 7rem;
}

.posts-search-label,
.posts-category-label {
    display: block;
    margin: 0 0 .7rem;
    color: #08162d;
    font-family: 'Poppins', sans-serif;
    font-size: .95rem;
    font-weight: 600;
    line-height: 1.5;
}

.posts-search-row {
    display: flex;
    gap: .75rem;
    align-items: stretch;
}

.posts-search-field {
    position: relative;
    flex: 1;
    min-width: 0;
}

.posts-search-field svg {
    position: absolute;
    left: 1.15rem;
    top: 50%;
    width: 1.25rem;
    height: 1.25rem;
    transform: translateY(-50%);
    color: #536581;
    pointer-events: none;
}

.posts-search-field input {
    width: 100%;
    min-width: 0;
    height: 3.5rem;
    padding: .9rem 1rem .9rem 3rem;
    border: 1px solid #cbd6e6;
    border-radius: .85rem;
    background: #f8fafd;
    color: #08162d;
    font: inherit;
    font-size: 1rem;
    line-height: 1.5;
}

.posts-search-field input::placeholder { color: #536581; opacity: 1; }

.posts-search-submit {
    min-height: 3.5rem;
    padding: .85rem 1.8rem;
    border: 1px solid #3155ff;
    border-radius: 999px;
    background: #3155ff;
    color: #fff;
    font-family: 'Poppins', sans-serif;
    font-size: .95rem;
    font-weight: 700;
    line-height: 1.5;
    cursor: pointer;
    transition: background-color .18s ease;
}

.posts-search-submit:hover { background: #2344d8; border-color: #2344d8; }

.posts-category-nav { margin-top: 1.5rem; }
.posts-category-list { display: flex; flex-wrap: wrap; gap: .6rem; padding: 0; margin: 0; list-style: none; }
.posts-category-list li { min-width: 0; max-width: 100%; }

.posts-category-link {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    max-width: 100%;
    min-height: 2.75rem;
    padding: .6rem 1rem;
    border: 1px solid #dce3ec;
    border-radius: 999px;
    background: #f4f7fb;
    color: #344b6c;
    text-decoration: none;
    font-family: 'Poppins', sans-serif;
    font-size: .84rem;
    font-weight: 500;
    line-height: 1.5;
    transition: border-color .18s ease, background-color .18s ease;
}

.posts-category-link > span:first-child { overflow-wrap: anywhere; }
.posts-category-link:hover { border-color: #3155ff; background: #eef2ff; color: #2344d8; }
.posts-category-link[aria-current="true"] { border-color: #3155ff; background: #3155ff; color: #fff; }
.posts-category-count { flex-shrink: 0; min-width: 1.4rem; text-align: center; font-size: .8rem; font-weight: 600; }

.posts-filter-results {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    gap: .75rem 1rem;
    margin: 1.5rem 0 0;
    padding-top: 1rem;
    border-top: 1px solid #e5ebf3;
    color: #536581;
    font-size: .95rem;
    line-height: 1.6;
}

.posts-filter-results p { margin: 0; overflow-wrap: anywhere; }
.posts-filter-results strong { color: #08162d; }
.posts-filter-reset { color: #2449d5; font-weight: 600; text-underline-offset: .2em; }
.posts-filter-reset:hover { color: #08162d; }

.posts-filters :is(input, button, a):focus-visible,
.posts-empty a:focus-visible { outline: 3px solid #3155ff; outline-offset: 4px; }

.posts-empty {
    padding: clamp(2rem, 4vw, 3.5rem);
    border: 1px solid #dce3ec;
    border-radius: 1.4rem;
    background: #fff;
    text-align: center;
}

.posts-empty h3 { margin: 0 0 .75rem; font-size: clamp(1.4rem, 3vw, 2rem); }
.posts-empty p { margin: 0 0 1rem; color: #536581; line-height: 1.7; }

@media (max-width: 560px) {
    .posts-filters, .posts-empty { border-radius: 1.1rem; }
    .posts-filters { scroll-margin-top: 6rem; }
    .posts-search-row { flex-direction: column; }
    .posts-search-submit { width: 100%; }
    .posts-category-link { padding: .6rem .8rem; font-size: .8rem; gap: .4rem; }
}

@media (prefers-reduced-motion: reduce) {
    .posts-search-submit, .posts-category-link { transition: none; }
}


/* Controls stay still for touch hover and for reduced-motion preferences. */
@media (prefers-reduced-motion: no-preference) {
    .posts-search-submit, .posts-category-link {
        transition: transform .22s cubic-bezier(.2,.8,.2,1), background-color .18s ease, border-color .18s ease, box-shadow .22s ease;
    }
    .posts-search-field input {
        transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease;
    }
    .posts-search-field input:focus {
        border-color: #3155ff;
        background: #fff;
        box-shadow: 0 0 0 3px rgb(49 85 255 / 8%);
    }
    .posts-search-submit:active, .posts-category-link:active {
        transform: translateY(1px) scale(.97);
    }
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
    .posts-search-submit:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgb(49 85 255 / 18%);
    }
    .posts-category-link:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 10px rgb(8 22 45 / 7%);
    }
    .posts-search-submit:active, .posts-category-link:active {
        transform: translateY(1px) scale(.97);
    }
}
