/*
 * Hero ingredient search — sitewide bar + form.
 * Mobile-first. Stacks vertically on small screens, inline on wider screens.
 * Design tokens from client mockup.
 */

:root {
    --mes-plum:     #5B3A6E;
    --mes-plum-dk:  #472B57;
    --mes-green:    #6FA548;
    --mes-green-dk: #4E7A2F;
    --mes-ink:      #33313A;
    --mes-mute:     #77737F;
    --mes-cream:    #FBF9F6;
    --mes-line:     #E9E4DC;
}

/* ── Hero wrapper ──────────────────────────────────────────────────────────── */

.mes-hero-wrap {
    width: 100%;
    background: var(--mes-cream);
    border-bottom: 1px solid var(--mes-line);
    padding: 18px 20px;
    box-sizing: border-box;
}

/* Home page gets extra breathing room for heading + subhead */
.mes-hero-wrap--home {
    padding: 36px 20px 32px;
}

.mes-hero-inner {
    max-width: 760px;
    margin: 0 auto;
}

.mes-hero-heading {
    font-family: 'Avenir Next', 'Segoe UI', system-ui, sans-serif;
    font-size: clamp(26px, 4.5vw, 42px);
    font-weight: 700;
    color: var(--mes-plum-dk);
    margin: 0 0 8px;
    line-height: 1.15;
}

.mes-hero-subhead {
    font-size: 16.5px;
    color: var(--mes-mute);
    margin: 0 0 20px;
}

/* ── Search form ───────────────────────────────────────────────────────────── */

.mes-hero-search-form {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
}

.mes-hero-search-inner {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mes-hero-search-input {
    flex: 1;
    width: 100%;
    padding: 20px 22px;
    font-size: 19px;
    line-height: 1.4;
    border: 2.5px solid var(--mes-plum);
    border-radius: 16px;
    background: #fff;
    color: var(--mes-ink);
    box-sizing: border-box;
    box-shadow: 0 8px 28px rgba(91, 58, 110, 0.14);
    -webkit-appearance: none;
    appearance: none;
}

.mes-hero-search-input:focus {
    outline: none;
    border-color: var(--mes-plum-dk);
    box-shadow: 0 8px 28px rgba(91, 58, 110, 0.22);
}

.mes-hero-search-input::placeholder {
    color: var(--mes-mute);
}

.mes-hero-search-button {
    padding: 14px 28px;
    font-size: 17px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    background: var(--mes-green);
    color: #fff;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.mes-hero-search-button:hover,
.mes-hero-search-button:focus {
    background: var(--mes-green-dk);
    outline: none;
}

/* ── Try chips ───────────────────────────────────────────────────────────── */

.mes-hero-try-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 12px 0 0;
}

.mes-hero-try-label {
    font-size: 0.85rem;
    color: #666;
}

.mes-hero-try-chip {
    padding: 5px 14px;
    font-size: 0.85rem;
    line-height: 1.4;
    background: #fff;
    color: var(--mes-plum);
    border: 1px solid var(--mes-line);
    border-radius: 99px;
    cursor: pointer;
    transition: background 0.12s ease, border-color 0.12s ease;
}

.mes-hero-try-chip:hover,
.mes-hero-try-chip:focus {
    background: var(--mes-cream);
    border-color: var(--mes-plum);
    outline: none;
}

/* ── Match indicator (injected into each grid card by PHP) ──────────────── */

.mes-match-indicator {
    margin: 8px 12px 4px;
    padding: 0 10px;
    font-size: 11.5px;
    color: #4E7A2F;
    line-height: 1.4;
    white-space: normal;
    overflow: visible;
    word-break: break-word;
}

/* ── Page-level partial-match notice (above the grid) ───────────────────── */

.mes-partial-match-notice {
    margin: 0 0 16px;
    padding: 10px 16px;
    font-size: 0.9rem;
    color: #555;
    background: #fafafa;
    border: 1px solid #ddd;
    border-left: 4px solid #f9a825;
    border-radius: 3px;
}

.mes-partial-match-notice[hidden] {
    display: none;
}

/* ── Side-by-side on wider screens ──────────────────────────────────────── */

@media (min-width: 600px) {
    .mes-hero-search-inner {
        flex-direction: row;
        align-items: stretch;
    }

    .mes-hero-search-input {
        border-radius: 4px 0 0 4px;
    }

    .mes-hero-search-button {
        border-radius: 0 4px 4px 0;
    }
}
