/* ============================================================================
   Header dropdown menus (includes/header.php): Use Cases, Solutions, Insights, Company.
   Colours, spacing and layout only; the font rules are in typography.css section 3.

   From 992px (where the navbar is expanded) Use Cases, Solutions and Insights open one
   panel under the nav bar, centred on the menu items from 1280px and on the bar below that
   (.nv-mega: same width for all three, never edge to edge);
   Company opens a small card under its own item (.nv-small). They open on hover (with a
   short grace period so the panel does not close while the mouse travels to it) and on
   click / keyboard (Bootstrap's .show). Below 992px they stack inside the collapsed menu.
   ============================================================================ */

/* The site's colours: teal (--green) for labels and links, the light grey tiles and the light teal
   hover used on the landing pages, neutral greys for text. */
.nv-panel {
    --nv-ink: #111;
    --nv-text: #5c5c5c;
    --nv-label: #0e606e;
    --nv-card: #f4f5f7;
    --nv-card-hover: #e0eff1;
    --nv-line: #e4e4e8;
    --nv-accent: #0d606e;
    --nv-accent-hover: #10484f;
    background: #fff;
    border: 0;
    border-radius: 16px;
    padding: 26px 30px 24px;
    color: var(--nv-text);
    text-align: left;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22), 0 2px 8px rgba(0, 0, 0, 0.08);
}

.nv-panel a {
    text-decoration: none;
}

/* ".navbar .nv-panel" in front of the paragraph rules: page themes colour every <p> (book-a-demo's
   dark theme paints them light grey, which made the labels vanish on the white panel). */
.navbar .nv-panel .nv-eyebrow {
    margin: 0 0 12px 12px;
    color: var(--nv-label);
    text-transform: uppercase;
}

/* ---- Use Cases: three columns of title + one line ---- */
.nv-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px 28px;
}

.nv-item {
    display: block;
    padding: 10px 12px;
    border-radius: 10px;
    transition: background-color 0.15s ease;
}

.nv-item:hover,
.nv-item:focus-visible {
    background: var(--nv-card);
}

.nv-title {
    display: block;
    color: var(--nv-ink);
}

.nv-desc {
    display: block;
    margin-top: 2px;
    color: var(--nv-text);
}

.nv-item:hover .nv-title,
.nv-card:hover .nv-title,
.nv-current .nv-title {
    color: var(--nv-accent);
}

.nv-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 24px;
    margin-top: 16px;
    padding: 16px 12px 0;
    border-top: 1px solid var(--nv-line);
}

.navbar .nv-panel .nv-foot p {
    margin: 0;
    color: var(--nv-text);
}

.nv-panel a.nv-cta {
    color: var(--nv-accent);
}

.nv-panel a.nv-cta:hover {
    color: var(--nv-accent-hover);
    text-decoration: underline;
}

/* ---- Solutions and case studies: beige cards ---- */
.nv-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.nv-cards-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* No fill at rest (like the Use Cases items); the same light grey as those items on hover. */
.nv-card {
    display: block;
    padding: 16px 20px 18px;
    border-radius: 12px;
    background: transparent;
    transition: background-color 0.15s ease;
}

.nv-card:hover,
.nv-card:focus-visible {
    background: var(--nv-card);
}

/* ---- Insights: case studies on the left, a hairline, then the Learn links ---- */
.nv-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 190px;
    gap: 0 34px;
}

.navbar .nv-panel .nv-split .nv-eyebrow {
    margin-left: 2px;
}

.nv-learn {
    border-left: 1px solid var(--nv-line);
    padding-left: 34px;
}

.nv-learn ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nv-learn li {
    margin: 0;
    padding: 0;
    border: 0;
}

/* .nv-panel in front: style.css colours every link in a hovered dropdown <li> pink */
.nv-panel .nv-learn a {
    display: block;
    padding: 9px 0;
    color: var(--nv-ink);
    background: none;
}

.nv-panel .nv-learn a:hover,
.nv-panel .nv-learn a.nv-current {
    color: var(--nv-accent);
}

/* ---- Company: small list card ---- */
.nv-small-panel {
    width: 290px;
    padding: 14px 12px;
}

