/* Mexperience Search Bar — shared component
 * The filter/search bar used on the search page and (as a search entry point +
 * sort control) on tag archives. Relies on the --mex-* tokens from mex-cards.css.
 */

.mex-search-filters {
    background: var(--mex-stone);
    border: 1px solid var(--mex-border);
    border-radius: 8px;
    padding: 20px 24px;
    margin-bottom: 30px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    font-family: 'Open Sans', Arial, sans-serif;
}

.mex-search-filters .filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mex-search-filters .filter-group.search-field {
    flex: 1 1 260px;
    min-width: 200px;
}

.mex-search-filters .filter-group label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--mex-grey);
    font-family: 'Open Sans', Arial, sans-serif;
}

.mex-search-filters input[type="text"] {
    padding: 10px 14px;
    border: 1px solid #d1cfcb;
    border-radius: 6px;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
    background: #fff;
    color: var(--mex-ink);
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: 'Open Sans', Arial, sans-serif;
}

.mex-search-filters input[type="text"]:focus {
    border-color: var(--mex-red);
    outline: none;
    box-shadow: 0 0 0 2px rgba(206, 17, 38, 0.12);
}

.mex-search-filters select {
    padding: 10px 32px 10px 12px;
    border: 1px solid #d1cfcb;
    border-radius: 6px;
    font-size: 14px;
    background-color: #fff;
    color: var(--mex-ink);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236f6f6f' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    min-width: 170px;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: 'Open Sans', Arial, sans-serif;
}

.mex-search-filters select:focus {
    border-color: var(--mex-red);
    outline: none;
    box-shadow: 0 0 0 2px rgba(206, 17, 38, 0.12);
}

.mex-search-filters .filter-submit {
    padding: 10px 22px;
    background: var(--mex-red);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
    height: 40px;
    font-family: 'Open Sans', Arial, sans-serif;
}

.mex-search-filters .filter-submit:hover {
    background: var(--mex-red-light);
}

.mex-search-filters .filter-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    font-size: 13px;
    font-weight: 500;
    color: var(--mex-grey);
    background: #fff;
    border: 1px solid #d1cfcb;
    border-radius: 6px;
    padding: 0 16px;
    text-decoration: none;
    align-self: flex-end;
    white-space: nowrap;
    box-sizing: border-box;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.mex-search-filters .filter-clear:hover {
    color: var(--mex-ink);
    background: var(--mex-stone);
    border-color: var(--mex-grey);
    text-decoration: none;
}

/* Nested forms (used on tag pages: one form searches the site, another sorts
   the listing) sit inline and don't break the single-row bar layout. */
.mex-search-filters form {
    display: contents;
    margin: 0;
}

/* ── Responsive ── */
@media screen and (max-width: 960px) {
    .mex-search-filters .filter-group.search-field {
        flex: 1 1 200px;
        min-width: 160px;
    }

    .mex-search-filters select {
        min-width: 150px;
    }
}

@media screen and (max-width: 600px) {
    .mex-search-filters {
        flex-direction: column;
        align-items: stretch;
        padding: 16px;
    }

    /* display:contents lets the column layout reach nested form children too. */
    .mex-search-filters .filter-group.search-field,
    .mex-search-filters .filter-group {
        flex: unset;
        min-width: unset;
    }

    .mex-search-filters select,
    .mex-search-filters .filter-submit,
    .mex-search-filters .filter-clear {
        min-width: unset;
        width: 100%;
    }
}
