/*
 * website-explorer.css - the shared "marketplace" chrome for org-website /
 * community listing routes: a pill search box, a result-head strip (count +
 * sort + mobile filter trigger), a sticky filter rail, and a matching empty
 * state. Registered once from views/website/_listing-header.php, the single
 * choke point every listing route (org, community, and the platform browse
 * routes via views/collection/browse.php) already passes through.
 *
 * Built entirely from the site's own design tokens (web/css/variables.css +
 * the --website-* builder overrides in website-theme.css) - no hardcoded
 * colors - so it inherits whatever theme/palette the org or community has
 * chosen, in both light and dark mode. Never scoped under .website-body: a
 * community-rendered listing page (views/collection/browse.php,
 * CommunityCollectionHelper) runs under the platform's own views/layouts/main.php,
 * which never sets that class - see the same note in _listing-header.php.
 *
 * Card polish (radius, hover lift, shadow) is intentionally NOT duplicated
 * here - website-theme.css already themes every listing card via
 * .website-card-hover-accent + the --website-card-* / --website-radius-lg
 * builder variables. This file only adds the chrome those cards sit inside.
 */

/* --- Search box: plain input -> a rounded pill, matching the header search --- */
.website-listing-search .form-control {
    border-radius: var(--radius-full, 999px);
    padding: 0.65rem 1.25rem;
    border-color: var(--border-default, var(--color-secondary-200));
    box-shadow: var(--shadow-xs);
}
.website-listing-search .form-control:focus {
    box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--bs-primary, var(--color-primary-500)) 20%, transparent);
    border-color: var(--bs-primary, var(--color-primary-500));
}

/* --- Category chips: fuller pill treatment for the shared filter row ------ */
.shop-category-chip {
    border-radius: var(--radius-full, 999px);
    font-weight: var(--font-weight-medium, 500);
}

/* --- Search bar with a Location field (events/rentals only, the 'location'
 * knob): keyword + location + a visual "Explore" button in one pill,
 * matching the design's three-segment bar. Without the knob, the box stays
 * the single plain pill above - this modifier only applies when a second
 * input is actually present. ------------------------------------------- */
