/* =========================================================
   HEADER.CSS — STYLE "PHOTO / JOURNAL" (isolé MH)
   - ultra clean mobile-first
   - zéro interférence (tout préfixé .mh-)
   - menu burger + nav drawer sur mobile
   - fond animé "grille / carrés" discret
   ========================================================= */

/* ---------- Tokens ---------- */
:root{
  --mh-bg:#f6f3ea;
  --mh-bg2:#fbf8f1;
  --mh-ink:#121212;
  --mh-muted:#5a5a5a;

  --mh-rule:#1c1c1c;
  --mh-rule-soft: rgba(0,0,0,.18);

  --mh-card:#fffdf7;
  --mh-card2:#fffaf0;

  --mh-radius:16px;
  --mh-radius2:22px;

  --mh-shadow: 0 16px 40px rgba(0,0,0,.08);
  --mh-shadow2: 0 10px 24px rgba(0,0,0,.06);

  --mh-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --mh-serif: ui-serif, Georgia, "Times New Roman", Times, serif;
  --mh-sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;

  --mh-container: 1100px;
}

/* ---------- Base safe (MH only) ---------- */
.mh{ color:var(--mh-ink); background: var(--mh-bg); }
.mh *{ box-sizing:border-box; }
.mh img{ max-width:100%; display:block; }
.mh a{ color:inherit; text-decoration:none; }

/* container du header (pas ton .container global) */
.mh-header__container{
  max-width: var(--mh-container);
  margin: 0 auto;
  padding: 14px 16px;
}

/* ---------- Background animé (derrière header) ---------- */
.mh-header{
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(180deg, rgba(246,243,234,.96), rgba(251,248,241,.88));
  border-bottom: 2px solid var(--mh-rule);
  backdrop-filter: blur(10px);
}

/* grille */
.mh-header::before{
  content:"";
  position:absolute;
  inset:-60px;
  pointer-events:none;
  opacity:.14;
  z-index:0;

  background:
    linear-gradient(to right, rgba(0,0,0,.18) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0,0,0,.18) 1px, transparent 1px);
  background-size: 48px 48px, 48px 48px;

  animation: mhGrid 14s linear infinite;
}

/* blocs */
.mh-header::after{
  content:"";
  position:absolute;
  inset:-90px;
  pointer-events:none;
  opacity:.08;
  z-index:0;

  background:
    repeating-linear-gradient(90deg, rgba(0,0,0,.18) 0 2px, transparent 2px 32px),
    repeating-linear-gradient(0deg,  rgba(0,0,0,.16) 0 2px, transparent 2px 36px);
  background-size: 240px 240px, 300px 300px;

  animation: mhBlocks 10s linear infinite;
}

@keyframes mhGrid{
  from{ background-position: 0 0, 0 0; }
  to  { background-position: 160px 160px, 160px 160px; }
}
@keyframes mhBlocks{
  from{ background-position: 0 0, 0 0; }
  to  { background-position: -240px 240px, 300px -300px; }
}
@media (prefers-reduced-motion: reduce){
  .mh-header::before,.mh-header::after{ animation:none !important; }
}

/* ---------- Layout header ---------- */
.mh-header__container{
  position: relative;
  z-index: 1; /* au-dessus du fond animé */
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
}

/* ---------- Brand ---------- */
.mh-brand{
  display:flex;
  align-items:center;
  gap: 10px;
  min-width: 0;
  padding: 10px 12px;
  border: 2px solid var(--mh-rule);
  border-radius: 999px;
  background: rgba(255,255,255,.65);
  box-shadow: var(--mh-shadow2);
}

.mh-brand__dot{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--mh-rule);
  flex: 0 0 auto;
  box-shadow: 0 0 0 3px rgba(0,0,0,.08);
}

.mh-brand__text{
  font: 900 14px/1 var(--mh-serif);
  letter-spacing: .2px;
  white-space: nowrap;
}

.mh-brand__tag{
  font: 800 11px/1 var(--mh-mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--mh-muted);
  white-space: nowrap;
  overflow:hidden;
  text-overflow: ellipsis;
  max-width: 42vw;
}

/* ---------- Nav (desktop) ---------- */
.mh-nav{
  display:flex;
  align-items:center;
  gap: 10px;
}

.mh-nav__link{
  font: 900 12px/1 var(--mh-mono);
  letter-spacing: .18em;
  text-transform: uppercase;

  padding: 11px 12px;
  border-radius: 999px;
  border: 2px solid var(--mh-rule);
  background: rgba(255,255,255,.55);
  box-shadow: var(--mh-shadow2);

  transition: transform .12s ease, background .2s ease, box-shadow .25s ease;
}

