/* ═══════════════════════════════════════════════════════════════════════
   nav.css — Navbar cataracte.fr
   Source unique de vérité pour tous les styles de navigation.

   Architecture desktop (≥ 901px) :
     .nav-inner [flex] → .nav-logo | .nav-burger (hidden) | .nav-right [flex:1]
     .nav-right → .nav-links [flex:1 centré] | lang-switcher | .btn-rdv-nav

   Architecture mobile (≤ 900px) :
     .nav-burger → toggle .nav-right.open (tiroir vertical absolu).
     .nav-cta-mobile = bouton Doctolib dans le tiroir.
     Dr Gozlan affiché dans la liste (pas en bouton séparé).

   Spécificité : sélecteurs #site-header .xxx (1,1,0) battent main.css
   (.xxx = 0,1,0) sans !important dans la majorité des cas.
   Exception : un seul !important nécessaire (font-weight Dr Gozlan mobile,
   pour neutraliser main.css qui a font-weight:700!important).
   ═══════════════════════════════════════════════════════════════════════ */


/* ── Variables locales nav ─────────────────────────────────────────────── */
:root {
  /* --font défini par la micro-<style> PHP dans nav.php (valeur langue-dépendante).
     --font-latin est fixe (Roboto pour les fragments latins dans pages RTL). */
  --nav-font-latin: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
  --nav-h:          80px;    /* hauteur du header — lue par main.js */
}

/* Hébreu : taille de base +7% (équivalent de he-rtl.css sur DG/RET) */
html[lang="he"] { font-size: 107%; }

/* Fragments latins dans pages RTL (AR/HE) → retomber sur Roboto */
bdi, [lang="fr"], [lang="en"] { font-family: var(--nav-font-latin); }


/* ══════════════════════════════════════════════════════════════════════════
   HEADER STICKY
   ══════════════════════════════════════════════════════════════════════════ */
#site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 1px 8px rgba(0,0,0,0.06);
  width: 100%;
  padding-top: env(safe-area-inset-top, 0px);
}


/* ══════════════════════════════════════════════════════════════════════════
   NAV-INNER — conteneur flex principal
   ══════════════════════════════════════════════════════════════════════════ */
#site-header .nav-inner {
  max-width: 100%;
  padding: 0 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-h);
}


/* ══════════════════════════════════════════════════════════════════════════
   LOGO
   ══════════════════════════════════════════════════════════════════════════ */
#site-header .nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  color: #003366;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -.035em;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.2;
}
#site-header .nav-logo img {
  height: 55px;
  width: auto;
  display: block;
  flex-shrink: 0;
}
#site-header .nav-logo-wordmark,
#site-header .nav-logo-base,
#site-header .nav-logo-wordmark > span { font-family: var(--nav-font-latin); }

#site-header .nav-logo-base {
  color: #003366;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -.035em;
}
#site-header .nav-logo-wordmark > span:last-child {
  color: #007ACC;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -.035em;
}
#site-header .nav-logo:hover { opacity: .88; text-decoration: none; }

/* Hébreu : compense l'agrandissement global de 107% */
html[lang="he"] #site-header .nav-logo-base,
html[lang="he"] #site-header .nav-logo-wordmark > span { font-size: 1.12rem; }


/* ══════════════════════════════════════════════════════════════════════════
   HAMBURGER
   ══════════════════════════════════════════════════════════════════════════ */
#site-header .nav-burger {
  display: none;                    /* masqué sur desktop */
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: .5rem;
  border-radius: 4px;
  transition: background .2s;
  flex-shrink: 0;
}
#site-header .nav-burger:hover { background: rgba(0,51,102,.08); }
#site-header .nav-burger span  { display: block; width: 22px; height: 2px; background: #003366; border-radius: 2px; transition: transform .3s, opacity .3s; }
#site-header .nav-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
#site-header .nav-burger.open span:nth-child(2) { opacity: 0; }
#site-header .nav-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }


/* ══════════════════════════════════════════════════════════════════════════
   NAV-RIGHT — conteneur des liens + langue + RDV
   Desktop : flex normal enfant de .nav-inner
   Mobile  : tiroir absolu (display:none → .open → display:flex)
   ══════════════════════════════════════════════════════════════════════════ */
#site-header .nav-right {
  display: flex;
  align-items: center;
  gap: 0;
}


/* ══════════════════════════════════════════════════════════════════════════
   LISTE DE LIENS
   ══════════════════════════════════════════════════════════════════════════ */
