/* ==========================================================================
   Accueil : bandeau de recherche + rubriques — refonte 2026
   Prefixe : hh-
   ========================================================================== */

/* La recherche est dans le bandeau : pas de doublon sous l'en-tete mobile */
body.has-hero .nv-mobile-search {
    display: none;
}

.hh {
    position: relative;
    margin-bottom: 14px;
    padding: 26px 32px 24px;
    color: #fff;
    background: var(--secondary);
    border-radius: 20px;
}

.hh-inner {
    max-width: 100%;
}

.hh-title {
    font-size: 28px;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: #fff;
}

.hh-title span {
    color: var(--primary);
}

.hh-sub {
    margin-top: 6px;
    font-size: 14px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.75);
}

/* ---------- Recherche ---------- */
.hh-search {
    margin-top: 16px;
    padding: 8px;
    color: var(--text-main);
    background: #fff;
    border-radius: 16px;
}

.hh-ai-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
}

.hh-ai-search .hh-ai-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
}

.hh-ai-bot {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 4px;
}

.hh-ai-field input {
    text-overflow: ellipsis;
}

.hh-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 8px;
}

.hh-tab {
    position: relative;
    flex-shrink: 0;
}

.hh-tab input {
    position: absolute;
    top: 0;
    left: 0;
    width: 1px;
    height: 1px;
    margin: 0;
    opacity: 0;
    pointer-events: none;
}

.hh-tab span {
    display: inline-block;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.15s;
}

.hh-tab span:hover {
    color: var(--primary);
}

.hh-tab input:checked + span {
    color: var(--primary-dark);
    background: var(--primary-light);
}

.hh-tab input:focus-visible + span {
    outline: 3px solid rgba(254, 120, 85, 0.45);
}

.hh-row {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr) auto;
    gap: 10px;
}

.hh-field {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    height: 46px;
    padding: 0 14px;
    gap: 8px;
    color: var(--text-muted);
    background: var(--bg-app);
    border: 1.5px solid transparent;
    border-radius: 12px;
    cursor: text;
    transition: all 0.15s;
}

.hh-field:focus-within {
    color: var(--primary);
    background: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(254, 120, 85, 0.14);
}

.hh-field svg {
    flex-shrink: 0;
}

.hh-field input,
.hh-field select {
    flex: 1;
    min-width: 0;
    height: 100%;
    font-family: var(--font-sans);
    font-size: 14px;
    color: var(--text-main);
    background: transparent;
    border: none;
    outline: none;
}

.hh-field select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.hh-field input::-webkit-search-cancel-button {
    display: none;
}

.hh-submit {
    height: 46px;
    padding: 0 26px;
    font-family: var(--font-sans);
    font-size: 14.5px;
    font-weight: 700;
    color: #fff;
    background: var(--primary);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.18s;
}

.hh-submit:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.hh-popular {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    font-size: 12.5px;
}

.hh-popular span {
    margin-right: 4px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
}

.hh-popular a {
    padding: 4px 12px;
    font-weight: 600;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius-full);
    transition: all 0.15s;
}

.hh-popular a:hover {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
}

/* ---------- Rubriques ---------- */
.hh-tiles {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

/* Tuiles en largeur reduite : la fleche est superflue et prendrait la place du texte */
.hh-tile > svg {
    display: none;
}

.hh-tile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 14px;
    box-shadow: none;
    transition: all 0.2s;
}

.hh-tile:hover {
    color: var(--primary);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.hh-tile-ico {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    background: var(--primary-light);
    border-radius: 12px;
}

.hh-tile-txt {
    flex: 1;
    min-width: 0;
}

.hh-tile-txt strong {
    display: block;
    font-size: 14px;
    color: var(--secondary);
}

.hh-tile-txt small {
    display: block;
    margin-top: 2px;
    font-size: 12.5px;
    color: var(--text-muted);
}

/* ---------- Tablette / mobile ---------- */
@media (max-width: 991px) {
    .hh-tiles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hh-row {
        grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto;
    }
}

@media (max-width: 640px) {
    .hh {
        padding: 18px 14px 16px;
        border-radius: 16px;
    }

    .hh-title {
        font-size: 21px;
    }

    .hh-sub {
        font-size: 13px;
    }

    .hh-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .hh-tab span {
        white-space: nowrap;
    }

    .hh-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    /* Recherche : le bouton passe sous le champ sur petit écran. */
    .hh-ai-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .hh-ai-search .hh-ai-row {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .hh-ai-row .hh-submit {
        grid-column: 1 / -1;
    }

    .hh-popular {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .hh-popular a {
        white-space: nowrap;
    }

    .hh-tile {
        padding: 10px 12px;
        gap: 10px;
    }

    .hh-tile > svg {
        display: none;
    }
}

/* Petits ecrans (320-380 px) : tuiles plus compactes pour eviter que le texte deborde */
@media (max-width: 380px) {
    .hh-tiles {
        gap: 10px;
    }

    .hh-tile {
        padding: 10px;
        gap: 8px;
    }

    .hh-tile-ico {
        width: 32px;
        height: 32px;
        border-radius: 10px;
    }

    .hh-tile-txt strong {
        font-size: 13px;
        overflow-wrap: anywhere;
    }

    .hh-tile-txt small {
        font-size: 11.5px;
        overflow-wrap: anywhere;
    }
}