.mh-nav__link:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,.86);
  box-shadow: 0 14px 30px rgba(0,0,0,.10);
}

.mh-nav__link:active{ transform: translateY(0); }

/* état actif (si tu veux plus tard : ajouter class "is-active" côté PHP) */
.mh-nav__link.is-active{
  background: rgba(0,0,0,.92);
  color:#fff;
}

/* ---------- Burger ---------- */
.mh-burger{
  display:none;
  width: 46px;
  height: 42px;
  border-radius: 14px;
  border: 2px solid var(--mh-rule);
  background: rgba(255,255,255,.65);
  box-shadow: var(--mh-shadow2);
  cursor:pointer;
  padding: 0;
  align-items:center;
  justify-content:center;
  gap: 5px;
  transition: transform .12s ease, background .2s ease;
}
.mh-burger:hover{ transform: translateY(-1px); background: rgba(255,255,255,.88); }
.mh-burger:active{ transform: translateY(0); }

.mh-burger span{
  display:block;
  width: 18px;
  height: 2px;
  background: var(--mh-rule);
  border-radius: 999px;
}

/* ---------- Mobile nav drawer ---------- */
@media (max-width: 900px){
  .mh-burger{ display:flex; }

  .mh-nav{
    position: fixed;
    left: 12px;
    right: 12px;
    top: 70px;
    display: grid;
    gap: 10px;

    padding: 14px;
    border-radius: var(--mh-radius2);
    border: 2px solid var(--mh-rule);
    background: linear-gradient(180deg, rgba(255,255,255,.82), rgba(255,255,255,.62));
    box-shadow: var(--mh-shadow);

    transform: translateY(-10px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
  }

  /* ouverture */
  body.mh-nav-open .mh-nav{
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  /* overlay (clic dehors) */
  body.mh-nav-open::before{
    content:"";
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.18);
    backdrop-filter: blur(2px);
    z-index: 40;
  }
  .mh-header{ z-index: 50; }

  /* le header reste au-dessus de l’overlay */
  .mh-header__container{ z-index: 51; }

  /* brand tag plus court sur mobile */
  .mh-brand__tag{ max-width: 52vw; }
}

/* ---------- Main wrappers (compat) ---------- */
.mh-main{
  background: transparent;
}
.mh-container{
  max-width: var(--mh-container);
  margin: 0 auto;
  padding: 18px 16px;
}

/* ---------- Small polish ---------- */
@media (max-width: 420px){
  .mh-brand{ gap:8px; padding: 9px 10px; }
  .mh-brand__text{ font-size: 13px; }
  .mh-brand__tag{ font-size: 10px; letter-spacing:.14em; }
}

/* print: clean */
@media print{
  .mh-header{ position: static; }
  .mh-header::before,.mh-header::after{ display:none !important; }
  body.mh-nav-open::before{ display:none !important; }
}


@media (max-width: 1024px){
  /* Global: bloque le scroll horizontal (gauche/droite) */
  html, body{
    width: 95%;
    max-width: 100%;
    overflow-x: hidden;
  }
}

@media (min-width: 1025px){
  html, body{
    width: 100%;
    max-width: none;
    overflow-x: visible;
  }
}

/* évite les décalages chelous */
.mh{
  overflow-x: clip; /* mieux que hidden si supporté */
}

/* fallback si clip pas supporté */
@supports not (overflow: clip){
  .mh{ overflow-x: hidden; }
}





/* iPhone/Safari: évite le “site shrink” + bugs de viewport */
@supports (-webkit-touch-callout: none){
  html{ -webkit-text-size-adjust:100%; }
  body{ width:100%; min-width:0; }
  .mh, .mh-main, .mh-container{ width:100%; min-width:0; }
}

/* mobile only: empêche qu’un truc force une largeur “desktop” */
@media (max-width: 980px){
  html, body{ overflow-x:hidden; }
  .mh{ overflow-x:hidden; }
  img, video, canvas, svg{ max-width:100%; height:auto; }
}




/* Chrome / Safari / Edge */
html::-webkit-scrollbar,
body::-webkit-scrollbar{
  width: 0;
  height: 0;
}

/* Firefox */
html, body{
  scrollbar-width: none;
}

/* IE/old Edge */
html, body{
  -ms-overflow-style: none;
}