#site-header .nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}
#site-header .nav-links a {
  position: relative;
  color: #333;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: color .2s;
}
/* Sous-label sur 2 lignes (ex : "Avant / l'opération") */
#site-header .nav-links a.nav-link-two-lines {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.08;
  min-height: 34px;
}
#site-header .nav-links a .nav-link-sub {
  display: block;
  margin-top: 1px;
  line-height: 1.08;
  font-family: var(--font, var(--nav-font-latin));
  font-size: 0.9rem;
  font-weight: 400;
  letter-spacing: normal;
}
/* Soulignement animé */
#site-header .nav-links a::after {
  content: '';
  position: absolute;
  bottom: 2px; left: 50%; right: 50%;
  height: 2px;
  background: #007ACC;
  border-radius: 2px;
  transition: left .25s cubic-bezier(.4,0,.2,1), right .25s cubic-bezier(.4,0,.2,1);
}
#site-header .nav-links a:hover,
#site-header .nav-links a.active          { color: #007ACC; }
#site-header .nav-links a:hover::after,
#site-header .nav-links a.active::after   { left: 8px; right: 8px; }

/* Séparateur vertical (avant Dr Gozlan) */
#site-header .nav-links li.nav-divider {
  width: 2px; height: 20px;
  background: #007ACC;
  margin: 0 10px; padding: 0;
  flex: 0 0 2px;
  align-self: center;
  flex-shrink: 0;
}
#site-header .nav-links li.nav-divider::before { display: none; }

/* Dr Gozlan : en gras sur desktop */
#site-header .nav-links li.nav-divider + li > a { font-weight: 700; }

/* Boutons exclusifs au mobile : masqués sur desktop */
#site-header .nav-doctor-mobile { display: none; }
#site-header .nav-cta-mobile    { display: none; }
#site-header .nav-rdv-mobile     { display: none; }


/* ══════════════════════════════════════════════════════════════════════════
   SÉLECTEUR DE LANGUE
   ══════════════════════════════════════════════════════════════════════════ */
#site-header .lang-switcher { position: relative; display: inline-flex; align-items: center; }

#site-header .lang-switcher-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: 1.5px solid rgba(0,51,102,.22);
  border-radius: 20px;
  padding: 5px 10px 5px 7px;
  cursor: pointer;
  font-family: var(--nav-font-latin); /* pill: toujours latin */
  color: #003366;
  direction: ltr;
  white-space: nowrap;
  transition: border-color .2s, background .2s;
}
#site-header .lang-switcher-btn:hover,
#site-header .lang-switcher-btn.open { border-color: #007ACC; background: #f0f7ff; }
#site-header .lang-switcher-btn::after { display: none; }  /* annule ::after de .nav-links a si hérité */

#site-header .ls-flag    { width: 20px; height: 15px; border-radius: 2px; object-fit: cover; flex-shrink: 0; }
#site-header .ls-code    { font-size: .7rem; font-weight: 700; letter-spacing: .09em; color: #003366; }
#site-header .ls-chevron { width: 10px; height: 10px; display: block; flex-shrink: 0; color: #003366; transition: transform .2s; }
#site-header .lang-switcher-btn.open .ls-chevron { transform: rotate(180deg); }

#site-header .lang-dropdown {
  position: absolute;
  top: calc(100% + 6px); right: 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-top: 3px solid #007ACC;
  border-radius: 8px;
  box-shadow: 0 12px 36px rgba(0,51,102,.13);
  min-width: 170px;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  pointer-events: none;
  z-index: 9999;
  transition: opacity .15s, transform .15s;
}
#site-header .lang-dropdown.open {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0) scale(1);
}

#site-header .lang-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  text-decoration: none;
  color: #334155;
  font-size: .82rem;
  font-family: var(--font, var(--nav-font-latin));
  border-bottom: 1px solid #f1f5f9;
  transition: background .12s;
  cursor: pointer;
  direction: ltr;
}
#site-header .lang-option:last-child { border-bottom: none; }
#site-header .lang-option:hover      { background: #f0f7ff; color: #003366; }
#site-header .lang-option.active     { background: #e8f4fd; color: #003366; font-weight: 700; pointer-events: none; }
#site-header .lang-option.lang-inactive { opacity: .55; cursor: not-allowed; pointer-events: none; }
#site-header .lo-flag  { width: 22px; height: 16px; border-radius: 2px; object-fit: cover; flex-shrink: 0; }
#site-header .lo-name  { flex: 1; }
#site-header .lo-check { width: 12px; height: 12px; color: #007ACC; display: none; }
#site-header .lang-option.active .lo-check { display: block; }
#site-header .lo-soon  { font-size: .65rem; font-weight: 600; color: #9CA3AF; background: #f3f4f6; border-radius: 4px; padding: 1px 5px; white-space: nowrap; }

