/* The header (2026-11-24, Emile's structure). Written into every page by
   scripts/sync-shell.mjs from scripts/nav-menu.mjs; the header carries
   data-nav="f". Loaded after site.css, so the id selectors here win over the
   page styles and the old compact menu (769-1439 px).

   Two rows, both inside the fixed header:
   - .dv-top: a thin black-and-white bar (phone, "Voyez notre contenu et nos
     avis" with the platform icons, FR/EN). It slides away once the page scrolls.
   - the main bar: logo, Services and Zones (the only dropdowns), seven links,
     the quote button. No phone in it any more. */

:root { --dv-top-h: 36px; }
@media (max-width: 1023px) { :root { --dv-top-h: 34px; } }

/* The page moves down by the bar's height, so every page keeps the band it had
   under the main bar (a hero photo, the reviews page's dark band). */
html:has(#mainHeader[data-nav="f"]) { padding-top: var(--dv-top-h); }

/* ---------- the top bar ---------- */
/* Version 2 (2026-11-24): centred. Black, white, Inter bold in small capitals,
   one line in the middle: the number, a dot, "Voyez notre contenu et nos avis"
   with the four icons, a dot, FR/EN. */
html body #mainHeader .dv-top {
  height: var(--dv-top-h); background: #000; color: #fff;
  line-height: 1; position: relative; z-index: 2;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
html body #mainHeader .dv-top-in { height: 100%; margin: 0 auto; display: flex; align-items: center; }
html body #mainHeader .dv-top-left,
html body #mainHeader .dv-top-right { display: flex; align-items: center; min-width: 0; }
html body #mainHeader .dv-top a { color: #fff; text-decoration: none; text-shadow: none; }
html body #mainHeader .dv-top-phone { display: inline-flex; align-items: center; white-space: nowrap; font-variant-numeric: tabular-nums; }
html body #mainHeader .dv-top-phone svg { color: currentColor; flex-shrink: 0; }
html body #mainHeader .dv-top-follow { white-space: nowrap; }
html body #mainHeader .dv-top-icons { display: inline-flex; align-items: center; gap: 2px; }
html body #mainHeader .dv-top-icon {
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%;
  color: #fff; transition: color 160ms ease, background-color 160ms ease, transform 160ms cubic-bezier(0.23, 1, 0.32, 1);
}
html body #mainHeader .dv-top-icon svg { width: 16px; height: 16px; }
/* The Google mark is filled, the others are drawn: a touch smaller so all four read the same weight. */
html body #mainHeader .dv-top-icon[title="Google"] svg { width: 14px; height: 14px; }
html body #mainHeader .dv-top-icon:active { transform: scale(0.94); }
html body #mainHeader .dv-top-lang { display: inline-flex; align-items: center; }
html body #mainHeader .dv-top .lang-toggle.dv-top-langs {
  display: inline-flex !important; align-items: center; gap: 2px; padding: 0; margin: 0; background: none !important; border: 0 !important; box-shadow: none !important;
}
html body #mainHeader .dv-top .dv-top-langs .lang-toggle-opt {
  display: inline-flex; align-items: center; justify-content: center; height: 22px; padding: 0 7px !important; border-radius: 6px;
  font-family: inherit !important; font-size: 0.75rem !important; font-weight: 700 !important; letter-spacing: 0.06em;
  color: #fff !important; background: none !important; transition: color 160ms ease, background-color 160ms ease;
}
/* The page's language reads as a white chip, black letters. */
html body #mainHeader .dv-top .dv-top-langs .lang-toggle-opt.lang-toggle-active { color: #000 !important; background: #fff !important; }
@media (hover: hover) and (pointer: fine) {
  html body #mainHeader .dv-top-icon:hover { color: #000; background: #fff; }
  html body #mainHeader .dv-top .dv-top-langs a.lang-toggle-opt:not(.lang-toggle-active):hover { box-shadow: inset 0 0 0 1px #fff; }
}
html body #mainHeader .dv-top a:focus-visible { outline: 2px solid #fff; outline-offset: 2px; border-radius: 6px; }
html body #mainHeader .dv-top { font-family: 'Outfit', 'Inter', system-ui, sans-serif; font-size: 0.75rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
html body #mainHeader .dv-top-in { padding: 0 16px; justify-content: center; gap: 0; }
html body #mainHeader .dv-top-left,
html body #mainHeader .dv-top-right { gap: 0; }
html body #mainHeader .dv-top-phone { gap: 7px; height: 28px; font-size: 0.75rem; letter-spacing: 0.08em; }
html body #mainHeader .dv-top-calltext::after { content: "\00a0:\00a0"; }
html body #mainHeader .dv-top-phone svg { width: 12px; height: 12px; }
html body #mainHeader .dv-top-follow { margin-right: 8px; }
html body #mainHeader .dv-top-icons { gap: 0; }
html body #mainHeader .dv-top-icon { width: 28px; height: 28px; }
html body #mainHeader .dv-top-icon svg { width: 14px; height: 14px; }
html body #mainHeader .dv-top-icon[title="Google"] svg { width: 12px; height: 12px; }
/* A small white dot between the three parts. */
html body #mainHeader .dv-top-right::before,
html body #mainHeader .dv-top-lang::before {
  content: ""; width: 4px; height: 4px; border-radius: 50%; background: #fff; margin: 0 18px; flex-shrink: 0;
}
/* The icons carry their own 7px of room, so the dot after them sits a little closer. */
html body #mainHeader .dv-top-lang::before { margin-left: 11px; }
html body #mainHeader .dv-top .dv-top-langs .lang-toggle-opt { height: 20px; padding: 0 6px !important; font-size: 0.6875rem !important; letter-spacing: 0.1em; }
@media (hover: hover) and (pointer: fine) {
  html body #mainHeader .dv-top-phone:hover span { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
}
@media (max-width: 1023px) {
  html body #mainHeader .dv-top-lang { display: none; }
}
@media (max-width: 767px) {
  html body #mainHeader .dv-top-follow { display: none; }
  html body #mainHeader .dv-top-calltext { display: none; }
  html body #mainHeader .dv-top-phone { height: 32px; font-size: 0.8125rem; }
  html body #mainHeader .dv-top-right::before { margin: 0 12px; }
}

