/* ════════════════════════════════════════════════════════════
   POUSSIÈRE D'OUEST — Header CSS (fichier dédié)
   ════════════════════════════════════════════════════════════

   CSS COMMUN À TOUTES LES PAGES DU SITE.

   Ce fichier contient les styles pour :
     1. La barre éditoriale (.wco-topbar)
     2. Le header principal (.site-header)
     3. La navigation (.site-header__nav)
     4. Le menu auth (.nav-auth-*)
     5. Le bouton mobile (.nav-toggle)

   Le HTML correspondant est dans :
     template-parts/site-header.php

   Toute modification ici se répercute automatiquement
   sur l'ensemble des pages du site.

════════════════════════════════════════════════════════════ */

/* ══════════════════════════════════════════════════════════
   HEADER & TOPBAR — SOURCE UNIQUE
   Toute modification ici se répercute sur TOUTES les pages.
   La seule exception : .home .site-header (position absolute
   pour overlay sur la photo hero).
══════════════════════════════════════════════════════════ */

/* ─── Barre éditoriale ─── */
.wco-topbar {
  position: relative;
  z-index: 510;  /* toujours au-dessus du header sticky (500) */
  background: var(--wco-dusk);
  padding: 0.4rem 3rem;
  border-bottom: 1px solid rgba(192,133,42,0.25);
}
.wco-topbar__inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.58rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.wco-topbar__left  { color: var(--wco-muted); }
.wco-topbar__right { color: var(--wco-sand); display: flex; align-items: center; gap: 0.75em; }
.wco-topbar__sep   { color: var(--wco-rust); }
.wco-topbar__km    { color: var(--wco-gold); }

/* ─── Header navigation ─── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 500;
  background: var(--wco-dusk);
  border-bottom: 1px solid rgba(192,133,42,0.2);
  box-shadow: 0 2px 16px rgba(20,10,4,0.25);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 0.35rem 3rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* Logo image */
.site-header__logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  line-height: 1;
  text-decoration: none;
}
.site-header__logo--text {
  font-family: var(--wco-font-display);
  font-style: italic;
  font-size: 1.5rem;
  color: var(--wco-cream);
  letter-spacing: 0.01em;
  white-space: nowrap;
  text-decoration: none;
}
.site-header__logo-text { white-space: nowrap; }
.site-header__logo .logo-accent { color: var(--wco-rust); }
.site-header__logo .custom-logo-link { display: flex; align-items: center; line-height: 0; }
.site-header__logo .custom-logo,
.site-header__logo img.custom-logo {
  height: 100px !important;
  width: auto !important;
  max-height: 100px !important;
  max-width: none !important;
  object-fit: contain !important;
  display: block !important;
  transition: opacity 0.2s;
}
.site-header__logo:hover .custom-logo { opacity: 0.85; }
.wp-custom-logo .site-header__logo-text { display: none; }

/* Menu */
.site-header__nav { display: flex; align-items: center; gap: 0; }
.site-header__nav ul { list-style: none; display: flex; gap: 0; flex-wrap: wrap; align-items: center; }
.site-header__nav a {
  display: block;
  font-size: 0.63rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(237,224,203,0.65);
  padding: 0.5rem 1rem;
  border-radius: 2px;
  transition: color 0.2s;
  white-space: nowrap;
}
.site-header__nav a:hover,
.site-header__nav a:focus  { color: var(--wco-cream); }
.site-header__nav .current-menu-item a,
.site-header__nav .current_page_item a { color: var(--wco-gold); }

/* Liens auth : rester en ligne malgré la règle générale .site-header__nav a */
.site-header__nav .nav-auth-item { display: flex; align-items: center; gap: 0.15rem; }
.site-header__nav .nav-auth-link { display: inline-block; }

/* Bouton hamburger mobile */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--wco-cream); transition: all 0.25s; }

/* Auth nav */
.nav-auth-item {
  border-left: 1px solid rgba(212,168,67,0.15);
  margin-left: 0.4rem;
  padding-left: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.15rem;
}
.nav-auth-link {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.5rem 0.7rem;
  border-radius: 2px;
  white-space: nowrap;
  transition: color 0.2s, background 0.2s;
}
.nav-auth-sep {
  color: rgba(192,133,42,0.3);
  font-size: 0.7rem;
  user-select: none;
}
.nav-auth-link--compte { color: var(--wco-gold); }
.nav-auth-link--compte:hover { color: var(--wco-cream); background: rgba(212,168,67,0.1); }
.nav-auth-link--login { color: var(--wco-gold); }
.nav-auth-link--login:hover { color: var(--wco-cream); background: rgba(212,168,67,0.1); }
.nav-auth-link--logout { color: rgba(200,184,154,0.55); }
.nav-auth-link--logout:hover { color: var(--wco-rust); background: rgba(193,68,14,0.08); }

/* ─── Home uniquement : header en overlay sur le hero (desktop) ─── */
.home .site-header {
  position: absolute;
  top: 28px;   /* hauteur de la topbar sur desktop */
  left: 0; right: 0;
  z-index: 200;
  /* background, border, box-shadow hérités du .site-header de base */
}
/* Admin bar WordPress (desktop) : décale l'overlay de la hauteur de la barre */
body.admin-bar.home .site-header { top: calc(28px + 32px); }

