/* ========================================================================== 
   NINO SEPO — PREMIUM ARCHIVE TAXONOMY FILTER
   Shared by Shop and Journal archives
   ========================================================================== */

/*
 * Keep this container free from transform, filter, backdrop-filter,
 * isolation and overflow:hidden. Those properties create stacking contexts
 * that can interfere with the Elementor Menu Cart drawer.
 */
.ninosepo-archive-filter {
    --filter-black: #090909;
    --filter-white: #fff;
    --filter-muted: rgba(255, 255, 255, 0.56);
    --filter-line: rgba(255, 255, 255, 0.14);
    --filter-gold: #bda16b;

    position: relative;
    z-index: 20;
    width: 100%;
    margin: 0;
    padding: 0 clamp(24px, 4vw, 76px);
    color: var(--filter-white) !important;
    background-color: var(--filter-black) !important;
    background-image: none !important;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.08);
}

/*
 * Elementor's generated .e-con rules may be printed after theme styles.
 * Match that container explicitly so its editor background cannot turn the
 * rail white while the filter labels remain white.
 */
body .elementor .ninosepo-archive-filter.e-con,
body .elementor .ninosepo-archive-filter.e-con-full,
body .ninosepo-archive-filter.elementor-element {
    color: #fff !important;
    background-color: #090909 !important;
    background-image: none !important;
    --background-transition: 0s;
}

.ninosepo-archive-filter.elementor-sticky--active {
    z-index: 100 !important;
    background-color: rgba(9, 9, 9, 0.985) !important;
    background-image: none !important;
    border-bottom-color: rgba(255, 255, 255, 0.13);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.16);
}

body .elementor .ninosepo-archive-filter.e-con.elementor-sticky--active,
body .ninosepo-archive-filter.elementor-element.elementor-sticky--active {
    background-color: rgba(9, 9, 9, 0.985) !important;
    background-image: none !important;
}

/* Never recreate the former outer overlay. */
.ninosepo-archive-filter::before,
.ninosepo-archive-filter::after {
    display: none !important;
    content: none !important;
}

/* ========================================================================== 
   WIDGET / SCROLL AREA
   ========================================================================== */

.ninosepo-archive-filter__taxonomy {
    position: relative;
    width: 100%;
    min-width: 0;
    max-width: 1180px;
    margin: 0 auto;
}

