/* =========================================================
   Recherche avancée MHSC v2
   Portée : tout est préfixé .mhs pour ne rien casser ailleurs.
   ========================================================= */

.mhs {
    --navy: #0b1f33;
    --blue: #1257a5;
    --red: #cc0b2a;
    --line: #dde3ea;
    --text: #17222e;
    --muted: #64748b;
    --bg: #f4f6f9;
    --max: 1200px;

    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    overflow-x: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
}

.mhs *,
.mhs *::before,
.mhs *::after {
    box-sizing: border-box;
}

.mhs-wrap {
    width: 100%;
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 20px;
}

/* ---------- Hero ---------- */
.mhs-hero {
    background: var(--navy);
    color: #fff;
    padding: 32px 0 28px;
}

.mhs .mhs-hero h1 {
    margin: 0 0 6px;
    color: #fff;
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
}

.mhs-hero p.mhs-lead {
    margin: 0 0 18px;
    color: #b8c6d6;
    font-size: 15px;
    max-width: 640px;
}

.mhs-searchbar {
    display: flex;
    gap: 8px;
    max-width: 720px;
}

.mhs-searchbar input[type="text"] {
    flex: 1;
    min-width: 0;
    height: 46px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: 0;
    background: #fff;
    color: var(--text);
    font-size: 15px;
    font-family: inherit;
}

.mhs-searchbar input[type="text"]:focus {
    outline: 2px solid #3c82d6;
    outline-offset: 0;
}

.mhs-searchbar button {
    flex: none;
    height: 46px;
    padding: 0 22px;
    border: 0;
    border-radius: 0;
    background: var(--red);
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.mhs-searchbar button:hover {
    background: #a80a22;
}

/* ---------- Layout ---------- */
.mhs-body {
    padding: 22px 0 44px;
}

.mhs-grid {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
    width: 100%;
    min-width: 0;
}

.mhs-grid > * {
    min-width: 0;
    max-width: 100%;
}

.mhs-filters-toggle {
    display: none;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 11px 14px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

/* ---------- Rail de filtres ---------- */
.mhs-rail {
    background: #fff;
    border: 1px solid var(--line);
    padding: 14px;
    position: sticky;
    top: 20px;
}

.mhs-rail-h {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    padding-bottom: 10px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.mhs .mhs-rail-h h2 {
    margin: 0;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.mhs-rail-h a {
    font-size: 12px;
    color: var(--blue);
    text-decoration: none;
}

.mhs-rail-h a:hover {
    text-decoration: underline;
}

.mhs-field {
    margin-bottom: 12px;
}

/* Filtre hors de portée du type de contenu sélectionné. */
.mhs-field--off {
    display: none;
}

.mhs-field label {
    display: block;
    margin-bottom: 4px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

/* Précise qu'un filtre ne couvre pas tous les types de contenu.
   Utile seulement en mode « Tout », où les types coexistent. */
.mhs-scope {
    display: none;
    margin-top: 1px;
    font-style: normal;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    color: #94a3b8;
}

.mhs-rail--all .mhs-scope {
    display: block;
}

.mhs-field select {
    width: 100%;
    height: 38px;
    padding: 0 8px;
    border: 1px solid var(--line);
    border-radius: 0;
    background: #fff;
    color: var(--text);
    font-family: inherit;
    font-size: 13.5px;
}

.mhs-apply {
    width: 100%;
    padding: 11px 14px;
    border: 0;
    background: var(--blue);
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.mhs-apply:hover {
    background: #0d4483;
}

/* ---------- Résultats ---------- */
.mhs-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}

.mhs-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 10px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text);
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
}

.mhs-chip span {
    color: var(--muted);
    font-weight: 700;
}

.mhs-chip:hover {
    border-color: var(--red);
    color: var(--red);
    text-decoration: none;
}

.mhs-scope-note {
    margin: 0 0 14px;
    padding: 9px 12px;
    border-left: 3px solid var(--blue);
    background: #eef4fb;
    font-size: 12.5px;
    color: #3a5470;
}

.mhs-group {
    background: #fff;
    border: 1px solid var(--line);
    margin-bottom: 16px;
}

.mhs-group-h {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    background: #fbfcfd;
}

.mhs .mhs-group-h h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.mhs-group-h a {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--blue);
    text-decoration: none;
    white-space: nowrap;
}

.mhs-group-h a:hover {
    text-decoration: underline;
}

.mhs-badge {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 3px 7px;
    white-space: nowrap;
}

.mhs-badge--free {
    color: #0b6b3a;
    background: #e4f6ec;
}

.mhs-badge--premium {
    color: var(--red);
    background: #fdecef;
}

.mhs-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mhs-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    margin: 0;
    border-bottom: 1px solid #eef1f5;
    min-width: 0;
    max-width: 100%;
}

.mhs-item:last-child {
    border-bottom: 0;
}

.mhs-item:hover {
    background: #f7fbff;
}

.mhs-item > img {
    flex: none;
    width: 34px;
    height: 34px;
    object-fit: contain;
    background: #f3f6fa;
    border: 1px solid var(--line);
}

.mhs-item-body {
    flex: 1;
    min-width: 0;
}

.mhs-item-body > a {
    display: block;
    font-size: 14.5px;
    font-weight: 700;
    color: var(--blue);
    text-decoration: none;
    line-height: 1.3;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.mhs-item-body > a:hover {
    text-decoration: underline;
}

.mhs-meta {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mhs-item-stats {
    flex: none;
    display: flex;
    gap: 14px;
    text-align: center;
}

.mhs-item-stats span,
.mhs-item-stats .mhs-lock {
    display: block;
    min-width: 34px;
    padding: 0;
    border: 0;
    background: none;
    font-family: inherit;
}

.mhs-item-stats b {
    display: block;
    font-size: 14px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--text);
}

.mhs-item-stats i {
    display: block;
    font-style: normal;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

.mhs-lock {
    cursor: pointer;
}

.mhs-lock b {
    color: var(--red);
    letter-spacing: 1px;
}

.mhs-empty {
    background: #fff;
    border: 1px solid var(--line);
    padding: 34px 20px;
    text-align: center;
}

.mhs-empty strong {
    display: block;
    font-size: 17px;
    font-weight: 800;
    margin-bottom: 6px;
}

.mhs-empty p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

/* ---------- Pagination ---------- */
.mhs-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding-top: 15px;
    flex-wrap: wrap;
}

.mhs-pager-btn,
.mhs-pager-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 14px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--blue) !important;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.15s ease-in-out;
}

