/* control-toolbox.org — VitePress global navigation styles */

a img {
  display: inline !important;
}

/* Show VitePress footer */
.VPFooter.has-sidebar {
    display: block !important;
}

:root {
    --ct-banner-height: 40px;
}

/*
 * Tell VitePress about our banner height via its own layout variable.
 * This single rule adjusts VPNav, VPSidebar, VPContent, VPNavScreen, etc.
 * !important overrides Vue's inline style="--vp-layout-top-height: 0px" on .Layout.
 */
.Layout {
    --vp-layout-top-height: var(--ct-banner-height) !important;
}

/* VPLocalNav on desktop uses top: var(--vp-nav-height) directly, needs explicit offset. */
@media (min-width: 960px) {
    .VPLocalNav {
        top: calc(var(--vp-nav-height) + var(--ct-banner-height)) !important;
    }
}

/* ─── Banner ─────────────────────────────────────────────────────────────── */

#ct-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--ct-banner-height);
    z-index: var(--vp-z-index-layout-top, 40);
    background: linear-gradient(90deg, #007fa2 80%, #005f73 100%);
    box-shadow: 0 2px 12px rgba(0, 95, 115, 0.35);
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0 1rem;
    font-size: 14px;
    box-sizing: border-box;
}

.dark #ct-banner {
    background: linear-gradient(90deg, #005f73 80%, #007fa2 100%);
}

#ct-banner .ct-brand {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    margin-right: 1rem;
}

#ct-banner .ct-brand img {
    height: 22px;
}

#ct-banner .ct-links {
    display: flex;
    align-items: center;
    gap: 0.05rem;
    flex: 1;
    overflow: hidden;
}

#ct-banner .ct-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    padding: 0.18rem 0.7rem;
    border-radius: 10px;
    white-space: nowrap;
    transition: background 0.2s ease, color 0.2s ease;
    letter-spacing: 0.01em;
}

#ct-banner .ct-links a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
    font-size: 18px;
}

/* ─── Heading colors ─────────────────────────────────────────────────────── */

.vp-doc h1 { color: #003d4d; }
.vp-doc h2 { color: #005f73; }
.vp-doc h3 { color: #0096a0; }
.vp-doc h4 { color: #f18f01; }
.vp-doc h5 { color: #d72638; }
.vp-doc h6 { color: #6a0572; }

.dark .vp-doc h1 { color: #4db8ff; }
.dark .vp-doc h2 { color: #5ec9d6; }
.dark .vp-doc h3 { color: #7dd3e0; }
.dark .vp-doc h4 { color: #ffb347; }
.dark .vp-doc h5 { color: #ff6b6b; }
.dark .vp-doc h6 { color: #c77dff; }

/* ─── Sticky footer ──────────────────────────────────────────────────────── */

.VPDoc {
    min-height: calc(100vh - var(--vp-nav-height) - var(--ct-banner-height));
}

/* ─── Hamburger button ───────────────────────────────────────────────────── */

#ct-banner #ct-toggler {
    display: none;
    margin-left: auto;
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 0.25rem;
}

#ct-banner .ct-hamburger-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    gap: 5px;
    width: 18px;
    height: 16px;
}

#ct-banner .ct-hamburger-top,
#ct-banner .ct-hamburger-middle,
#ct-banner .ct-hamburger-bottom {
    display: block;
    height: 2px;
    background-color: rgba(255, 255, 255, 0.85);
    transition: transform 0.25s ease, opacity 0.25s ease;
}

#ct-banner .ct-hamburger-top {
    width: 16px;
}

#ct-banner .ct-hamburger-middle {
    width: 8px;
}

#ct-banner .ct-hamburger-bottom {
    width: 12px;
}

#ct-banner #ct-toggler:hover .ct-hamburger-top,
#ct-banner #ct-toggler:hover .ct-hamburger-middle,
#ct-banner #ct-toggler:hover .ct-hamburger-bottom {
    background-color: #fff;
}

#ct-banner #ct-toggler.ct-toggler-active .ct-hamburger-top {
    transform: translateY(7px) rotate(45deg);
    width: 16px;
}

#ct-banner #ct-toggler.ct-toggler-active .ct-hamburger-middle {
    opacity: 0;
}

#ct-banner #ct-toggler.ct-toggler-active .ct-hamburger-bottom {
    transform: translateY(-7px) rotate(-45deg);
    width: 16px;
}

/* ─── Mobile: hide links, show hamburger ────────────────────────────────── */

@media (max-width: 767px) {
    #ct-banner {
        flex-wrap: wrap;
        height: auto;
        min-height: var(--ct-banner-height);
        padding-top: 0;
        padding-bottom: 0;
        align-items: flex-start;
    }

    #ct-banner .ct-brand {
        height: var(--ct-banner-height);
    }

    #ct-banner #ct-toggler {
        display: flex;
        align-items: center;
        height: var(--ct-banner-height);
    }

    #ct-banner .ct-links {
        display: none;
        flex-direction: column;
        width: 100%;
        padding: 0.4rem 0 0.6rem;
        gap: 0;
    }

    #ct-banner .ct-links.ct-links-open {
        display: flex;
    }

    #ct-banner .ct-links a {
        line-height: 2;
        padding: 0 0.25rem;
    }
}