/* Sélecteur langue dans le tiroir mobile : visible par défaut (flex) */
#site-header .lang-mobile-row { display: flex; justify-content: center; padding: 8px 0; }


/* ══════════════════════════════════════════════════════════════════════════
   BOUTON RDV DOCTOLIB (desktop uniquement)
   ══════════════════════════════════════════════════════════════════════════ */
/* ── Bouton RDV Doctolib (desktop) ── */
.btn-rdv-nav {
  display: inline-flex; align-items: center; gap: 0;
  background: #007ACC; color: #fff; border: none;
  padding: 0 14px 0 8px; height: 40px; border-radius: 50px;
  cursor: pointer; font-family: var(--font, "Roboto", sans-serif);
  white-space: nowrap; flex-shrink: 0; text-decoration: none;
  position: relative; overflow: hidden;
  box-shadow: 0 2px 0 rgba(255,255,255,0.15) inset, 0 -1px 0 rgba(0,0,0,0.10) inset, 0 4px 14px rgba(0,122,204,0.42), 0 2px 6px rgba(0,0,0,0.12);
  animation: rdv-pulse 3.2s ease-in-out infinite;
  transition: background .2s, transform .18s, box-shadow .18s;
}
.btn-rdv-nav::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 50%;
  background: linear-gradient(to bottom, rgba(255,255,255,0.13) 0%, transparent 100%);
  border-radius: 50px 50px 0 0; pointer-events: none;
}
@keyframes rdv-pulse {
  0%,100% { box-shadow: 0 2px 0 rgba(255,255,255,0.15) inset, 0 -1px 0 rgba(0,0,0,0.10) inset, 0 4px 14px rgba(0,122,204,0.42), 0 2px 6px rgba(0,0,0,0.12); }
  50%     { box-shadow: 0 2px 0 rgba(255,255,255,0.15) inset, 0 -1px 0 rgba(0,0,0,0.10) inset, 0 8px 28px rgba(0,122,204,0.65), 0 2px 6px rgba(0,0,0,0.12); }
}
.btn-rdv-nav:hover { background: #005FA3; transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,122,204,0.52); animation: none; }
.btn-rdv-nav:active { transform: translateY(0) scale(0.98); }
.brn-icon  { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: #fff; position: relative; z-index: 2; }
.brn-sep   { width: 1px; height: 20px; background: rgba(255,255,255,0.6); margin-left: 8px; flex-shrink: 0; position: relative; z-index: 2; }
.brn-label { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 10px; gap: 1px; text-align: center; position: relative; z-index: 2; }
.brn-pre   { font-size: 1.05rem; font-weight: 800; color: #fff; line-height: 1.25; letter-spacing: 0.03em; text-transform: uppercase; white-space: nowrap; }
.btn-rdv-nav:hover .brn-sep { background: rgba(255,255,255,0.3); }
[dir="rtl"] .brn-sep   { margin-left: 0; margin-right: 8px; }
[dir="rtl"] .brn-label { padding: 0 10px; align-items: center; }


/* ══════════════════════════════════════════════════════════════════════════
   DESKTOP ≥ 901px — layout principal
   ══════════════════════════════════════════════════════════════════════════ */
@media (min-width: 901px) {

  /* display:contents → nav-links et nav-right deviennent
     enfants directs de .nav-inner (flex). */
  #site-header .nav-drawer { display: contents; }

  /* Conteneur : gap uniforme entre logo, liens et pilule+RDV */
  #site-header .nav-inner { gap: 16px; }

  /* Logo : fixe à gauche.
     margin-right:0 !important écrase margin-right:auto de main.css */
  #site-header .nav-logo {
    flex-shrink: 0 !important;
    flex-grow:   0 !important;
    margin-right: 0 !important;
  }

  /* Liens : prennent TOUT l'espace libre, centrés. */
  #site-header .nav-links {
    flex: 1 1 0% !important;
    justify-content: center;
    padding: 0;
    column-gap: 4px;
    row-gap:    4px;
    margin-left:  32px !important;
    margin-right: 32px !important;
  }

  /* Nav-right : compact (pilule + RDV), collé au bord droit. */
  #site-header .nav-right {
    flex-shrink: 0 !important;
    flex-grow:   0 !important;
    margin-left: 0 !important;
    gap: 12px;
    align-items: center;
  }

  /* Sélecteur de langue */
  #site-header .lang-mobile-row {
    display: flex;
    flex-shrink: 0;
    padding: 0;
    border-bottom: 0;
    margin: 0;
  }

  /* ES + PT : liens longs → distribution équitable */
  html[lang="es"] #site-header .nav-links,
  html[lang="pt"] #site-header .nav-links,
  html[lang="pt-PT"] #site-header .nav-links { justify-content: space-evenly; gap: 0; }
  html[lang="es"] #site-header .nav-links a,
  html[lang="pt"] #site-header .nav-links a,
  html[lang="pt-PT"] #site-header .nav-links a { padding: 6px 10px; }
}

