/* =====================================================================
   Kho Kho Uganda - masthead (loads after premium.css and skins.css)
   A deep, always-dark bar with a gold "touch line" along its lower edge, wide mega menus,
   and a palette button for the colour skins. Replaces the floating pill header.
   ===================================================================== */

/* topbar: slimmer, ticker is driven by theme.js */
.topbar { font-size: .82rem; }
.topbar .container { min-height: 34px; }
.topbar-ticker { width: min(520px, 42vw); }
.topbar-ticker span { animation: none !important; opacity: 0; transform: translateY(8px); transition: opacity .5s ease, transform .5s ease; }
.topbar-ticker span.is-on { opacity: 1; transform: none; }
.topbar-contact span + span { margin-left: 1rem; }
.topbar-social a { margin-left: .6rem; }

.k-head-wrap { position: sticky; top: 0; z-index: 1030; }
.k-head {
    --h-bg: linear-gradient(100deg, var(--k-night) 0%, var(--k-deep) 58%, var(--k-royal-2) 100%);
    background: var(--h-bg); padding: .5rem 0; position: relative;
    box-shadow: 0 10px 30px rgba(3, 13, 34, .22);
    transition: padding .3s ease, box-shadow .3s ease;
}
/* the touch line: a gold court line with the little cross-lane marks */
.k-head::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
    background:
        repeating-linear-gradient(90deg, var(--k-night) 0 2px, transparent 2px 36px) 0 0 / 100% 100%,
        linear-gradient(90deg, var(--k-gold-2), var(--k-gold) 30%, var(--k-sky) 70%, var(--k-gold) 100%);
}
.k-head.is-scrolled { padding: .2rem 0; box-shadow: 0 14px 36px rgba(3, 13, 34, .4); }
.k-head > .container { position: relative; }

