/* ============================================
   PAGES PUBLIQUES : en-tête, pied de page, barre mobile (refonte)
   Chargé sur toutes les pages publiques.
   HTML : templates/public/partials/site-header.php et site-footer.php
   JS   : assets/js/public-chrome.js
   ============================================ */

:root {
    --lv-blue: #357ba9;
    --lv-blue-soft: #edf5fb;
    --lv-ink: #202a37;
    --lv-muted: #687586;
    --lv-line: #e3e9f0;
    --lv-bg: #f5f7fa;
    --lv-red: #db3452;
    --lv-green: #38845c;
    --lv-font: Inter, "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
}

/* ---------- Base de la page d'accueil refaite ---------- */
body.layout-home {
    margin: 0;
    background: var(--lv-bg);
    color: var(--lv-ink);
    font-family: var(--lv-font);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body.layout-home *,
.site-header *,
.site-footer *,
.tabbar * {
    box-sizing: border-box;
}

.dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--lv-green);
}

/* ---------- Boutons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 0 18px;
    border-radius: 6px;
    border: 1px solid var(--lv-line);
    font-family: var(--lv-font);
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}

.btn--ghost {
    background: #fff;
    color: var(--lv-ink);
}

.btn--ghost:hover {
    background: var(--lv-bg);
}

.btn--primary {
    background: var(--lv-red);
    border-color: var(--lv-red);
    color: #fff;
}

.btn--primary:hover {
    background: #c42a46;
    border-color: #c42a46;
}

.btn:focus-visible,
.site-nav__link:focus-visible,
.site-footer a:focus-visible,
.tabbar__item:focus-visible {
    outline: 3px solid #827FF4;
    outline-offset: 2px;
}

/* ---------- En-tête ---------- */
.site-header {
    width: 100%;
    background: #fff;
    border-bottom: 1px solid var(--lv-line);
    font-family: var(--lv-font);
}

.site-header__bar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
    max-width: 1240px;
    min-height: 88px;
    margin: 0 auto;
    padding: 0 24px;
}

.site-header__logo {
    justify-self: start;
    display: block;
    line-height: 0;
}

.site-header__logo img {
    display: block;
    width: 148px;
    height: auto;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 28px;
}

.site-nav__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--lv-ink);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
}

.site-nav__link:hover {
    color: var(--lv-blue);
}

.site-nav__link.is-active {
    color: var(--lv-red);
    font-weight: 600;
}

.site-nav__online {
    font-size: 13px;
    font-weight: 400;
}

.site-nav__count {
    color: var(--lv-red);
    font-size: 12px;
    font-weight: 600;
}

.site-header__actions {
    justify-self: end;
    display: flex;
    gap: 10px;
}

/* ---------- Pied de page ---------- */
.site-footer {
    margin-top: auto;
    width: 100%;
    background: #fff;
    border-top: 1px solid var(--lv-line);
    font-family: var(--lv-font);
}

.site-footer__links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px 18px;
    max-width: 1240px;
    margin: 0 auto;
    padding: 20px 24px;
}

.site-footer__links a {
    color: var(--lv-muted);
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
}

.site-footer__links a:hover {
    color: var(--lv-blue);
    text-decoration: underline;
}

.site-footer__copy {
    color: var(--lv-muted);
    font-size: 12px;
}

/* ---------- Barre de navigation mobile ---------- */
.tabbar {
    display: none;
}

/* ---------- Tablette : le menu passe sur une 2e ligne ---------- */
@media (max-width: 899px) {
    .site-header__bar {
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "logo actions"
            "nav  nav";
        gap: 12px 16px;
        min-height: 0;
        padding: 16px 24px 0;
    }

    .site-header__logo    { grid-area: logo; }
    .site-header__actions { grid-area: actions; }

    .site-nav {
        grid-area: nav;
        justify-content: space-between;
        gap: 12px;
        padding: 14px 0;
        overflow-x: auto;
    }
}

/* ---------- Mobile ---------- */
@media (max-width: 767px) {
    .site-header__bar {
        padding: 14px 16px 0;
    }

    .site-header__login {
        display: none;
    }

    .site-header__actions .btn {
        height: 40px;
    }

    .site-nav {
        padding: 12px 0;
    }

    .site-footer__links {
        padding: 20px 16px;
        gap: 10px 14px;
    }

    .site-footer {
        padding-bottom: 64px;
    }

    .tabbar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 900;
        display: flex;
        justify-content: space-around;
        background: #fff;
        border-top: 1px solid var(--lv-line);
        padding: 6px 0 calc(6px + env(safe-area-inset-bottom, 0px));
        font-family: var(--lv-font);
    }

    .tabbar__item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 3px;
        min-width: 64px;
        color: var(--lv-muted);
        font-size: 11px;
        text-decoration: none;
    }

    .tabbar__item svg {
        width: 22px;
        height: 22px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.8;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .tabbar__item.is-active {
        color: var(--lv-red);
        font-weight: 600;
    }
}
