
/**
 * HLxHub — Mobile Archive Filters
 *
 * File:
 * assets/css/archive-mobile/mobile-filters.css
 *
 * Purpose:
 * Premium, responsive mobile archive filter interface.
 *
 * Compatible with:
 * template-parts/archive-mobile/mobile-filters.php
 */


/* =========================================================
   1. ROOT
========================================================= */

.hlx-mobile-filters {
    --filter-primary: #2563eb;
    --filter-primary-dark: #1d4ed8;
    --filter-text: #172033;
    --filter-muted: #64748b;
    --filter-border: #e2e8f0;
    --filter-surface: #ffffff;
    --filter-bg: #f8faff;
    --filter-radius: 16px;

    position: relative;
    z-index: 5;

    width: 100%;
    margin: 35px auto;
    padding: 30px;

    background:
        radial-gradient(
            circle at 0% 0%,
            rgba(59, 130, 246, 0.07),
            transparent 35%
        ),
        linear-gradient(
            145deg,
            #ffffff,
            #f8faff
        );

    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 22px;

    box-shadow:
        0 12px 35px rgba(15, 23, 42, 0.055),
        0 2px 8px rgba(15, 23, 42, 0.025);

    box-sizing: border-box;
}

.hlx-mobile-filters *,
.hlx-mobile-filters *::before,
.hlx-mobile-filters *::after {
    box-sizing: border-box;
}


/* =========================================================
   2. CONTAINER
========================================================= */

.hlx-mobile-filters__container {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
}


/* =========================================================
   3. HEADER
========================================================= */

.hlx-mobile-filters__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;

    margin-bottom: 26px;
}

.hlx-mobile-filters__heading {
    min-width: 0;
}

.hlx-mobile-filters__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    margin-bottom: 10px;
    padding: 6px 12px;

    color: #2563eb;
    background: #eff6ff;

    border: 1px solid #dbeafe;
    border-radius: 30px;

    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.4px;
    line-height: 1.5;
    text-transform: uppercase;
}

.hlx-mobile-filters__eyebrow::before {
    content: "";

    width: 7px;
    height: 7px;

    flex: 0 0 7px;

    background: #3b82f6;
    border-radius: 50%;

    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.10);
}

.hlx-mobile-filters__heading h2 {
    margin: 0 0 8px;

    color: var(--filter-text);

    font-size: clamp(23px, 2.5vw, 32px);
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.8px;
}

.hlx-mobile-filters__heading p {
    max-width: 600px;

    margin: 0;

    color: var(--filter-muted);

    font-size: 13px;
    font-weight: 400;
    line-height: 1.8;
}


/* =========================================================
   4. MOBILE TOGGLE
========================================================= */

.hlx-mobile-filters__mobile-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 9px;

    min-height: 44px;
    padding: 0 17px;

    color: #ffffff;
    background: linear-gradient(
        135deg,
        #3b82f6,
        #2563eb
    );

    border: 1px solid #2563eb;
    border-radius: 11px;

    font-family: inherit;
    font-size: 12px;
    font-weight: 700;

    cursor: pointer;

    box-shadow: 0 5px 14px rgba(37, 99, 235, 0.17);

    transition:
        background 0.25s ease,
        box-shadow 0.25s ease,
        transform 0.25s ease;
}

.hlx-mobile-filters__mobile-toggle:hover {
    background: #1d4ed8;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.24);
    transform: translateY(-2px);
}

.hlx-mobile-filters__toggle-icon {
    font-size: 17px;
    line-height: 1;
}


/* =========================================================
   5. FILTER FORM
========================================================= */

.hlx-mobile-filters__form {
    width: 100%;
    margin: 0;
    padding: 0;
}

.hlx-mobile-filters__fields {
    display: grid;
    grid-template-columns:
        minmax(0, 1.15fr)
        minmax(0, 1.15fr)
        minmax(0, 1fr)
        minmax(155px, 0.85fr);

    align-items: end;
    gap: 18px;

    width: 100%;
}


/* =========================================================
   6. INDIVIDUAL FILTER
========================================================= */

.hlx-mobile-filter {
    display: flex;
    flex-direction: column;
    gap: 10px;

    min-width: 0;
}

.hlx-mobile-filter__label {
    display: block;

    margin: 0;

    color: #334155;

    font-size: 12px;
    font-weight: 750;
    line-height: 1.5;
    letter-spacing: 0.2px;
}


/* =========================================================
   7. SELECT WRAPPER
========================================================= */

