/* Méoweb — styles partagés (en-tête, navigation, boutons).
   Les styles propres à chaque page restent dans la page, comme dans les maquettes. */

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--color-dark-900); font-family: var(--font-body); color: var(--color-text-on-dark); -webkit-font-smoothing: antialiased; }

/* ── En-tête fixe givré : transparent au repos, sombre au défilement ── */
.mw-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100; border-radius: 0;
  background: rgba(255,255,255,0.05);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  transition: background 250ms cubic-bezier(0.4,0,0.2,1), border-color 250ms cubic-bezier(0.4,0,0.2,1), box-shadow 250ms cubic-bezier(0.4,0,0.2,1);
}
html.mw-scrolled .mw-header,
html.mw-menu-open .mw-header {
  background: rgba(10,10,10,0.82);
  border-bottom-color: rgba(255,255,255,0.1);
  box-shadow: 0 4px 32px rgba(0,0,0,0.45);
}

.nav-link { color: rgba(255,255,255,0.75); font-size: var(--text-sm); cursor: pointer; text-decoration: none; position: relative; transition: color var(--duration-fast) var(--ease-out); }
.nav-link::after { content: ''; position: absolute; bottom: -3px; left: 0; right: 0; height: 1px; background: var(--color-brand); transform: scaleX(0); transition: transform var(--duration-fast) var(--ease-out); }
.nav-link:hover { color: white; }
.nav-link:hover::after { transform: scaleX(1); }
.nav-link.active { color: white; font-weight: var(--font-semibold); }
.nav-link.active::after { transform: scaleX(1); }
.mw-nav::-webkit-scrollbar { display: none; }

.svc-menu { display: none; }
.svc-wrap:focus-within .svc-menu { display: flex; }
@keyframes svcBlink { 0%,100% { color: rgba(255,255,255,0.75); text-shadow: none; filter: none; } 50% { color: #fff; text-shadow: 0 0 8px rgba(255,255,255,0.95), 0 0 22px rgba(255,255,255,0.8), 0 0 44px rgba(255,255,255,0.55); filter: drop-shadow(0 0 14px rgba(255,255,255,0.7)); } }
.svc-blink { animation: svcBlink 0.65s ease-in-out 3; position: relative; }

.btn-primary { background: var(--color-brand); color: white; border: none; border-radius: var(--radius-full); font-family: var(--font-body); font-weight: var(--font-bold); cursor: pointer; letter-spacing: var(--tracking-wide); transition: background var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out), transform var(--duration-fast) var(--ease-out); }
.btn-primary:hover { background: var(--color-brand-hover); box-shadow: var(--glow-brand-md); transform: translateY(-1px); }
.btn-primary:active { transform: scale(0.97); }
.btn-primary[disabled] { opacity: .6; cursor: progress; transform: none; }

@media (max-width: 1180px) {
  .mw-header-inner { gap: var(--space-4) !important; }
  .mw-nav { gap: var(--space-4) !important; }
  .mw-header-inner > .btn-primary { padding: 10px 18px !important; }
}
@media (max-width: 1040px) { .mw-tools-btn { display: none !important; } }

/* ── Menu mobile (sous 760 px la navigation principale est masquée) ── */
.mw-burger { display: none; flex-shrink: 0; width: 42px; height: 42px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.28); background: rgba(255,255,255,0.06); cursor: pointer; padding: 0; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.mw-burger span { display: block; width: 16px; height: 2px; border-radius: 2px; background: var(--color-white); transition: transform 200ms, opacity 200ms; }
html.mw-menu-open .mw-burger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
html.mw-menu-open .mw-burger span:nth-child(2) { opacity: 0; }
html.mw-menu-open .mw-burger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.mw-mobile-menu { display: flex; flex-direction: column; padding: var(--space-2) var(--space-5) var(--space-5); border-top: 1px solid rgba(255,255,255,0.08); }
.mw-mobile-menu[hidden] { display: none; }
.mw-mobile-menu a { color: rgba(255,255,255,0.8); text-decoration: none; padding: 14px 4px; font-size: 16px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.mw-mobile-menu a:last-child { border-bottom: 0; }
.mw-mobile-menu a.active, .mw-mobile-menu a:hover { color: var(--color-brand); }
@media (max-width: 760px) {
  .mw-header .mw-nav { display: none !important; }
  .mw-header .mw-header-inner { justify-content: space-between; padding: 0 var(--space-5) !important; gap: var(--space-3) !important; }
  .mw-header-inner > a:first-child { margin-right: auto; }
  .mw-burger { display: inline-flex; }
}
@media (max-width: 480px) {
  .mw-header .mw-header-inner { gap: var(--space-2) !important; height: 76px !important; }
  .mw-header-inner > a:first-child img { height: 40px !important; }
  .mw-header .mw-header-inner > .mw-cta { padding: 8px 12px !important; font-size: 12px !important; }
}
@media (max-width: 340px) {
  .mw-header .mw-header-inner > .mw-cta { display: none !important; }
}
@media (min-width: 761px) { .mw-mobile-menu { display: none !important; } }

html[data-theme="light"] .mw-burger { border-color: rgba(0,0,0,0.2); background: rgba(0,0,0,0.05); }
html[data-theme="light"] .mw-burger span { background: #111; }
html[data-theme="light"] .mw-mobile-menu a { color: rgba(17,17,17,0.8); border-color: rgba(0,0,0,0.08); }
html[data-theme="light"] .mw-mobile-menu { border-color: rgba(0,0,0,0.08); }

/* Indicateur de défilement de l'accueil : masqué dès que l'on fait défiler */
html.mw-scrolled .scroll-hint { opacity: 0 !important; pointer-events: none !important; }

/* Animations d'apparition (pages Accueil et Professionnels) */
.reveal { opacity: 0; transform: translateY(32px); transition: opacity var(--duration-slow) var(--ease-out), transform var(--duration-slow) var(--ease-out); }
.reveal.visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .carousel-track, .scroll-hint { animation: none !important; }
}

/* Message de retour (formulaires) */
.mw-flash { border-radius: var(--radius-md); padding: 14px 16px; font-size: var(--text-sm); line-height: var(--leading-relaxed); margin-bottom: var(--space-6); }
.mw-flash.ok { background: var(--color-success-subtle); border: 1px solid rgba(46,139,87,0.5); color: var(--color-gray-100); }
.mw-flash.err { background: var(--color-error-subtle); border: 1px solid rgba(204,42,42,0.5); color: var(--color-gray-100); }
.mw-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* Article : décalage des ancres sous l'en-tête fixe */
.art-chapter { scroll-margin-top: 110px; }

/* Survols des pages dynamiques (actualités, admin) */
.mw-link:hover { color: var(--color-white) !important; }
.mw-hover-brand:hover { color: var(--color-brand) !important; }
.mw-hover-border:hover { border-color: var(--color-brand) !important; }
.mw-card-hover:hover { transform: translateY(-2px); border-color: var(--color-brand) !important; }
.mw-hover-fill:hover { background: rgba(255,0,131,0.15) !important; }

/* Pied de page responsive (commun à toutes les pages) */
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr !important; gap: var(--space-8) !important; } }
@media (max-width: 640px) {
  .footer-grid { grid-template-columns: 1fr !important; }
  section, header > div, footer > div { padding-left: var(--space-5) !important; padding-right: var(--space-5) !important; }
}

