/* Explore page (explore.html). Builds on home-format.css for the navbar, tokens,
   eyebrow and footer. Same ledger look as home: no boxed panels, hairlines between
   the header, the toolbar and the filters. Controls match the series page. */

/* ===== Header ===== */
.ex-hero {
    padding: 24px 0 28px;
    border-bottom: 1px solid var(--ff-line);
}

.ex-title {
    margin: 0 0 10px;
    font-size: clamp(30px, 3.4vw, 40px);
    font-weight: 650;
    line-height: 1.08;
    letter-spacing: -0.03em;
}

.ex-hero__text {
    max-width: 52ch;
    margin: 0 0 22px;
    font-size: 15px;
    line-height: 1.55;
    color: var(--ff-text-secondary);
}

/* Results update as you type, so there's no button: the icon sits inside the box */
.ex-searchbox {
    position: relative;
    max-width: 560px;
}

.ex-searchbox svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ff-text-secondary);
    pointer-events: none;
}

.ex-searchbox input {
    width: 100%;
    height: 48px;
    padding: 0 14px 0 42px;
    font: inherit;
    font-size: 15px;
    color: var(--ff-text);
    background: var(--ff-track);
    border: 1px solid var(--ff-card-border);
    border-radius: 6px;
    outline: none;
}

.ex-searchbox input::placeholder {
    color: var(--ff-text-secondary);
}

.ex-searchbox input:focus {
    border-color: var(--ff-gold);
}

/* ===== Inputs and selects (same look as the series page) ===== */
.ex-control {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    font: inherit;
    font-size: 14px;
    color: var(--ff-text);
    background: var(--ff-track);
    border: 1px solid var(--ff-card-border);
    border-radius: 6px;
    color-scheme: dark;
}

.ex-control::placeholder {
    color: var(--ff-text-secondary);
}

.ex-control:hover {
    border-color: var(--ff-text-secondary);
}

.ex-control:focus {
    outline: none;
    border-color: var(--ff-gold);
}

.ex-btn:focus-visible,
.ex-page-btn:focus-visible,
.ex-link-btn:focus-visible,
.ex-check input:focus-visible {
    outline: 2px solid var(--ff-gold);
    outline-offset: 2px;
}

/* ===== Count and sort row (pagination scrolls back to here) ===== */
.ex-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 24px;
    padding: 16px 0;
    border-bottom: 1px solid var(--ff-line);
    scroll-margin-top: 16px;
}

.ex-count {
    margin: 0;
    font-size: 14px;
    color: var(--ff-text-secondary);
    font-variant-numeric: tabular-nums;
}

.ex-toolbar__left {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
}

/* Active filter chips: a plain bordered control with a ×, never gold-filled */
.ex-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ex-chips:empty {
    display: none;
}

.ex-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px 5px 10px;
    border: 1px solid var(--ff-card-border);
    border-radius: 6px;
    background: var(--ff-track);
    color: var(--ff-text);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}

.ex-chip:hover {
    border-color: var(--ff-text-secondary);
}

.ex-chip:focus-visible {
    outline: 2px solid var(--ff-gold);
    outline-offset: 2px;
}

.ex-chip__x {
    font-size: 15px;
    line-height: 1;
    color: var(--ff-text-secondary);
}

.ex-toolbar__right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ex-sort {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--ff-text-secondary);
    white-space: nowrap;
}

.ex-sort select {
    width: auto;
    min-width: 210px;
}

.ex-btn {
    height: 40px;
    padding: 0 16px;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--ff-text);
    background: transparent;
    border: 1px solid var(--ff-card-border);
    border-radius: 6px;
    cursor: pointer;
}

.ex-btn:hover {
    border-color: var(--ff-text-secondary);
}

.ex-btn[aria-expanded="true"] {
    border-color: var(--ff-gold);
}

.ex-filters-toggle {
    display: none; /* shown on small screens only */
}

/* ===== Layout ===== */
.ex-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 40px;
    align-items: start;
}

/* ===== Filters: a plain column, fields split by hairlines ===== */
.ex-filters {
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 16px;
}

.ex-filters__title {
    margin: 0;
    padding-bottom: 12px;
    font-size: 15px;
    font-weight: 600;
}

.ex-field,
.ex-check {
    padding: 16px 0;
    border-top: 1px solid var(--ff-line);
}

.ex-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ex-field > label {
    font-size: 13px;
    font-weight: 500;
    color: var(--ff-text-secondary);
}

.ex-range {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--ff-text-secondary);
}

.ex-range .ex-control {
    min-width: 0;
}

.ex-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    line-height: 1.4;
    cursor: pointer;
}

.ex-check input {
    width: 18px;
    height: 18px;
    margin: 1px 0 0;
    accent-color: var(--ff-gold);
    flex-shrink: 0;
}

.ex-link-btn {
    align-self: flex-start;
    padding: 0;
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    color: var(--ff-text-secondary);
    text-decoration: underline;
    text-underline-offset: 3px;
    background: none;
    border: none;
    cursor: pointer;
}

.ex-link-btn:hover {
    color: var(--ff-text);
}

.ex-filters > .ex-link-btn {
    padding-top: 16px;
    border-top: 1px solid var(--ff-line);
    align-self: stretch;
    text-align: left;
}

/* ===== Results ===== */
.ex-results .ff-card-grid {
    grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
    padding: 0;
}

.ex-empty {
    grid-column: 1 / -1;
    padding: 48px 0;
    text-align: center;
    color: var(--ff-text-secondary);
    border-top: 1px solid var(--ff-line);
    border-bottom: 1px solid var(--ff-line);
}

.ex-empty p {
    margin: 0 0 12px;
    font-size: 16px;
    color: var(--ff-text);
}

/* ===== Pagination (same as the series page) ===== */
.ex-pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--ff-line);
}

.ex-page-btn {
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    color: var(--ff-text);
    background: transparent;
    border: 1px solid var(--ff-card-border);
    border-radius: 6px;
    cursor: pointer;
}

.ex-page-btn:hover:not(:disabled):not(.is-current) {
    border-color: var(--ff-text-secondary);
}

.ex-page-btn.is-current {
    font-weight: 600;
    color: #0E0F11;
    background: var(--ff-gold);
    border-color: var(--ff-gold);
    cursor: default;
}

.ex-page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.ex-page-gap {
    padding: 0 4px;
    color: var(--ff-text-secondary);
}

/* ===== Smaller screens ===== */
@media (max-width: 900px) {
    .ex-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

    .ex-filters-toggle {
        display: inline-block;
    }

    /* Opens above the results, closed off by a hairline */
    .ex-filters {
        display: none;
        position: static;
        margin-bottom: 24px;
        border-bottom: 1px solid var(--ff-line);
    }

    .ex-filters.is-open {
        display: flex;
    }

    .ex-filters > .ex-link-btn {
        padding-bottom: 16px;
    }
}

@media (max-width: 767px) {
    /* Text boxes match the 44px selects */
    .ex-control {
        height: 44px;
    }

    .ex-filters > .ex-link-btn {
        min-height: 44px;
    }
}

@media (max-width: 600px) {
    .ex-hero {
        padding: 8px 0 24px;
    }

    .ex-toolbar__right {
        width: 100%;
    }

    .ex-sort {
        flex: 1;
        min-width: 0;
    }

    .ex-sort span {
        display: none;
    }

    .ex-sort select {
        flex: 1;
        min-width: 0;
    }

    .ex-results .ff-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 24px 12px;
    }
}
