/*
 * Scsu.AspNetCore - mobile section menu: the menu-only headline bar (used by _ScsuHeadline when a view sets
 * HideHeadline) and the sidebar's open state.
 * Served at ~/_content/Scsu.AspNetCore/css/scsu-headline.css. Link it before the app's site.css.
 *
 * The SCSU sidebar is off-canvas below 1030px (scsu-main-styles: .sidebar { position: fixed; left: -100% }) and the
 * headline's "section menu" button is the only way to open it. Breakpoint matches SCSU's min-width: 1030px rules.
 */

/* Desktop: the sidebar is always visible, so no bar. */
.headline.headline--menu-only {
    display: none;
}

@media (max-width: 1029.98px) {
    .headline.headline--menu-only {
        display: block;
        padding: 0.75rem 20px;
    }

    /* Several apps' site.css hide the toggle until 1024px; show it in this bar wherever the sidebar is off-canvas.
       SCSU offsets the toggle (position: relative; top/left: 20px) to sit inside the tall headline; in this short
       bar that pushed it out of the bar and under the page content. */
    .headline--menu-only .headline__sidebar-toggle {
        display: inline-block;
        top: 0;
        left: 0;
    }

    /* Open state. init-min-api.js adds .sidebar--visible; several apps' site.css re-declare
       .sidebar { left: -100% } in their mobile media query (later in the cascade than SCSU's .sidebar--visible)
       and only undo it for .sidebar.is-active, which nothing sets - so the menu never slid in
       (Emergency, Immunization, eTranscriptRequest). Two classes outrank their one, whatever the load order. */
    .sidebar.sidebar--visible {
        left: 0;
    }

    /* Keep the close (X) button above a long, wrapping sidebar title - in Emergency the title link sat on top
       of it, so tapping X followed the link instead of closing the menu. */
    .sidebar__close-trigger {
        z-index: 2;
    }
}

@media print {
    .headline.headline--menu-only {
        display: none !important;
    }
}