.k-brand { display: inline-flex; align-items: center; gap: .7rem; color: #fff; padding: 0; margin-right: 1rem; }
.k-brand:hover { color: #fff; }
.k-head .brand-crest { width: 48px; height: 48px; box-shadow: 0 0 0 2px var(--k-gold), 0 6px 16px rgba(0, 0, 0, .4); }
.k-head .brand-crest::after { border-color: color-mix(in srgb, var(--k-gold) 70%, transparent); }
.k-brand-text { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 .3rem; font-family: var(--font-display); line-height: 1.05; font-size: 1.22rem; }
.k-brand-text strong { font-weight: 800; letter-spacing: -.01em; }
.k-brand-text em { font-style: normal; font-weight: 500; color: var(--k-gold); }
.k-brand-text small { flex-basis: 100%; font-family: var(--font-body); font-size: .68rem; font-weight: 500; opacity: .72; letter-spacing: .02em; }

.k-links { gap: .1rem; }
.k-head .nav-link {
    position: relative; color: rgba(255, 255, 255, .86); font-weight: 600; font-size: .94rem;
    padding: .7rem .8rem !important; border-radius: 0; background: none !important; box-shadow: none !important; transform: none !important;
}
.k-head .nav-link::after {
    content: ""; display: block !important; position: absolute; left: .8rem; right: .8rem; bottom: .25rem; height: 3px; border-radius: 3px;
    background: var(--k-gold); transform: scaleX(0); transform-origin: center; transition: transform .28s ease; border: 0; margin: 0;
}
.k-head .nav-link:hover, .k-head .nav-link:focus-visible, .k-head .nav-link.show { color: #fff; }
.k-head .nav-link:hover::after, .k-head .nav-link:focus-visible::after, .k-head .nav-link.show::after { transform: scaleX(1); }
.k-head .nav-link.active { color: var(--k-gold); }
.k-head .nav-link.active::after { transform: scaleX(1); height: 3px; background: var(--k-gold); }
.k-head .dropdown-toggle::after { /* keep Bootstrap caret, but override the underline rule above */
    position: static; display: inline-block !important; width: auto; height: auto; transform: none !important; margin-left: .4em; vertical-align: .2em;
    border-top: .3em solid; border-right: .3em solid transparent; border-left: .3em solid transparent; border-bottom: 0; background: none;
}

/* tools */
.k-tools { display: flex; align-items: center; gap: .4rem; margin-left: .8rem; }
.k-staff { display: inline-flex; gap: .3rem; align-items: center; }
.k-ico {
    width: 40px; height: 40px; border-radius: 12px; display: inline-grid; place-items: center; cursor: pointer;
    background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16); color: #fff; font-size: 1.02rem;
    transition: background .25s, transform .25s, border-color .25s;
}
.k-ico:hover, .k-ico:focus-visible { background: rgba(255, 255, 255, .2); border-color: var(--k-gold); color: #fff; transform: translateY(-2px); }
.k-ico-quiet { background: transparent; border-style: dashed; opacity: .7; } .k-ico-quiet:hover { opacity: 1; }
.k-join {
    display: inline-flex; align-items: center; gap: .4rem; padding: .62rem 1.15rem; border-radius: 12px; font-weight: 800; font-size: .93rem;
    color: #0a0a0a; background: var(--k-grad-gold); box-shadow: 0 8px 20px rgba(255, 184, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .55);
    transition: transform .25s, box-shadow .25s; white-space: nowrap;
}
.k-join:hover { color: #0a0a0a; transform: translateY(-2px); box-shadow: 0 12px 26px rgba(255, 184, 0, .5); }
.k-join i { transition: transform .25s; } .k-join:hover i { transform: translate(2px, -2px); }

/* mega menus */
@media (min-width: 992px) {
    .k-head .k-has-mega { position: static; }
    .k-head .k-mega-sm { position: relative; }
    .k-head .k-mega.dropdown-menu {
        left: 0; right: 0; top: 100%; margin: 0; padding: 1.1rem; border: 0; border-radius: 0 0 22px 22px; width: auto;
        background: var(--surface); box-shadow: 0 30px 60px rgba(3, 13, 34, .35);
        grid-template-columns: 1fr 280px; gap: 1.1rem;
    }
    .k-head .k-mega.dropdown-menu.show { display: grid; animation: k-mega-in .22s ease both; }
    .k-head .k-mega-sm .k-mega.dropdown-menu { left: 50%; right: auto; width: 340px; transform: translateX(-50%); border-radius: 18px; margin-top: .6rem; display: none; grid-template-columns: 1fr; }
    .k-head .k-mega-sm .k-mega.dropdown-menu.show { display: block; animation: none; }
}
@keyframes k-mega-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.k-mega-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .25rem .5rem; }
.k-mega-grid.k-one { grid-template-columns: 1fr; }
.k-mi { display: flex; gap: .8rem; padding: .7rem .8rem; border-radius: 14px; color: var(--text); align-items: flex-start; transition: background .2s, transform .2s; }
.k-mi i { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 1.1rem; color: var(--k-royal); background: var(--k-sky-soft); transition: background .2s, color .2s; }
.k-mi b { display: block; font-size: .95rem; line-height: 1.2; }
.k-mi small { display: block; margin-top: .15rem; color: var(--kku-muted, #5a5f66); font-size: .8rem; line-height: 1.35; }
.k-mi:hover, .k-mi:focus-visible { background: var(--k-tint); color: var(--text); transform: translateX(3px); }
.k-mi:hover i { background: var(--k-royal); color: #fff; }
[data-bs-theme="dark"] .k-mi i { color: var(--k-sky); } [data-bs-theme="dark"] .k-mi small { color: #9aa6b2; }
.k-feature {
    position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: .25rem; min-height: 200px; padding: 1.1rem; border-radius: 18px; overflow: hidden;
    color: #fff; background: linear-gradient(180deg, rgba(3, 13, 34, .05) 20%, rgba(3, 13, 34, .88)), var(--bg) center / cover, var(--k-deep);
}
.k-feature:hover { color: #fff; }
.k-feature strong { font-family: var(--font-display); font-size: 1.15rem; line-height: 1.15; }
.k-feature span { font-size: .85rem; opacity: .9; }
.k-feature .k-feature-tag { align-self: flex-start; background: var(--k-gold); color: #0a0a0a; font-weight: 800; font-size: .72rem; padding: .15rem .6rem; border-radius: 999px; opacity: 1; margin-bottom: .3rem; }
.k-feature::before { content: ""; position: absolute; inset: 0; background: url('/images/patterns/court.svg') center / 240px; opacity: .1; }
.k-feature > * { position: relative; }

/* colour theme picker */
.k-skins { width: 300px; padding: .9rem; border: 0; border-radius: 18px; box-shadow: 0 24px 54px rgba(3, 13, 34, .4); background: var(--surface); margin-top: .7rem !important; }
.k-skins-title { font-weight: 800; font-size: .9rem; margin-bottom: .6rem; color: var(--heading); }
.k-skins-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; }
.k-skin { display: flex; align-items: center; gap: .55rem; padding: .45rem .55rem; border-radius: 12px; border: 2px solid transparent; background: var(--k-tint); color: var(--text); font-weight: 600; font-size: .85rem; text-align: left; cursor: pointer; transition: border-color .2s, transform .2s; }
.k-skin:hover { transform: translateY(-2px); }
.k-skin[aria-checked="true"] { border-color: var(--k-gold-2); box-shadow: 0 0 0 2px color-mix(in srgb, var(--k-gold) 40%, transparent); }
.k-skin-sw { width: 28px; height: 28px; border-radius: 9px; flex: none; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.k-mode { width: 100%; margin-top: .7rem; padding: .55rem; border-radius: 12px; border: 1px dashed var(--line); background: transparent; color: var(--text); font-weight: 700; font-size: .88rem; cursor: pointer; }
.k-mode:hover { background: var(--k-tint); }
.k-mode .theme-icon-dark { display: none; } [data-bs-theme="dark"] .k-mode .theme-icon-light { display: none; } [data-bs-theme="dark"] .k-mode .theme-icon-dark { display: inline; }

/* search panel sits under the bar */
.search-panel { position: relative; z-index: 2; }

/* mobile */
.k-quick { display: flex; gap: .4rem; align-items: center; margin-left: auto; }
.k-burger { width: 44px; height: 44px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .08); display: inline-flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px; padding: 0; }
.k-burger span { display: block; width: 20px; height: 2px; border-radius: 2px; background: #fff; transition: transform .25s, opacity .25s; }
.k-burger:not(.collapsed) span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.k-burger:not(.collapsed) span:nth-child(2) { opacity: 0; }
.k-burger:not(.collapsed) span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.k-burger:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--k-gold) 55%, transparent); }
@media (max-width: 991.98px) {
    .k-head .navbar-collapse { margin-top: .6rem; padding: .6rem 0 .8rem; border-top: 1px solid rgba(255, 255, 255, .12); max-height: calc(100vh - 90px); overflow-y: auto; }
    .k-head .nav-link { padding: .8rem .4rem !important; font-size: 1.02rem; border-bottom: 1px solid rgba(255, 255, 255, .08); }
    .k-head .nav-link::after { display: none !important; }
    .k-head .nav-link.dropdown-toggle::after { display: inline-block !important; float: right; margin-top: .6em; }
    .k-head .k-mega.dropdown-menu { background: rgba(255, 255, 255, .05); border: 0; border-radius: 14px; padding: .4rem; margin: .3rem 0 .5rem; }
    .k-mega-grid { grid-template-columns: 1fr; }
    .k-mi { color: #fff; } .k-mi:hover { color: #fff; background: rgba(255, 255, 255, .08); }
    .k-mi small { color: rgba(255, 255, 255, .7); } .k-mi i { background: rgba(255, 255, 255, .12); color: var(--k-gold); }
    .k-feature { display: none; }
    .k-tools { margin: .9rem 0 0; flex-wrap: wrap; }
    .k-join { flex: 1; justify-content: center; }
    .k-skins { width: min(300px, 86vw); }
}
@media (max-width: 420px) { .k-brand-text { font-size: 1.05rem; } .k-brand-text small { display: none; } }
@media (min-width: 992px) and (max-width: 1199.98px) { .k-brand-text small { display: none; } .k-head .nav-link { padding: .7rem .55rem !important; font-size: .88rem; } .k-join { padding: .6rem .85rem; } }
@media (prefers-reduced-motion: reduce) { .k-mega.dropdown-menu.show { animation: none !important; } .topbar-ticker span { transition: none; } }

/* picture thumbnails in the menus */
.k-mi .k-thumb { flex: none; width: 52px; height: 52px; border-radius: 14px; object-fit: cover; box-shadow: 0 4px 12px rgba(3, 13, 34, .18); transition: transform .3s, box-shadow .3s; }
.k-mi:hover .k-thumb, .k-mi:focus-visible .k-thumb { transform: scale(1.07) rotate(-2deg); box-shadow: 0 8px 18px rgba(3, 13, 34, .3); }
.k-feature { transition: transform .35s, box-shadow .35s; background-size: cover; }
.k-feature:hover { transform: translateY(-3px); box-shadow: 0 18px 36px rgba(3, 13, 34, .35); }
@media (min-width: 992px) {
    .k-head .k-has-mega .k-mega.dropdown-menu { display: grid; visibility: hidden; opacity: 0; pointer-events: none; transform: translateY(-8px); transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s; }
    .k-head .k-has-mega .k-mega.dropdown-menu.show { visibility: visible; opacity: 1; pointer-events: auto; transform: none; transition-delay: 0s; animation: none; }
    .k-head .k-has-mega .k-mega.dropdown-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -16px; height: 16px; } /* keeps the pointer inside the menu while crossing the gap */
    .k-head .k-has-mega > .nav-link.show::after, .k-head .k-has-mega:hover > .nav-link::after { transform: rotate(180deg); }
    .k-mega-grid { grid-auto-rows: min-content; align-content: start; }
}
@media (max-width: 991.98px) { .k-mi .k-thumb { width: 44px; height: 44px; } }
@media (prefers-reduced-motion: reduce) { .k-head .k-has-mega .k-mega.dropdown-menu, .k-mi .k-thumb, .k-feature { transition: none !important; } }