.ninosepo-archive-filter__taxonomy .e-filter {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    gap: clamp(28px, 3.2vw, 58px);
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 22px 0 20px;
    overflow-x: auto;
    overflow-y: hidden;
    list-style: none;
    overscroll-behavior-inline: contain;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.ninosepo-archive-filter__taxonomy .e-filter::-webkit-scrollbar {
    display: none;
}

/* ========================================================================== 
   FILTER ITEMS
   ========================================================================== */

.ninosepo-archive-filter__taxonomy .e-filter-item {
    position: relative;
    flex: 0 0 auto;
    min-width: 0;
    margin: 0;
    padding: 6px 0 8px;
    appearance: none;
    -webkit-appearance: none;
    color: var(--filter-muted) !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    font-family: inherit;
    font-size: 10px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0.19em;
    text-align: center;
    text-transform: uppercase;
    white-space: nowrap;
    cursor: pointer;
    transition: color 220ms ease, opacity 220ms ease;
}

/* Fine gold editorial rule. */
.ninosepo-archive-filter__taxonomy .e-filter-item::after {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    width: calc(100% - 0.19em);
    height: 1px;
    margin: auto;
    content: "";
    background: var(--filter-gold);
    opacity: 0;
    transform: scaleX(0.25);
    transform-origin: center;
    transition:
        opacity 220ms ease,
        transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.ninosepo-archive-filter__taxonomy .e-filter-item:hover,
.ninosepo-archive-filter__taxonomy .e-filter-item:focus-visible {
    color: var(--filter-white) !important;
}

.ninosepo-archive-filter__taxonomy .e-filter-item:hover::after,
.ninosepo-archive-filter__taxonomy .e-filter-item:focus-visible::after {
    opacity: 0.52;
    transform: scaleX(1);
}

.ninosepo-archive-filter__taxonomy .e-filter-item:focus-visible {
    outline: 1px solid rgba(189, 161, 107, 0.78);
    outline-offset: 5px;
}

/* Active selection — cover Elementor's current state variations. */
.ninosepo-archive-filter__taxonomy .e-filter-item[aria-pressed="true"],
.ninosepo-archive-filter__taxonomy .e-filter-item[aria-current="true"],
.ninosepo-archive-filter__taxonomy .e-filter-item.e-active,
.ninosepo-archive-filter__taxonomy .e-filter-item.elementor-active {
    color: var(--filter-white) !important;
}

.ninosepo-archive-filter__taxonomy .e-filter-item[aria-pressed="true"]::after,
.ninosepo-archive-filter__taxonomy .e-filter-item[aria-current="true"]::after,
.ninosepo-archive-filter__taxonomy .e-filter-item.e-active::after,
.ninosepo-archive-filter__taxonomy .e-filter-item.elementor-active::after {
    opacity: 1;
    transform: scaleX(1);
}

.ninosepo-archive-filter__taxonomy button.e-filter-item,
.ninosepo-archive-filter__taxonomy button.e-filter-item:hover,
.ninosepo-archive-filter__taxonomy button.e-filter-item:focus,
.ninosepo-archive-filter__taxonomy button.e-filter-item:active {
    background-color: transparent !important;
}

.ninosepo-archive-filter__taxonomy .e-filter-item[disabled],
.ninosepo-archive-filter__taxonomy .e-filter-item[aria-disabled="true"] {
    opacity: 0.30;
    cursor: default;
}

/* ========================================================================== 
   MOBILE OVERFLOW CUES
   ========================================================================== */

.ninosepo-archive-filter__scroll-cue {
    display: none;
}

@media (max-width: 1024px) {
    .ninosepo-archive-filter {
        padding-inline: 24px;
    }

    .ninosepo-archive-filter__taxonomy .e-filter {
        justify-content: flex-start;
        gap: 34px;
        padding-block: 20px 18px;
    }
}

@media (max-width: 767px) {
    .ninosepo-archive-filter {
        padding-inline: 16px;
    }

    .ninosepo-archive-filter__taxonomy {
        max-width: none;
    }

    .ninosepo-archive-filter__taxonomy .e-filter {
        gap: 24px;
        padding-top: 15px;
        padding-right: 4px;
        padding-bottom: 14px;
    }

    .ninosepo-archive-filter__taxonomy.has-horizontal-overflow .e-filter {
        padding-right: 62px;
    }

    .ninosepo-archive-filter__taxonomy .e-filter-item {
        padding-top: 5px;
        padding-bottom: 7px;
        font-size: 9px;
        letter-spacing: 0.16em;
    }

    /*
     * Elementor archive templates often retain their desktop top padding on
     * mobile. Pull only the Loop Grid section into a deliberate editorial
     * rhythm, without touching the cards or their image proportions.
     */
    body .ninosepo-archive-filter + .e-con:has(.elementor-widget-loop-grid),
    body .ninosepo-archive-filter + .elementor-element:has(.elementor-widget-loop-grid) {
        padding-top: 28px !important;
    }

    /* Left fade appears after the visitor begins scrolling. */
    .ninosepo-archive-filter__taxonomy::before {
        position: absolute;
        z-index: 4;
        top: 0;
        bottom: 0;
        left: -1px;
        width: 32px;
        content: "";
        pointer-events: none;
        background: linear-gradient(
            to right,
            var(--filter-black) 12%,
            rgba(9, 9, 9, 0)
        );
        opacity: 0;
        transition: opacity 180ms ease;
    }

    .ninosepo-archive-filter__taxonomy.can-scroll-left::before {
        opacity: 1;
    }

    /* Real button: communicates overflow and advances the category rail. */
    .ninosepo-archive-filter__scroll-cue {
        position: absolute;
        z-index: 5;
        top: 50%;
        right: 0;
        display: inline-flex;
        visibility: hidden;
        align-items: center;
        justify-content: flex-end;
        gap: 6px;
        width: 60px;
        height: calc(100% - 2px);
        margin: 0;
        padding: 0 0 0 15px;
        color: rgba(255, 255, 255, 0.82) !important;
        background: linear-gradient(
            to right,
            rgba(9, 9, 9, 0),
            var(--filter-black) 38%
        ) !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        font-family: inherit;
        font-size: 7px;
        font-weight: 500;
        line-height: 1;
        letter-spacing: 0.16em;
        text-transform: uppercase;
        cursor: pointer;
        opacity: 0;
        transform: translateY(-50%);
        transition: color 180ms ease, opacity 180ms ease;
    }

    .ninosepo-archive-filter__taxonomy.can-scroll-right
    .ninosepo-archive-filter__scroll-cue {
        visibility: visible;
        opacity: 1;
    }

    .ninosepo-archive-filter__scroll-cue:hover,
    .ninosepo-archive-filter__scroll-cue:focus-visible {
        color: var(--filter-white) !important;
    }

    .ninosepo-archive-filter__scroll-cue:focus-visible {
        outline: 1px solid rgba(189, 161, 107, 0.78);
        outline-offset: -2px;
    }

    .ninosepo-archive-filter__scroll-arrow {
        font-size: 13px;
        line-height: 1;
        transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
    }

    .ninosepo-archive-filter__scroll-cue:hover
    .ninosepo-archive-filter__scroll-arrow {
        transform: translateX(3px);
    }
}

@media (max-width: 420px) {
    .ninosepo-archive-filter {
        padding-inline: 14px;
    }

    .ninosepo-archive-filter__taxonomy .e-filter {
        gap: 21px;
    }

    .ninosepo-archive-filter__taxonomy.has-horizontal-overflow .e-filter {
        padding-right: 54px;
    }

    .ninosepo-archive-filter__scroll-cue {
        width: 52px;
        padding-left: 12px;
    }

    .ninosepo-archive-filter__scroll-cue > span:first-child {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .ninosepo-archive-filter__scroll-arrow {
        margin-left: auto;
        font-size: 16px;
    }
}

/* ========================================================================== 
   REDUCED MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .ninosepo-archive-filter,
    .ninosepo-archive-filter__taxonomy::before,
    .ninosepo-archive-filter__taxonomy .e-filter,
    .ninosepo-archive-filter__taxonomy .e-filter-item,
    .ninosepo-archive-filter__taxonomy .e-filter-item::after,
    .ninosepo-archive-filter__scroll-cue,
    .ninosepo-archive-filter__scroll-arrow {
        scroll-behavior: auto;
        transition: none !important;
    }
}
