/* ===================================================================
   Tool nav  (Views/Shared/Components/HubToolNav/Default.cshtml)
   ===================================================================
   The ONE definition of the left-hand column of tool buttons. The Tenant dashboard and the Project
   dashboard show it, and so does every page that asks for it (BaseController.ShowToolNav), so a button
   looks the same wherever it is. Which buttons there are is Util/HubToolNav.cs; this is only the look.

     .row.hub-dash                 the page frame: 40px under the menu bar, then
       > .hub-toolnav              the buttons, from the top of the frame
           > a.card-link > .card.shadow.toolitem.hub-tool[.hub-tool-active] > .card-body
               > h4.hub-tool-title
               + .hub-tool-band.hub-tool-<colour>       i.hub-tool-icon  [+ p.hub-tool-count]
               [+ p.hub-tool-caption]
           > .hub-toolnav-link                           the small text link under the buttons
       > .hub-toolnav-main         the page's own content

   Everything that sizes a button lives here: column width, title type, band height, icon size,
   spacing. Keep grid classes, spacing utilities and page-level overrides OFF these elements - the
   tenant page's buttons once sat in a col-1 (96px wide at 1440, 44px at 820, titles spilling out of
   the card) while the project page's were 210px, and a viewport-scaled title size shrank both.

   Loaded on every page (Views/Shared/Partials/Global/_Header.cshtml) and standing on its own, so a
   page that shows the column, or a tile that borrows a button's look, needs no other stylesheet for
   it. (The dashboards' omniStyles.css, where this used to live, styles every .card on the page,
   which the other pages must not get.) */
.hub-dash {
    padding-top: 40px;
}

.hub-toolnav {
    flex: 0 0 210px;
    width: 210px;
    max-width: 210px;
    padding: 0;
    margin-right: 1rem;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

    /* The link wrapped round each button behaves like the card it wraps. Bootstrap also spaces
       adjacent .card-link siblings apart (.card-link + .card-link), hence the margin. */
    .hub-toolnav > .card-link,
    .hub-toolnav > .card-link:hover {
        display: block;
        margin: 0;
        color: inherit;
        text-decoration: none;
    }

/* The page's main column beside the buttons. min-width:0 so wide content (a table) cannot force it
   to wrap under the button column. */
.hub-toolnav-main {
    flex: 1 1 0;
    min-width: 0;
}

/* A page that is not a dashboard (the layout draws its frame, .hub-dash-page) brings 10px of top padding
   of its own, from when it sat straight under the menu bar. Taken back here, so its first line starts
   level with the first button, as a dashboard's title does. */
.hub-dash-page > .hub-toolnav-main {
    margin-top: -10px;
}

.hub-tool {
    border-radius: 0.5rem;
    cursor: pointer;
}

    .hub-tool:hover {
        transform: translateY(-3px);
        box-shadow: 0 7px 25px rgba(0, 0, 0, 0.2);
    }

.hub-tool .card-body {
    padding: 0;
    margin: 0; /* site.css gives every .card-body a 5px left margin */
}

.hub-tool-title {
    margin: 0;
    padding: 0.25rem 0.25rem 0.5rem;
    font-size: 1rem;
    line-height: 1.2;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--slate-digital-primary-shade);
}

.hub-tool-band {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 60px;
    color: #fff;
    background: var(--hub-tool-bg);
}

    .hub-tool-band:last-child {
        border-bottom-left-radius: 0.5rem;
        border-bottom-right-radius: 0.5rem;
    }

/* Font Awesome runs in SVG mode: the <i> becomes an <svg> (height 1em) that keeps these classes. */
.hub-tool-icon {
    font-size: 2.25rem;
}

/* Count variant (Assets, and Pending Changes in both sets): icon left, live count right, split
   on a diagonal from the dark slate into the button's colour. */
.hub-tool-band.hub-tool-split {
    justify-content: space-between;
    padding: 0 1rem;
    background: linear-gradient(120deg, var(--slate-digital-primary-shade) 0%, var(--slate-digital-primary-shade) 48%, var(--hub-tool-bg) 52%, var(--hub-tool-bg) 100%);
}

.hub-tool-count {
    margin: 0;
    font-size: 1.8rem;
    line-height: 1;
}

.hub-tool-caption {
    margin: 0;
    padding-top: 0.25rem;
    line-height: 1.5;
    text-align: center;
}

/* Band colours: each button keeps the colour it had before the shared definition, except Assets,
   which moved from gold to the FLOW 3 asset anchor. */
.hub-tool-green { --hub-tool-bg: #00871e; }                                  /* was .ProductTableHeaderGreen */
.hub-tool-gold { --hub-tool-bg: var(--gold-digital-primary-color); }         /* was .ProductTableHeaderGold */
.hub-tool-slate { --hub-tool-bg: var(--slate-digital-primary-color); }       /* was .data-bowser-bg (#3d4543) */
.hub-tool-blue { --hub-tool-bg: var(--section-blue-digital-tertiary-color); } /* was .project-copy-bg (#3f677d) */
.hub-tool-red { --hub-tool-bg: var(--inspection-red); }                      /* was .project-delete-bg (#c23d31) */
.hub-tool-coral { --hub-tool-bg: lightcoral; }                               /* was .project-reopen-bg */
.hub-tool-asset { --hub-tool-bg: var(--asset-purple-800); }                  /* Assets; was gold */

/* Assets' "Manage" caption matches its band (it was the gold .highlight). */
.hub-tool-caption.hub-tool-caption-asset { color: var(--asset-purple-800); }

/* The button of the page being shown (.hub-tool-active, with aria-current="page" on its link): a
   thick gold frame round the button, a thick white one round its icon, and the title in gold. The
   white frame is what marks a gold button, whose band the gold one would melt into. Bootstrap's
   .shadow is !important, so the frame has to be too. */
.hub-tool.hub-tool-active {
    box-shadow: 0 0 0 4px var(--DIGON-gold-400), 0 0.5rem 1rem rgba(0, 0, 0, 0.3) !important;
}

    .hub-tool-active .hub-tool-title {
        color: var(--DIGON-gold-700);
    }

    .hub-tool-active .hub-tool-band {
        box-shadow: inset 0 0 0 4px #fff;
    }

.hub-toolnav-link {
    padding-top: 0.5rem;
    margin-bottom: 3rem; /* clear of the fixed footer */
    text-align: center;
}

/* Phones: the column goes full width and the buttons wrap across it at their one size. */
@media (max-width: 575.98px) {
    .hub-toolnav {
        flex: 0 0 100%;
        width: 100%;
        max-width: 100%;
        margin-right: 0;
        flex-direction: row;
        flex-wrap: wrap;
    }

        .hub-toolnav > * {
            flex: 0 0 210px;
        }

        .hub-toolnav > .hub-toolnav-link {
            flex-basis: 100%;
        }

    .hub-toolnav-main {
        flex-basis: 100%;
    }
}
