/* Styles mobiles partagés - HAIZE Elec (menu + anti-débordement)
   Utilisé par toutes les pages sauf l'accueil (qui a son propre menu).
   La classe .mnav-js est posée par un script inline dans le <head> :
   sans JavaScript, le menu d'origine reste affiché. */

@media (max-width: 900px) {
  .mnav-js body > header > nav,
  .mnav-js body > header > .nav-container {
    display: none !important;
  }
}

header.mnav-compact {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: space-between !important;
  height: auto !important;
  min-height: 64px;
  padding-left: 16px !important;
  padding-right: 8px !important;
}

body > header .logo { text-decoration: none; }
/* Le logo a des attributs width/height : garder ses proportions sous max-height */
body > header .logo img,
img.marque-logo { width: auto; height: auto; }
header.mnav-compact .logo { min-width: 0; }
header.mnav-compact .logo img { max-width: 100%; height: auto; }

header.mnav-compact > nav,
header.mnav-compact > .nav-container {
  display: none !important;
}

.mnav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 11px;
  margin-left: auto;
  background: none;
  border: 0;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

header.mnav-compact .mnav-toggle { display: flex; }

.mnav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--mnav-fg, #fff);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.mnav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mnav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.mnav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mnav-toggle:focus-visible {
  outline: 2px solid #D3A625;
  outline-offset: 2px;
  border-radius: 6px;
}

.mnav-panel {
  position: fixed;
  left: 0;
  right: 0;
  top: var(--mnav-top, 70px);
  max-height: calc(100vh - var(--mnav-top, 70px));
  overflow-y: auto;
  padding: 6px 24px 24px;
  background: var(--mnav-bg, #0d1524);
  border-bottom: 1px solid rgba(211, 166, 37, 0.25);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.18);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0.25s;
}

.mnav-panel.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.mnav-panel .mnav-link {
  display: block;
  padding: 15px 0;
  color: var(--mnav-fg, #fff);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--mnav-line, rgba(255, 255, 255, 0.08));
}

.mnav-panel .mnav-link:hover,
.mnav-panel .mnav-link:focus-visible { color: #D3A625; }

.mnav-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.mnav-ctas a {
  flex: 1 1 140px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: none;
  white-space: nowrap;
}

.mnav-ctas .mnav-call { background: #D3A625; color: #1A2336; }
.mnav-ctas .mnav-wa { background: #157A3E; color: #fff; }

@media (prefers-reduced-motion: reduce) {
  .mnav-panel, .mnav-toggle span { transition: none; }
}

/* Encadré « L'essentiel » (fond crème) : texte foncé même dans un bandeau sombre */
.essentiel-box { color: #2c3e50; }

/* ── Anti-débordement du contenu sur petits écrans ── */
@media (max-width: 600px) {
  /* anywhere (et non break-word) : fonctionne aussi dans les titres en flex */
  h1, h2, h3, h4 {
    overflow-wrap: anywhere;
  }

  /* Césure seulement sur les H1 et les mots d'au moins 10 lettres */
  h1 {
    -webkit-hyphens: auto;
    hyphens: auto;
    hyphenate-limit-chars: 10 4 4;
  }

  p, li, td, th, dd {
    overflow-wrap: break-word;
  }

  img, video, iframe { max-width: 100%; }

  /* Les tableaux défilent horizontalement au lieu d'élargir la page */
  table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* Titres principaux plus compacts sur téléphone (police Syne très large) */
@media (max-width: 420px) {
  .page-hero h1,
  .article-container h1,
  .article-hero h1,
  .hero h1 {
    font-size: 1.6rem;
    line-height: 1.15;
  }
}

/* Liens dorés de l'encadré auteur : or foncé lisible sur fond clair (contraste 5,1:1) */
.author-box a { color: #86650a !important; }

/* Textes et liens dorés sur fond clair : or foncé (5,1:1) ; le doré vif reste pour les fonds sombres */
.blog-category,
.blog-category i { color: #86650a !important; }
.content-section a:not([class]):not([style]),
.article-container a:not([class]):not([style]),
.faq-section a:not([class]):not([style]),
.content-section a[style*="couleur-accent"],
.article-container a[style*="couleur-accent"] { color: #86650a !important; }
.tarif-note { color: #5b6470; }

/* Petits textes gris et badges hérités : contraste ≥ 4,5:1 */
.tarif-sub,
.puissance-sub,
.prix-sub,
figcaption,
[style*="color:#888"],
[style*="color: #888"],
[style*="color:#777"],
[style*="color: #777"] { color: #5b6470 !important; }
.tag-electro,
.info-box h4 { color: #1f6391; }
.tag-menu { color: #a04000; }
.price-tag { color: #1a2336 !important; }
.moteur-pros,
.pros { color: #1e7d45 !important; }
.note-badge,
.partner-job,
.info-block a { color: #86650a !important; }
