/* Header Senego
 * Variables (--orange, --ink, --shadow-*, --topbar-h, --mainbar-h…) définies dans
 * le Design System : assets/css/design-system/tokens.css (alias des tokens
 * --senego-*). Les surcharges responsive de --mainbar-h/--compact-h plus bas
 * (dans @media) restent ici car spécifiques au comportement du header.
 */

  /* Tout est SCOPÉ au header / modales / drawer — ne touche jamais le reste du site */
  .senego-header, .senego-header *,
  .modal-backdrop, .modal-backdrop *,
  .drawer, .drawer * { box-sizing: border-box; }

  .senego-header, .modal, .drawer {
    font-family: 'Source Sans 3', system-ui, -apple-system, sans-serif;
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }
  .senego-header a, .modal a, .drawer a { color: inherit; text-decoration: none; }
  .senego-header button, .modal button, .drawer button { font: inherit; cursor: pointer; }

  /* Exception : les boutons à FOND PLEIN (orange/rouge/sombre) gardent un texte
     blanc lisible. Sans ça, le `color: inherit` ci-dessus les repasse en sombre
     (--ink) → texte noir illisible sur fond orange (cas CTA « Naviguer sans pub »,
     « Sans pub », « Se connecter »). */
  .senego-header a.cta-sub,    .modal a.cta-sub,    .drawer a.cta-sub,
  .senego-header a.compact-cta, .modal a.compact-cta, .drawer a.compact-cta,
  .senego-header a.submit-btn, .modal a.submit-btn, .drawer a.submit-btn,
  .senego-header a.senego-btn--primary, .modal a.senego-btn--primary, .drawer a.senego-btn--primary,
  .senego-header a.senego-btn--premium, .modal a.senego-btn--premium, .drawer a.senego-btn--premium,
  .senego-header a.btn-primary, .modal a.btn-primary, .drawer a.btn-primary {
    color: #fff;
  }

  /* ============ Header shell ============ */
  .senego-header {
    position: relative;
    z-index: 100;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
  }

  /* ============ Top bar (black) ============ */
  .topbar {
    background: var(--black);
    color: #fff;
    height: var(--topbar-h);
    font-size: 12.5px;
    letter-spacing: .01em;
    overflow: hidden;
  }
  .topbar-inner {
    max-width: 1320px;
    margin: 0 auto;
    height: 100%;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
  }
  .topbar-left, .topbar-right { display: flex; align-items: center; gap: 18px; }

  /* Lien Contact dans la topbar droite (icône enveloppe + texte) */
  .topbar-contact {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(255,255,255,.78);
    font-size: 12.5px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: color .15s var(--ease);
  }
  .topbar-contact:hover { color: #fff; }
  .topbar-contact svg { opacity: .85; }

  /* Séparateur vertical entre Contact et réseaux sociaux */
  .topbar-sep {
    display: inline-block;
    width: 1px;
    height: 14px;
    background: rgba(255,255,255,.22);
  }

  /* Icônes réseaux sociaux dans la topbar */
  .topbar-social {
    display: inline-flex;
    align-items: center;
    gap: 12px;
  }
  .topbar-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: rgba(255,255,255,.78);
    border-radius: 4px;
    transition: color .15s var(--ease), background .15s var(--ease);
  }
  .topbar-social a:hover { color: #fff; background: rgba(255,255,255,.08); }
  .topbar-social svg { display: block; }
  .topbar-item {
    color: rgba(255,255,255,.78);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
  }
  .topbar-item .dot { color: rgba(255,255,255,.32); }
  .topbar-item svg { opacity: .85; }
  .lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,.78);
  }
  .lang-switch .active { color: #fff; font-weight: 500; }
  .lang-switch .sep { color: rgba(255,255,255,.28); }
  .premium-pill .check {
    width: 12px; height: 12px;
    border-radius: 50%;
    background: #ffd27a;
    color: #000;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 900;
  }

  /* ============ Main bar ============ */
  .mainbar {
    height: var(--mainbar-h);
    display: flex;
    align-items: center;
    /* PAS d'overflow:hidden ici sinon le menu déroulant `.account-menu`
       (qui dépasse vers le bas pour s'afficher sous le bouton Premium)
       est clippé et masqué par la navbar orange en dessous. */
    overflow: visible;
    position: relative;
    z-index: 50;
  }
  .mainbar-inner {
    max-width: 1320px;
    width: 100%;
    margin: 0 auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 1fr minmax(280px, 520px) 1fr;
    align-items: center;
    gap: 32px;
  }
  .logo {
    display: inline-flex;
    align-items: baseline;
    gap: 2px;
    font-family: 'Source Sans 3', system-ui, sans-serif;
    font-weight: 900;
    font-size: 34px;
    line-height: 1;
    letter-spacing: -.02em;
    color: var(--ink);
    transition: font-size .3s var(--ease);
  }
  .logo .dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--orange);
    margin-left: 4px;
    transform: translateY(-2px);
  }
  .logo .tagline {
    font-size: 10px;
    font-weight: 400;
    color: var(--meta);
    letter-spacing: .12em;
    text-transform: uppercase;
    margin-left: 10px;
    transform: translateY(-2px);
    display: inline-block;
  }

  /* Search */
  .search {
    position: relative;
    width: 100%;
  }
  .search input {
    width: 100%;
    height: 44px;
    border: 1px solid var(--line-strong);
    background: var(--bg-soft);
    border-radius: 8px;
    padding: 0 14px 0 44px;
    font-size: 14.5px;
    font-family: inherit;
    color: var(--ink);
    transition: all .2s var(--ease);
  }
  .search input::placeholder { color: var(--meta); }
  .search input:focus {
    outline: none;
    border-color: var(--orange);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(255,153,0,.12);
  }
  .search .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--meta);
    pointer-events: none;
  }
  .search .kbd {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    color: var(--meta);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 2px 6px;
    font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  }

  /* Right cluster */
  .main-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
  }
  /* Modales et menus utilisateur : migrés vers plugin senego-account/assets/css/modals.css */

  .icon-btn {
    width: 40px; height: 40px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--ink);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all .15s var(--ease);
    position: relative;
  }
  .icon-btn:hover { background: var(--bg-soft); border-color: var(--line); }

  /* ============ Nav bar (orange) ============ */
  .navbar {
    background: var(--orange);
    height: var(--navbar-h);
    overflow: hidden;
  }
  .navbar-inner {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
  }
  .nav-list {
    display: flex;
    align-items: stretch;
    gap: 0;
    list-style: none;
    margin: 0;
    padding: 0;
    height: 100%;
  }
  .nav-list li { display: flex; }
  .nav-list a {
    display: inline-flex;
    align-items: center;
    height: 100%;
    padding: 0 16px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: .005em;
    position: relative;
    transition: background .15s var(--ease);
  }
  .nav-list a:hover { background: rgba(0,0,0,.08); }
  .nav-list a.active { background: rgba(0,0,0,.12); font-weight: 700; }
  .nav-list a.active::after {
    content: '';
    position: absolute;
    left: 12px; right: 12px; bottom: 0;
    height: 3px;
    background: #fff;
    border-radius: 2px 2px 0 0;
  }
  .nav-list .new-badge {
    margin-left: 6px;
    font-size: 10px;
    background: var(--red);
    color: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: .05em;
    font-weight: 700;
  }
  .nav-aux {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,.85);
    font-size: 13px;
  }
  .nav-aux a {
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    font-weight: 500;
    transition: background .15s var(--ease);
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }
  .nav-aux a:hover { background: rgba(0,0,0,.1); }
  @keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(255,255,255,.7); }
    70% { box-shadow: 0 0 0 8px rgba(255,255,255,0); }
    100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); }
  }

  /* ============ Compact bar (barre fixe au scroll) ============ */
  .compactbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--compact-h);
    display: flex;
    align-items: center;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 2px 14px rgba(0,0,0,.06);
    z-index: 101;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: transform .3s var(--ease), opacity .25s var(--ease);
    will-change: transform;
  }
  .compactbar-inner {
    max-width: 1320px;
    margin: 0 auto;
    width: 100%;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 20px;
  }
  .compact-logo {
    font-weight: 900;
    font-size: 20px;
    letter-spacing: -.02em;
    color: var(--ink);
    display: inline-flex;
    align-items: baseline;
    gap: 2px;
  }
  .compact-logo .dot {
    width: 5px; height: 5px;
    background: var(--orange);
    border-radius: 50%;
    display: inline-block;
    margin-left: 2px;
    transform: translateY(-1px);
  }
  .compact-nav {
    display: flex;
    gap: 2px;
    flex: 1;
    overflow: hidden;
  }
  .compact-nav a {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--ink);
    transition: background .15s var(--ease);
    white-space: nowrap;
  }
  .compact-nav a:hover { background: var(--bg-soft); }
  .compact-nav a.active { color: var(--orange-dark); }
  .compact-right {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  /* Modales et menus utilisateur : migrés vers plugin senego-account/assets/css/modals.css */

  /* ============ Affichage du compact-bar au scroll ============ */
  .senego-header.is-compact .compactbar {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  .field { margin-bottom: 12px; }
  .field label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--meta);
    margin-bottom: 6px;
  }
  .field input {
    width: 100%;
    height: 44px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    padding: 0 14px;
    font: inherit;
    font-size: 14px;
    background: #fff;
    transition: all .15s var(--ease);
  }
  .field input:focus {
    outline: none;
    border-color: var(--orange);
    box-shadow: 0 0 0 4px rgba(255,153,0,.12);
  }
  /* Modales et menus utilisateur : migrés vers plugin senego-account/assets/css/modals.css */

  /* ============ Mobile ============ */
  .burger {
    display: none;
    width: 40px; height: 40px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    align-items: center; justify-content: center;
  }
  .mobile-only { display: none; }

  /* Mobile drawer */
  .drawer {
    position: fixed;
    top: 0; left: 0;
    width: min(86vw, 360px);
    /* Audit 2026-05-27 : 100dvh évite le bug Safari iOS où 100vh ignore l'URL bar. */
    height: 100vh;
    height: 100dvh;
    padding-bottom: env(safe-area-inset-bottom);
    background: #fff;
    /* z-index très élevé : essaie de passer au-dessus des anchor ads AdSense
       (qui utilisent souvent 2147483647). Combiné avec le masquage CSS ci-dessous
       sous body.drawer-open pour garantir la visibilité du drawer. */
    z-index: 2147483646;
    box-shadow: var(--shadow-lg);
    transform: translateX(-100%);
    transition: transform .35s cubic-bezier(.25,.46,.45,.94);
    will-change: transform;
    display: flex;
    flex-direction: column;
  }
  .drawer.open { transform: translateX(0); }

  /* Quand le drawer est ouvert : masque les pubs AdSense flottantes
     (anchor ads, vignettes plein écran) qui couvriraient le bas du drawer.
     Cible les patterns standards d'anchor ads sans toucher aux pubs in-page. */
  body.drawer-open ins.adsbygoogle[data-anchor-status],
  body.drawer-open ins.adsbygoogle[data-anchor-shown],
  body.drawer-open iframe[id*="aswift_"][name*="aswift_"],
  body.drawer-open .google-anchor,
  body.drawer-open #google_ads_iframe_anchor,
  body.drawer-open ins.adsbygoogle[data-google-query-id][style*="position: fixed"] {
    display: none !important;
    visibility: hidden !important;
  }
  /* Filet de sécurité : padding-bottom dans la liste du drawer pour s'assurer
     que le dernier élément reste visible même si une pub passe entre les mailles. */
  .drawer-list { padding-bottom: 80px; }

  /* Mini topbar noire dans le drawer (Contact + réseaux sociaux), juste sous le logo */
  .drawer-topbar {
    background: var(--ink, var(--senego-color-text));
    color: rgba(255,255,255,.85);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
  }
  .drawer-topbar-contact {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: inherit;
    font-size: 12.5px;
    font-weight: 500;
    text-decoration: none;
    padding: 4px 6px;
    border-radius: 4px;
    transition: background .15s var(--ease);
  }
  .drawer-topbar-contact:hover { background: rgba(255,255,255,.08); }
  .drawer-topbar-contact svg { opacity: .85; flex-shrink: 0; }
  .drawer-topbar-social {
    display: inline-flex;
    align-items: center;
    gap: 8px;
  }
  .drawer-topbar-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    color: rgba(255,255,255,.85);
    border-radius: 4px;
    transition: background .15s var(--ease), color .15s var(--ease);
  }
  .drawer-topbar-social a:hover {
    color: #fff;
    background: rgba(255,255,255,.1);
  }
  .drawer-topbar-social svg { display: block; }
  .drawer-head {
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
  }
  .drawer-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 12px;
  }
  .drawer-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 12px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    color: var(--ink);
    border-bottom: 1px solid var(--line);
  }
  .drawer-list a:last-child { border-bottom: none; }
  .drawer-list a:hover { background: var(--bg-soft); }
  .drawer-foot {
    padding: 16px 20px;
    border-top: 1px solid var(--line);
    background: var(--bg-soft);
  }
  .drawer-backdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.4);
    /* z-index très élevé : passer au-dessus des anchor ads AdSense (juste sous le drawer). */
    z-index: 2147483645;
    opacity: 0; pointer-events: none;
    transition: opacity .25s var(--ease);
  }
  .drawer-backdrop.open { opacity: 1; pointer-events: auto; }

  @media (max-width: 980px) {
    .topbar-item.weather, .topbar-item.date { display: none; }
    .topbar-inner { padding: 0 16px; }
    .mainbar-inner {
      grid-template-columns: auto 1fr auto;
      gap: 12px;
      padding: 0 16px;
    }
    .logo { font-size: 26px; }
    .logo .tagline { display: none; }
    /* '.search { display:none }' RETIRÉ le 2026-06-01 : ce sélecteur nu masquait
       AUSSI <body class="search"> (classe ajoutée par WordPress sur les pages de
       résultats de recherche) → page de recherche TOUTE BLANCHE sur mobile. Le
       champ de recherche desktop (.search.desktop-only) reste masqué en mobile
       par la règle .desktop-only ci-dessous. */
    .navbar { display: none; }
    .burger { display: inline-flex; }
    /* .cta-sub responsive : migré vers plugin senego-account/assets/css/modals.css */
    .icon-btn.search-mobile { display: inline-flex; }
    .mobile-only { display: inline-flex; }
    .desktop-only { display: none !important; }
    .compactbar-inner { padding: 0 16px; }
    .compact-nav { display: none; }
    :root { --mainbar-h: 64px; --compact-h: 56px; }
  }
  @media (min-width: 981px) {
    .icon-btn.search-mobile { display: none; }
    .burger { display: none; }
  }
  /* ─── Mobile (≤ 620 px) : 70-75 % de l'audience Senego ─────
   * État NON RÉTRACTÉ (avant scroll) : on dégraisse la mainbar et on cache la topbar
   * noire (FR/EN seul, pas utile sur petit écran). Toutes les actions utilisateur
   * restent accessibles via le drawer (burger) ou les pages dédiées /abonnement /connexion. */
  @media (max-width: 620px) {
    /* Topbar noire conservée sur mobile — version « icônes uniquement »
       (textes cachés pour gain de place, icônes restent visibles). */
    .topbar { height: 34px; font-size: 11px; }
    .topbar-inner { padding: 0 10px; gap: 8px; }
    .topbar-left, .topbar-right { gap: 10px; }

    /* Cache les LIBELLÉS texte (date longue, "Dakar 28°C") — on garde l'icône SVG */
    .topbar-label { display: none; }
    /* Cache les séparateurs `·` qui n'ont plus de sens sans textes */
    .topbar-item.dot-sep { display: none; }
    /* Cache la langue FR/EN (raccourci pas utilisable utilement sur petit écran) */
    .topbar-item.lang { display: none; }

    /* Lien Contact : on cache le mot "Contact", on garde l'icône enveloppe */
    .topbar-contact span { display: none; }
    .topbar-contact { padding: 2px; }

    /* Séparateur vertical plus discret entre Contact et sociaux */
    .topbar-sep { height: 12px; }

    /* Icônes sociales un peu plus compactes pour tout faire tenir */
    .topbar-social { gap: 8px; }
    .topbar-social a { width: 22px; height: 22px; }

    /* Mainbar : hauteur réduite, padding/gap resserrés, logo plus petit */
    :root { --mainbar-h: 56px; }
    .mainbar { height: 56px; }
    .mainbar-inner { padding: 0 12px; gap: 8px; }
    .logo img { height: 32px !important; }

    /* Boutons CTA abonnement et lien "Se connecter" texte cachés dans la mainbar :
     * ils restent disponibles via le menu burger (drawer) et la page /abonnement. */
    .main-right .cta-sub,
    .main-right .topbar-login { display: none; }

    /* Avatar / badge Premium : compactés mais conservés (raccourci visuel vers /mon-compte) */
    .main-right .premium-badge-main {
      height: 32px; padding: 0 10px 0 4px; font-size: 12px; gap: 6px;
    }
    .main-right .premium-badge-main .av { width: 24px; height: 24px; font-size: 10px; }
    .main-right .avatar { width: 32px; height: 32px; font-size: 11px; }
    .main-right { gap: 6px; }
  }

