/* ==========================================================================
   Search-first homepage (HOMEPAGE_SEARCH_V2 "new" arm)
   include/home_search_v2.php (signed out), include/home_search_band.php (signed in)

   One bold move: a full-bleed food photograph with the search box on it, and
   the box typing real searches (js/home_search.js). Everything below is quiet.
   Brand stays the site's own: cream, ink, terracotta, Playfair display.
   Every selector starts at html.legendary .hs-home / .hs-band so site-wide
   element rules (e.g. html.legendary :where(input)) can't override it.
   ========================================================================== */

html.legendary .hs-home,
html.legendary .hs-band {
    --hs-cream: var(--contrast-light-bg, #FBF8F1);
    --hs-paper: var(--contrast-paper-bg, #FFFDF8);
    --hs-ink: var(--contrast-light-ink, #231F1A);
    --hs-muted: var(--contrast-light-muted, #554D43);
    --hs-line: #E4DCCD;
    --hs-tomato: var(--contrast-accent-bg, #B84E31);
    --hs-tomato-deep: var(--contrast-editorial-ink, #7E301F);
    --hs-herb: #3F5A35;
    --hs-char: #17120E;
    --hs-on-photo: #FFFDF8;
    --hs-gutter: clamp(16px, 4vw, 56px);
    color: var(--hs-ink);
    font-family: var(--font-body, system-ui, sans-serif);
}

html.legendary .hs-home {
    background: var(--hs-cream);
    padding-bottom: clamp(48px, 8vw, 96px);
}

html.legendary .hs-home .visually-hidden,
html.legendary .hs-band .visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

html.legendary .hs-home h1,
html.legendary .hs-home h2,
html.legendary .hs-home h3,
html.legendary .hs-band h2 {
    font-family: var(--font-display, Georgia, serif);
    letter-spacing: -0.015em;
    color: inherit;
}

/* ── Hero ─────────────────────────────────────────────────────────── */
html.legendary .hs-home .hs-hero {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: clamp(560px, 82vh, 780px);
    padding: clamp(96px, 14vh, 160px) var(--hs-gutter) clamp(28px, 5vh, 48px);
    background: var(--hs-char);
    color: var(--hs-on-photo);
    overflow: hidden;
}
html.legendary .hs-home .hs-hero picture { display: contents; }
html.legendary .hs-home .hs-hero__photo {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 60% 50%;
}
/* Scrim: dark where the text sits (bottom on phones, left on wide screens). */
html.legendary .hs-home .hs-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(to top, rgba(23, 18, 14, 0.94) 0%, rgba(23, 18, 14, 0.80) 45%, rgba(23, 18, 14, 0.25) 100%);
}
@media (min-width: 900px) {
    html.legendary .hs-home .hs-hero::before {
        background:
            linear-gradient(to right, rgba(23, 18, 14, 0.92) 0%, rgba(23, 18, 14, 0.72) 42%, rgba(23, 18, 14, 0.05) 78%),
            linear-gradient(to top, rgba(23, 18, 14, 0.55), transparent 40%);
    }
}
html.legendary .hs-home .hs-hero__inner {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}
html.legendary .hs-home .hs-hero__title {
    max-width: 13.5ch;
    margin: 0 0 1rem;
    font-size: clamp(2.6rem, 7.2vw, 5.6rem);
    font-weight: 800;
    line-height: 0.98;
    color: var(--hs-on-photo);
}
html.legendary .hs-home .hs-hero__lede {
    max-width: 34rem;
    margin: 0 0 1.6rem;
    color: #F1EADF;
    font-size: clamp(1.02rem, 1.5vw, 1.2rem);
    line-height: 1.55;
}
html.legendary .hs-home .hs-hero__promise {
    margin: 0.9rem 0 0 0.25rem;
    color: #F1EADF;
    font-size: 0.98rem;
    font-weight: 600;
}
/* Top corner: the bottom right is where the floating My Kitchen button sits. */
html.legendary .hs-home .hs-hero__credit {
    position: absolute;
    right: var(--hs-gutter);
    top: 14px;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: rgba(23, 18, 14, 0.62);
    color: #E9E1D4;
    font-size: 0.8rem;
    text-decoration: none;
}
html.legendary .hs-home .hs-hero__credit:hover { text-decoration: underline; }
html.legendary .hs-home .hs-hero__credit:focus-visible { outline: 2px solid var(--hs-on-photo); outline-offset: 3px; }

/* ── Search box ───────────────────────────────────────────────────── */
html.legendary .hs-home .hs-search,
html.legendary .hs-band .hs-search {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 44rem;
    padding: 7px 7px 7px 22px;
    background: var(--hs-paper);
    border: 0;
    border-radius: 999px;
    box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.55);
}
html.legendary .hs-band .hs-search {
    border: 2px solid var(--hs-ink);
    box-shadow: none;
}
html.legendary .hs-home .hs-search:focus-within,
html.legendary .hs-band .hs-search:focus-within {
    outline: 3px solid var(--hs-tomato);
    outline-offset: 3px;
}
html.legendary .hs-home .hs-search__input,
html.legendary .hs-band .hs-search__input {
    flex: 1 1 auto;
    min-width: 0;
    height: 52px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: var(--hs-ink);
    font: inherit;
    font-size: 1.12rem;
}
html.legendary .hs-home .hs-search__input:focus,
html.legendary .hs-band .hs-search__input:focus { outline: none; box-shadow: none; }
html.legendary .hs-home .hs-search__input::placeholder,
html.legendary .hs-band .hs-search__input::placeholder { color: var(--hs-muted); opacity: 1; }
html.legendary .hs-home .hs-search__button,
html.legendary .hs-band .hs-search__button {
    flex: 0 0 auto;
    height: 52px;
    padding: 0 1.6rem;
    border: 0;
    border-radius: 999px;
    background: var(--hs-tomato);
    color: var(--hs-paper);
    font: inherit;
    font-weight: 700;
    font-size: 1.02rem;
    cursor: pointer;
}
html.legendary .hs-home .hs-search__button:hover,
html.legendary .hs-band .hs-search__button:hover { background: var(--hs-tomato-deep); }
html.legendary .hs-home .hs-search__button:focus-visible,
html.legendary .hs-band .hs-search__button:focus-visible { outline: 3px solid var(--hs-ink); outline-offset: 2px; }

/* ── Chips ────────────────────────────────────────────────────────── */
html.legendary .hs-home .hs-chips,
html.legendary .hs-band .hs-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-width: 44rem;
    margin-top: 1.25rem;
}
html.legendary .hs-home .hs-chip,
html.legendary .hs-band .hs-chip {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 1rem;
    border-radius: 999px;
    font-size: 0.94rem;
    font-weight: 600;
    text-decoration: none;
}
/* On the photo: dark glass. */
html.legendary .hs-home .hs-hero .hs-chip {
    background: rgba(23, 18, 14, 0.62);
    border: 1px solid rgba(255, 253, 248, 0.38);
    color: var(--hs-on-photo);
    backdrop-filter: blur(6px);
}
html.legendary .hs-home .hs-hero .hs-chip:hover { background: var(--hs-paper); color: var(--hs-ink); }
/* On cream (signed-in band). */
html.legendary .hs-band .hs-chip {
    background: var(--hs-paper);
    border: 1px solid var(--hs-line);
    color: var(--hs-ink);
}
html.legendary .hs-band .hs-chip:hover { border-color: var(--hs-ink); }
html.legendary .hs-home .hs-chip:focus-visible,
html.legendary .hs-band .hs-chip:focus-visible { outline: 3px solid var(--hs-tomato); outline-offset: 2px; }

/* ── Shared section furniture ─────────────────────────────────────── */
html.legendary .hs-home .hs-shelf,
html.legendary .hs-home .hs-cuisines,
html.legendary .hs-home .hs-diets,
html.legendary .hs-home .hs-start {
    max-width: 1200px;
    margin: clamp(56px, 8vw, 96px) auto 0;
    padding: 0 var(--hs-gutter);
}
html.legendary .hs-home .hs-section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem 1.5rem;
    margin-bottom: 1.5rem;
}
html.legendary .hs-home .hs-section-head h2,
html.legendary .hs-home .hs-diets h2,
html.legendary .hs-home .hs-start h2,
html.legendary .hs-home .hs-demo h2 {
    margin: 0;
    font-size: clamp(1.75rem, 3.6vw, 2.7rem);
    line-height: 1.08;
}
html.legendary .hs-home .hs-text-link {
    color: var(--hs-tomato-deep);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 0.2em;
}
html.legendary .hs-home .hs-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 1.4rem;
    border: 2px solid var(--hs-tomato);
    border-radius: 999px;
    background: var(--hs-tomato);
    color: var(--hs-paper);
    font-weight: 700;
    text-decoration: none;
}
html.legendary .hs-home .hs-button:hover { background: var(--hs-tomato-deep); border-color: var(--hs-tomato-deep); color: var(--hs-paper); }
html.legendary .hs-home .hs-button:focus-visible { outline: 3px solid var(--hs-ink); outline-offset: 2px; }
html.legendary .hs-home .hs-button--quiet { background: transparent; border-color: var(--hs-ink); color: var(--hs-ink); }
html.legendary .hs-home .hs-button--quiet:hover { background: var(--hs-ink); border-color: var(--hs-ink); color: var(--hs-paper); }

/* ── Demo ─────────────────────────────────────────────────────────── */
html.legendary .hs-home .hs-demo {
    display: grid;
    gap: clamp(24px, 4vw, 56px);
    max-width: 1200px;
    margin: clamp(56px, 8vw, 96px) auto 0;
    padding: 0 var(--hs-gutter);
    align-items: start;
}
@media (min-width: 960px) {
    html.legendary .hs-home .hs-demo { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr); }
}
html.legendary .hs-home .hs-demo__intro p {
    max-width: 30rem;
    margin: 1rem 0 1.5rem;
    color: var(--hs-muted);
    font-size: 1.05rem;
    line-height: 1.6;
}
html.legendary .hs-home .hs-demo__compare {
    display: grid;
    gap: 14px;
}
@media (min-width: 640px) {
    html.legendary .hs-home .hs-demo__compare { grid-template-columns: 1fr 1fr; }
}
html.legendary .hs-home .hs-demo__card {
    padding: clamp(18px, 2.6vw, 26px);
    background: var(--hs-paper);
    border: 1px solid var(--hs-line);
    border-radius: 6px;
}
html.legendary .hs-home .hs-demo__card--you {
    background: var(--hs-herb);
    border-color: var(--hs-herb);
    color: var(--hs-paper);
}
html.legendary .hs-home .hs-demo__label {
    margin: 0 0 0.2rem;
    font-size: 1.25rem;
    line-height: 1.2;
}
html.legendary .hs-home .hs-demo__meta {
    margin: 0 0 1rem;
    color: var(--hs-muted);
    font-size: 0.92rem;
}
html.legendary .hs-home .hs-demo__card--you .hs-demo__meta { color: #DCE4D2; }
html.legendary .hs-home .hs-demo__list { margin: 0; padding: 0; list-style: none; }
html.legendary .hs-home .hs-demo__list li {
    display: grid;
    grid-template-columns: 4.6rem 1fr;
    gap: 0.6rem;
    padding: 0.5rem 0;
    border-top: 1px solid var(--hs-line);
    line-height: 1.35;
}
html.legendary .hs-home .hs-demo__card--you .hs-demo__list li { border-top-color: rgba(255, 253, 248, 0.22); }
html.legendary .hs-home .hs-demo__list li span { font-weight: 700; font-variant-numeric: tabular-nums; }
/* Amounts the rewrite changed, in honey on the herb card. */
html.legendary .hs-home .hs-demo__list li.is-changed span { color: #F6C453; }
html.legendary .hs-home .hs-demo__list li.is-removed { color: #DCE4D2; }
html.legendary .hs-home .hs-demo__changes {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 1.1rem 0 0;
    padding: 0;
    list-style: none;
}
html.legendary .hs-home .hs-demo__changes li {
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    background: var(--hs-paper);
    color: var(--hs-herb);
    font-size: 0.85rem;
    font-weight: 700;
}

/* ── Copycat cards ───────────────────────────────────────────────── */
html.legendary .hs-home .hs-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
    gap: 28px 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}
html.legendary .hs-home .hs-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: var(--hs-ink);
    text-decoration: none;
}
html.legendary .hs-home .hs-card__frame {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 6px;
    background: var(--hs-line);
}
html.legendary .hs-home .hs-card__frame picture,
html.legendary .hs-home .hs-card__image {
    display: block;
    width: 100%;
}
html.legendary .hs-home .hs-card__image {
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}
html.legendary .hs-home .hs-card__stamp {
    position: absolute;
    left: 10px;
    bottom: 10px;
    padding: 0.25rem 0.6rem;
    background: var(--hs-ink);
    color: var(--hs-paper);
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: 3px;
}
html.legendary .hs-home .hs-card__title {
    margin-top: 0.75rem;
    font-family: var(--font-display, Georgia, serif);
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.25;
}
html.legendary .hs-home .hs-card__meta { margin-top: 0.25rem; color: var(--hs-muted); font-size: 0.9rem; }
html.legendary .hs-home .hs-card:hover .hs-card__title { text-decoration: underline; text-underline-offset: 0.18em; }
html.legendary .hs-home .hs-card:focus-visible { outline: 3px solid var(--hs-tomato); outline-offset: 4px; border-radius: 6px; }

/* ── Cuisine photo tiles ─────────────────────────────────────────── */
html.legendary .hs-home .hs-photo-tiles {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}
@media (min-width: 900px) {
    html.legendary .hs-home .hs-photo-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
}
html.legendary .hs-home .hs-photo-tile {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    aspect-ratio: 4 / 3;
    padding: 14px;
    overflow: hidden;
    border-radius: 6px;
    background: var(--hs-char);
    color: var(--hs-on-photo);
    text-decoration: none;
}
html.legendary .hs-home .hs-photo-tile__img {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
html.legendary .hs-home .hs-photo-tile::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(to top, rgba(23, 18, 14, 0.88) 0%, rgba(23, 18, 14, 0.35) 55%, rgba(23, 18, 14, 0.05) 100%);
}
html.legendary .hs-home .hs-photo-tile__name {
    font-family: var(--font-display, Georgia, serif);
    font-size: clamp(1.2rem, 2.2vw, 1.55rem);
    font-weight: 700;
    line-height: 1.1;
}
html.legendary .hs-home .hs-photo-tile__count { margin-top: 0.15rem; color: #EDE5D8; font-size: 0.85rem; }
html.legendary .hs-home .hs-photo-tile:hover .hs-photo-tile__name { text-decoration: underline; text-underline-offset: 0.15em; }
html.legendary .hs-home .hs-photo-tile:focus-visible { outline: 3px solid var(--hs-tomato); outline-offset: 3px; }

/* ── Diets ────────────────────────────────────────────────────────── */
html.legendary .hs-home .hs-diet-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 1.25rem 0 0;
    padding: 0;
    list-style: none;
}
html.legendary .hs-home .hs-diet {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 48px;
    padding: 0 1.1rem;
    border: 2px solid var(--hs-ink);
    border-radius: 999px;
    color: var(--hs-ink);
    font-weight: 700;
    text-decoration: none;
}
html.legendary .hs-home .hs-diet span { color: var(--hs-muted); font-weight: 600; font-size: 0.88rem; }
html.legendary .hs-home .hs-diet:hover { background: var(--hs-ink); color: var(--hs-paper); }
html.legendary .hs-home .hs-diet:hover span { color: var(--hs-line); }
html.legendary .hs-home .hs-diet:focus-visible { outline: 3px solid var(--hs-tomato); outline-offset: 2px; }

/* ── Start band ───────────────────────────────────────────────────── */
html.legendary .hs-home .hs-start {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem 2rem;
    padding-top: clamp(28px, 4vw, 40px);
    border-top: 1px solid var(--hs-line);
}
html.legendary .hs-home .hs-start p { margin: 0.6rem 0 0; color: var(--hs-muted); max-width: 34rem; }
html.legendary .hs-home .hs-start__actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ── Signed-in band ───────────────────────────────────────────────── */
/* Same column as .rk-hero (homepage.css) so the band lines up with Tonight. */
html.legendary .hs-band {
    width: min(100% - 2rem, 1240px);
    margin: 0 auto;
    padding: 20px 0 4px;
}
html.legendary .hs-band .hs-band__title {
    margin: 0 0 0.75rem;
    font-size: 1.25rem;
}
html.legendary .hs-band .hs-search { padding-left: 18px; }
html.legendary .hs-band .hs-search__input,
html.legendary .hs-band .hs-search__button { height: 44px; }
html.legendary .hs-band .hs-search__input { font-size: 1rem; }

/* Phones: the header's search box sits right above the band, so the band keeps
   only its chips, in one row that scrolls inside itself. */
@media (max-width: 767px) {
    html.legendary .hs-band { padding-top: 12px; }
    html.legendary .hs-band .hs-band__title,
    html.legendary .hs-band .hs-search { display: none; }
    html.legendary .hs-band .hs-chips {
        flex-wrap: nowrap;
        max-width: none;
        margin-top: 0;
        overflow-x: auto;
        scrollbar-width: none;
    }
    html.legendary .hs-band .hs-chips::-webkit-scrollbar { display: none; }
    html.legendary .hs-band .hs-chip { flex: 0 0 auto; white-space: nowrap; }
}

@media (max-width: 480px) {
    html.legendary .hs-home .hs-search { padding-left: 18px; }
    html.legendary .hs-home .hs-search__button { padding: 0 1.1rem; }
}