/* ── RTL desktop ─────────────────────────────────────────────────── */
@media (min-width: 901px) {
  [dir="rtl"] #site-header .nav-logo   { order: 1; margin-right: 0 !important; margin-left: 0; }
  [dir="rtl"] #site-header .nav-burger { order: 2; }
  [dir="rtl"] #site-header .nav-links  { order: 3; margin-left: 32px !important; margin-right: 32px !important; }
  [dir="rtl"] #site-header .nav-right  { order: 4; }

  [dir="rtl"] #site-header .nav-links,
  html[lang="zh"] #site-header .nav-links  { justify-content: space-evenly; gap: 0; }
  [dir="rtl"] #site-header .nav-links a,
  html[lang="zh"] #site-header .nav-links a { padding: 6px 10px; }
}


/* ══════════════════════════════════════════════════════════════════════════
   MOBILE ≤ 900px — tiroir vertical
   ══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {

  /* ── Header réduit ── */
  #site-header .nav-inner { padding: 0 16px; }

  /* ── RTL mobile : annule le margin-right:auto de main.css sur le logo ── */
  [dir="rtl"] #site-header .nav-logo { margin-right: 0; }
  [dir="rtl"] #site-header .nav-drawer { right: auto; left: 0; }

  /* ── Logo adapté ── */
  #site-header .nav-logo img { height: 42px; }

  /* ── Hamburger visible ── */
  #site-header .nav-burger { display: flex; }

  /* ── Tiroir : caché / ouvert ── */
  #site-header .nav-drawer {
    display: none;
    position: absolute;
    top: var(--nav-h); left: 0; right: 0;
    background: #fff;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 16px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    border-bottom: 1px solid #e8e8e8;
    border-radius: 0;
    z-index: 999;
    overflow-y: auto;
    max-height: calc(100vh - var(--nav-h));
  }
  #site-header .nav-drawer.open { display: flex; }

  /* Ordre dans le tiroir : liens / nav-right (pilule) / bouton RDV mobile */
  #site-header .nav-drawer > .nav-right { order: 2; }
  #site-header .nav-rdv-mobile           { order: 3; }

  /* Nav-right : sélecteur langue centré dans le tiroir */
  #site-header .nav-drawer > .nav-right {
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 8px;
  }

  /* ── Liste de liens ── */
  #site-header .nav-links {
    position: static;
    flex-direction: column;
    align-items: stretch;
    flex: 0 0 auto;
    width: 100%;
    padding: 0;
    gap: 0;
    background: transparent;
    clip-path: none;
    transition: none;
    box-shadow: none;
    border-top: 0;
    border-radius: 0;
  }
  #site-header .nav-links li + li:not(.nav-divider) { border-top: none; }
  #site-header .nav-links li.nav-divider            { display: none; }

  /* Dr Gozlan : affiché dans la liste (pas en bouton séparé) */
  #site-header .nav-links li.nav-doctor-item { display: list-item; }
  /* Même poids que les autres liens sur mobile */
  #site-header .nav-links li.nav-divider + li > a   { font-weight: 400 !important; }   /* override main.css 700!important */

  #site-header .nav-links a {
    display: block;
    text-align: center;
    padding: 14px 16px;
    font-size: 0.82rem;
    font-weight: 400;
    letter-spacing: normal;
  }
  #site-header .nav-links a::after { display: none; }

  /* Liens sur 2 lignes → fusionnés en 1 ligne sur mobile */
  #site-header .nav-links a.nav-link-two-lines {
    display: block;
    text-align: center;
    min-height: auto;
    line-height: 1.38;
  }
  #site-header .nav-links a .nav-link-sub {
    display: inline;
    margin-top: 0;
    margin-left: .3em;
  }

  /* Dr Gozlan : marge supérieure pour séparer visuellement du reste */
  #site-header .nav-links li:last-child { margin-top: 12px; }

  /* Bouton Dr Gozlan séparé → masqué (item dans la liste suffit) */
  #site-header .nav-doctor-mobile { display: none; }

  /* ── Bouton Doctolib mobile ── */
  /* Ordre dans le tiroir : liens (défaut), lang (order:2), Doctolib (order:3) */
  /* Bouton RDV mobile */
  #site-header .nav-rdv-mobile {
    display: flex;
    align-self: stretch;
    justify-content: center;
    align-items: center;
    gap: 6px;
    width: 100%;
    box-sizing: border-box;
    margin: 8px auto 4px;
    padding: 8px 16px;
    background: #007ACC;
    color: #fff;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    box-shadow: 0 2px 8px rgba(0,51,102,0.2);
    text-decoration: none;
    white-space: nowrap;
  }
  #site-header .nav-rdv-mobile:hover { background: #005FA3; }

  /* Bouton RDV desktop → masqué */
  #site-header .btn-rdv-nav { display: none; }

  /* ── Sélecteur de langue mobile ── */
  #site-header .nav-drawer.open .lang-mobile-row {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 14px 0 10px;
    margin-top: 2px;
  }
  #site-header .lang-switcher {
    display: flex;
    justify-content: center;
    align-items: center;
    width: fit-content;
    margin: 0 auto;
    padding: 0;
  }
  #site-header .lang-switcher-btn {
    min-height: 38px;
    padding: 6px 11px 6px 8px;
    background: rgba(255,255,255,.92);
    box-shadow: none;
  }

  /* Dropdown langue : s'ouvre vers le haut, centré horizontalement */
  #site-header .lang-dropdown {
    bottom: calc(100% + 8px);
    top: auto;
    left: 50%; right: auto;
    transform: translateX(-50%) translateY(6px) scale(0.98);
  }
  #site-header .lang-dropdown.open {
    transform: translateX(-50%) translateY(0) scale(1);
  }
}


