/*
 * Toolbar del portale (COMPONENTI L1).
 * Riproduce l'aspetto della precedente ejs-toolbar (#menuToolbar.e-toolbar in site.css):
 * antracite, 65px, raggio e ombra della card. Titolo, macro-aree e tendina mobile
 * usano le classi già esistenti (toolbar-center-content, toolbar-macro-*).
 * Antracite in entrambi i temi (D20).
 */

.hy-toolbar {
    position: relative;
    z-index: var(--hy-z-toolbar); /* la tendina delle macro-aree deve stare sopra il contenuto */
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 65px;
    margin: 10px 10px 0;
    padding: 0 10px;
    border-radius: var(--hy-radius-md);
    background: var(--hy-brand-dark);
    box-shadow: var(--hy-shadow-3);
    color: #ffffff;
}

.hy-toolbar__brand {
    flex-shrink: 0;
    margin-left: 8px;
    text-decoration: none;
}

.hy-toolbar__brand:focus-visible,
.hy-toolbar .toolbar-macro-link:focus-visible,
.hy-toolbar summary:focus-visible {
    outline: 2px solid var(--hy-focus-ring);
    outline-offset: 2px;
    border-radius: var(--hy-radius-sm);
}

.hy-toolbar__center {
    flex: 1 1 auto;
    min-width: 0;
}

/* Come nella toolbar precedente: titolo e macro-aree subito dopo il logo (desktop). */
.hy-toolbar .toolbar-center-content {
    justify-content: flex-start;
}

.hy-toolbar__actions {
    flex-shrink: 0;
    margin-left: auto;
    margin-right: 4px;
}

/* Variante degli hub (ViewData["HubToolbar"]): barra alta con logo e titolo grandi come il riquadro degli hub di prima
   (hub-panel, richiesta dell'utente 2026-10-22), con gli stessi comandi della barra normale. Solo da 992px in su:
   sotto resta la barra normale con la tendina delle macro-aree, che è posizionata sotto i suoi 62-65px. */
@media (min-width: 992px) { /* sotto 992px il layout passa alla tendina delle macro-aree */
    .hy-toolbar--hub {
        min-height: 124px;
        padding: 0 20px;
        background: linear-gradient(180deg, #3b3b3a, #353534);
    }

    .hy-toolbar--hub .hy-toolbar__brand,
    .hy-toolbar--hub .app-brand {
        min-height: 76px;
        height: 76px;
    }

    .hy-toolbar--hub #ErreviLogo { /* id: vince sulle regole di site.css */
        height: 60px;
    }

    .hy-toolbar--hub .toolbar-center-content {
        gap: 18px;
        padding-left: 16px;
    }

    .hy-toolbar--hub .toolbar-page-title {
        color: #ffffff;
        font-size: clamp(22px, 2.4vw, 40px); /* px: site.css fissa html a 14px */
        font-weight: 700;
        letter-spacing: -.04em;
        text-transform: none;
    }
}

/* I toast in alto (Notyf) partono sotto la toolbar, per non coprirne i bottoni (COMPONENTI K3). */
body .notyf { /* "body": notyf.min.css è caricato dopo questo file */
    padding-top: 84px;
}

@media (max-width: 768px) {
    .hy-toolbar {
        min-height: 62px;
        margin: 8px 8px 0;
        padding: 0 6px;
    }

    .hy-toolbar__brand {
        margin-left: 2px;
    }

    /* Su telefono il titolo si tronca con i puntini: logo e bottoni restano sempre visibili. */
    .hy-toolbar .toolbar-macro-mobile {
        justify-content: flex-start;
        min-width: 0;
    }

    .hy-toolbar .toolbar-macro-mobile details,
    .hy-toolbar .toolbar-macro-mobile summary {
        min-width: 0;
        max-width: 100%;
    }

    .hy-toolbar .toolbar-page-title-mobile,
    .hy-toolbar .toolbar-page-title-mobile .toolbar-page-title {
        display: block;
        min-width: 0;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }
}