/* Scrolled, the top bar slides away and the main bar stays. */
html body:not(#dvf) #mainHeader#mainHeader[data-nav="f"] { transition: transform 0.35s cubic-bezier(0.23, 1, 0.32, 1), background-color 0.4s ease, box-shadow 0.4s ease; }
html body:not(#dvf) #mainHeader#mainHeader[data-nav="f"].scrolled { transform: translateY(calc(-1 * var(--dv-top-h))) !important; }

/* The phone, the 150 $ and the language switch left the main bar for the top
   bar (the phone menu keeps its own call button and switch). */
html body #mainHeader[data-nav="f"] .header-content > div > .nav-phone,
html body #mainHeader[data-nav="f"] .header-content > div > .nav-ref-btn-desk { display: none !important; }
/* 2026-11-24 (Emile): the FR/EN switch is easy to see in the main bar, next to the quote button; the top bar no longer carries it. */
html body #mainHeader .dv-top-lang { display: none !important; }

/* ---------- the main bar, computer ---------- */
@media (min-width: 1024px) {
  /* The logo sits closer to the left edge to give the menu its room. */
  html body #mainHeader[data-nav] .header-container { max-width: none !important; padding: 0 clamp(16px, 1.8vw, 28px) !important; }
  html body #mainHeader[data-nav] .header-content { gap: 24px; }
  html body #mainHeader[data-nav] .logo { font-size: 1.32rem !important; gap: 10px !important; flex-shrink: 0; }
  html body #mainHeader[data-nav] .logo-img { width: 42px !important; height: 42px !important; }
  html body #mainHeader[data-nav] .nav-links { gap: clamp(16px, 1.75vw, 30px) !important; margin: 0 auto; }
  html body #mainHeader[data-nav] .nav-link { font-size: 0.95rem !important; padding: 10px 0 !important; gap: 5px !important; letter-spacing: -0.005em; white-space: nowrap; }
  html body #mainHeader[data-nav] .nav-chevron { width: 11px !important; height: 11px !important; opacity: 0.75; }
  html body #mainHeader[data-nav] .header-content > div { gap: 10px !important; flex-shrink: 0; }
  html body #mainHeader[data-nav] .nav-btn-cta { padding: 11px 20px !important; font-size: 0.9rem !important; border-radius: 30px !important; white-space: nowrap; }
}
@media (min-width: 1024px) and (max-width: 1279px) {
  html body #mainHeader[data-nav] .header-content { gap: 14px; }
  html body #mainHeader[data-nav] .nav-links { gap: 14px !important; }
  html body #mainHeader[data-nav] .nav-link { font-size: 0.9rem !important; }
  html body #mainHeader[data-nav] .logo { font-size: 1.2rem !important; }
  html body #mainHeader[data-nav] .logo-img { width: 38px !important; height: 38px !important; }
  html body #mainHeader[data-nav] .nav-btn-cta { padding: 10px 16px !important; font-size: 0.86rem !important; }
}

@media (min-width: 1024px) and (max-width: 1179px) {
  html body #mainHeader[data-nav] .header-container { padding: 0 14px !important; }
  html body #mainHeader[data-nav] .header-content { gap: 12px; }
  html body #mainHeader[data-nav] .nav-links { gap: 15px !important; }
  html body #mainHeader[data-nav] .nav-link { font-size: 0.86rem !important; }
  html body #mainHeader[data-nav] .logo { font-size: 1.12rem !important; gap: 8px !important; }
  html body #mainHeader[data-nav] .logo-img { width: 36px !important; height: 36px !important; }
  html body #mainHeader[data-nav] .nav-btn-cta { padding: 10px 14px !important; font-size: 0.84rem !important; }
}
@media (min-width: 1024px) {
  /* Over a hero photo the main bar gets a soft shade so the links read on any sky or tree. */
  html body #mainHeader[data-nav="f"]:not(.scrolled) .header-content { position: relative; }
  html body #mainHeader[data-nav="f"]:not(.scrolled) .header-content::before {
    content: ''; position: absolute; inset: 0 0 -28px; z-index: -1; pointer-events: none;
    background: linear-gradient(180deg, rgba(8, 16, 11, 0.5) 0%, rgba(8, 16, 11, 0.22) 60%, rgba(8, 16, 11, 0) 100%);
  }
}
/* A hairline ring keeps the cream logo disc visible on the white scrolled bar. */
html body #mainHeader[data-nav="f"].scrolled .logo-img { box-shadow: 0 0 0 1px rgba(20, 40, 27, 0.14); border-radius: 50%; }

/* Dropdowns open from the keyboard too (the labels are focusable). */
html body #mainHeader .nav-item-dropdown:focus-within .dropdown-menu {
  opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0);
}
html body #mainHeader .nav-item-dropdown:focus-within .nav-chevron { transform: rotate(180deg); }
html body #mainHeader .nav-link:focus-visible,
html body #mainHeader .dropdown-link:focus-visible { outline: 2px solid var(--g); outline-offset: 4px; border-radius: 6px; }
/* A gap between the label and its panel no longer closes the panel. */
html body #mainHeader .nav-item-dropdown::after {
  content: ''; position: absolute; left: -12px; right: -12px; top: 100%; height: 14px;
}