/* Header collé en haut au scroll (home uniquement) — activé par JS */
.home .site-header.is-stuck {
  position: fixed;
  top: 0;
  left: 0; right: 0;
  z-index: 500;
  animation: wco-slide-down 0.3s ease;
  box-shadow: 0 2px 20px rgba(20,10,4,0.35);
}
body.admin-bar .home .site-header.is-stuck,
body.admin-bar.home .site-header.is-stuck { top: 32px; }

@keyframes wco-slide-down {
  from { transform: translateY(-100%); }
  to   { transform: translateY(0); }
}

/* ─── Mobile ─── */
@media (max-width: 768px) {
  .wco-topbar { padding: 0.4rem 1.25rem; }

  /* Sur mobile, le header n'est PAS en overlay : il suit la topbar
     dans le flux normal. `relative` (et non `static`) pour que le menu
     déroulant `.is-open` (position:absolute; top:100%) se cale bien
     sous le header. */
  .home .site-header,
  .site-header {
    position: relative;
    top: auto;
  }
  body.admin-bar.home .site-header { top: auto; }

  .site-header__inner {
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .site-header__nav { display: none; }
  .site-header__nav.is-open {
    display: block;
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--wco-dusk);
    padding: 1rem 1.5rem 1.5rem;
    border-top: 1px solid rgba(192,133,42,0.2);
    z-index: 500;
  }
  .site-header__nav.is-open ul { flex-direction: column; }

  /* Burger toujours visible sur mobile */
  .nav-toggle {
    display: flex;
    position: relative;
    z-index: 501;
  }

  .nav-auth-item {
    border-left: none;
    border-top: 1px solid rgba(212,168,67,0.12);
    margin-left: 0; padding-left: 0;
    margin-top: 0.3rem; padding-top: 0.3rem;
  }
}

/* ══════════════════════════════════════════════════════════
   FIN HEADER & TOPBAR
══════════════════════════════════════════════════════════ */


/* ════════════════════════════════════════════════════════
   CUSTOMIZER — Focal point picker (cadrage photo héro)
════════════════════════════════════════════════════════ */
.wco-fp-wrap {
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  background: #1a1a1a;
  margin: 8px 0;
  cursor: crosshair;
  user-select: none;
}
.wco-fp-img {
  display: block;
  width: 100%;
  height: 180px;
  object-fit: cover;
  object-position: 50% 50%;
  pointer-events: none;
}
/* Overlay en pointillés simulant le ratio du hero (16:5 env.) */
.wco-fp-overlay {
  position: absolute;
  inset: 0;
  /* Zone visible = rectangle centré, légèrement plus petit pour montrer le débordement */
  box-shadow: inset 0 0 0 3px rgba(255,255,255,0.15);
}
.wco-fp-overlay::before {
  content: '';
  position: absolute;
  /* Rectangle représentant la zone affichée dans le hero */
  top: 10%;
  left: 5%;
  right: 5%;
  bottom: 10%;
  border: 2px dashed rgba(255, 220, 100, 0.85);
  border-radius: 2px;
  pointer-events: none;
}
.wco-fp-overlay::after {
  content: 'Zone affichée dans le hero';
  position: absolute;
  top: calc(10% + 4px);
  left: calc(5% + 6px);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: rgba(255, 220, 100, 0.9);
  text-transform: uppercase;
  font-family: -apple-system, sans-serif;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
  pointer-events: none;
}
/* Le point focal draggable */
.wco-fp-dot {
  position: absolute;
  width: 24px;
  height: 24px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 10;
}
.wco-fp-dot::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 0 2px rgba(0,0,0,0.4), 0 2px 8px rgba(0,0,0,0.5);
}
.wco-fp-dot::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #C1440E;
}
/* Axes crosshair */
.wco-fp-dot-h,
.wco-fp-dot-v {
  position: absolute;
  background: rgba(255,255,255,0.45);
  pointer-events: none;
  z-index: 9;
}
.wco-fp-dot-h { height: 1px; left: 0; right: 0; top: 50%; transform: translateY(-50%); }
.wco-fp-dot-v { width: 1px;  top: 0; bottom: 0; left: 50%; transform: translateX(-50%); }

/* Valeurs affichées */
.wco-fp-values {
  display: flex;
  gap: 8px;
  margin: 6px 0 4px;
  font-size: 11px;
  color: #646970;
  font-family: -apple-system, sans-serif;
}
.wco-fp-val-badge {
  background: #f0f0f1;
  border: 1px solid #dcdcde;
  border-radius: 3px;
  padding: 2px 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.wco-fp-val-badge strong { color: #1d2327; }

/* Sliders de précision */
.wco-fp-sliders { margin-top: 6px; }
.wco-fp-slider-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 11px;
  color: #646970;
  font-family: -apple-system, sans-serif;
}
.wco-fp-slider-row label { width: 16px; flex-shrink: 0; font-weight: 600; }
.wco-fp-slider-row input[type=range] {
  flex: 1;
  accent-color: #C1440E;
  height: 4px;
}
.wco-fp-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100px;
  color: rgba(255,255,255,0.4);
  font-size: 12px;
  font-family: -apple-system, sans-serif;
  flex-direction: column;
  gap: 6px;
}
.wco-fp-placeholder svg { opacity: 0.3; }
