/*
 * Header + mobile drawer, ported from the skillwave design (classes prefixed khn-).
 * Colours follow the logo: deep navy and royal blue, with metallic gold accents.
 */

/* ======================= tokens ======================= */
:root {
    --khn-primary: #e0a514;
    --khn-primary-dark: #d5902a;
    --khn-primary-text: #a87300; /* gold that stays readable as text on white */
    --khn-primary-soft: rgba(224, 165, 20, .14);
    --khn-navy: #06256f;

    --khn-surface: #ffffff;
    --khn-heading: #06256f;
    --khn-text: #4a5468;
    --khn-muted: #77808f;
    --khn-border: rgba(6, 37, 111, .1);
    --khn-shadow: 0 16px 44px rgba(6, 37, 111, .1);
    --khn-glass: rgba(255, 255, 255, .78);
    --khn-glass-border: rgba(6, 37, 111, .08);

    --khn-header-h: 76px;
    --khn-header-top: 14px;
    --khn-header-space: calc(var(--khn-header-h) + var(--khn-header-top) * 2);
}

/* the header floats over the page: the first section runs underneath it, so its background
   reaches the top of the page, and only its content is pushed below the header */
.main>.hero-section {
    margin-top: 0; /* the old theme pulled the hero up under its transparent header */
}

.main>.site-breadcrumb,
.main>.auth-area {
    padding-top: calc(var(--khn-header-space) + 50px);
}

.main>:first-child:not(.hero-section):not(.site-breadcrumb):not(.auth-area):not(.tq-hero),
.khn-drawer+:not(.main) {
    margin-top: var(--khn-header-space);
}

/* ======================= buttons ======================= */
.khn-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border-radius: 60px;
    border: 1px solid transparent;
    font-weight: 700;
    line-height: 1;
    text-decoration: none !important;
    cursor: pointer;
    transition: transform .2s ease, background .2s ease, background-position .6s ease, color .2s ease, border-color .2s ease, box-shadow .3s ease;
}

.khn-btn--sm {
    height: 46px;
    padding: 0 24px;
    font-size: 15px;
    border-width: 2px;
}

.khn-btn--primary {
    background: linear-gradient(135deg, #5b3505, #b77716, #ffd76a, #fff2a8, #c4871d, #6a4007);
    background-size: 200% 200%;
    background-position: 0% 50%;
    color: #fff !important;
    text-shadow: 0 1px 2px rgba(60, 30, 0, .45);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .65), inset 0 -2px 6px rgba(80, 45, 0, .55), 0 0 20px rgba(255, 196, 58, .45);
}

.khn-btn--primary:hover {
    background-position: 100% 50%;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .65), inset 0 -2px 6px rgba(80, 45, 0, .55), 0 0 30px rgba(255, 196, 58, .65);
}

.khn-btn--outline {
    background: transparent;
    border: 2px solid var(--khn-navy);
    color: var(--khn-heading) !important;
}

.khn-btn--outline:hover {
    background: var(--khn-navy);
    color: #fff !important;
}

/* text that slides up and is replaced by a copy of itself on hover */
.khn-flip {
    position: relative;
    display: inline-block;
    overflow: hidden;
    line-height: 1.2;
    vertical-align: middle;
}

.khn-flip>span {
    display: block;
}

/* ======================= header ======================= */
.khn-header {
    position: fixed;
    top: var(--khn-header-top);
    left: 50%;
    z-index: 1000;
    width: calc(100% - 28px);
    max-width: 1340px;
    transform: translateX(-50%);
    border-radius: 60px;
    background: var(--khn-glass);
    border: 1px solid var(--khn-glass-border);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 6px 24px rgba(6, 37, 111, .06);
    transition: background .3s ease, box-shadow .3s ease, top .3s ease;
}

.khn-header.is-scrolled {
    top: 8px;
    background: var(--khn-surface);
    box-shadow: var(--khn-shadow);
}

.khn-header__inner {
    height: var(--khn-header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 0 12px 0 26px;
}

.khn-logo img {
    display: block;
    height: 55px;
    width: auto;
    max-width: 190px;
    object-fit: contain;
}

.khn-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.khn-menu {
    display: flex;
    align-items: center;
    gap: 4px;
}

.khn-menu>li {
    position: relative;
}

.khn-menu>li>a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    border-radius: 30px;
    color: var(--khn-heading);
    font-size: 15.5px;
    font-weight: 600;
    text-decoration: none;
    transition: color .2s ease, background .2s ease;
}

.khn-menu>li>a:hover,
.khn-menu>li.is-active>a {
    color: var(--khn-primary-text);
}

.khn-menu>li.is-active>a {
    background: var(--khn-primary-soft);
}

.khn-menu .khn-caret {
    font-size: 11px;
    transition: transform .25s ease;
}

.khn-menu>li:hover .khn-caret,
.khn-menu>li:focus-within .khn-caret {
    transform: rotate(180deg);
}

