
/* ==========================================================
   PLANETJAMEL — MENU DESKTOP HORIZONTAL
   Fichier : menu-desktop-planetjamel.css

   Le JavaScript pilote le passage au menu burger avec :
   body.menu-burger-required

   Largeur commune des menus calculée par JavaScript.
   ========================================================== */


/* ==========================================================
   1. BARRE DE NAVIGATION DESKTOP
   ========================================================== */

@media screen and (min-width: 1025px) {

  /* --------------------------------------------------------
     BARRE DE NAVIGATION
     -------------------------------------------------------- */

  body > .sidebar {
    display: block !important;

    position: relative;
    z-index: 1000;

    width: 100%;
    max-width: none;

    height: auto;
    min-height: 54px;

    margin: 0;
    padding: 0;

    overflow: visible;

    background-color: #002e58;

    box-sizing: border-box;
  }


  /* --------------------------------------------------------
     CONTENEUR HORIZONTAL
     -------------------------------------------------------- */

  body > .sidebar > .accordion {
    display: flex;

    flex-direction: row;
    flex-wrap: nowrap;

    align-items: stretch;
    justify-content: center;

    width: 100%;
    max-width: none;
    min-width: 0;

    margin: 0;
    padding: 0;

    gap: 0;

    overflow: visible;

    border: 0;
    border-radius: 0;

    background-color: #002e58;

    box-shadow: none;

    box-sizing: border-box;
  }


  /* --------------------------------------------------------
     RUBRIQUES PRINCIPALES
     La largeur est définie par le JavaScript.
     -------------------------------------------------------- */

  body > .sidebar > .accordion > .accordion-item {
    display: block;

    position: relative;
    z-index: 1;

    flex: 0 0 auto;

    width: max-content;
    min-width: 0;
    max-width: none;

    margin: 0;
    padding: 0;

    overflow: visible;

    border: 0;
    border-radius: 0;

    background-color: #002e58;

    box-sizing: border-box;
  }


  /* --------------------------------------------------------
     BOUTONS PRINCIPAUX
     -------------------------------------------------------- */

  body > .sidebar > .accordion
  > .accordion-item > .accordion-button {
    display: flex;

    align-items: center;
    justify-content: center;

    gap: 10px;

    width: 100%;
    min-width: 0;

    min-height: 54px;
    height: 100%;

    margin: 0;
    padding: 0 22px;

    border: 0;
    border-radius: 0;

    background-color: #002e58;
    color: #ffffff;

    font-family: Arial, sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.4;

    text-align: center;
    text-decoration: none;

    white-space: nowrap;

    cursor: pointer;

    box-shadow: none;

    box-sizing: border-box;

    transition:
      background-color 0.2s ease,
      color 0.2s ease;
  }


  /* --------------------------------------------------------
     FLÈCHE DES SOUS-MENUS
     -------------------------------------------------------- */

  body > .sidebar > .accordion
  > .accordion-item > .accordion-button::after {
    content: "";

    display: inline-block;

    flex: 0 0 auto;

    width: 7px;
    height: 7px;

    margin-top: -4px;

    border: 0;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;

    background: transparent;

    transform: rotate(45deg);

    transition: transform 0.2s ease;
  }


  /* Flèche tournée lorsque le menu est ouvert */

  body > .sidebar > .accordion
  > .accordion-item.active > .accordion-button::after {
    margin-top: 4px;

    transform: rotate(225deg);
  }


  /* --------------------------------------------------------
     SURVOL ET ÉTAT ACTIF
     -------------------------------------------------------- */

  body > .sidebar > .accordion
  > .accordion-item > .accordion-button:hover {
    background-color: #1487c6;
    color: #ffffff;
  }

  body > .sidebar > .accordion
  > .accordion-item.active > .accordion-button {
    background-color: #1487c6;
    color: #ffffff;
  }


  /* --------------------------------------------------------
     ACCESSIBILITÉ CLAVIER
     -------------------------------------------------------- */

  body > .sidebar > .accordion
  > .accordion-item > .accordion-button:focus-visible {
    position: relative;
    z-index: 2;

    outline: 2px solid #ffffff;
    outline-offset: -4px;
  }


  /* --------------------------------------------------------
     SOUS-MENUS
     Leur largeur est définie par le JavaScript.
     -------------------------------------------------------- */

  body > .sidebar > .accordion
  > .accordion-item > .accordion-content {
    display: none !important;

    position: absolute;

    top: 100%;
    left: 0;
    right: auto;

    z-index: 1200;

    width: max-content;
    min-width: 100%;
    max-width: none;

    height: auto;
    max-height: min(70vh, 600px);

    margin: 0;
    padding: 6px 0;

    overflow-x: hidden;
    overflow-y: auto;

    border: 0;
    border-radius: 0 0 6px 6px;

    background-color: #f9f9f9;
    color: #002e58;

    text-align: left;

    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);

    box-sizing: border-box;
  }


  /* Ouverture du sous-menu */

  body > .sidebar > .accordion
  > .accordion-item.active:not(.closed-by-click)
  > .accordion-content {
    display: block !important;
  }


  /* Priorité absolue : fermeture manuelle */

  body > .sidebar > .accordion
  > .accordion-item.closed-by-click
  > .accordion-content {
    display: none !important;
  }


  /* La rubrique ouverte passe au premier plan */

  body > .sidebar > .accordion
  > .accordion-item.active {
    z-index: 1100;
  }


  /* --------------------------------------------------------
     LIENS DES SOUS-MENUS
     Toujours empilés verticalement.
     -------------------------------------------------------- */

  body > .sidebar > .accordion
  > .accordion-item > .accordion-content a {
    display: block;

    width: 100%;
    min-width: 0;
    max-width: 100%;

    margin: 0;
    padding: 11px 16px;

    border: 0;
    border-radius: 0;

    background-color: #f9f9f9;
    color: #002e58;

    font-family: Arial, sans-serif;
    font-size: 0.88rem;
    font-weight: 400;
    line-height: 1.45;

    text-align: left;
    text-decoration: none;

    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;

    box-sizing: border-box;

    transition:
      background-color 0.15s ease,
      color 0.15s ease;
  }


  /* Survol des liens */

  body > .sidebar > .accordion
  > .accordion-item > .accordion-content a:hover {
    background-color: #1487c6;
    color: #ffffff;
  }


  /* Focus clavier des liens */

  body > .sidebar > .accordion
  > .accordion-item > .accordion-content a:focus-visible {
    background-color: #1487c6;
    color: #ffffff;

    outline: 2px solid #1487c6;
    outline-offset: -2px;
  }


  /* --------------------------------------------------------
     CONTENU PRINCIPAL
     Pleine largeur, sans colonne latérale.
     -------------------------------------------------------- */

  body > .container {
    display: block;

    width: 100%;
    max-width: none;
    min-width: 0;

    margin: 0;
    padding: 30px 5%;

    background-color: #ffffff;

    box-sizing: border-box;
  }

}


/* ==========================================================
   2. TABLETTE ET MOBILE
   Le CSS burger prend le relais.
   ========================================================== */

@media screen and (max-width: 1024px) {

  body > .sidebar {
    display: none !important;
  }

}
