/* ==========================================================================
   Intuceo brand layer
   --------------------------------------------------------------------------
   One source of truth for the application's colour and type. Every brand value
   is a custom property declared here; nothing else in the application should
   carry a brand colour as a literal.

   The values are taken from intuceo.com: the palette from the site's own
   global stylesheet (--e-global-color-*), and the two typefaces it sets, Inter
   for text and Noto Serif for headings.

   Loaded after main.css and the Bootstrap 3 bundle, so it settles anything
   those declare. Bootstrap is old and specific, which is why a few rules below
   are more specific than they would otherwise need to be.
   ========================================================================== */

/* --------------------------------------------------------------- typefaces

   Self-hosted deliberately. This application runs inside the facility, where
   an outbound call to a font CDN is a dependency that can be blocked, slow, or
   simply unavailable - and a font that arrives late is a page that reflows
   under the reader. Both files are variable, so one download covers every
   weight the interface uses.
*/

@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("../fonts/brand/inter-variable.woff2") format("woff2");
}

@font-face {
    font-family: "Noto Serif";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("../fonts/brand/noto-serif-variable.woff2") format("woff2");
}

/* ------------------------------------------------------------------ tokens */

:root {
    /* Core palette, from intuceo.com's global stylesheet. */
    --brand-blue: #1276E1;          /* actions, links, selection */
    --brand-navy: #0E1846;          /* headings and dark surfaces */
    --brand-ink: #212529;           /* body text */
    --brand-accent: #FE7D34;        /* the orange: attention, never decoration */
    --brand-surface: #E6F2FF;       /* pale blue fill */
    --brand-white: #FFFFFF;

    /* Derived, for states. Kept here so a hover colour is never invented at
       the point of use. */
    --brand-blue-dark: #0F63BE;
    --brand-blue-darker: #0B4E97;
    --brand-blue-faint: #F2F8FE;
    --brand-accent-dark: #E8641B;
    --brand-navy-soft: #1B2A5E;

    /* Neutrals. Warmed very slightly towards the navy so greys sit with the
       palette rather than beside it. */
    --brand-text: #2A3444;
    --brand-text-muted: #5A6577;
    --brand-border: #DCE3EC;
    --brand-border-strong: #C3CEDC;
    --brand-canvas: #F5F7FA;

    /* Status. Chosen to stay legible next to the brand blue. */
    --brand-danger: #C62828;
    --brand-warning: #B26A00;
    --brand-success: #1B7F4F;
    --brand-success-dark: #146340;

    --brand-font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
        Roboto, "Helvetica Neue", Arial, sans-serif;
    --brand-font-head: "Noto Serif", Georgia, "Times New Roman", serif;

    --brand-radius: 8px;
    --brand-shadow: 0 1px 3px rgba(14, 24, 70, .08),
                    0 4px 14px rgba(14, 24, 70, .06);
}

/* -------------------------------------------------------------------- base */

