/* ======================================================
MODS LANDING PAGE
template-mods.php — enqueued only on that template.
Card + sheet visuals live in featured-mods.css, which is
enqueued alongside this file.
====================================================== */

/* ---------- Wrapper ---------- */
.sc-mods-page {
    padding-bottom: 64px;
}

/* ---------- Header ---------- */
.sc-mods-header__title {
    letter-spacing: 0.01em;
}

.sc-mods-search {
    width: 100%;
}

.sc-mods-search__field {
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.sc-mods-search__field:focus-within {
    border-color: rgba(255, 255, 255, 0.16);
}

.sc-mods-search__icon {
    color: rgba(255, 255, 255, 0.4);
}

.sc-mods-search__input {
    caret-color: #fff;
}

.sc-mods-search__input:focus,
.sc-mods-search__input:focus-visible {
    outline: 0;
    border: 0;
    box-shadow: none;
}

.sc-mods-search__input::placeholder {
    color: rgba(255, 255, 255, 0.38);
}

.sc-mods-search__input::-webkit-search-decoration,
.sc-mods-search__input::-webkit-search-cancel-button,
.sc-mods-search__input::-webkit-search-results-button,
.sc-mods-search__input::-webkit-search-results-decoration {
    -webkit-appearance: none;
    appearance: none;
    display: none;
}

.sc-mods-search__clear {
    display: inline-flex;
    width: 28px;
    height: 28px;
    color: rgba(255, 255, 255, 0.45);
}

.sc-mods-search__clear[hidden] {
    display: none;
}

.sc-mods-search__clear:hover,
.sc-mods-search__clear:focus-visible {
    color: #fff;
}

.sc-mods-rail-outer.is-search-open .sc-mods-search.is-docked {
    width: 100%;
    padding: 0 max(10px, calc(50vw - 590px + 10px)) 10px;
    box-sizing: border-box;
}

/* ---------- Floating search (same bar as the build page) ---------- */
.sc-actions-bar {
    right: 16px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    transform: translateY(120%);
    opacity: 0;
    pointer-events: none;
    transition:
        transform 0.28s cubic-bezier(0.32, 0.72, 0, 1),
        opacity 0.22s ease,
        bottom 0.28s cubic-bezier(0.32, 0.72, 0, 1);
    transform-origin: bottom right;
    will-change: transform, opacity;
}

.sc-actions-bar.is-visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.sc-actions-bar .sc-hero__btn {
    background: #262626;
    border-color: rgba(255, 255, 255, 0.12);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    width: 54px;
    height: 54px;
}

.sc-actions-bar .sc-hero__btn svg {
    width: 24px;
    height: 24px;
}

.sc-actions-bar .sc-hero__btn[aria-expanded="true"] [data-sc-mods-search-fab-icon="search"],
.sc-actions-bar .sc-hero__btn[aria-expanded="false"] [data-sc-mods-search-fab-icon="close"] {
    display: none;
}

.sc-actions-bar .sc-hero__btn:active {
    background: #323232;
}

/* Stay tappable as Close while search is open, even if the nav is showing. */
body.sc-mods-search-docked .sc-actions-bar,
body.sc-mods-search-docked .sc-actions-bar.is-visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
    z-index: 1010;
}

body.sc-mods-search-docked:has(.sc-nav:not(.sc-nav--hidden)) .sc-actions-bar {
    bottom: calc(12px + 56px + env(safe-area-inset-bottom, 0px));
}

@media (prefers-reduced-motion: reduce) {
    .sc-actions-bar {
        transition: none;
    }
}

/* ---------- Category chips (pin on scroll down, hide on scroll up) ---------- */
.sc-mods-rail-outer {
    position: relative;
    z-index: 50;
    background: transparent;
    padding-left: 10px;
}

.sc-mods-rail-spacer {
    pointer-events: none;
}

.sc-mods-rail-outer.is-pinned {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1020;
    background: var(--bgsection, #1c1c1c);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    transform: translateY(0);
    transition: transform 0.25s ease;
}

.sc-mods-rail-outer.is-pinned.is-away {
    transform: translateY(-100%);
    pointer-events: none;
}

.sc-mods-rail-outer.is-pinned .sc-mods-rail {
    padding-top: 10px;
    padding-bottom: 10px;
}

@media (prefers-reduced-motion: reduce) {
    .sc-mods-rail-outer.is-pinned {
        transition: none;
    }
}

.sc-mods-rail {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    scrollbar-width: none;
    padding: 4px 0 10px;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    padding-left: max(10px, calc(50vw - 590px + 10px));
    padding-right: max(10px, calc(50vw - 590px + 10px));
}

.sc-mods-rail::-webkit-scrollbar {
    display: none;
}

.sc-mods-chip {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 999rem;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.25;
    white-space: nowrap;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.07);
    color: rgba(255, 255, 255, 0.45);
    background: transparent;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.sc-mods-chip:hover {
    border-color: rgba(255, 255, 255, 0.10);
}

/* All — active matches build modlist */
.sc-mods-chip.is-active:not([data-chip-color]) {
    color: #fff;
    background: rgba(255, 255, 255, 0.10);
    border-color: rgba(255, 255, 255, 0.10);
}

/* Category chips — active uses modlist tile colors */
.sc-mods-chip[data-chip-color].is-active {
    border: 1px solid color-mix(in srgb, var(--chip-c) 55%, transparent);
    color: #fff;
    background: color-mix(in srgb, var(--chip-c) 18%, transparent);
}

.sc-mods-chip[data-chip-color].is-active .u-mod-chip-count {
    background: color-mix(in srgb, var(--chip-c) 25%, transparent);
    color: #fff;
}

/* ---------- Infinite scroll ---------- */
.sc-mods-grid.is-swapping {
    opacity: 0.4;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.sc-mods-sentinel {
    height: 1px;
    pointer-events: none;
}

.sc-mods-status {
    text-align: center;
    padding: 20px 0 4px;
    color: #7d7d7d;
    font-size: 12px;
    margin: 0;
}

/* ---------- Empty state ---------- */
.sc-mods-empty {
    text-align: center;
    padding: 64px 0;
    color: #9a9a9a;
    font-size: 14px;
    margin: 0;
}

.sc-mods-empty[hidden] {
    display: none;
}

.sc-mods-empty__all {
    min-height: 40px;
    color: rgba(255, 255, 255, 0.72);
}

.sc-mods-empty__all[hidden] {
    display: none;
}

.sc-mods-empty__all:hover,
.sc-mods-empty__all:focus-visible {
    color: #fff;
}

/* ---------- Responsive ---------- */
@media (min-width: 701px) {
    .sc-mods-rail {
        padding-left: max(20px, calc(50vw - 590px + 20px));
        padding-right: max(20px, calc(50vw - 590px + 20px));
    }

    .sc-mods-search {
        width: 340px;
        flex-shrink: 0;
    }

    .sc-mods-rail-outer.is-search-open .sc-mods-search.is-docked {
        width: 100%;
        padding-left: max(20px, calc(50vw - 590px + 20px));
        padding-right: max(20px, calc(50vw - 590px + 20px));
    }
}

@media (max-width: 700px) {
    .sc-mods-header__title {
        font-size: 2.6rem;
    }
}
