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

   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). */
@media (min-width: 992px) and (max-width: 1279.98px) {
    .navbar .navbar-nav>.nav-item {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
}

/* 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;
    }
}