body {
    font-family: var(--brand-font-body);
    /* main.css set the whole document bold, which left no weight in reserve
       for the things that are actually emphasised. */
    font-weight: 400;
    color: var(--brand-text);
    background-color: var(--brand-canvas);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* main.css sets a global p { color: #bcbcbc }, which is close to invisible on
   white. Body copy inherits the text colour like everything else. */
p,
li,
td,
th,
dd,
dt,
label,
.form-control {
    color: inherit;
}

p {
    color: var(--brand-text);
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--brand-font-head);
    color: var(--brand-navy);
    font-weight: 600;
    letter-spacing: -0.01em;
}

h1, .h1 { font-weight: 300; }
h2, .h2 { font-weight: 300; }

a {
    color: var(--brand-blue);
}

a:hover,
a:focus {
    color: var(--brand-blue-dark);
}

::selection {
    background: var(--brand-surface);
    color: var(--brand-navy);
}

:focus-visible {
    outline: 2px solid var(--brand-blue);
    outline-offset: 2px;
}

/* ------------------------------------------------------------------ header */

.navbar {
    background-color: var(--brand-white);
    border-bottom: 1px solid var(--brand-border);
    box-shadow: 0 1px 2px rgba(14, 24, 70, .05);
}

/* The brand block: the company mark, then the product name beside it.
 *
 * These sat one above the other, which suited the previous logo because it was
 * a short wordmark. This one is taller, and stacked it overflowed the 80px bar
 * and clipped the product name. Side by side also says the right thing: Intuceo
 * is the company, Equipment Inventory is the application. */
.navbar-nav .nav-group-1 {
    display: flex;
    /* .navbar-nav .nav-item stacks its children; this block is a row. */
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
    height: 80px;
}

.navbar-nav .brand-logo {
    width: 132px;
    height: auto;
    display: block;
    flex-shrink: 0;
}

.navbar-nav .logo-text {
    width: auto;
    font-family: var(--brand-font-head);
    font-size: 15px;
    line-height: 1.25;
    color: var(--brand-navy);
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    padding-left: 14px;
    border-left: 1px solid var(--brand-border);
}

@media (max-width: 767px) {
    .navbar-nav .brand-logo { width: 104px; }
    .navbar-nav .logo-text {
        font-size: 12px;
        padding-left: 10px;
    }
    .navbar-nav .nav-group-1 { gap: 10px; }
}

/* The landing panel. The product name is the heading; the mark sits under it,
   so the heading takes the navy and leaves the blue for actions. */
.welcome-title {
    font-family: var(--brand-font-head);
    color: var(--brand-navy);
    font-weight: 300;
}

.navbar-nav .nav-item {
    color: var(--brand-text);
    font-weight: 500;
}

.navbar-nav .nav-item:hover,
.navbar-nav .nav-item:focus {
    color: var(--brand-blue);
}

.navbar-nav .nav-item.active,
.navbar-nav .nav-item.selected {
    color: var(--brand-blue);
    border-bottom-color: var(--brand-blue);
}

/* ----------------------------------------------------------------- actions */

.btn-primary,
.btn-primary:focus {
    background-color: var(--brand-blue);
    border-color: var(--brand-blue);
    color: var(--brand-white);
    font-weight: 600;
}

.btn-primary:hover,
.btn-primary:active,
.btn-primary.active,
.btn-primary:active:focus,
.open > .dropdown-toggle.btn-primary {
    background-color: var(--brand-blue-dark);
    border-color: var(--brand-blue-dark);
    color: var(--brand-white);
}

.btn-default {
    background-color: var(--brand-white);
    border-color: var(--brand-border-strong);
    color: var(--brand-text);
    font-weight: 500;
}

.btn-default:hover,
.btn-default:focus {
    background-color: var(--brand-blue-faint);
    border-color: var(--brand-blue);
    color: var(--brand-blue-dark);
}

.btn-danger {
    background-color: var(--brand-danger);
    border-color: var(--brand-danger);
}

.btn-success {
    background-color: var(--brand-success);
    border-color: var(--brand-success);
}

.btn-warning {
    background-color: var(--brand-accent);
    border-color: var(--brand-accent);
    color: var(--brand-white);
}

.btn-warning:hover,
.btn-warning:focus {
    background-color: var(--brand-accent-dark);
    border-color: var(--brand-accent-dark);
    color: var(--brand-white);
}

.btn:focus-visible {
    outline: 2px solid var(--brand-navy);
    outline-offset: 2px;
}

/* ------------------------------------------------------------------- forms */

.form-control {
    border-color: var(--brand-border-strong);
    border-radius: 6px;
    color: var(--brand-ink);
    box-shadow: none;
}

.form-control:focus {
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 3px rgba(18, 118, 225, .15);
}

/* ------------------------------------------------------------------ tables */

.table > thead > tr > th {
    font-family: var(--brand-font-body);
    font-weight: 600;
    color: var(--brand-navy);
    border-bottom: 2px solid var(--brand-border);
    background-color: var(--brand-white);
}

.table > tbody > tr > td {
    border-top-color: var(--brand-border);
}

.table-striped > tbody > tr:nth-of-type(odd) {
    background-color: var(--brand-blue-faint);
}

.table-hover > tbody > tr:hover {
    background-color: var(--brand-surface);
}

/* ------------------------------------------------------------- components */

.brand-card,
.panel,
.well {
    background-color: var(--brand-white);
    border: 1px solid var(--brand-border);
    border-radius: var(--brand-radius);
    box-shadow: var(--brand-shadow);
}

.panel-heading,
.brand-card-header {
    background-color: var(--brand-white);
    border-bottom: 1px solid var(--brand-border);
    color: var(--brand-navy);
    font-family: var(--brand-font-head);
    font-weight: 600;
}

.panel-primary > .panel-heading {
    background-color: var(--brand-navy);
    border-color: var(--brand-navy);
    color: var(--brand-white);
}

.nav-tabs > li.active > a,
.nav-tabs > li.active > a:hover,
.nav-tabs > li.active > a:focus {
    color: var(--brand-blue);
    border-bottom-color: transparent;
}

.nav-tabs > li > a:hover {
    background-color: var(--brand-blue-faint);
}

.pagination > .active > a,
.pagination > .active > a:hover,
.pagination > .active > span {
    background-color: var(--brand-blue);
    border-color: var(--brand-blue);
}

.pagination > li > a {
    color: var(--brand-blue);
}

.label-primary,
.badge {
    background-color: var(--brand-blue);
}

.progress-bar {
    background-color: var(--brand-blue);
}

.alert-info {
    background-color: var(--brand-surface);
    border-color: #BBD9F7;
    color: var(--brand-navy);
}

.alert-warning {
    background-color: #FFF3E8;
    border-color: #FFD3B0;
    color: #8A4A12;
}

.alert-danger {
    background-color: #FDECEC;
    border-color: #F5C2C2;
    color: #8E1F1F;
}

.alert-success {
    background-color: #E9F6EF;
    border-color: #BFE3D0;
    color: #14603C;
}

/* The welcome panel on the landing page. */
.welcome-logo {
    max-width: 320px;
    height: auto;
}

/* ------------------------------------------------------------------ print */

@media print {
    /* The navy mark reads on paper; the white one does not. */
    .brand-logo {
        content: url("../img/brand/intuceo-logo-navy.png");
    }

    body {
        background: #fff;
        color: #000;
    }
}