.khn-sub {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    min-width: 250px;
    padding: 10px !important;
    border-radius: 18px;
    background: var(--khn-surface);
    border: 1px solid var(--khn-border);
    box-shadow: var(--khn-shadow);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, visibility .2s;
}

/* bridge the gap so the menu stays open while the pointer moves down to it */
.khn-sub::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -14px;
    height: 14px;
}

.khn-menu>li:hover>.khn-sub,
.khn-menu>li:focus-within>.khn-sub {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.khn-sub a {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 14px;
    border-radius: 12px;
    color: var(--khn-heading);
    font-size: 14.5px;
    font-weight: 600;
    text-decoration: none;
}

.khn-sub a:hover,
.khn-sub li.is-active a {
    background: var(--khn-primary-soft);
    color: var(--khn-primary-text);
}

.khn-sub small {
    color: var(--khn-primary-text);
    font-weight: 700;
}

.khn-sub .khn-sub__all {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid var(--khn-border);
}

.khn-header__actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.khn-icon-btn {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1px solid var(--khn-border);
    display: none;
    place-items: center;
    background: transparent;
    color: var(--khn-heading);
    font-size: 17px;
    cursor: pointer;
    text-decoration: none;
    transition: background .2s ease, color .2s ease, border-color .2s ease;
}

.khn-icon-btn:hover {
    background: var(--khn-primary);
    border-color: var(--khn-primary);
    color: #fff;
}

/* ======================= mobile drawer ======================= */
.khn-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1001;
    background: rgba(0, 0, 0, .55);
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, visibility .3s;
}

.khn-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 1002;
    width: min(380px, 88vw);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 24px 26px 34px;
    background: var(--khn-surface);
    color: var(--khn-text);
    transform: translateX(100%);
    transition: transform .35s cubic-bezier(.4, 0, .2, 1);
}

.khn-drawer-open {
    overflow: hidden;
}

.khn-drawer-open .khn-backdrop {
    opacity: 1;
    visibility: visible;
}

.khn-drawer-open .khn-drawer {
    transform: none;
}

.khn-drawer ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.khn-drawer__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.khn-drawer__close {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid var(--khn-border);
    background: transparent;
    color: var(--khn-heading);
    font-size: 18px;
    cursor: pointer;
}

.khn-drawer__menu {
    margin-top: 24px !important;
    border-top: 1px solid var(--khn-border);
}

.khn-drawer__menu>li {
    border-bottom: 1px solid var(--khn-border);
}

.khn-drawer__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.khn-drawer__menu a {
    display: block;
    flex: 1;
    padding: 14px 0;
    color: var(--khn-heading);
    font-weight: 700;
    text-decoration: none;
}

.khn-drawer__menu a:hover {
    color: var(--khn-primary-text);
}

.khn-drawer__toggle {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 0;
    background: var(--khn-primary-soft);
    color: var(--khn-heading);
    cursor: pointer;
}

.khn-drawer__toggle i {
    transition: transform .25s ease;
}

.khn-drawer__menu li.is-open .khn-drawer__toggle i {
    transform: rotate(180deg);
}

.khn-drawer__sub {
    display: none;
    padding: 0 0 10px 14px !important;
}

.khn-drawer__menu li.is-open .khn-drawer__sub {
    display: block;
}

.khn-drawer__sub a {
    padding: 8px 0;
    font-weight: 600;
    color: var(--khn-text);
}

.khn-drawer__block {
    margin-top: 26px;
}

.khn-drawer__title {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--khn-heading);
    margin: 0 0 12px;
}

.khn-drawer__item {
    margin-bottom: 10px;
}

.khn-drawer__item span {
    display: block;
    font-size: 12.5px;
    color: var(--khn-muted);
}

.khn-drawer__item a,
.khn-drawer__item p {
    margin: 0;
    color: var(--khn-heading);
    font-weight: 600;
    word-break: break-word;
    text-decoration: none;
}

.khn-socials {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.khn-socials a {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--khn-primary-soft);
    color: var(--khn-primary-text);
    text-decoration: none;
    transition: background .2s ease, color .2s ease;
}

.khn-socials a:hover {
    background: var(--khn-primary);
    color: #fff;
}

/* ======================= responsive ======================= */
@media (max-width: 1199px) {

    .khn-nav,
    .khn-header__actions .khn-hide-md {
        display: none;
    }

    .khn-icon-btn {
        display: grid;
    }
}

@media (max-width: 767px) {
    :root {
        --khn-header-h: 66px;
        --khn-header-top: 10px;
    }

    .khn-header {
        width: calc(100% - 20px);
    }

    .khn-header__inner {
        padding: 0 8px 0 16px;
    }

    .khn-logo img {
        height: 40px;
        max-width: 150px;
    }

    /* style.css drops the banner to 25px on phones: keep 50px like every other section */
    .main>.site-breadcrumb {
        padding-top: calc(var(--khn-header-space) + 50px);
        padding-bottom: 50px;
    }
}
