/* nav.css — Barre de navigation du site recettes (catalogue, recette, ajout/modification).
   Trois dispositions :
   - grand écran (≥ 1440 px) : tout sur une ligne — titre, recherche, liens, bouton « Nouvelle recette » ;
   - tablette (700 à 1439 px, iPad) : titre, recherche, bouton « Nouvelle recette » et ☰ ; les autres liens dans un panneau ;
   - téléphone (< 700 px) : titre, « + » et ☰ sur la première ligne, la recherche pleine largeur dessous. */

.navbar {
    position: sticky; top: 0; z-index: 1000;
    background-color: var(--nav-bg, #111111); color: #fff;
    display: flex; align-items: center; gap: 14px;
    padding: 10px 24px;
    padding-left: max(24px, env(safe-area-inset-left)); padding-right: max(24px, env(safe-area-inset-right));
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06), 0 6px 20px rgba(0, 0, 0, 0.18);
}

/* Titre : une seule ligne, jamais coupé */
.navbar-brand { order: 1; flex: none; display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; white-space: nowrap; }
.brand-ico { font-size: 1.5rem; line-height: 1; }
.brand-txt { font-size: 1.15rem; font-weight: 800; letter-spacing: 0.06em; }
.brand-txt b { color: #f97316; font-weight: 800; }

/* Recherche */
.nav-search { order: 2; flex: 1 1 220px; max-width: 360px; display: flex; align-items: center; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 999px; padding: 3px; margin: 0; }
.nav-search input { flex: 1; min-width: 0; background: transparent; border: none; color: #fff; padding: 8px 14px; outline: none; font-family: inherit; font-size: 16px; }
.nav-search input::placeholder { color: #9ca3af; }
.nav-search button { flex: none; background: #f97316; color: #fff; border: none; border-radius: 50%; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 0.95rem; }
.nav-search button:hover { background: #ea580c; }

/* Bouton « Nouvelle recette » */
.btn-nav-orange { order: 4; flex: none; display: flex; align-items: center; gap: 6px; background: #f97316; color: #fff !important; text-decoration: none; font-weight: 700; font-size: 0.92rem; padding: 0 16px; min-height: 40px; border-radius: 10px; white-space: nowrap; }
.btn-nav-orange:hover { background: #ea580c; }
.btn-nav-orange .plus { font-size: 1.2rem; line-height: 1; }

/* Liens */
.nav-links { order: 3; margin-left: auto; display: flex; align-items: center; gap: 20px; }
.nav-links a { color: #fff; text-decoration: none; font-weight: 600; font-size: 0.95rem; white-space: nowrap; transition: color 0.2s; }
.nav-links a:hover { color: #f97316; }

.hamburger { order: 5; display: none; flex: none; width: 44px; height: 44px; align-items: center; justify-content: center; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 10px; color: #fff; font-size: 1.4rem; line-height: 1; cursor: pointer; padding: 0; }
.hamburger:hover { background: rgba(255, 255, 255, 0.18); }

/* ---------- Tablette et petits écrans : les liens passent dans un panneau ---------- */
@media (max-width: 1439px) {
    .hamburger { display: flex; }
    .nav-search { margin-left: auto; }
    .btn-nav-orange { margin-left: 0; }
    .nav-links {
        display: none; position: absolute; top: calc(100% + 8px); right: 16px; left: auto; width: 290px; margin: 0;
        flex-direction: column; align-items: stretch; gap: 2px;
        background: #1a1a1a; border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 14px; padding: 8px;
        box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
    }
    .nav-links.active { display: flex; }
    .nav-links a { display: block; padding: 13px 14px; border-radius: 10px; font-size: 1rem; }
    .nav-links a:hover { background: rgba(255, 255, 255, 0.08); }
}

/* ---------- Téléphone ---------- */
@media (max-width: 699px) {
    .navbar { flex-wrap: wrap; padding: 10px 14px; gap: 10px; }
    .brand-txt { font-size: 1rem; letter-spacing: 0.04em; }
    .navbar-brand { margin-right: auto; }
    .nav-search { order: 10; flex: 1 1 100%; max-width: none; margin: 0; }
    .btn-nav-orange { padding: 0; width: 44px; min-height: 44px; justify-content: center; }
    .btn-nav-orange .lib { display: none; }
    .btn-nav-orange .plus { font-size: 1.6rem; }
    .nav-links { right: 12px; left: 12px; width: auto; }
}