.nv-small-panel .nv-item {
    padding: 11px 14px;
}

/* ---- Focus ring for keyboard users ---- */
.nv-panel a:focus-visible {
    outline: 2px solid var(--nv-accent);
    outline-offset: 2px;
}

/* ============================================================================
   Expanded navbar (992px and up): panels float under the bar
   ============================================================================ */
@media (min-width: 992px) {

    /* Let every top-level item fill the bar's height, so the mouse never leaves the item on its way
       down to the panel (the list used to be centred with auto margins, which kept it text-high). */
    .navbar .navbar-collapse {
        align-self: stretch;
    }

    .navbar .navbar-collapse>.navbar-nav {
        align-self: stretch;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }

    .navbar .navbar-nav>.nav-item {
        display: flex;
        align-items: center;
    }

    /* The three big panels are centred on the bar (which is fixed, full width), not on their item;
       from 1280px on the menu items instead (see the 1280px block below). */
    .navbar .navbar-nav>.nv-mega {
        position: static;
    }

    .navbar .nav-item>.dropdown-menu.nv-panel {
        display: block;
        position: absolute;
        top: calc(100% + 10px);
        left: 50%;
        right: auto;
        margin: 0;
        visibility: hidden;
        opacity: 0;
        transform: translate(-50%, 8px);
        z-index: 2;
        transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0.18s;
    }

    .navbar .nv-mega>.dropdown-menu.nv-panel {
        width: min(960px, calc(100vw - 48px));
    }

    /* Invisible bridge over the 10px gap between the bar and the panel. */
    .navbar .nav-item>.dropdown-menu.nv-panel::before {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        top: -10px;
        height: 10px;
    }

    .navbar .nav-item.dropdown:hover>.dropdown-menu.nv-panel,
    .navbar .nav-item>.dropdown-menu.nv-panel.show {
        visibility: visible;
        opacity: 1;
        transform: translate(-50%, 0);
        z-index: 3;
        transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0s;
    }
}

/* Small laptops: "Revenue Leak Assessment" is longer than the old "AI Readiness Scorecard", so the
   items sit a little closer together here to keep the bar inside the window (px-3 is !important).
   The spacing shrinks with the window (item 10px + link 8px each side at 1365px, 3px + 3px at 992px),
   so the logo, the six items and the button all fit down to 992px (iPad landscape is 1024).
   2026-12-02: the menu links are Inter now (wider than the old Roboto Light), so this range runs up
   to 1365px instead of 1279px and starts at 3px; the links are also var(--fs-body-sm) (14px) up to
   1150px (typography.css section 2). The button ends 15px inside the window at every width. */
@media (min-width: 992px) and (max-width: 1365.98px) {
    .navbar .navbar-nav>.nav-item {
        padding-left: clamp(3px, calc(3px + (100vw - 992px) * 7 / 374), 10px) !important;
        padding-right: clamp(3px, calc(3px + (100vw - 992px) * 7 / 374), 10px) !important;
    }

    .navbar .navbar-nav>.nav-item>.nav-link {
        padding-left: clamp(3px, calc(3px + (100vw - 992px) * 5 / 374), 8px);
        padding-right: clamp(3px, calc(3px + (100vw - 992px) * 5 / 374), 8px);
    }
}

/* Logo (2026-12-01). Its box used to shrink when the bar was crowded: the image kept its 100px height
   while its width was squeezed (a thin pink sliver around 1280px wide, gone at 992-1100px), and on
   phones the global mobile image rule (max-width 85%) narrowed it to 85 x 100. The box never shrinks
   now and the image keeps its square proportions. */
.navbar .navbar-brand {
    flex-shrink: 0;
}

.navbar .navbar-brand img {
    width: auto;
    max-width: none;
}

/* From 992px (menu in one row) the logo scales with the window: 100px tall from 1440px, 89px at 1280,
   69px at 992. It stays vertically centred and the bar keeps its 110px height. The button block is a
   quarter of the bar on wide screens; on narrower ones it may shrink to the button itself so the
   logo and the menu fit (from 1440px nothing moves). */