.mhs-pager-num {
    padding: 0;
    width: 38px;
}

.mhs-pager-btn:hover,
.mhs-pager-num:hover {
    border-color: var(--blue);
    background: #f1f5f9;
    text-decoration: none !important;
}

.mhs-pager-current {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: var(--blue);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    border: 1px solid var(--blue);
    border-radius: 4px;
}

/* ---------- Modale paywall ---------- */
.mhs-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(9, 20, 33, 0.62);
    padding: 20px;
}

.mhs-modal.is-on {
    display: flex;
    align-items: center;
    justify-content: center;
}

.mhs-modal-box {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border: 1px solid var(--line);
    padding: 24px;
    text-align: center;
}

.mhs .mhs-modal-box h3 {
    margin: 0 0 8px;
    font-size: 19px;
    font-weight: 800;
}

.mhs-modal-box p {
    margin: 0 0 18px;
    color: var(--muted);
    font-size: 14px;
}

.mhs-btn,
.mhs-ghost {
    display: block;
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    text-align: center;
}

.mhs-btn {
    background: var(--red);
    color: #fff;
}

.mhs-btn:hover {
    background: #a80a22;
    color: #fff;
    text-decoration: none;
}

.mhs-ghost {
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text);
}

.mhs-ghost:hover {
    border-color: var(--blue);
    color: var(--blue);
    text-decoration: none;
}

.mhs-modal-box button {
    width: 100%;
    padding: 8px;
    border: 0;
    background: none;
    color: var(--muted);
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .mhs-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }

    .mhs-filters-toggle {
        display: block;
    }

    /* Tiroir replié par défaut sur mobile, déplié via le bouton. */
    .mhs-rail {
        display: none;
        position: static;
    }

    .mhs-rail.is-open {
        display: block;
    }
}

@media (max-width: 700px) {
    .mhs-wrap {
        padding: 0 14px;
    }

    .mhs-hero {
        padding: 22px 0 20px;
    }

    .mhs .mhs-hero h1 {
        font-size: 22px;
    }

    .mhs-hero p.mhs-lead {
        font-size: 14px;
        margin-bottom: 14px;
    }

    .mhs-searchbar {
        flex-wrap: wrap;
    }

    .mhs-searchbar input[type="text"] {
        flex: 1 1 100%;
        height: 48px;
        font-size: 16px;
    }

    .mhs-searchbar button {
        flex: 1 1 100%;
        height: 44px;
    }

    .mhs-item {
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 10px;
    }

    .mhs-item-body {
        flex: 1 1 calc(100% - 50px);
        min-width: 0;
    }

    .mhs-meta {
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .mhs-item-stats {
        flex: 1 1 100%;
        width: 100%;
        max-width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 14px;
        padding-left: 46px;
        min-width: 0;
    }

    .mhs-item-stats span,
    .mhs-item-stats .mhs-lock {
        min-width: 0;
    }

    .mhs-hide-xs {
        display: none !important;
    }
}

/* ---------- Sablier Moderne (Loader) ---------- */
.mhs-loader-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease-in-out;
}

.mhs-loading .mhs-loader-overlay {
    display: flex;
}

.mhs-loader-spinner {
    width: 54px;
    height: 54px;
    border: 4px solid #f1f5f9;
    border-top-color: var(--blue);
    border-right-color: var(--blue);
    border-radius: 50%;
    animation: mhs-spin 0.8s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

@keyframes mhs-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ---------- Encars publicitaires (meme look que accueil-v2) ---------- */
.mhs .mh2-ad {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.mhs .mh2-ad-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #9aa8b6;
    margin-bottom: 8px;
}

.mhs .mh2-ad a,
.mhs .mh2-ad img {
    display: block;
    max-width: 100%;
}

.mhs .mh2-ad--leaderboard {
    padding: 18px 0 6px;
}

.mhs .mh2-ad--leaderboard .mh2-ad-box {
    width: 100%;
    max-width: 728px;
    min-height: 90px;
}

.mhs .mh2-ad--box {
    align-items: flex-start;
    margin: 0 0 18px;
    max-width: 300px;
}

.mhs .mh2-ad--box .mh2-ad-box {
    width: 300px;
    max-width: 100%;
    height: 250px;
    overflow: hidden;
}

.mhs .mh2-ad--box img {
    width: 100%;
    height: 100%;
    max-height: 250px;
    object-fit: contain;
}

.mhs .mh2-ad-box {
    background: #fff;
    border: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.mhs .mh2-ad-empty {
    width: 100%;
    min-height: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: #8b9aab;
    background: repeating-linear-gradient(-45deg, #f7f9fb, #f7f9fb 8px, #eef2f6 8px, #eef2f6 16px);
    border: 1px dashed #c5d0dc;
    font-size: 12px;
    text-align: center;
    padding: 16px;
}

.mhs .mh2-ad-empty strong {
    color: #5c6d80;
    font-size: 13px;
}
