/* ===========================
   Custom Responsive CSS (sans Bootstrap)
   =========================== */

body {
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
  overflow-x: hidden;
}

/* --- STRUCTURE --- */
#art-main {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.content-wrapper {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  padding: 15px;
}

/* --- SIDEBARS & CONTENT --- */
.art-sidebar1, .art-sidebar2, .art-content {
  box-sizing: border-box;
}

.art-sidebar1 { flex: 1 1 22%; min-width: 250px; margin-right: 10px; }
.art-content { flex: 1 1 50%; min-width: 300px; }
.art-sidebar2 { flex: 1 1 7%; margin-left: 10px; }

/* --- MENU --- */
.art-nav {
  background-color: #004a9f;
  color: white;
  padding: 10px 15px;
  position: relative;
}

.menu-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  padding: 10px 100px;
  box-sizing: border-box;
}

.menu-toggle {
  display: none;
  cursor: pointer;
  font-size: 1.2em;
  background: #00397c;
  padding: 8px 12px;
  border-radius: 5px;
}

.art-nav ul {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
}

.art-nav ul li {
  margin: 0 10px;
  position: relative;
}

.art-nav ul li a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  display: block;
  padding: 8px 10px;
  white-space: nowrap;
}

.art-nav ul li a:hover { text-decoration: underline; }

