/* ==========================================================================
   Docent overrides for the HelpSmith WebHelp output
   --------------------------------------------------------------------------
   Injected into every generated page by phase-help.sh. Kept OUT of the
   generated files themselves: the WebHelp directory is exported wholesale
   from HelpSmith, so anything hand-edited in there is lost on the next
   export. This file and docent-help.js are re-applied on every deploy.

   What it changes:
     1. Drops the "Docent IMS Help Center" title bar, so the
        Contents / Index / Search column starts at the very top of the page.
     2. Adds a top bar across the topic column holding the Docent logo
        (moved up out of the topic body) and a Return button.
     3. Return exists because the Dashboard runs in an Edge --app window:
        no browser chrome, so following a help link leaves the user with no
        way back.
   ========================================================================== */

/* 1. The desktop title bar. #hs-header-m (the mobile bar with the hamburger)
   is deliberately left alone - it is the only way to reach the nav on a
   narrow screen. */
#hs-header-d {
    display: none !important;
}

/* #hs-nav is absolutely positioned and HelpSmith's app.js sets its top from
   the header height. With the header gone that space would just be blank. */
#hs-nav {
    top: 0 !important;
}

/* 2. The new top bar. Its left offset and height are set by docent-help.js:
   left = the nav column's real width, height = the real height of the
   Contents/Index/Search tab strip, so the logo's top edge lines up with the
   top of that strip whatever the theme does. */
#docent-help-bar {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;                    /* JS overrides with the nav width */
    z-index: 5;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 16px;
    background: #ffffff;
    border-bottom: 1px solid #e0e0e0;
}

#docent-help-bar .docent-help-logo {
    display: block;
    max-height: calc(100% - 10px);
    max-width: 40%;
    width: auto;
    height: auto;
}

#docent-help-return {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    padding: 6px 14px;
    border: 1px solid #0f6cbd;
    border-radius: 4px;
    background: #0f6cbd;
    color: #ffffff !important;
    font: 14px/1.2 "Segoe UI", Arial, sans-serif;
    text-decoration: none !important;
    white-space: nowrap;
    cursor: pointer;
}

#docent-help-return:hover,
#docent-help-return:focus {
    background: #115ea3;
    border-color: #115ea3;
}

/* The logo lived in a one-cell table at the top of every topic. Once it is
   moved into the bar the paragraph that held it is an empty gap; JS removes
   it, and this covers the moment before JS runs. */
.docent-help-logo-moved {
    display: none !important;
}
