/* Barra superiore di AlterEgo (26/10/2026): marchio AlterEgo.it a sinistra, collegamenti nel menu
   dell'hamburger a destra (js/barra.js) sotto i 992 px; sugli schermi larghi in fila nella barra. */
.ae-barra { position: relative; z-index: 1030; }
.ae-barra > .container-fluid { flex-wrap: nowrap; }
.ae-barra .navbar-brand { min-width: 0; }

.ae-barra-hamburger { display: inline-flex; flex-direction: column; justify-content: center; gap: 5px; flex: 0 0 auto;
    width: 44px; height: 40px; padding: 0 10px; background: transparent; border: 1px solid rgba(255,255,255,.45);
    border-radius: 8px; cursor: pointer; }
.ae-barra-hamburger span { display: block; height: 2px; background: #fff; border-radius: 1px; transition: transform .2s, opacity .2s; }
.ae-barra-hamburger:hover { background: rgba(255,255,255,.1); }
.ae-barra-hamburger:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.ae-barra-hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.ae-barra-hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.ae-barra-hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.ae-barra-menu { position: absolute; top: 100%; right: 8px; min-width: 230px; max-width: calc(100vw - 16px);
    max-height: calc(100vh - 80px); overflow-y: auto; padding: 6px 0; text-align: left; background: #123456;
    border: 1px solid rgba(255,255,255,.2); border-top: 0; border-radius: 0 0 10px 10px; box-shadow: 0 8px 20px rgba(0,0,0,.35); }
.ae-barra-menu[hidden] { display: none; }
.ae-barra-menu .navbar-nav { flex-direction: column; margin: 0; }
.ae-barra-menu .nav-link { display: block; padding: 10px 18px; color: #fff; white-space: nowrap; }
.ae-barra-menu .nav-link:hover, .ae-barra-menu .nav-link:focus-visible { background: rgba(255,255,255,.12); color: #fff; }

/* Schermi larghi: collegamenti in fila nella barra come prima, l'hamburger solo sotto questa larghezza. */
@media (min-width: 992px) {
    .ae-barra-hamburger { display: none; }
    /* !important: Bootstrap nasconde [hidden] con !important */
    .ae-barra-menu, .ae-barra-menu[hidden] { display: block !important; position: static; min-width: 0; max-width: none; max-height: none;
        overflow: visible; padding: 0; background: transparent; border: 0; border-radius: 0; box-shadow: none; }
    .ae-barra-menu .navbar-nav { flex-direction: row; }
    .ae-barra-menu .nav-link { padding: 8px 10px; }
}