/* ---------- phone and tablet ---------- */
/* The bar stays thin: the number on the left, the icons on the right. */
@media (max-width: 1023px) {
  /* The phone header was a fixed 56 px tall; it now holds the bar too. Three ids
     outrank the place pages' phone header rules in site.css (two). */
  html body:not(#dvf) #mainHeader#mainHeader[data-nav="f"] { height: auto !important; }
  /* The number lives in the bar now, not twice on the same screen. */
  html body:not(#dvf) #mainHeader#mainHeader[data-nav="f"] .header-content .nav-phone { display: none !important; }
  /* The open menu starts under both rows. */
  html body:not(#dvf) #mobileNav#mobileNav[data-nav="f"] { padding-top: calc(var(--pp-hd, 56px) + var(--dv-top-h) + 8px) !important; }
}
@media (max-width: 1023px) {
  /* Scrolled on a phone, a hairline keeps the bar apart from the page under it. */
  html body:not(#dvf) #mainHeader#mainHeader[data-nav="f"].scrolled { box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08), 0 2px 12px rgba(0, 0, 0, 0.06) !important; }
}

@media (prefers-reduced-motion: reduce) {
  html body #mainHeader[data-nav="f"],
  html body #mainHeader .dv-top-icon { transition: none !important; }
}
html[lang^="en"] body #mainHeader .dv-top-calltext::after { content: ":\00a0"; }
@media (min-width: 1024px) { html body #mainHeader[data-nav="f"] .header-content > div > .lang-toggle-desk { display: inline-flex !important; } }
@media (min-width: 1024px) and (max-width: 1179px) { html body #mainHeader[data-nav] .header-content { gap: 12px; } html body #mainHeader[data-nav="f"] .header-content > div > .lang-toggle-desk .lang-toggle-opt { padding: 0 9px !important; min-width: 0 !important; } }
@media (min-width: 1024px) and (max-width: 1179px) { html body #mainHeader[data-nav] .nav-links { gap: 14px !important; } }
@media (max-width: 1023px) { html body:not(#dvf) #mainHeader#mainHeader[data-nav="f"] .header-content > div > .lang-toggle-desk { display: inline-flex !important; margin-right: 10px; } html body #mainHeader[data-nav="f"] .header-content > div > .lang-toggle-desk .lang-toggle-opt { padding: 0 9px !important; min-width: 0 !important; } }
/* Phone header: the switch reads on the white bar, black and white like the top bar. */
@media (max-width: 1023px) {
  html body:not(#dvf) #mainHeader#mainHeader[data-nav="f"] .header-content > div > .lang-toggle-desk { background: #fff !important; border: 1.5px solid #000 !important; box-shadow: none !important; padding: 2px !important; border-radius: 999px; }
  html body:not(#dvf) #mainHeader#mainHeader[data-nav="f"] .header-content > div > .lang-toggle-desk .lang-toggle-opt { color: #000 !important; background: transparent !important; font-weight: 800 !important; height: 26px; display: inline-flex; align-items: center; border-radius: 999px; }
  html body:not(#dvf) #mainHeader#mainHeader[data-nav="f"] .header-content > div > .lang-toggle-desk .lang-toggle-opt.lang-toggle-active { color: #fff !important; background: #000 !important; }
}
/* Phone: nothing under 14px (phone-all). */
@media (max-width: 1023px) {
  html body #mainHeader .dv-top-phone { font-size: 0.875rem !important; }
  html body:not(#dvf) #mainHeader#mainHeader[data-nav="f"] .header-content > div > .lang-toggle-desk .lang-toggle-opt { font-size: 0.875rem !important; }
}