@media (min-width: 992px) {
    .navbar .navbar-brand {
        display: flex;
        align-items: center;
        min-height: 110px;
    }

    .navbar .navbar-brand img {
        height: clamp(56px, calc(100vw * 100 / 1440), 100px);
    }

    .navbar #consultation-link {
        flex: 0 1 auto;
        min-width: max-content;
    }
}

/* From 1280px the three big panels are centred on the menu items, not on the whole bar. The logo on
   the left is narrower than the button block on the right, so the items sit left of the page centre
   (126px at 2250px wide) and a bar-centred panel drifted right, starting after "Use Cases". Below
   1280px the 960px panel cannot be centred on the items without running off the left edge, so it
   stays centred on the bar there. The list is as tall as the bar, so the 10px gap is unchanged. */
@media (min-width: 1280px) {
    .navbar .navbar-collapse>.navbar-nav {
        position: relative;
    }
}

@media (min-width: 992px) and (prefers-reduced-motion: reduce) {

    .navbar .nav-item>.dropdown-menu.nv-panel,
    .navbar .nav-item.dropdown:hover>.dropdown-menu.nv-panel,
    .navbar .nav-item>.dropdown-menu.nv-panel.show {
        transform: translate(-50%, 0);
        transition: none;
    }
}

/* ============================================================================
   Collapsed navbar (below 992px): the panels stack inside the menu
   ============================================================================ */
@media (max-width: 991.98px) {
    .navbar .nav-item>.dropdown-menu.nv-panel {
        width: 100%;
        margin: 8px 0 12px;
        padding: 18px 16px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    }

    .nv-grid,
    .nv-cards {
        grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr));
    }

    .nv-cards-2 {
        grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
    }

    .nv-split {
        grid-template-columns: minmax(0, 1fr);
    }

    .nv-learn {
        margin-top: 18px;
        padding: 14px 0 0;
        border-left: 0;
        border-top: 1px solid var(--nv-line);
    }

    .nv-learn ul {
        display: flex;
        flex-wrap: wrap;
        gap: 0 24px;
    }

    .nv-foot {
        flex-direction: column;
        align-items: flex-start;
    }
}


/* ============================================================================
   "Book a scoping call" button (#consultation-button, 2026-12-02)
   It sits on the bar's centre line, the same line as the menu links (Bootstrap's mt-3 pushed it 6px
   lower), and its label and arrow stay on one line inside the button at every width.
   ============================================================================ */
.navbar #consultation-link {
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center;
}

.navbar #consultation-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    white-space: nowrap;
}

.navbar #consultation-button img {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    max-width: none;
}

/* Collapsed menu (below 992px): logo on the left, the button and the menu toggle on the right, the
   opened menu underneath. The button used to be hidden up to 770px, and the toggle sat mid-bar
   (style.css gives it margin-left: 40%) with the button squeezed against the window edge. */
@media (max-width: 991.98px) {
    .navbar #consultation-link {
        order: 1;
        flex: 0 0 auto;
        width: auto;
        margin-left: auto;
        padding: 0;
    }

    .navbar .navbar-toggler {
        order: 2;
        margin-left: 12px;
    }

    .navbar .navbar-collapse {
        order: 3;
    }
}

/* Phones: a smaller button so logo, button and toggle fit on one row down to 320px */
@media (max-width: 575.98px) {
    .navbar #consultation-button {
        gap: 6px;
        padding: 6px 10px !important;
    }

    .navbar #consultation-button img {
        width: 16px;
        height: 16px;
    }

    .navbar .navbar-toggler {
        margin-left: 8px;
    }
}

/* Screens under 360px (old 320px phones): tighter button, toggle and logo gap (the button text is one
   step smaller there, typography.css section 3) */
@media (max-width: 359.98px) {
    .navbar #consultation-button {
        gap: 5px;
        padding: 5px 8px !important;
    }

    .navbar #consultation-button img {
        width: 14px;
        height: 14px;
    }

    .navbar .navbar-toggler {
        margin-left: 6px;
        padding: 4px;
    }

    .navbar .navbar-brand {
        margin-right: 8px;
    }
}
