/* ==========================================================================
   MacSeeds — Header global (chargé sur tout le site)
   ========================================================================== */

.ms-site-header{
  position: sticky; top: 0; z-index: 100;
  background: rgba(250,249,247,0.85);
  border-bottom: 1px solid rgba(0,0,0,0.07);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
}

/* Filet de sécurité : tout lien sans style explicite retombe sur le bleu système,
   jamais sur le violet par défaut de WordPress (#7a00df). */
body a{ color:#007AFF; }

/* Neutralise le violet par défaut du navigateur sur les liens déjà visités —
   sans cette règle, chaque lien que TU as cliqué en testant s'affiche en violet
   dans TON navigateur, même si le CSS du site est parfaitement correct. */
a:visited{ color: inherit; }

.ms-header-inner{
  max-width: 1180px; margin: 0 auto;
  padding: 14px 28px;
  display:flex; align-items:center; gap: 28px;
}

.ms-header-branding{ flex:none; display:flex; align-items:center; }
.ms-header-brand-text{
  font-family: "Bricolage Grotesque", -apple-system, sans-serif;
  font-weight:700; font-size:20px; letter-spacing:-0.02em;
  color:#17181A; text-decoration:none;
}
.ms-header-logo{ display:flex; align-items:center; }
.ms-header-logo img{ display:block; height:56px; width:auto; }

.ms-logo-dark{ display:none; }
html[data-theme="dark"] .ms-logo-light{ display:none; }
html[data-theme="dark"] .ms-logo-dark{ display:flex; }

.ms-header-nav{ flex:1; display:flex; justify-content:center; align-items:center; }
.ms-header-nav ul{
  list-style:none; margin:0; padding:0;
  display:flex; gap:30px; flex-wrap:wrap;
  justify-content:center; align-items:center;
}
.ms-header-nav li{ display:flex; align-items:center; }
.ms-header-nav a,
.ms-header-nav a:link,
.ms-header-nav a:visited{
  font-family: "Bricolage Grotesque", -apple-system, sans-serif;
  color:#55585E !important; text-decoration:none;
  font-size:14px; font-weight:700; line-height:1;
  text-transform:uppercase; letter-spacing:0.02em;
  display:block; padding:4px 0;
}
.ms-header-nav a:hover{ color:#17181A !important; }
.ms-header-nav .current-menu-item a,
.ms-header-nav .current-menu-item a:link,
.ms-header-nav .current-menu-item a:visited{ color:#17181A !important; }

/* pilule de langue — construite en HTML natif, pas via le rendu par défaut de Polylang */
ul.ms-lang-switch{
  flex:none; list-style:none !important; margin:0 !important; padding:4px !important;
  display:flex; gap:4px; align-items:center;
  background: rgba(0,0,0,0.045); border-radius:100px;
}
ul.ms-lang-switch li{ margin:0 !important; padding:0 !important; list-style:none !important; display:flex; }
ul.ms-lang-switch a{
  display:block; padding:5px 12px; border-radius:100px;
  font-size:12.5px; font-weight:700; text-decoration:none;
  color:#55585E; line-height:1.4;
}
ul.ms-lang-switch li.is-current a{
  background:#fff; color:#17181A;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

/* bouton hamburger — masqué sur desktop */
.ms-menu-toggle{
  display:none; flex:none;
  width:36px; height:36px; border-radius:10px;
  background:none; border:none; cursor:pointer;
  align-items:center; justify-content:center;
}
.ms-menu-toggle span,
.ms-menu-toggle span::before,
.ms-menu-toggle span::after{
  content:""; display:block;
  width:20px; height:2px; background:#17181A; border-radius:2px;
  transition: transform .2s ease, opacity .2s ease;
}
.ms-menu-toggle span::before{ transform: translateY(-6px); }
.ms-menu-toggle span::after{ transform: translateY(4px); }
.ms-site-header.is-menu-open .ms-menu-toggle span{ background: transparent; }
.ms-site-header.is-menu-open .ms-menu-toggle span::before{ transform: translateY(0) rotate(45deg); }
.ms-site-header.is-menu-open .ms-menu-toggle span::after{ transform: translateY(0) rotate(-45deg); }

/* interrupteur mode clair/sombre — même esprit que la pilule FR/EN */
.ms-theme-switch.ms-theme-switch--mobile{ display:none; }
.ms-theme-switch{
  flex:none; display:flex; gap:4px; padding:4px;
  background: rgba(0,0,0,0.07); border-radius:100px;
}
.ms-theme-opt{
  display:grid; place-items:center;
  width:32px; height:32px; border-radius:100px;
  background:none; border:none; cursor:pointer;
  color:#55585E;
  padding:0; margin:0; line-height:0;
  box-sizing:border-box;
}
.ms-theme-opt svg{
  display:block;
  width:16px; height:16px;
  flex-shrink:0;
}
.ms-theme-opt.is-active{
  background:#fff; color:#17181A;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

/* ==========================================================================
   Mode sombre — variables globales (le header + les pages qui utilisent
   les mêmes variables --ms-bg / --ms-ink / --ms-ink-soft en héritent).
   ========================================================================== */
html[data-theme="dark"]{
  --ms-bg: #121214;
  --ms-ink: #F2F2F3;
  --ms-ink-soft: #9A9CA2;
}
html[data-theme="dark"] body{ background: var(--ms-bg); color: var(--ms-ink); }

html[data-theme="dark"] .ms-site-header{
  background: rgba(18,18,20,0.85);
  border-bottom-color: rgba(255,255,255,0.08);
}
html[data-theme="dark"] .ms-header-brand-text,
html[data-theme="dark"] .ms-header-nav .current-menu-item a{ color:#F2F2F3; }
html[data-theme="dark"] .ms-header-nav a{ color:#9A9CA2; }
html[data-theme="dark"] .ms-header-nav a:hover{ color:#F2F2F3; }
html[data-theme="dark"] .ms-menu-toggle span,
html[data-theme="dark"] .ms-menu-toggle span::before,
html[data-theme="dark"] .ms-menu-toggle span::after{ background:#F2F2F3; }
html[data-theme="dark"] ul.ms-lang-switch,
html[data-theme="dark"] .ms-theme-switch{ background: rgba(0,0,0,0.35); }
html[data-theme="dark"] ul.ms-lang-switch a{ color:#9A9CA2; }
html[data-theme="dark"] ul.ms-lang-switch li.is-current a{ background:#3A3A3E; color:#FFFFFF; }
html[data-theme="dark"] .ms-theme-opt{ color:#9A9CA2; }
html[data-theme="dark"] .ms-theme-opt.is-active{ background:#3A3A3E; color:#FFFFFF; }

@media (max-width: 780px){
  .ms-header-inner{ flex-wrap:wrap; gap:14px; padding: 12px 20px; }
  .ms-header-logo img{ height:40px; }

  .ms-menu-toggle{ display:flex; order:2; margin-left:auto; }
  ul.ms-lang-switch{ order:3; }
  .ms-theme-switch.ms-theme-switch--desktop{ display:none; }

  .ms-header-nav{
    order:4; flex-basis:100%;
    display:none;
    flex-direction:column; align-items:flex-start;
    justify-content:flex-start;
  }
  .ms-site-header.is-menu-open .ms-header-nav{ display:flex; }
  .ms-header-nav ul{
    flex-direction:column; align-items:flex-start; gap:4px;
    width:100%; padding: 10px 0 4px;
  }
  .ms-header-nav a{ padding:8px 0; font-size:15px; }

  .ms-theme-switch.ms-theme-switch--mobile{
    display:inline-flex;
    margin-top:10px;
  }
}