/* --- Sous-menus Desktop --- */
@media (min-width: 993px) {
  .art-nav ul li ul {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    background: #00397c;
    padding: 10px 0;
    min-width: 180px;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 9999;
  }

  .art-nav ul li:hover > ul {
    visibility: visible;
    opacity: 1;
  }

  .art-nav ul li ul li a {
    padding: 8px 15px;
    color: #fff;
    text-align: left;
    white-space: nowrap;
  }

  .art-nav ul li ul li a:hover { background: #002b60; }
}

/* --- Responsive (Mobile) --- */
@media (max-width: 992px) {
  .content-wrapper { flex-direction: column; }

  .art-sidebar1, .art-sidebar2, .art-content { width: 100%; margin: 0 0 15px 0; }

  .menu-toggle { 
    display: block; 
  }
  
  .menu-toggle.active {
    background: #002b60;
  }

  .art-nav ul {
    display: none;
    flex-direction: column;
    width: 100%;
    background-color: #004a9f;
    margin-top: 8px;
  }

  .art-nav ul.open { display: flex; }

  /* CORRECTION RADICALE : Espacement vertical très réduit */
  .art-nav ul li {
    margin: 0 !important; /* Supprime TOUTES les marges */
    text-align: left;
    padding: 0 !important; /* Supprime TOUT le padding */
    width: 100%;
    box-sizing: border-box;
    border-bottom: 1px solid rgba(255,255,255,0.1); /* Ligne séparatrice fine */
  }

  /* CORRECTION : Supprime l'espacement entre le dernier item */
  .art-nav ul li:last-child {
    border-bottom: none;
  }

  /* CORRECTION : Liens principaux avec hauteur minimale */
  .art-nav ul li > a {
    white-space: normal;
    word-wrap: break-word;
    padding: 6px 40px 6px 12px !important; /* Padding vertical très réduit */
    display: flex;
    align-items: center;
    min-height: 30px !important; /* Hauteur très réduite */
    margin: 0 !important;
    line-height: 1.2 !important; /* Interligne réduit */
  }

  /* CORRECTION : Sous-menus compacts */
  .art-nav ul li ul {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: #00397c;
    margin: 0 !important;
    padding: 0 !important;
    border-left: 3px solid #002b60;
    width: 100%;
    box-sizing: border-box;
  }

  .art-nav ul li.open > ul {
    max-height: 500px;
    padding: 0 !important;
  }

  /* CORRECTION : Liens sous-menus compacts */
  .art-nav ul li ul li a {
    padding: 5px 15px 5px 20px !important; /* Très compact */
    color: #ddd;
    font-size: 0.9em;
    white-space: normal;
    word-wrap: break-word;
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin: 0 !important;
    line-height: 1.2 !important;
    min-height: 28px !important; /* Hauteur réduite pour sous-menus */
    border-bottom: 1px solid rgba(255,255,255,0.05);
  }

  .art-nav ul li ul li:last-child a {
    border-bottom: none;
  }

  .art-nav ul li ul li a:hover { 
    background: rgba(255,255,255,0.1); 
  }

  /* CORRECTION : Flèches compactes */
  .art-nav ul li span.dropdown-arrow {
    display: inline-block;
    margin-left: 6px;
    cursor: pointer;
    font-size: 0.8em;
    transition: transform 0.3s ease;
    user-select: none;
    float: right;
    padding: 0 8px;
    line-height: inherit;
  }

  .art-nav ul li.open > span.dropdown-arrow { transform: rotate(180deg); }
}

/* === CORRECTIONS MENU MOBILE === */
.art-nav ul.art-hmenu {
    display: flex !important;
    flex-wrap: wrap;
}

/* Cacher le menu par défaut sur mobile */
@media (max-width: 992px) {
    .art-nav ul.art-hmenu {
        display: none !important;
        flex-direction: column;
        width: 100%;
    }
    
    .art-nav ul.art-hmenu.open {
        display: flex !important;
    }
    
    .art-nav {
        position: relative;
        z-index: 10000;
    }
    
    .menu-container {
        position: relative;
        z-index: 10001;
        padding: 8px 15px !important;
    }
    
    /* CORRECTION : Menu ultra compact */
    .art-nav ul.art-hmenu {
        gap: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .art-nav ul.art-hmenu li {
        margin: 0 !important;
        padding: 0 !important;
    }

    .art-nav ul.art-hmenu li a {
        white-space: normal !important;
        word-wrap: break-word !important;
        padding: 6px 12px !important;
        margin: 0 !important;
        line-height: 1.2 !important;
        min-height: 30px !important;
        display: flex !important;
        align-items: center !important;
    }

    /* CORRECTION : Sous-menus compacts */
    .art-nav ul.art-hmenu ul {
        position: static !important;
        display: none !important;
        background: rgba(0, 0, 0, 0.2);
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        box-sizing: border-box;
    }
    
    .art-nav ul.art-hmenu li.open > ul {
        display: block !important;
    }

    .art-nav ul.art-hmenu li ul li a {
        padding: 5px 12px 5px 20px !important;
        font-size: 0.9em;
        min-height: 28px !important;
        line-height: 1.2 !important;
    }

    .art-nav ul.art-hmenu li ul ul li a {
        padding: 5px 12px 5px 30px !important;
    }
}

/* --- FOOTER --- */
.art-footer {
  background-color: #002b60;
  color: #ddd;
  text-align: center;
  padding: 20px;
  margin-top: auto;
}

.art-footer p { margin: 5px 0; }

hr.ligne { width: 75%; opacity: 0.3; margin: 10px auto; }

/* === Slideshow CK flèches === */
.slideshowck, #slideshowck { position: relative; width: 100% !important; overflow: hidden; }

.slideshowck-prev, .slideshowck-next {
  display: block !important;
  position: absolute !important;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  background: rgba(0,0,0,0.4);
  color: #fff !important;
  text-align: center;
  line-height: 48px;
  font-size: 28px;
  font-weight: bold;
  border-radius: 50%;
  z-index: 9999;
  transition: background 0.3s ease;
}

.slideshowck-prev:hover, .slideshowck-next:hover { background: rgba(0,0,0,0.7); }
.slideshowck-prev { left: 15px; }
.slideshowck-next { right: 15px; }

@media (max-width: 768px) {
  .slideshowck-prev, .slideshowck-next {
    width: 36px;
    height: 36px;
    line-height: 36px;
    font-size: 20px;
  }

  .menu-container {
    padding: 6px 12px !important;
  }

  /* CORRECTION : Encore plus compact sur très petits écrans */
  .art-nav ul li > a {
    padding: 5px 35px 5px 10px !important;
    min-height: 28px !important;
    font-size: 0.9em;
  }

  .art-nav ul li ul li a {
    padding: 4px 10px 4px 18px !important;
    min-height: 26px !important;
  }
}