/* ================================================================
   nav.css  –  Compliance Checker
   Fixed top nav bar + dropdown menus + breadcrumbs.
   Loaded globally via base.html.
   ================================================================ */


/* === NAV BAR ================================================== */

.cc-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-h);
    background: var(--ae-darkblue-90);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    z-index: var(--z-nav);
    box-shadow: var(--shadow-card);
    transition: height 0.3s ease-in-out, background 0.3s ease-in-out,
                padding 0.3s ease-in-out;
}

.cc-nav--scrolled {
    height: 70px;
    padding: 0 32px;
    background: rgba(8, 120, 128, 0.75);
}


/* === BRAND (left side) ======================================== */

.cc-nav__brand {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    color: var(--white);
    cursor: pointer;
}

.cc-nav__brand-logo {
    height: 48px;
    width: auto;
    transition: height 0.3s ease-in-out;
}
.cc-nav--scrolled .cc-nav__brand-logo { height: 36px; }


/* === LINKS (right side) ======================================= */

.cc-nav__links {
    display: flex;
    align-items: center;
    gap: 20px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.cc-nav__item {
    position: relative;
    display: flex;
    align-items: center;
}

.cc-nav__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 18px;
    letter-spacing: -0.9px;
    line-height: 1.1;
    color: var(--white);
    white-space: nowrap;
    padding: 6px 4px;
    border-bottom: 2px solid transparent;
    transition: border-color var(--transition-base), opacity var(--transition-base);
}
.cc-nav__link:hover    { 
    color: var(--ae-lightgreen);
    opacity: 0.85; }
.cc-nav__item.is-active > .cc-nav__link {
    border-bottom-color: var(--white);
}

.cc-nav__caret {
    font-size: 10px;
    opacity: 0.8;
    margin-left: 2px;
    transition: transform var(--transition-base);
}
.cc-nav__item--dropdown:hover .cc-nav__caret { transform: rotate(180deg); }


/* === DROPDOWN PANEL =========================================== */

.cc-nav__dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    min-width: 220px;
    padding-top: 12px;   /* hover-safe gap between link and panel */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: var(--z-dropdown);
}
.cc-nav__item--dropdown:hover .cc-nav__dropdown,
.cc-nav__item--dropdown:focus-within .cc-nav__dropdown {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.cc-nav__dropdown .dropdown-menu {
    display: block;
    position: static;
    float: none;
    list-style: none;
    margin: 0;
    padding: 6px 0;
    width: 100%;
    max-height: 60vh;
    overflow-y: auto;
    background: var(--white);
    border: none;
    border-radius: var(--radius-dropdown);
    box-shadow: var(--shadow-dropdown);
    color: var(--text-muted);
}

.cc-nav__dropdown .form-control {
    margin: 6px 10px 10px;
    width: calc(100% - 20px);
    padding: 6px 10px;
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--ae-black);
    background: var(--ae-white);
    border: 1px solid var(--card-bg);
    border-radius: var(--radius-sm);
}
.cc-nav__dropdown .form-control:focus {
    outline: none;
    border-color: var(--ae-darkblue);
    background: var(--white);
}
.cc-nav__dropdown .form-control::placeholder { color: var(--color-placeholder); }

.cc-nav__dropdown .dropdown-item {
    display: block;
    padding: 8px 16px;
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 14px;
    color: var(--text-muted);
    letter-spacing: 0;
    transition: background 0.15s ease, color 0.15s ease;
}
.cc-nav__dropdown .dropdown-item:hover {
    background: var(--ae-darkblue-10);
    color: var(--ae-darkblue);
    text-decoration: none;
}


/* === CTA BUTTON (Explore case studies) ======================== */

.cc-nav__item--cta { margin-left: 8px; }

.cc-nav__cta {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    background: var(--white);
    color: var(--ae-darkblue-90);
    font-family: var(--font-cta);
    font-weight: 500;
    font-size: 15px;
    letter-spacing: -0.3px;
    line-height: 1;
    padding: 12px 16px;
    border-radius: var(--radius-pill);
    border: 2px solid transparent;
    white-space: nowrap;
    transition: padding-left 0.25s ease, background var(--transition-base),
                border-color var(--transition-base), color var(--transition-base);
}
.cc-nav__cta-text {
    display: inline-block;
    color: inherit;
}
/* Grow padding on the left on hover so the button widens leftward while the
   text stays anchored to the right edge of the nav. */
.cc-nav__cta:hover {
    transform: scale(1.06);
    background: var(--ae-lightgreen);
    color: var(--ae-darkblue);
}


/* === BREADCRUMBS ============================================== */

.breadcrumb-trail {
    padding: 10px 20px;
    margin: calc(var(--nav-h) + 10px) 0 calc(var(--nav-h) * -1) 0;
    width: 100%;
}
.breadcrumb-trail .breadcrumb {
    display: flex;
    flex-wrap: wrap;
    padding: 0;
    margin: 0;
    list-style: none;
    background-color: transparent;
}
.breadcrumb-trail .breadcrumb-item {
    display: flex;
    align-items: center;
    color: var(--ae-darkblue);
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 500;
}
.breadcrumb-trail .breadcrumb-item a {
    color: var(--ae-darkblue);
    text-decoration: none;
    transition: color var(--transition-base);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}
