/* ==========================================================================
   LBDT - HEADER
   Accès membre dans la barre supérieure OceanWP
   ========================================================================== */

/* ==========================================================================
   BARRE SUPÉRIEURE OCEANWP
   ========================================================================== */

/*
 * La Top Bar accueille l'accès membre sur tous les appareils.
 * Le contenu doit pouvoir déborder verticalement afin que
 * le sous-menu utilisateur reste visible devant le header.
 */
#top-bar-wrap {
    position: relative;
    margin: 0 !important;
    padding: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    overflow: visible !important;
    z-index: 1000;
}

/*
 * Aligne l'accès membre à droite de la barre supérieure
 * et limite son encombrement vertical.
 */
/*
 * Top Bar :
 * réseaux sociaux OceanWP à gauche,
 * accès membre LBDT à droite.
 */
#top-bar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    padding-top: 3px !important;
    padding-bottom: 3px !important;

    min-height: 0 !important;
    height: auto !important;
    line-height: normal !important;
    overflow: visible !important;

    z-index: 1000;
}


/*
 * Conteneur OceanWP natif :
 * contient notamment le menu social.
 */
#top-bar-inner {
    order: 1;
    flex: 1 1 auto;
    width: auto;

    display: flex;
    align-items: center;

    min-width: 0;
}


/*
 * OceanWP positionne normalement le menu social en absolute
 * avec top:50% et margin-top:-10px.
 * On neutralise complètement ce positionnement pour laisser
 * Flexbox assurer le centrage vertical.
 */
#top-bar-social.top-bar-left,
#top-bar-social.top-bar-right {
    position: static !important;

    top: auto !important;
    left: auto !important;
    right: auto !important;

    float: none !important;

    height: auto !important;
    line-height: 1 !important;
    margin-top: 0 !important;
}


/*
 * Accès membre injecté par LBDT.
 */
.lbdt-member-access {
    order: 2;
    flex: 0 0 auto;

    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;

    margin-left: auto;
    padding: 0;

    transform: none !important;

    z-index: 1050;
}

/* ==========================================================================
   TOP BAR - RESPONSIVE
   ========================================================================== */

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

    #top-bar {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;

        min-height: 0 !important;
        height: auto !important;

        padding-top: 6px !important;
        padding-bottom: 6px !important;

        line-height: 1 !important;
    }

    #top-bar-inner {
        display: flex !important;
        align-items: center !important;

        flex: 1 1 auto !important;
        width: auto !important;

        min-height: 0 !important;
        height: auto !important;

        margin: 0 !important;
        padding: 0 !important;
    }

    #top-bar-social.top-bar-left,
    #top-bar-social.top-bar-right {
        position: static !important;

        top: auto !important;
        right: auto !important;
        bottom: auto !important;
        left: auto !important;

        float: none !important;

        display: flex !important;
        align-items: center !important;

        height: auto !important;
        line-height: 1 !important;

        margin: 0 !important;
        padding: 0 !important;

        transform: none !important;
    }

    #top-bar-social ul {
        display: flex !important;
        align-items: center !important;

        margin: 0 !important;
        padding: 0 !important;
    }

    .lbdt-member-access {
        position: static !important;

        display: flex !important;
        align-items: center !important;
        align-self: center !important;

        flex: 0 0 auto !important;

        margin: 0 0 0 auto !important;
        padding: 0 !important;

        transform: none !important;
    }
}

/* ==========================================================================
   ACCÈS MEMBRE
   ========================================================================== */
/*
 * Conteneur commun :
 * - "Espace membre" pour un visiteur ;
 * - prénom + menu pour un membre connecté.
 */
.lbdt-member-access {
    position: relative;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-left: auto;
    padding: 0;
    z-index: 1050;
}

/* ==========================================================================
   BOUTON
   ========================================================================== */

.lbdt-member-access__button {
    display: inline-flex;
    align-items: center;
    padding: 7px 11px;
    background-color: #111111;
    color: #f5a623;
    border: 1px solid #111111;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease;
}

/* Survol et navigation clavier */
.lbdt-member-access__button:hover,
.lbdt-member-access__button:focus {
    background-color: #f5a623;
    color: #111111;
    border-color: #f5a623;
    text-decoration: none;
}

/* ==========================================================================
   MENU DU MEMBRE CONNECTÉ
   ========================================================================== */

/* ==========================================================================
   TITRE DU SITE INTERNE
   ========================================================================== */

/* État normal : blanc */
body.logged-in #site-logo .site-title {
    color: #ffffff;
}

/* Survol : orange */
body.logged-in #site-logo .site-title:hover,
body.logged-in #site-logo .site-title:focus {
    color: #f5a623;
}

/*
 * <details> contient le bouton prénom et son sous-menu.
 */
.lbdt-member-menu {
    position: relative;
    z-index: 1060;
}

/* Supprime le marqueur natif du <summary>. */
.lbdt-member-menu > summary {
    list-style: none;
    cursor: pointer;
}

/* Chrome / Safari */
.lbdt-member-menu > summary::-webkit-details-marker {
    display: none;
}

/*
 * Prénom + flèche.
 * La largeur s'adapte automatiquement au prénom.
 */
.lbdt-member-menu .lbdt-member-access__button {
    gap: 6px;
    white-space: nowrap;
}

/* Petite flèche */
.lbdt-member-access__arrow {
    display: inline-block;
    font-size: 10px;
    transition: transform 0.2s ease;
}

/* La flèche pivote lorsque le menu est ouvert. */
.lbdt-member-menu[open] .lbdt-member-access__arrow {
    transform: rotate(180deg);
}

/* ==========================================================================
   SOUS-MENU
   ========================================================================== */
/*
 * Le sous-menu commence immédiatement sous le bouton.
 *
 * L'absence d'espace entre les deux zones évite une fermeture
 * intempestive lors du passage de la souris vers le sous-menu.
 */
.lbdt-member-menu__dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 170px;
    padding: 6px 0;
    background-color: #ffffff;
    border: 1px solid #dddddd;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    z-index: 1100;
}

/* Liens du sous-menu */
.lbdt-member-menu__dropdown a {
    display: block;
    padding: 9px 14px;
    color: #222222;
    font-size: 14px;
    line-height: 1.3;
    text-decoration: none;
    white-space: nowrap;
}

/* Survol et navigation clavier dans le sous-menu */
.lbdt-member-menu__dropdown a:hover,
.lbdt-member-menu__dropdown a:focus {
    background-color: #f3f3f3;
    color: #111111;
    text-decoration: none;
}

/*
 * Sépare visuellement l'action de déconnexion
 * des liens liés au profil et au compte.
 */
.lbdt-member-menu__logout {
    margin-top: 5px;
    border-top: 1px solid #e5e5e5;
}