.website-listing-search--bar {
    display: grid;
    grid-template-columns: 1fr minmax(160px, 0.42fr) auto;
    align-items: stretch;
    gap: 0;
    max-width: 720px;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-default, var(--color-secondary-200));
    border-radius: var(--radius-full, 999px);
    box-shadow: var(--shadow-sm);
    padding: var(--space-1, 0.25rem);
}
.website-listing-search--bar .form-control {
    border: 0;
    box-shadow: none;
    border-radius: var(--radius-full, 999px);
}
.website-listing-search--bar .form-control:first-child {
    border-right: 1px solid var(--border-default, var(--color-secondary-100));
    border-radius: var(--radius-full, 999px) 0 0 var(--radius-full, 999px);
}
.website-listing-search--bar .form-control:focus {
    box-shadow: none;
}
.website-listing-search-submit {
    background-color: var(--bs-primary, var(--color-primary-600));
    color: var(--color-on-primary, #fff);
    border: 0;
    border-radius: var(--radius-full, 999px);
    padding: 0 var(--space-6, 1.5rem);
    font-weight: var(--font-weight-semibold, 600);
    white-space: nowrap;
}
.website-listing-search-submit:hover {
    background-color: color-mix(in srgb, var(--bs-primary, var(--color-primary-600)) 88%, black);
    color: var(--color-on-primary, #fff);
}

@media (max-width: 575.98px) {
    .website-listing-search--bar {
        grid-template-columns: 1fr;
        border-radius: var(--radius-xl, 0.75rem);
    }
    .website-listing-search--bar .form-control:first-child {
        border-right: 0;
        border-bottom: 1px solid var(--border-default, var(--color-secondary-100));
        border-radius: var(--radius-xl, 0.75rem) var(--radius-xl, 0.75rem) 0 0;
    }
    .website-listing-search-submit {
        border-radius: 0 0 var(--radius-xl, 0.75rem) var(--radius-xl, 0.75rem);
        padding: var(--space-3, 0.75rem);
    }
}

/* --- Explorer band style (nav_presentation 'band_style'): a brighter
 * eyebrow, an oversized title and a widened search bar over the banner -
 * the reference marketplace-listing composition. Classic (the default for
 * every existing row) gets none of this: these rules only fire under the
 * --explorer modifier views/website/_listing-header.php adds. Room is left
 * at the band's bottom for the Featured strip to overlap into (see
 * .website-boost-strip--overlap below). The --explorer modifier applies
 * whether or not a banner is on (Explorer with Banner=None is a valid,
 * plain-background combination), so the light-on-dark eyebrow tint is
 * scoped to .listing-header--hero (only present when a band actually
 * renders) rather than to --explorer alone - ListingHeroWidget's own CSS
 * scopes its h1/.lead white-text override the same way. ------------------ */
.listing-header--hero.website-listing-header--explorer .website-listing-eyebrow {
    color: rgba(255, 255, 255, 0.85);
}
.website-listing-header--explorer .website-section-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
}
.website-listing-header--explorer .website-listing-subtitle {
    max-width: 640px;
    font-size: var(--font-size-lg, 1.125rem);
}
.website-listing-header--explorer .website-listing-search {
    max-width: 720px;
}
.website-listing-header--explorer .website-listing-search--bar {
    max-width: 860px;
}

/* --- Featured strip ('boost' knob): a promoted row above the category
 * pills / result head, pulled slightly over the hero's bottom edge like the
 * design's boost-zone card. -------------------------------------------- */
.website-boost-strip {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-default, var(--color-secondary-200));
    border-radius: var(--radius-xl, 0.75rem);
    box-shadow: var(--shadow-md);
    padding: var(--space-5, 1.25rem);
    margin-bottom: var(--space-8, 2rem);
}
.website-boost-strip-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: var(--space-3, 0.75rem);
    margin-bottom: var(--space-4, 1rem);
}
.website-boost-eyebrow {
    font-size: var(--font-size-xs, 0.75rem);
    font-weight: var(--font-weight-bold, 700);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: var(--space-1, 0.25rem);
}
.website-boost-heading {
    font-family: var(--font-family-heading);
    font-size: var(--font-size-xl, 1.25rem);
    margin: 0;
}
.website-boost-note {
    color: var(--text-muted);
    white-space: nowrap;
}
.website-boost-track {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4, 1rem);
}
.website-boost-card {
    display: grid;
    grid-template-columns: 96px 1fr;
    border: 1px solid var(--border-default, var(--color-secondary-200));
    border-radius: var(--radius-lg, 0.5rem);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 200ms var(--ease-in-out, ease), transform 200ms var(--ease-in-out, ease);
}
.website-boost-card:hover {
    color: inherit;
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.website-boost-image-wrap {
    position: relative;
    display: block;
    background-color: var(--bg-secondary);
}
.website-boost-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.website-boost-badge {
    position: absolute;
    top: var(--space-2, 0.5rem);
    left: var(--space-2, 0.5rem);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.6rem;
    font-weight: var(--font-weight-bold, 700);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-full, 999px);
}
.website-boost-copy {
    padding: var(--space-3, 0.75rem);
    display: flex;
    flex-direction: column;
    gap: var(--space-2, 0.5rem);
    min-width: 0;
}
.website-boost-copy strong {
    font-family: var(--font-family-heading);
    font-weight: var(--font-weight-medium, 500);
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.website-boost-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1, 0.25rem);
}

/* Explorer band style pulls the strip up over the band's bottom edge, the
 * "boost-zone card" look the design comment above has always described but
 * this modifier was never written for. z-index: 4 is required, not
 * cosmetic - .listing-header--hero has z-index: auto (no stacking context
 * of its own), so its descendants (.listing-header__overlay z-2,
 * .listing-header__content z-3 - ListingHeroWidget's own CSS) compete
 * globally with this strip; 4 must stay ahead of both. */
.website-boost-strip--overlap {
    position: relative;
    z-index: 4;
    margin-top: calc(-1 * var(--space-10, 2.5rem));
}
@media (max-width: 767.98px) {
    .website-boost-strip--overlap {
        margin-top: var(--space-4, 1rem);
    }
}

@media (max-width: 991.98px) {
    .website-boost-track {
        grid-template-columns: 1fr 1fr;
    }
    .website-boost-card:nth-child(3) {
        display: none;
    }
}
@media (max-width: 575.98px) {
    .website-boost-strip-head {
        flex-direction: column;
        align-items: flex-start;
    }
    .website-boost-track {
        grid-template-columns: 1fr;
    }
    .website-boost-card:nth-child(3) {
        display: grid;
    }
}

