/* ============================================
   FIX FOOTER ALIGNEMENT - SOLUTION UNIQUE ET DÉFINITIVE
   ============================================ */
/* Ce fichier contient TOUTES les règles d'alignement du footer
   Aucune autre règle d'alignement ne doit exister ailleurs */

/* SOLUTION : Le footer doit avoir la MÊME largeur que le page-wrapper (1200px) et être centré */
/* Le fond du footer doit être aligné verticalement avec le reste de la page */
html body > footer.ts-footer,
html body footer.ts-footer,
body.body-color > footer.ts-footer,
body.body-color footer.ts-footer,
body > footer.ts-footer.footer-modern,
body footer.ts-footer.footer-modern,
footer.ts-footer,
footer.ts-footer.footer-modern {
  /* Largeur limitée à 1200px comme le page-wrapper */
  width: 100% !important;
  max-width: 1200px !important;
  min-width: auto !important;

  /* Centrer le footer comme le page-wrapper */
  margin-left: auto !important;
  margin-right: auto !important;

  /* Positionnement */
  position: relative !important;
  left: auto !important;
  right: auto !important;

  /* ZÉRO marge et padding LATÉRAL */
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  /* Note: padding-top et padding-bottom sont gérés par style.css (25px 0) */

  /* Fond vert qui sera limité à 1200px */
  background: #00944f !important;
  background-color: #00944f !important;

  /* Box model */
  box-sizing: border-box !important;
  display: block !important;
  clear: both !important;

  /* Surcharger TOUTES les autres règles */
  transform: none !important;
  float: none !important;
}

/* ============================================
   FIX VISIBILITÉ TITRE "MÉDIATHÈQUE IMAGE" EN PRODUCTION
   ============================================ */
/* S'assurer que le titre "Médiathèque image" est visible en production */
/* Ce fichier est chargé EN DERNIER, donc ces règles surchargent tout */
@media (max-width: 991px) {
  #more-news-section .ts-title-wrapper,
  .page-wrapper #more-news-section .ts-title-wrapper,
  body #more-news-section .ts-title-wrapper,
  body .page-wrapper #more-news-section .ts-title-wrapper {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    height: auto !important;
    overflow: visible !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  #more-news-section .mediatheque-banner,
  #more-news-section .ts-title-wrapper .mediatheque-banner,
  #more-news-section .ts-title-wrapper img.mediatheque-banner,
  #more-news-section .ts-title-wrapper img.title-image,
  #more-news-section img.mediatheque-banner,
  #more-news-section img.title-image.mediatheque-banner,
  .page-wrapper #more-news-section .mediatheque-banner,
  body #more-news-section .mediatheque-banner,
  body .page-wrapper #more-news-section .mediatheque-banner {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: 60px !important;
    position: relative !important;
    top: 0 !important;
    left: 0 !important;
    transform: none !important;
    z-index: 20 !important;
  }
}

/* ============================================
   MEDIATHEQUE IMAGE - FORCE IMAGE FULL CARD (chargé en dernier)
   ============================================ */
@media (min-width: 992px) {
  /* Carte: hauteur fixe et aucun espace interne */
  #more-news-section #more-news-slider .item,
  .page-wrapper #more-news-section #more-news-slider .item {
    height: 240px !important;
    padding: 0 !important;
    background: transparent !important;
    overflow: hidden !important;
  }

  /* Conteneur d'image: occupe 100% de la carte */
  #more-news-section #more-news-slider .item .ts-post-thumb,
  .page-wrapper #more-news-section #more-news-slider .item .ts-post-thumb {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    overflow: hidden !important;
    display: block !important;
  }

  /* Lien autour de l'image: 100% */
  #more-news-section #more-news-slider .item .ts-post-thumb > a,
  .page-wrapper #more-news-section #more-news-slider .item .ts-post-thumb > a {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
  }

  /* Image: remplissage complet de la carte */
  #more-news-section #more-news-slider .item .ts-post-thumb img,
  .page-wrapper #more-news-section #more-news-slider .item .ts-post-thumb img {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover !important;
    object-position: center center !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
  }
}
/* Footer-main doit couvrir toute la largeur du footer */
footer.ts-footer .footer-main,
footer.ts-footer.footer-modern .footer-main {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  background: #00944f !important;
  background-color: #00944f !important;
  box-sizing: border-box !important;
}

/* Container du footer - contenu limité à 1200px comme page-wrapper */
footer.ts-footer .container,
footer.ts-footer.footer-modern .container {
  max-width: 1200px !important;
  margin: 0 auto !important;
  width: 100% !important;
  padding-left: 15px !important;
  padding-right: 15px !important;
  box-sizing: border-box !important;
}

/* Footer-bottom aussi */
footer.ts-footer .footer-bottom-modern,
footer.ts-footer.footer-modern .footer-bottom-modern {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  box-sizing: border-box !important;
}
