/* =========================================
   STYLES.CSS — Cadre global du site
========================================= */


/*============================
======= FICHIERS COMMUNS ========
=============================
   Variables, reset, layout global
=============================*/

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

  /* Sidebar + calage */
  --sidebar-width:180px;      /* largeur du menu à gauche en desktop */
  --sidebar-gap:10px;         /* marge entre menu et mainbox */
  --top-gap:20px;             /* distance du menu par rapport au haut */

  /* Header */
  --header-max:900px;         /* largeur max de l’image titre */
}

*{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) Mainbox — cadre commun
======================= */

.mainbox{
  /* alignement horizontal : calé sur la sidebar */
  margin-left: calc(var(--sidebar-width) + var(--sidebar-gap) + 20px);
  margin-right: auto;

  /* alignement vertical */
  margin-top: var(--top-gap);
  margin-bottom: 40px;

  padding: 20px;
  min-height: 100vh;

  /* largeur max sécurisée */
  width: min(1600px, calc(100% - (var(--sidebar-width) + var(--sidebar-gap) + 40px)));

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

  overflow: visible;
  position: relative;
}

/* =======================
   2) Header global
======================= */

.site-header{
  padding:15px 0;
  text-align:center;
  background:transparent;
}

.titre-container{
  max-width:var(--header-max);
  width:100%;
  margin:0 auto;
}

.titre-container img{
  display:block;
  width:100%;
  height:auto;
}

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

/* =======================
   3) Footer global
======================= */

.site-footer {
  margin-left: calc(var(--sidebar-width) + var(--sidebar-gap) + 20px);
  margin-right: auto;

  margin-top: 20px;
  margin-bottom: 30px;

  max-width: 1600px;

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

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.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;
}
.back-to-top:hover { background: #a0a09d; }

/* =======================
   4) Menu latéral + bouton burger
======================= */

/* Bouton burger (mobile/tablette) */
.hamburger-btn{
  position: fixed;
  top: 32px;
  left: 12px;
  z-index: 2000;
  background:#BABAB7;
  color:#000;
  border:1px solid #000;
  border-radius:8px;
  font-size:22px;
  padding:8px 12px;
  cursor:pointer;
}

/* Aspect général de la sidebar */
.sidebar{
  background: var(--brand-green,#047303);
  border:1px solid #000;
  border-radius:10px;
  padding:8px;
  box-sizing:border-box;
}

/* Liste de liens */
.sidebar-links{
  list-style:none;
  margin:0;
  padding:0;
}

/* Style des boutons du menu */
.sidebar-links li{
  margin-bottom:8px;
}
.sidebar-links li a{
  display:block;
  background:#047303;
  color:#fff;
  padding:10px 12px;
  border:1px solid #000;
  border-radius:6px;
  text-align:center;
  font-size:15px;
  font-weight:bold;
  text-decoration:none;
  transition:background .2s ease, transform .1s ease;
}
.sidebar-links li a:hover{
  background:#059304;
  transform:translateY(-2px);
}
.sidebar-links li a:active{
  background:#035b02;
  transform:translateY(0);
}

/* Conteneur principal des liens */
.sidebar-links {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Le logo Facebook doit se coller en bas */
.sidebar-facebook {
  margin-top: auto;
  padding-top: 20px;
  text-align: center;
}

/* Image Facebook */
.facebook-logo {
  width: 40px;
  height: auto;
  border-radius: 6px;
  transition: transform 0.2s;
  cursor: pointer;
}
.facebook-logo:hover {
  transform: scale(1.15);
}


/*============================
====== FICHIERS PETITS FORMATS ======
=============================
   Smartphones portrait / petits écrans
=============================*/

/* Espace au-dessus du titre pour le burger */
@media (max-width:768px){
  .site-header{ margin-top:40px; }
}

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

/* Menu : largeur réduite & boutons plus étroits */
@media (max-width:700px){
  .sidebar{
    width:210px;
  }

  .sidebar-links li a{
    font-size:14px;
    padding:7px 8px;
    max-width:185px;
    margin:0 auto 8px;
  }
}

/* ===========================================
   TITRE LES PAYSANNERIES — VERSION SMARTPHONE
   Correction pour la page index
=========================================== */
@media (max-width: 700px) {
  .titre-container img {
    width: 80% !important;
    max-width: 420px !important;
    margin: 15px auto !important;
    display: block !important;
  }
}


/*============================
====== FICHIERS MOYENS FORMATS =====
=============================
   Smartphones paysage / Tablettes (≤1024px)
=============================*/

/* Mainbox plein écran en mobile/tablette */
@media (max-width:1024px){
  .mainbox{
    margin: var(--top-gap) 8px 24px 8px;
    width: auto;
    padding: 12px;
  }
}

/* Footer recentré en mobile/tablette */
@media (max-width:1024px){
  .site-footer{
    margin:10px 8px 20px 8px;
    padding:12px;
  }
}

/* Menu coulissant mobile/tablette */
@media (max-width:1024px){
  .sidebar{
    position: fixed;
    top: var(--top-gap,20px);
    left: 0;
    height: calc(100vh - var(--top-gap,20px));
    width: 240px;
    border-radius: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 1900;

    transform: translateX(-100%);
    transition: transform .28s ease-out;
  }
  .sidebar.open{
    transform: translateX(0);
  }

  /* On laisse de la place au burger */
  .sidebar-links{
    padding-top: 70px;
  }

  /* Empêche la page de défiler quand le menu est ouvert */
  body.menu-open{
    overflow:hidden;
  }
}


/*============================
===== FICHIERS GRANDS FORMATS ======
=============================
   Tablettes paysage / petits laptops
   (pas de règles spécifiques supplémentaires)
=============================*/


/*============================
======= FICHIERS ORDINATEURS =======
=============================
   Desktop ≥1025px
=============================*/

/* Sidebar fixe, burger caché */
@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;
    border-radius:10px;
    transform: none !important;
    z-index:1500;
  }
}