.hlx-mobile-filter__select-wrap {
    position: relative;
    width: 100%;
    min-width: 0;
}

.hlx-mobile-filter__icon {
    position: absolute;
    top: 50%;
    left: 14px;
    z-index: 2;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 20px;
    height: 20px;

    color: #64748b;

    font-size: 16px;
    font-weight: 700;
    line-height: 1;

    pointer-events: none;
    transform: translateY(-50%);
}


/* =========================================================
   8. SELECT DROPDOWNS
========================================================= */

.hlx-mobile-filter__select {
    display: block;

    width: 100%;
    min-width: 0;
    min-height: 49px;

    margin: 0;
    padding: 0 38px 0 43px;

    appearance: none;
    -webkit-appearance: none;

    color: #334155;
    background-color: #ffffff;

    border: 1px solid #dbe2ed;
    border-radius: 11px;

    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.5;

    cursor: pointer;

    outline: none;

    transition:
        border-color 0.25s ease,
        box-shadow 0.25s ease,
        background 0.25s ease;
}


/* Custom dropdown arrow */

.hlx-mobile-filter__select-wrap::after {
    content: "";

    position: absolute;
    top: 50%;
    right: 16px;

    width: 8px;
    height: 8px;

    border-right: 1.8px solid #64748b;
    border-bottom: 1.8px solid #64748b;

    pointer-events: none;
    transform: translateY(-70%) rotate(45deg);
    transition: transform 0.2s ease;
}


/* Focus state */

.hlx-mobile-filter__select:focus {
    border-color: #60a5fa;

    box-shadow:
        0 0 0 3px rgba(59, 130, 246, 0.13);

    background-color: #ffffff;
}


/* Hover state */

.hlx-mobile-filter__select:hover {
    border-color: #93c5fd;
}


/* Options */

.hlx-mobile-filter__select option {
    color: #172033;
    background: #ffffff;
    font-size: 13px;
}


/* =========================================================
   9. APPLY BUTTON
========================================================= */

.hlx-mobile-filter--action {
    justify-content: flex-end;
}

.hlx-mobile-filter__apply {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;

    width: 100%;
    min-height: 49px;

    margin: 0;
    padding: 0 17px;

    color: #ffffff;

    background: linear-gradient(
        135deg,
        #3b82f6 0%,
        #2563eb 55%,
        #1d4ed8 100%
    );

    border: 1px solid #2563eb;
    border-radius: 11px;

    font-family: inherit;
    font-size: 12px;
    font-weight: 750;
    line-height: 1.4;

    cursor: pointer;

    box-shadow:
        0 7px 17px rgba(37, 99, 235, 0.20),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);

    transition:
        background 0.25s ease,
        box-shadow 0.25s ease,
        transform 0.25s ease;
}

.hlx-mobile-filter__apply:hover {
    color: #ffffff;

    background: linear-gradient(
        135deg,
        #2563eb,
        #1d4ed8
    );

    box-shadow: 0 11px 23px rgba(37, 99, 235, 0.28);
    transform: translateY(-2px);
}

.hlx-mobile-filter__apply span:last-child {
    font-size: 20px;
    line-height: 1;

    transition: transform 0.25s ease;
}

.hlx-mobile-filter__apply:hover span:last-child {
    transform: translateX(4px);
}

.hlx-mobile-filter__apply:active {
    transform: translateY(0);
}


/* =========================================================
   10. ACTIVE FILTERS
========================================================= */

.hlx-mobile-filters__active {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;

    margin-top: 22px;
    padding: 13px 16px;

    background: #eff6ff;

    border: 1px solid #dbeafe;
    border-radius: 12px;
}

.hlx-mobile-filters__active-label {
    display: inline-flex;
    align-items: center;
    gap: 9px;

    color: #1e40af;

    font-size: 12px;
    font-weight: 750;
}

.hlx-mobile-filters__active-label span {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 21px;
    height: 21px;

    color: #ffffff;
    background: #2563eb;

    border-radius: 50%;

    font-size: 12px;
    font-weight: 800;
}


/* Clear all */

.hlx-mobile-filters__clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;

    padding: 7px 11px;

    color: #dc2626;
    background: #ffffff;

    border: 1px solid #fecaca;
    border-radius: 8px;

    font-size: 11px;
    font-weight: 750;
    text-decoration: none;

    transition:
        color 0.2s ease,
        background 0.2s ease,
        border-color 0.2s ease;
}