/* --- Result head: count/sort strip above the grid -------------------------- */
.website-result-head {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: var(--space-3, 0.75rem);
    margin-bottom: var(--space-6, 1.5rem);
}
.website-result-head-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2, 0.5rem);
    flex-wrap: wrap;
}
.website-sort-select-wrap {
    min-width: 0;
}
.website-sort-select {
    border-radius: var(--radius-lg, 0.5rem);
    border-color: var(--border-default, var(--color-secondary-200));
    font-weight: var(--font-weight-medium, 500);
}
.website-rail-toggle {
    border-radius: var(--radius-full, 999px);
}

/* --- Workspace: sticky rail + results, matching the design's 260px column - */
.website-listing-workspace {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: var(--space-7, 1.75rem);
    align-items: start;
}
.website-listing-results {
    min-width: 0;
}

/* --- Filter rail ------------------------------------------------------------ */
.website-filter-rail {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-default, var(--color-secondary-200));
    border-radius: var(--radius-xl, 0.75rem);
    padding: var(--space-5, 1.25rem);
    align-self: start;
    position: sticky;
    top: var(--space-5, 1.25rem);
}
.website-filter-rail-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-3, 0.75rem);
}
.website-filter-rail-title {
    font-size: var(--font-size-base, 1rem);
    font-weight: var(--font-weight-semibold, 600);
    margin: 0;
}
.website-rail-close {
    display: none;
}
.website-filter-group {
    padding: var(--space-3, 0.75rem) 0;
    border-top: 1px solid var(--border-default, var(--color-secondary-100));
}
.website-filter-group:first-of-type {
    border-top: 0;
    padding-top: 0;
}
.website-filter-group-label {
    display: block;
    font-size: var(--font-size-sm, 0.875rem);
    font-weight: var(--font-weight-semibold, 600);
    margin-bottom: var(--space-2, 0.5rem);
}
.website-filter-check {
    display: flex;
    align-items: center;
    gap: var(--space-2, 0.5rem);
    padding: var(--space-1, 0.25rem) 0;
    font-size: var(--font-size-sm, 0.875rem);
    color: var(--text-secondary, var(--text-primary));
    cursor: pointer;
}
.website-filter-range {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: var(--space-2, 0.5rem);
    cursor: default;
}
.website-filter-range input[type="range"] {
    width: 100%;
    accent-color: var(--bs-primary, var(--color-primary-500));
}
.website-filter-range output {
    font-weight: var(--font-weight-semibold, 600);
    font-size: var(--font-size-sm, 0.875rem);
    min-width: 2.5rem;
    text-align: right;
}
.website-filter-clear {
    display: block;
    width: 100%;
    margin-top: var(--space-3, 0.75rem);
    padding: var(--space-2, 0.5rem);
    border: 0;
    background: none;
    color: var(--bs-primary, var(--color-primary-600));
    font-weight: var(--font-weight-medium, 500);
    font-size: var(--font-size-sm, 0.875rem);
    text-align: center;
    border-radius: var(--radius-md, 0.375rem);
}
.website-filter-clear:hover {
    background-color: var(--bg-secondary);
}

/* --- Empty state: a dashed panel, matching the design's empty-result card -- */
.website-listing-empty {
    text-align: center;
    padding: var(--space-10, 2.5rem) var(--space-5, 1.25rem);
    border: 1px dashed var(--border-default, var(--color-secondary-300));
    border-radius: var(--radius-xl, 0.75rem);
}

@media (max-width: 991.98px) {
    .website-listing-workspace {
        grid-template-columns: 1fr;
    }
    .website-filter-rail {
        position: fixed;
        inset: 0 0 0 auto;
        width: min(340px, 88vw);
        max-width: 88vw;
        height: 100%;
        z-index: 1050;
        border-radius: 0;
        overflow-y: auto;
        transform: translateX(100%);
        transition: transform var(--duration-200, 200ms) var(--ease-in-out, ease);
        box-shadow: var(--shadow-2xl);
    }
    .website-filter-rail.open {
        transform: translateX(0);
    }
    .website-rail-close {
        display: inline-flex;
    }
}

[data-bs-theme="dark"] .website-filter-rail {
    background-color: var(--bg-secondary);
}