/* Case à cocher RGPD (formulaire de contact) */
.rgpd input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rgpd-box { width: 18px; height: 18px; flex-shrink: 0; background: var(--color-dark-900); border: 1px solid var(--color-dark-700); border-radius: 4px; margin-top: 1px; display: flex; align-items: center; justify-content: center; transition: border-color var(--duration-fast); }
.rgpd-box svg { opacity: 0; transition: opacity var(--duration-fast); }
.rgpd input:checked + .rgpd-box { border-color: var(--color-brand); }
.rgpd input:checked + .rgpd-box svg { opacity: 1; }
.rgpd input:focus-visible + .rgpd-box { box-shadow: var(--ring-focus); }

html { scroll-behavior: smooth; }

/* Accueil : le titre du hero (insécable dans la maquette) passe à la ligne sur mobile */
@media (max-width: 640px) {
  #hero h1 > span { white-space: normal !important; flex-wrap: wrap !important; row-gap: 0; }
  .hero-inner > div { width: 100%; max-width: 100%; }
}

/* Mentions légales / CGV : tableaux « libellé | valeur » empilés sur mobile */
@media (max-width: 640px) {
  .cgv-layout { grid-template-columns: minmax(0, 1fr) !important; }
  .cgv-layout [style*="grid-template-columns:200px"] { grid-template-columns: 1fr !important; gap: 4px !important; }
  .cgv-layout p, .cgv-layout div, .cgv-layout a { overflow-wrap: anywhere; }
}

/* Carte de la zone d'intervention (includes/partials/carte-zone.php) */
.mw-map { --map-line: rgba(255,255,255,0.22); --map-halo: var(--color-dark-800); }
html[data-theme="light"] .mw-map { --map-line: rgba(0,0,0,0.22); }
.mw-map-pulse { transform-box: fill-box; transform-origin: center; animation: mwMapPulse 2.4s ease-out infinite; }
@keyframes mwMapPulse { 0% { transform: scale(0.6); opacity: 0.35; } 100% { transform: scale(1.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .mw-map-pulse { animation: none; } }