.hlx-mobile-filters__clear:hover {
    color: #ffffff;
    background: #dc2626;
    border-color: #dc2626;
}

.hlx-mobile-filters__clear span {
    font-size: 18px;
    line-height: 1;
}


/* =========================================================
   11. KEYBOARD ACCESSIBILITY
========================================================= */

.hlx-mobile-filters__mobile-toggle:focus-visible,
.hlx-mobile-filter__apply:focus-visible,
.hlx-mobile-filters__clear:focus-visible {
    outline: 3px solid rgba(59, 130, 246, 0.55);
    outline-offset: 3px;
}

.hlx-mobile-filter__select:focus-visible {
    outline: 3px solid rgba(59, 130, 246, 0.35);
    outline-offset: 2px;
}


/* =========================================================
   12. TABLET
========================================================= */

@media (max-width: 1024px) {

    .hlx-mobile-filters {
        padding: 26px;
    }

    .hlx-mobile-filters__fields {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
        gap: 20px;
    }

    .hlx-mobile-filter--action {
        justify-content: flex-end;
    }

    .hlx-mobile-filter__apply {
        max-width: none;
    }
}


/* =========================================================
   13. MOBILE
========================================================= */

@media (max-width: 640px) {

    .hlx-mobile-filters {
        margin: 24px auto;
        padding: 20px 17px;

        border-radius: 18px;
    }

    .hlx-mobile-filters__top {
        align-items: center;
        gap: 12px;
        margin-bottom: 0;
    }

    .hlx-mobile-filters__heading {
        flex: 1;
    }

    .hlx-mobile-filters__eyebrow {
        margin-bottom: 8px;
        padding: 5px 10px;
        font-size: 9px;
    }

    .hlx-mobile-filters__heading h2 {
        margin-bottom: 6px;
        font-size: 23px;
        letter-spacing: -0.5px;
    }

    .hlx-mobile-filters__heading p {
        font-size: 11px;
        line-height: 1.65;
    }

    .hlx-mobile-filters__mobile-toggle {
        display: inline-flex;
        flex: 0 0 auto;
        min-height: 40px;
        padding: 0 13px;
        font-size: 11px;
    }

    /*
     * Mobile form collapsed by default.
     * JavaScript must toggle .is-open
     * on .hlx-mobile-filters.
     */

    .hlx-mobile-filters__form {
        display: none;
        margin-top: 22px;
        padding-top: 20px;
        border-top: 1px solid #e2e8f0;
    }

    .hlx-mobile-filters.is-open .hlx-mobile-filters__form {
        display: block;
        animation: hlx-filter-reveal 0.25s ease both;
    }

    .hlx-mobile-filters.is-open .hlx-mobile-filters__mobile-toggle {
        background: #1d4ed8;
    }

    .hlx-mobile-filters__fields {
        grid-template-columns: minmax(0, 1fr);
        gap: 17px;
    }

    .hlx-mobile-filter {
        gap: 8px;
    }

    .hlx-mobile-filter__label {
        font-size: 11px;
    }

    .hlx-mobile-filter__select {
        min-height: 46px;
        font-size: 12px;
    }

    .hlx-mobile-filter__apply {
        min-height: 47px;
        font-size: 12px;
    }

    .hlx-mobile-filters__active {
        margin-top: 17px;
        padding: 11px 12px;
    }
}


/* =========================================================
   14. SMALL MOBILE
========================================================= */

@media (max-width: 380px) {

    .hlx-mobile-filters {
        padding: 17px 13px;
        border-radius: 15px;
    }

    .hlx-mobile-filters__top {
        gap: 8px;
    }

    .hlx-mobile-filters__heading h2 {
        font-size: 21px;
    }

    .hlx-mobile-filters__heading p {
        font-size: 10px;
    }

    .hlx-mobile-filters__mobile-toggle {
        min-height: 37px;
        padding: 0 10px;
        gap: 6px;
    }

    .hlx-mobile-filters__toggle-icon {
        font-size: 15px;
    }

    .hlx-mobile-filters__active {
        align-items: flex-start;
        flex-direction: column;
    }

    .hlx-mobile-filters__clear {
        align-self: flex-end;
    }
}


/* =========================================================
   15. ANIMATION
========================================================= */

@keyframes hlx-filter-reveal {
    from {
        opacity: 0;
        transform: translateY(-7px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* =========================================================
   16. REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {

    .hlx-mobile-filters *,
    .hlx-mobile-filters *::before,
    .hlx-mobile-filters *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
