/* Explore marketplace (/explore). Tokens only; works in light and dark. */
.explore { padding-block: var(--space-8, 2rem); }

/* Hero (issue #53): compact illustrated header; the artwork layers are shared with the directory (hero-swipe.css).
 * The text is live HTML on top, the tabs stay below and never move with the image. */
.explore__head { margin: 0 0 var(--space-4, 1rem); text-align: left; }
.explore-hero { position: relative; border-radius: var(--radius-lg, 1rem); color: #fff; background: var(--color-primary-600); }
/* Issue #65: the frame has the artwork's own 3:1 ratio (reserved before load, same height on every tab) and the
 * images are contained, never cropped. The layers and their slide are clipped by the frame. */
.explore-hero__frame { position: relative; overflow: hidden; isolation: isolate; aspect-ratio: 3 / 1; border-radius: inherit; }
.explore-hero__layer { background: var(--hero-bg, var(--color-primary-600)); }
.explore-hero__layer img { object-fit: contain; }
/* Events art is 2160x728 (a hair taller than 3:1): contained, the sliver left over is a palette-matched inset. */
.explore-hero__layer--events { --hero-bg: #6b5a3c; }
.explore-hero__inner { position: absolute; left: 0; bottom: 0; z-index: 1; }
/* All offers: neutral branded cream / olive / violet, implies no single category. */
.explore-hero__layer--all { background: linear-gradient(135deg, var(--color-secondary-100, #efe9d6) 0%, var(--color-primary-300, #a9b48a) 55%, var(--color-accent-300, #b9a6d8) 100%); }
:root[data-theme="dark"] .explore-hero__layer--all, .dark .explore-hero__layer--all, [data-bs-theme="dark"] .explore-hero__layer--all {
    background: linear-gradient(135deg, var(--color-secondary-800, #2c2a22) 0%, var(--color-primary-800, #3b4326) 55%, var(--color-accent-800, #3f3358) 100%); }
.explore-hero__shade { position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background: linear-gradient(to top, rgba(0, 0, 0, .6), rgba(0, 0, 0, .2) 65%, rgba(0, 0, 0, .1)); }
.explore-hero__inner { padding: var(--space-6, 1.5rem); max-width: min(46rem, 100%); transition: opacity .15s ease; }
.explore-hero__inner.is-swapping { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .explore-hero__inner { transition: none; } }
/* Brand heading font at its real weight (Calistoga ships 400 only), body font for the lead. */
.explore__title { font-family: var(--font-family-heading, inherit); font-weight: 400; font-synthesis: none; color: inherit;
    font-size: clamp(1.25rem, 2.6vw, 2.2rem); line-height: 1.15; margin: 0 0 .35rem; text-shadow: 0 1px 12px rgba(0, 0, 0, .35); }
.explore__lead { font-family: var(--font-family-body, inherit); color: inherit; opacity: .95; margin: 0; font-size: 1.05rem; text-shadow: 0 1px 8px rgba(0, 0, 0, .35); }
/* Below 768px the text leaves the artwork and sits under it, so the whole illustration stays visible. */
@media (max-width: 767.98px) {
    .explore-hero__shade { display: none; }
    .explore-hero__inner { position: static; padding: 1rem; color: var(--color-text, inherit); }
    .explore-hero { color: var(--color-text, inherit); background: var(--color-surface, transparent); border: 1px solid var(--color-border, rgba(0, 0, 0, .1)); }
    .explore__title, .explore__lead { text-shadow: none; }
    .explore__title { font-size: 1.35rem; }
}

/* Tab switch in place: dim the slots that are being replaced (the layout never collapses). */
[data-explore-slot="layout"] { transition: opacity .15s ease; }
[data-explore-slot="layout"].is-loading { opacity: .5; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { [data-explore-slot="layout"] { transition: none; } }

/* Six equal tabs across the content width; 3 x 2 on small screens. */
.explore-tabs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .5rem; margin-bottom: var(--space-4, 1rem); }
.explore-tab { display: flex; align-items: center; justify-content: center; gap: .45rem; min-height: 2.75rem; padding: .5rem .75rem;
    border-radius: 999px; border: 1px solid var(--border-default, var(--color-secondary-200)); background: var(--bg-primary, transparent);
    color: inherit; text-decoration: none; font-weight: 500; text-align: center; line-height: 1.2; }
.explore-tab:hover { border-color: var(--bs-primary, var(--color-primary-500)); }
.explore-tab.is-active { background: var(--bs-primary, var(--color-primary-500)); border-color: transparent; color: var(--text-on-primary, #fff); }
@media (max-width: 767.98px) { .explore-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 399.98px) { .explore-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); } .explore-tab { font-size: .9rem; } }

.explore a:focus-visible, .explore button:focus-visible, .explore input:focus-visible, .explore select:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--bs-primary, var(--color-primary-500)) 55%, transparent); outline-offset: 2px; }

/* Search + location + button: one full-width row. */
.explore-search { display: grid; grid-template-columns: 2fr 1fr auto; gap: .5rem; margin-bottom: var(--space-6, 1.5rem); }
.explore-search .form-control { border-radius: 999px; padding: .65rem 1.25rem; min-width: 0; }
.explore-search__btn { border-radius: 999px; padding-inline: 1.5rem; }
@media (max-width: 575.98px) {
    .explore-search { grid-template-columns: minmax(0, 1fr) auto; }
    .explore-search__q { grid-column: 1 / -1; }
}

/* Marketplace Boost */
.explore-boost { margin-bottom: var(--space-6, 1.5rem); }
.explore-boost__head { display: flex; align-items: center; gap: .75rem; margin-bottom: .75rem; }
.explore-boost__title { font-size: 1.15rem; margin: 0; }
.explore-boost__nav { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.explore-boost__nav[hidden], .explore-boost__btn[hidden] { display: none; }
.explore-boost__btn { width: 2.5rem; height: 2.5rem; border-radius: 50%; border: 1px solid var(--border-default, var(--color-secondary-200));
    background: var(--bg-primary, transparent); color: inherit; display: inline-flex; align-items: center; justify-content: center; }
.explore-boost__btn:hover { border-color: var(--bs-primary, var(--color-primary-500)); }
.explore-boost__btn[data-carousel-toggle] { width: 2rem; height: 2rem; font-size: .75rem; color: var(--text-secondary, inherit); }
.explore-boost__track { display: flex; gap: 1rem; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: .25rem; }
.explore-boost__track::-webkit-scrollbar { display: none; }
.explore-boost__slide { flex: 0 0 calc((100% - 2rem) / 3); scroll-snap-align: start; min-width: 0; }
@media (max-width: 991.98px) { .explore-boost__slide { flex-basis: calc((100% - 1rem) / 2); } }
@media (max-width: 575.98px) { .explore-boost__slide { flex-basis: 100%; } }

/* Cards */
.explore-card { height: 100%; border-radius: var(--radius-lg, 1rem); overflow: hidden; background: var(--bg-primary, #fff);
    border: 1px solid var(--border-default, var(--color-secondary-200)); }
.explore-card__link { display: block; height: 100%; color: inherit; text-decoration: none; }
.explore-card__media { position: relative; aspect-ratio: 16 / 10; background: var(--bg-secondary, rgba(0,0,0,.05)); }
.explore-card__img { width: 100%; height: 100%; object-fit: cover; display: block; }
.explore-card__badge { display: inline-block; padding: .15rem .6rem; border-radius: 999px; font-size: .72rem; font-weight: 600; }
.explore-card__badge--sponsored { background: var(--color-accent-100, #fdf0cf); color: var(--color-accent-800, #6b4a00); }
.explore-card__media .explore-card__badge { position: absolute; top: .6rem; left: .6rem; }
.explore-card__body { padding: .9rem 1rem 1.1rem; }
.explore-card__type { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-secondary, inherit); }
.explore-card__title { font-size: 1.1rem; font-weight: 600; margin: .2rem 0 .3rem; }
.explore-card__meta { margin: 0; font-size: .9rem; color: var(--text-secondary, inherit); }

/* Sidebar + results */
.explore-layout { display: grid; grid-template-columns: 16rem minmax(0, 1fr); gap: var(--space-6, 1.5rem); align-items: start; }
@media (max-width: 991.98px) { .explore-layout { grid-template-columns: minmax(0, 1fr); } }

/* Collapsible desktop sidebar (issue #63). Calendar/Map start collapsed; presentation only, filters stay applied.
 * visibility (delayed until the width animation ends on close) keeps the hidden form out of the tab order. */
.explore-sidebar-toggle { display: none; align-items: center; gap: .45rem; padding: .3rem .85rem; min-height: 2.25rem;
    border-radius: 999px; border: 1px solid var(--border-default, var(--color-secondary-200)); background: var(--bg-primary, transparent);
    color: inherit; font-size: .9rem; font-weight: 500; line-height: 1.2; cursor: pointer; }
.explore-sidebar-toggle:hover { border-color: var(--bs-primary, var(--color-primary-500)); }
.explore-sidebar-toggle .badge { font-size: .72rem; }
.explore-sidebar-toggle__chevron { font-size: .7rem; opacity: .7; }
/* Follows the layout class (set before paint), so a swapped-in or reloaded layout never spins the chevron;
 * it only animates once the toggle is live (data-sidebar-ready, set by explore-filters.js). */
.explore-layout:not(.is-collapsed) .explore-sidebar-toggle__chevron { transform: rotate(180deg); }
.explore-layout[data-sidebar-ready] .explore-sidebar-toggle__chevron { transition: transform .25s ease; }
@media (min-width: 992px) {
    .explore-layout[data-sidebar-ready] { transition: grid-template-columns .25s ease, column-gap .25s ease; }
    .explore-layout.is-collapsed { grid-template-columns: 0 minmax(0, 1fr); column-gap: 0; }
    .explore-layout .explore-filters { transition: opacity .2s ease, visibility 0s linear 0s; }
    .explore-layout.is-collapsed .explore-filters { visibility: hidden; opacity: 0; overflow: hidden; min-width: 0;
        transition: opacity .15s ease, visibility 0s linear .25s; }
}
@media (prefers-reduced-motion: reduce) {
    .explore-layout, .explore-layout .explore-filters, .explore-layout.is-collapsed .explore-filters,
    .explore-sidebar-toggle__chevron { transition: none; }
}

/* The tools in the results column stack by their OWN width, so an open sidebar never squeezes or clips them. */
.explore-results { container-type: inline-size; container-name: explore-results; }
@container explore-results (max-width: 60rem) {
    .explore-results .evm2 .evm-controls--full { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .explore-results .evm2 .evm-controls--full .evm-where { grid-column: 1 / -1; }
}
@container explore-results (max-width: 52rem) {
    .explore-results .oc2 .oc-layout, .explore-results .evm2 .evm-body { grid-template-columns: minmax(0, 1fr); }
    .explore-results .oc2 .oc-agenda, .explore-results .evm2 .evm-panel { max-height: none; }
}
@container explore-results (max-width: 36rem) {
    .explore-results .evm2 .evm-controls--full { grid-template-columns: minmax(0, 1fr); }
}

@media (min-width: 992px) {
    .explore-filters { position: sticky; top: calc(var(--header-height, 4.5rem) + 1rem); max-height: calc(100vh - var(--header-height, 4.5rem) - 2rem);
        overflow-y: auto; padding-right: .25rem; }
    .explore-filters .offcanvas-header { display: none; }
    .explore-filters .offcanvas-body { padding: 0; overflow: visible; }
    .explore-filters__form.is-auto .explore-filters__apply { display: none; }
}
@media (max-width: 991.98px) {
    .explore-filters.offcanvas-lg { background: var(--bg-primary, #fff); color: var(--text-primary, inherit); }
    .explore-filters__actions { position: sticky; bottom: 0; background: var(--bg-primary, #fff); padding-block: .75rem; }
    .explore-filters__apply { flex: 1 1 auto; }
}
.explore-filters__group { margin: 0 0 1.25rem; padding: 0; border: 0; min-width: 0; }
.explore-filters__legend { display: block; font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
    color: var(--text-secondary, inherit); margin-bottom: .5rem; float: none; width: auto; padding: 0; }
.explore-filters__hint { font-size: .875rem; color: var(--text-secondary, inherit); margin: 0 0 1.25rem; }
.explore-filters .explore-filters__opt { display: flex; align-items: flex-start; gap: .5rem; margin: 0; padding: .3rem 0 .3rem 1.6em; min-height: 2rem; cursor: pointer; }
.explore-filters .explore-filters__opt .form-check-label { flex: 1 1 auto; line-height: 1.35; }
.explore-filters__count { margin-left: auto; padding-left: .5rem; font-size: .8rem; color: var(--text-secondary, inherit); font-variant-numeric: tabular-nums; }
.explore-filters__tree { list-style: none; margin: 0; padding: 0; }
.explore-filters__tree .explore-filters__tree { padding-left: 1.1rem; border-left: 1px solid var(--border-default, var(--color-secondary-200)); margin-left: .35rem; }
.explore-filters__range { display: flex; align-items: center; gap: .4rem; }
.explore-filters__range .form-control { min-width: 0; }
.explore-filters__actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.explore-filters .explore-filters__reset { padding-inline: 0; }

.explore-results { min-width: 0; scroll-margin-top: calc(var(--header-height, 4.5rem) + 1rem); }
.explore-results__head { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; margin-bottom: 1rem; }
.explore-results__title { font-size: 1.25rem; margin: 0; }
.explore-results__count { color: var(--text-secondary, inherit); }
.explore-range-nav { display: inline-flex; align-items: center; gap: .25rem; }
.explore-range-nav__btn { display: inline-flex; align-items: center; justify-content: center; width: 1.75rem; height: 1.75rem; border-radius: 50%;
    border: 1px solid var(--border-default, var(--color-secondary-200)); color: var(--text-secondary, inherit); font-size: .7rem; text-decoration: none; transition: background .15s, color .15s; }
a.explore-range-nav__btn:hover, a.explore-range-nav__btn:focus-visible { background: var(--bs-primary, var(--color-primary-500)); color: var(--text-on-primary, #fff); }
.explore-range-nav__btn.is-disabled { opacity: .4; }
/* Directory has no view switch: park the arrows at the right edge of the head. */
[data-directory-results] .explore-range-nav { margin-left: auto; }
.explore-views { margin-left: auto; display: inline-flex; gap: .25rem; padding: .2rem; border-radius: 999px; border: 1px solid var(--border-default, var(--color-secondary-200)); }
.explore-views a { padding: .3rem .85rem; border-radius: 999px; color: inherit; text-decoration: none; font-size: .9rem; }
.explore-views a.is-active { background: var(--bs-primary, var(--color-primary-500)); color: var(--text-on-primary, #fff); }

.explore-chips { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: 0 0 1rem; padding: 0; }
.explore-chip { display: inline-flex; align-items: center; gap: .4rem; padding: .25rem .7rem; border-radius: 999px; font-size: .85rem;
    background: var(--bg-secondary, rgba(0,0,0,.05)); border: 1px solid var(--border-default, var(--color-secondary-200)); color: inherit; text-decoration: none; }
.explore-chip:hover { border-color: var(--bs-primary, var(--color-primary-500)); }
.explore-chip .fa-xmark { font-size: .75rem; opacity: .7; }
.explore-chips__reset { font-size: .85rem; margin-left: .25rem; }

.explore-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
@media (max-width: 1199.98px) { .explore-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 575.98px) { .explore-grid { grid-template-columns: minmax(0, 1fr); } }
.explore-note { margin: .75rem 0 0; font-size: .9rem; color: var(--text-secondary, inherit); }
.explore-empty { text-align: center; padding: 3rem 1rem; color: var(--text-secondary, inherit); }
.explore-empty p { margin-bottom: .75rem; }
.explore-map { height: 32rem; border-radius: var(--radius-lg, 1rem); overflow: hidden; border: 1px solid var(--border-default, var(--color-secondary-200)); }

/* Sort: one field + two direction buttons (issue #42) */
.explore-sort__row { display: flex; gap: .4rem; align-items: stretch; }
.explore-sort__row .form-select { flex: 1 1 auto; min-width: 0; min-height: 2.75rem; }
.explore-sort__dirs { display: inline-flex; gap: .25rem; }
.explore-sort__dir { width: 2.75rem; min-height: 2.75rem; border-radius: var(--radius-md, .6rem); font-size: 1.1rem; line-height: 1;
    border: 1px solid var(--border-default, var(--color-secondary-200)); background: var(--bg-primary, transparent); color: inherit; cursor: pointer; }
.explore-sort__dir:hover { border-color: var(--bs-primary, var(--color-primary-500)); }
.explore-sort__dir.is-active { background: var(--bs-primary, var(--color-primary-500)); border-color: transparent; color: var(--text-on-primary, #fff); }
.explore-sort__label { margin: .4rem 0 0; font-size: .85rem; color: var(--text-secondary, inherit); }

/* Categories: included children, partial parents, format sub-heads */
.explore-filters__opt .form-check-input.is-included { opacity: .55; }
.explore-filters__subhead { margin: .6rem 0 .2rem; font-size: .8rem; font-weight: 600; color: var(--text-secondary, inherit); }

/* Event date presets */
.explore-presets { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .6rem; }
.explore-preset { position: relative; margin: 0; cursor: pointer; }
.explore-preset input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.explore-preset span { display: inline-block; padding: .35rem .8rem; min-height: 2.25rem; line-height: 1.5; border-radius: 999px; font-size: .875rem;
    border: 1px solid var(--border-default, var(--color-secondary-200)); background: var(--bg-primary, transparent); }
.explore-preset input:checked + span { background: var(--bs-primary, var(--color-primary-500)); border-color: transparent; color: var(--text-on-primary, #fff); }
.explore-preset input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--bs-primary, var(--color-primary-500)) 55%, transparent); outline-offset: 2px; }
.explore-presets__range { margin: 0 0 .6rem; }

/* Radios + checkboxes in the sidebar: brand primary, larger (the default Bootstrap blue is off-brand) */
.explore-filters .explore-filters__opt { padding: .4rem 0 .4rem 0; min-height: 2.5rem; align-items: center; gap: .65rem; }
.explore-filters .explore-filters__opt .form-check-input { float: none; margin: 0; flex: 0 0 auto; width: 1.4rem; height: 1.4rem;
    border: 2px solid var(--border-default, var(--color-secondary-300, #b9c0b4)); background-color: var(--bg-primary, transparent);
    cursor: pointer; transition: background-color .15s, border-color .15s, box-shadow .15s; }
.explore-filters .explore-filters__opt .form-check-input:hover { border-color: var(--bs-primary, var(--color-primary-500)); }
.explore-filters .explore-filters__opt .form-check-input:checked,
.explore-filters .explore-filters__opt .form-check-input:indeterminate {
    background-color: var(--bs-primary, var(--color-primary-500)); border-color: var(--bs-primary, var(--color-primary-500)); }
.explore-filters .explore-filters__opt .form-check-input[type="radio"]:checked {
    background-image: radial-gradient(circle, var(--text-on-primary, #fff) 0 34%, transparent 38%); }
.explore-filters .explore-filters__opt .form-check-input:focus { box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--bs-primary, var(--color-primary-500)) 30%, transparent); }
.explore-filters .explore-filters__opt .form-check-label { cursor: pointer; }

/* Sidebar still scrolls (wheel, touch, keys) but without its own scrollbar track */
@media (min-width: 992px) {
    .explore-filters { scrollbar-width: none; -ms-overflow-style: none; padding-right: 0; }
    .explore-filters::-webkit-scrollbar { display: none; }
}