/* ══════════════════════════════════════════════════════════════════════════
   FAB "Prendre RDV" — bouton flottant toutes pages
   (défini ici car généré par nav.php)
   ══════════════════════════════════════════════════════════════════════════ */
#fab-rdv {
  position: fixed;
  bottom: 28px; right: 28px;
  z-index: 8888;
  display: inline-flex;
  align-items: center;
  background: #00B4D8;
  color: #fff;
  border-radius: 50px;
  padding: .75rem 1.75rem;
  font-family: var(--font-display, var(--nav-font-latin));
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: -.01em;
  white-space: nowrap;
  text-decoration: none;
  box-shadow: 0 4px 18px rgba(0,180,216,0.40);
  transition: background .18s, transform .15s, box-shadow .18s, opacity .22s;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
}
#fab-rdv.fab-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  animation: fabPulse 3.4s ease-in-out infinite;
}
#fab-rdv:hover {
  background: #3bbcda;
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0,180,216,0.55);
  animation: none;
}
#fab-rdv:active { transform: translateY(0) scale(0.97); }
@keyframes fabPulse {
  0%,100% { box-shadow: 0 4px 18px rgba(0,180,216,0.40); }
  50%      { box-shadow: 0 6px 26px rgba(0,180,216,0.62); }
}
@media (max-width: 600px) {
  #fab-rdv { font-size: .9rem; padding: .7rem 1.4rem; }
}


/* ══════════════════════════════════════════════════════════════════════════
   BYLINE PHOTO (définie ici car nav.php génère tout le <head>)
   ══════════════════════════════════════════════════════════════════════════ */
.page-byline  { display: flex; align-items: center; gap: .45rem; }
.byline-photo { display: inline-block; width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 1.5px solid #d6e4f0; }
.byline-text  { display: flex; align-items: baseline; gap: .35rem; flex-wrap: nowrap; }
.byline-main  { line-height: 1.45; }
.byline-date  { color: #6B7280; font-size: .82rem; white-space: nowrap; }
@media (max-width: 640px) {
  .page-byline         { margin-top: 1.25rem; align-items: flex-start; }
  .author-bar-wrap .page-byline { margin-top: .5rem; }
  .byline-text         { flex-direction: column; align-items: flex-start; gap: .18rem; }
  .byline-main         { font-size: .77rem; line-height: 1.45; }
  .byline-date         { font-size: .74rem; color: #6B7280; }
}