/* Visibilité par état utilisateur (.when-anon/.when-loggedin/.when-premium) :
   migrée vers plugin senego-account/assets/css/modals.css */

/* ============ Overlay de recherche ============ */
.search-overlay {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 130;
  background: rgba(255,255,255,.98);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 8px 24px rgba(0,0,0,.10);
  padding: 18px 24px;
  transform: translateY(-100%);
  opacity: 0;
  visibility: hidden;
  transition: transform .28s var(--ease), opacity .2s var(--ease);
}
.search-overlay.open { transform: translateY(0); opacity: 1; visibility: visible; }
.search-overlay-inner { max-width: 760px; margin: 0 auto; }
.search-overlay form {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--soft-radius);
  background: #fff;
  padding: 0 12px;
  height: 54px;
}
.search-overlay form:focus-within { border-color: var(--orange); box-shadow: 0 0 0 4px rgba(255,153,0,.12); }
.search-overlay-icon { color: var(--meta); display: inline-flex; }
.search-overlay input {
  flex: 1; border: none; outline: none; background: transparent;
  font: inherit; font-size: 16px; color: var(--ink);
}
.search-overlay input::placeholder { color: var(--meta); }
.search-overlay-close {
  width: 34px; height: 34px; border-radius: 50%;
  border: none; background: var(--bg-soft); color: var(--meta);
  display: inline-flex; align-items: center; justify-content: center;
  transition: all .15s var(--ease);
}
.search-overlay-close:hover { background: var(--line); color: var(--ink); }