.breadcrumb-trail .breadcrumb-item a:hover {
    color: var(--ae-darkblue);
    background-color: var(--ae-darkblue-10);
}
.breadcrumb-trail .breadcrumb-item + .breadcrumb-item::before {
    content: "\203A" !important;    /* › */
    padding: 0 12px;
    color: var(--ae-darkblue);
    font-size: 20px;
    font-weight: bold;
}
.breadcrumb-trail .breadcrumb-item.active {
    color: var(--ae-darkblue);
    font-weight: 700;
}


/* === RESPONSIVE =============================================== */

@media (max-width: 768px) {
    .breadcrumb-trail {
        margin-top: 90px;
        padding: 8px 15px;
    }
    .breadcrumb-item { font-size: 14px; }
}


/* ================================================================
   RESPONSIVE NAVBAR  —  three states
   ----------------------------------------------------------------
   Desktop (>1400px) .......... original horizontal navbar with
                                 hover dropdowns — untouched.
   Tablet (≤1400px) ........... abbreviated direct links, no
                                 dropdowns, no hamburger.
   Mobile (≤768px) ............ logo + CTA + hamburger; clicking
                                 the hamburger opens a fullscreen
                                 overlay with stacked nav links.
   ================================================================ */

/* Base state for the new responsive-only elements.
   Hidden above 1400px; individual media queries below turn them on. */
.nav-tablet-only,
.nav-mobile-only,
.cc-nav__overlay,
.cc-nav__cta-text--short { display: none; }


/* === TABLET (≤1400px) ========================================= */

@media (max-width: 1400px) {

    /* Hide the desktop dropdown items (and therefore their carets
       and dropdown panels). The existing :hover dropdown rule is
       inert because the parent <li> is no longer rendered. */
    .nav-desktop-only { display: none; }
    .cc-nav__dropdown { display: none; }

    /* Show the short direct links that replace them */
    .nav-tablet-only  { display: flex; }

    /* Tighter typography + spacing so 6 links + CTA fit the row */
    .cc-nav__links    { gap: 14px; }
    .cc-nav__link     {
        font-size: 14px;
        letter-spacing: -0.4px;
        padding: 6px 2px;
    }

    /* Swap the CTA label for a shorter one */
    .cc-nav__cta-text--full  { display: none; }
    .cc-nav__cta-text--short { display: inline-block; }

    /* Nav horizontal padding tightens slightly */
    .cc-nav          { padding: 0 24px; }
    .cc-nav--scrolled { padding: 0 20px; }
}


/* === MOBILE (≤768px) ========================================== */

@media (max-width: 768px) {

    /* Hide every text-link item — desktop and tablet alike */
    .nav-desktop-only,
    .nav-tablet-only { display: none; }

    /* Show the hamburger */
    .nav-mobile-only { display: flex; }
    .cc-nav__hamburger {
        background: transparent;
        border: none;
        color: var(--white);
        font-size: 22px;
        line-height: 1;
        padding: 8px 10px;
        cursor: pointer;
    }
    .cc-nav__hamburger:hover { color: var(--ae-lightgreen); }

    /* Keep the CTA visible between brand and hamburger.
       .cc-nav__item--cta is NOT in any *-only class, so it persists. */
    .cc-nav__links         { gap: 8px; }
    .cc-nav__item--cta     { margin-left: 0; }
    .cc-nav__cta           { padding: 10px 14px; font-size: 14px; }

    /* --- FULLSCREEN OVERLAY ------------------------------------ */
    .cc-nav__overlay {
        display: flex;                 /* lifted from base `display: none` */
        position: fixed;
        inset: 0;
        width: 100%;
        height: 100%;
        background: var(--ae-darkblue);
        flex-direction: column;
        padding: 80px 24px 40px;
        z-index: var(--z-mobile-nav);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.25s ease,
                    visibility 0s linear 0.25s;   /* defer visibility until fade-out done */
    }
    .cc-nav__overlay.is-open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transition: opacity 0.25s ease,
                    visibility 0s linear 0s;
    }

    .cc-nav__overlay-close {
        position: absolute;
        top: 20px;
        right: 24px;
        background: transparent;
        border: none;
        color: var(--white);
        font-size: 26px;
        line-height: 1;
        padding: 8px;
        cursor: pointer;
    }
    .cc-nav__overlay-close:hover { color: var(--ae-lightgreen); }

    .cc-nav__overlay-links {
        list-style: none;
        margin: 0;
        padding: 0;
        display: flex;
        flex-direction: column;
    }
    .cc-nav__overlay-links li {
        border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    }
    .cc-nav__overlay-links a {
        display: flex;
        align-items: center;
        min-height: 56px;       /* ≥48px tap target */
        padding: 14px 4px;
        color: var(--white);
        font-family: var(--font-body);
        font-weight: 500;
        font-size: 22px;
        letter-spacing: -0.5px;
        text-decoration: none;
        transition: color 0.15s ease;
    }
    .cc-nav__overlay-links a:hover,
    .cc-nav__overlay-links a:focus { color: var(--ae-lightgreen); }

    /* Body scroll lock applied by the JS while the overlay is open */
    body.cc-nav-locked { overflow: hidden; }
}
