/* =======================
   0) Variables / reset
======================= */
:root{
  --brand-green:#047303;

  /* Sidebar + calage */
  --sidebar-width:150px;      /* largeur réelle de ton menu */
  --sidebar-gap:10px;         /* marge entre menu et contenu */
  --top-gap:20px;             /* hauteur depuis le haut de la fenêtre */

  /* Header */
  --header-max:900px;         /* largeur max du titre en desktop */
}

*{margin:0;padding:0;box-sizing:border-box;}
html{scroll-behavior:smooth;}
body{
  background:var(--brand-green);
  font-family:Verdana,Arial,sans-serif;
  color:#000; line-height:1.5;
}

/* =======================
   1) Sidebar (desktop par défaut)
======================= */

.sidebar{
  position:fixed;
  top:var(--top-gap);
  left:var(--sidebar-gap);
  width:var(--sidebar-width);

  background:var(--brand-green);
  border:1px solid #000;
  border-radius:10px;
  padding:10px;

  display:flex; flex-direction:column;
  z-index:1000;

  /* scroll auto si besoin (iPad) */
  max-height: calc(100vh - var(--top-gap) - 20px);
  overflow-y:auto;
  -webkit-overflow-scrolling:touch;
}
.sidebar-links{ list-style:none; display:flex; flex-direction:column; gap:14px; }
.sidebar-links a{
  display:block; text-align:center; white-space:nowrap;
  padding:5px 6px; font-size:11px; font-weight:bold;
  color:#fff; text-decoration:none;
  background:var(--brand-green);
  border:1px solid #000; border-radius:5px;
  transition:background-color .25s, border-color .25s;
}
.sidebar-links a:hover{ background:#036503; border-color:#fff; }

/* Burger (caché desktop) */
.hamburger-btn{ display:none; }

/* =======================
   2) Mainbox — cadre commun
======================= */

.mainbox{
  /* alignement horizontal : même calcul que le footer */
  margin-left: calc(var(--sidebar-width) + var(--sidebar-gap) + 20px);
  margin-right: auto;

  /* alignement vertical avec la sidebar via la même variable */
  margin-top: var(--top-gap);
  margin-bottom: 40px;

  padding:20px;
  min-height:100vh;
  max-width: 1600px;

  background: var(--brand-green);
  border:1px solid #000;
  border-radius:10px;
  overflow:hidden;
}

/* =======================
   3) Header global
======================= */

.site-header{ padding:15px 0; text-align:center; background:transparent; }
.titre-container img{
  display:block; margin:0 auto; width:100%; height:auto; max-width:var(--header-max);
}

/* Trait noir sous le titre (inchangé) */
.trait-noir{
  width: 50%; height: 3px; background:#000;
  margin:10px auto 50px; border:0; border-radius:0;
  display:block;
}

/* =======================
   4) Footer global
======================= */

.site-footer {
  /* alignement horizontal identique à la mainbox */
  margin-left: calc(var(--sidebar-width) + var(--sidebar-gap) + 20px);
  margin-right: auto;

  /* alignement vertical */
  margin-top: 20px;     /* espace sous la mainbox */
  margin-bottom: 30px;  /* espace avant le bas de page */

  /* largeur calée sur la mainbox */
  max-width: 1600px;

  /* style visuel */
  background: var(--brand-green);
  border: 1px solid #000;
  border-radius: 10px;
  padding: 20px 30px 20px;
  color: #000;
  text-align: center;
  font-size: 0.95rem;
  box-sizing: border-box;

  /* reste toujours aligné même si la page s’agrandit */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* liens et bouton dans le footer */
.site-footer a {
  color: #000;
  text-decoration: none;
  font-weight: 600;
}
.site-footer a:hover {
  text-decoration: underline;
}

/* === Bouton "Haut de page" === */
.back-to-top {
  background: #BABAB7;
  color: #000;
  border: 1px solid #000;
  border-radius: 6px;
  padding: 10px 20px;
  font-weight: 700;
  margin: 10px auto 20px auto;
  cursor: pointer;
  transition: background 0.2s ease;
  position: relative;
  top: 12px;
  z-index: 10; /* reste au-dessus du footer */
}

.back-to-top:hover {
  background: #a0a09d;
}

/* =======================
   5) Responsive GLOBAL
   (fusionne l'ancien global-responsive : le mobile reste identique)
======================= */

/* Laptop 1025–1440 */
@media (max-width:1440px) and (min-width:1025px){
  .titre-container img{ max-width:850px; }
}

/* Tablette paysage 768–1024 */
@media (max-width:1024px) and (min-width:768px){
  .hamburger-btn{
    display:block; position:fixed; top:12px; left:12px; z-index:1200;
    background:#BABAB7; color:#000; border:1px solid #000; border-radius:8px;
    font-size:22px; padding:5px 10px; cursor:pointer;
  }
  .sidebar{
    top:0; left:-260px; width:260px; height:100vh;
    border-radius:0; transition:left .3s;
  }
  .sidebar.open{ left:0; }

  /* mainbox & footer prennent la pleine largeur avec petites marges */
  .mainbox, .site-footer{ margin:10px; }
  .titre-container img{ max-width:700px; }
}

/* Tablette portrait 481–767 */
@media (max-width:767px) and (min-width:481px){
  .hamburger-btn{ display:block; position:fixed; top:12px; left:12px; z-index:1200; }
  .sidebar{
    top:0; left:-240px; width:240px; height:100vh;
    border-radius:0; transition:left .3s;
  }
  .sidebar.open{ left:0; }

  .mainbox{ margin:10px; padding:10px; }
  .site-footer{ margin:10px; padding:10px; }
  .titre-container img{ max-width:520px; }
}

/* Smartphone ≤480 (tu as dit que c'était parfait : on garde) */
@media (max-width:480px){
  .hamburger-btn{ display:block; position:fixed; top:12px; left:12px; z-index:1200; }
  .sidebar{
    top:0; left:-220px; width:220px; height:100vh;
    border-radius:0; transition:left .3s;
  }
  .sidebar.open{ left:0; }

  .mainbox{ width:auto; margin:10px 8px 0 10px; padding:8px; }
  .site-footer{ margin:10px 8px 20px 10px; }

  .titre-container img{ max-width:450px; }
}

/* Smartphone paysage optionnel */
@media (max-width:700px) and (orientation:landscape){
  .titre-container img{ max-width:340px; }
}

/* =========================================
   HEADER GLOBAL — commun à tout le site
   (image du titre + trait noir)
   ========================================= */

/* --- Taille du titre commune --- */
:root {
  --header-max: 900px; /* Taille identique sur toutes les pages */
}

/* --- Bloc header (centré, sans fond) --- */
.mainbox .site-header {
  padding: 15px 0;
  text-align: center;
  background: transparent;
}

/* --- Conteneur du titre --- */
.mainbox .site-header .titre-container {
  max-width: var(--header-max);
  width: 100%;
  margin: 0 auto;
}

/* --- Image du titre --- */
.mainbox .site-header .titre-container img {
  display: block;
  width: 100% !important;      /* s’adapte à la largeur du conteneur */
  height: auto !important;     /* garde les proportions */
  max-width: 100% !important;  /* empêche tout autre override */
  margin: 0 auto;
}

/* --- Trait noir sous le titre --- */
.trait-noir {
  width: 50%;
  height: 3px;
  background: #000;
  margin: 10px auto 50px; /* centrage + espacement */
  border: none;
  border-radius: 0;
  display: block;
}

/* --- Ajustement responsive (optionnel) --- */
@media (max-width: 700px) {
  .trait-noir {
    width: 70%; /* un peu plus large sur petits écrans */
  }


/* ===== BURGER — base ===== */

.hamburger-btn{
  position: fixed;
  top: 12px; left: 12px;
  z-index: 2000; /* au-dessus du menu */
  background:#BABAB7; color:#000;
  border:1px solid #000; border-radius:8px;
  font-size: 22px; padding:8px 12px; cursor:pointer;
}

/* Desktop : burger masqué, sidebar visible fixe */
@media (min-width:1025px){
  .hamburger-btn{ display:none !important; }
  .sidebar{
    position: fixed;
    top: var(--top-gap,20px);
    left: var(--sidebar-gap,10px);
    width: var(--sidebar-width,150px);
    max-height: calc(100vh - var(--top-gap,20px) - 20px);
    overflow-y: auto;
    z-index: 1500;
    transform: none !important; /* override mobile */
  }
}

/* Mobile / tablette : menu off-canvas à gauche */
@media (max-width:1024px){
  .hamburger-btn{ display:block; }

  .sidebar{
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    width: 260px;               /* largeur tiroir */
    background: var(--brand-green,#047303);
    border: 1px solid #000;
    border-radius: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 1900;
    transform: translateX(-100%);             /* caché */
    transition: transform .28s ease-out;
  }
  .sidebar.open{ transform: translateX(0); }   /* visible */

  /* overlay derrière le menu */
  .menu-backdrop{
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.35);
    z-index: 1800;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
  }
  .menu-backdrop.show{
    opacity: 1;
    pointer-events: auto;
  }

  /* bloquer le scroll de la page quand le menu est ouvert */
  body.menu-open{ overflow: hidden; }
}
.sidebar{ z-index: 1000; }     /* inférieur au bouton */
/* Position de la sidebar en desktop (si tu veux qu'elle reste fixe) */
.sidebar{
  position: fixed;
  top: var(--top-gap, 20px);
  left: var(--sidebar-gap, 10px);
  width: var(--sidebar-width, 150px);
  /* ... tes styles existants ... */
}

/* Slide-in en mobile */
@media (max-width:1024px){
  .sidebar{
    top: 0;
    left: -260px;                /* cachée hors écran */
    width: 260px; height: 100vh;
    transition: left .3s ease;
    overflow-y: auto; -webkit-overflow-scrolling: touch;
  }
  .sidebar.open{ left: 0; }      /* affichée quand .open est présent */
}

/* === Offsets mobiles pour la page REPAS (modifiables) === */
:root{
  --repas-menu-offset:    0px;  /* ↑/↓ image du menu en mobile */
  --repas-kiosque-offset: 0px;  /* ↑/↓ kiosque en mobile */
  --repas-marche-offset:  0px;  /* ↑/↓ marché gourmand en mobile */
}

/* === Footer commun : même largeur que la mainbox === */
.site-footer{
  /* mêmes marges latérales que .mainbox */
  margin-left: calc(var(--sidebar-width,150px) + var(--sidebar-gap,10px));
  margin-right: var(--sidebar-gap,10px);
  margin-top: 30px;
  margin-bottom: 30px;

  background: var(--brand-green, #047303);
  border: 1px solid #000;
  border-radius: 10px;
  padding: 12px 16px;

  color:#000;
  text-align:center;
  position: relative;  /* évite d'être recouvert */
  z-index: 1;
  box-sizing: border-box;
}
.site-footer a{ color:#000; text-decoration:none; font-weight:600; }
.site-footer a:hover{ text-decoration:underline; }

/* En mobile, mainbox et footer passent pleine largeur avec marges simples */
@media (max-width: 480px){
  .mainbox, .site-footer{
    margin: 10px 10px 20px 10px;
  }
}
