/*
Theme Name: St Kizito
Theme URI: https://stkizitoelearning.com/
Author: Joseph Seguya
Author URI: https://stkizitoelearning.com/
Description: A light standalone theme for St Kizito E-Learning with a BuddyBoss-style interface — sticky header with search, cart and avatar menu, a collapsible icon sidebar, and a mobile bottom bar. No BuddyPress or BuddyBoss dependency. Built for WP Download Manager and WooCommerce.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: stkizito
Tags: education, e-learning, custom-menu, custom-logo, featured-images, threaded-comments, translation-ready
*/

/* ==========================================================================
   Tokens
   Colours marked "set by the Customizer" are overwritten at runtime; the
   values here are the fallbacks if that inline style is ever stripped.
   ========================================================================== */

:root {
    --stkz-accent: #1E73BE;
    --stkz-accent-soft: #1E73BE1f;
    --stkz-panel: #3B82F6;
    --stkz-panel-ink: #ffffff;
    --stkz-panel-muted: rgba(255, 255, 255, .74);
    --stkz-panel-hover: rgba(255, 255, 255, .14);
    --stkz-panel-active: rgba(255, 255, 255, .22);
    --stkz-content-max: 1240px;

    --stkz-ink: #0f172a;
    --stkz-ink-2: #475569;
    --stkz-ink-3: #94a3b8;
    --stkz-line: #e7e9ec;
    --stkz-line-soft: #f1f5f9;
    --stkz-bg: #f5f7fa;
    --stkz-card: #ffffff;

    --stkz-radius: 10px;
    --stkz-radius-lg: 14px;
    --stkz-shadow: 0 1px 2px rgba(16, 24, 40, .05);
    --stkz-shadow-pop: 0 12px 34px -12px rgba(16, 24, 40, .28);

    --stkz-header-h: 64px;
    --stkz-sidebar-w: 244px;
    --stkz-sidebar-w-collapsed: 72px;
    --stkz-bottom-h: 60px;

    --stkz-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ==========================================================================
   Base
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--stkz-bg);
    color: var(--stkz-ink);
    font-family: var(--stkz-font);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

body.stkz-locked { overflow: hidden; }

img { max-width: 100%; height: auto; }

a { color: var(--stkz-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.25; letter-spacing: -.015em; margin: 0 0 .5em; }
h1 { font-size: 27px; font-weight: 800; }
h2 { font-size: 21px; font-weight: 700; }
h3 { font-size: 17px; font-weight: 700; }

:focus-visible { outline: 2px solid var(--stkz-accent); outline-offset: 2px; }

.screen-reader-text {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden; clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}

.stkz-skip {
    position: absolute; left: -9999px; top: 8px; z-index: 999;
    padding: 10px 16px; background: #fff; border-radius: 8px;
    box-shadow: var(--stkz-shadow-pop);
}
.stkz-skip:focus { left: 8px; }

.card {
    background: var(--stkz-card);
    border: 1px solid var(--stkz-line);
    border-radius: var(--stkz-radius-lg);
    box-shadow: var(--stkz-shadow);
}

/* ==========================================================================
   Buttons
   Scoped hard: several plugins on this site style bare <button> elements, and
   without this the header controls inherit their gradients.
   ========================================================================== */

.stkz-btn,
.stkz-btn:link,
.stkz-btn:visited {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 7px !important;
    padding: 9px 15px !important;
    border-radius: 9px !important;
    border: 1px solid transparent !important;
    background-image: none !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    text-decoration: none !important;
    text-transform: none !important;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    transition: background .15s ease, border-color .15s ease, transform .12s ease;
}

.stkz-btn--solid { background: var(--stkz-accent) !important; color: #fff !important; }
.stkz-btn--solid:hover { filter: brightness(1.07); text-decoration: none !important; }

.stkz-btn--ghost {
    background: transparent !important;
    border-color: var(--stkz-line) !important;
    color: var(--stkz-ink) !important;
}
.stkz-btn--ghost:hover { background: var(--stkz-line-soft) !important; text-decoration: none !important; }

.stkz-btn:active { transform: scale(.98); }

.stkz-iconbtn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative;
    width: 38px !important; height: 38px !important;
    padding: 0 !important; margin: 0 !important;
    background: transparent !important;
    background-image: none !important;
    border: 0 !important;
    border-radius: 10px !important;
    box-shadow: none !important;
    color: var(--stkz-ink-2) !important;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
}
.stkz-iconbtn:hover { background: var(--stkz-line-soft) !important; color: var(--stkz-ink) !important; }

/* ==========================================================================
   Header
   ========================================================================== */

.stkz-header {
    height: var(--stkz-header-h);
    position: sticky; top: 0; z-index: 900;
    background: #fff;
    border-bottom: 1px solid var(--stkz-line);
    transition: box-shadow .2s ease;
}
.stkz-header.is-stuck { box-shadow: 0 2px 10px -4px rgba(16, 24, 40, .18); }

.admin-bar .stkz-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .stkz-header { top: 46px; } }

.stkz-header__inner {
    display: flex; align-items: center; gap: 14px;
    height: 100%; max-width: 100%;
    padding: 0 16px;
}

.stkz-brand {
    display: flex; align-items: center;
    flex: 0 1 auto;
    /* min-width:0 is what stops a wide logo forcing the row off-screen */
    min-width: 0;
    overflow: hidden;
    text-decoration: none !important;
}
.stkz-brand img { max-height: 36px; width: auto; display: block; }
.stkz-brand__text {
    font-size: 17px; font-weight: 800; color: var(--stkz-ink);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.stkz-nav--primary { min-width: 0; overflow: hidden; }

.stkz-topnav {
    display: flex; align-items: center; gap: 2px;
    list-style: none; margin: 0; padding: 0;
}
.stkz-topnav li { position: relative; }
.stkz-topnav > li > a {
    display: block; padding: 8px 12px; border-radius: 8px;
    color: var(--stkz-ink-2); font-size: 14px; font-weight: 600;
    white-space: nowrap; text-decoration: none;
}
.stkz-topnav > li > a:hover { background: var(--stkz-line-soft); color: var(--stkz-ink); }
.stkz-topnav > li.current-menu-item > a { color: var(--stkz-accent); background: var(--stkz-accent-soft); }

.stkz-topnav .sub-menu {
    position: absolute; top: 100%; left: 0; z-index: 20;
    min-width: 210px; padding: 6px;
    list-style: none; margin: 6px 0 0;
    background: #fff; border: 1px solid var(--stkz-line);
    border-radius: 12px; box-shadow: var(--stkz-shadow-pop);
    opacity: 0; visibility: hidden; transform: translateY(-4px);
    transition: opacity .15s ease, transform .15s ease, visibility .15s;
}
.stkz-topnav li:hover > .sub-menu,
.stkz-topnav li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: none; }
.stkz-topnav .sub-menu a {
    display: block; padding: 8px 11px; border-radius: 7px;
    color: var(--stkz-ink-2); font-size: 13.5px; font-weight: 500; text-decoration: none;
}
.stkz-topnav .sub-menu a:hover { background: var(--stkz-line-soft); color: var(--stkz-ink); }

.stkz-header__aside {
    display: flex; align-items: center; gap: 6px;
    margin-left: auto;
    flex: 0 0 auto;
}

/* Cart */
.stkz-cart { text-decoration: none !important; }
.stkz-cart__count {
    position: absolute; top: 3px; right: 2px;
    min-width: 17px; height: 17px; padding: 0 4px;
    display: grid; place-items: center;
    background: var(--stkz-accent); color: #fff;
    border-radius: 999px; font-size: 10px; font-weight: 700; line-height: 1;
}
.stkz-cart__count.is-empty { display: none; }

/* Avatar + dropdown */
.stkz-account { position: relative; }
.stkz-account__btn {
    display: block !important;
    padding: 0 !important; margin: 0 !important;
    background: none !important; background-image: none !important;
    border: 0 !important; box-shadow: none !important;
    border-radius: 50% !important;
    cursor: pointer; line-height: 0;
    -webkit-appearance: none; appearance: none;
}
.stkz-avatar {
    width: 34px; height: 34px;
    border-radius: 50%; object-fit: cover; display: block;
    flex-shrink: 0;
}
.stkz-avatar--lg { width: 44px; height: 44px; }

.stkz-dropdown {
    position: absolute; right: 0; top: calc(100% + 8px); z-index: 950;
    width: 264px; padding: 8px;
    background: #fff; border: 1px solid var(--stkz-line);
    border-radius: 14px; box-shadow: var(--stkz-shadow-pop);
}
.stkz-dropdown__head {
    display: flex; align-items: center; gap: 11px;
    padding: 8px 8px 12px; margin-bottom: 6px;
    border-bottom: 1px solid var(--stkz-line-soft);
}
.stkz-dropdown__id { min-width: 0; display: flex; flex-direction: column; }
.stkz-dropdown__id strong { font-size: 14px; line-height: 1.3; }
.stkz-dropdown__id span {
    font-size: 12px; color: var(--stkz-ink-3);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.stkz-dropdown__list { list-style: none; margin: 0; padding: 0; }
.stkz-dropdown__list a {
    display: block; padding: 9px 10px; border-radius: 8px;
    color: var(--stkz-ink-2); font-size: 13.5px; font-weight: 600; text-decoration: none;
}
.stkz-dropdown__list a:hover { background: var(--stkz-line-soft); color: var(--stkz-ink); }

.stkz-dropdown__logout {
    display: flex; align-items: center; gap: 8px;
    margin-top: 6px; padding: 10px;
    border-top: 1px solid var(--stkz-line-soft);
    color: #e11d48 !important; font-size: 13.5px; font-weight: 600; text-decoration: none;
}
.stkz-dropdown__logout:hover { text-decoration: none; }

/* Search panel */
.stkz-searchpanel {
    display: none;
    position: absolute; left: 0; right: 0; top: 100%;
    background: #fff; border-bottom: 1px solid var(--stkz-line);
    box-shadow: 0 10px 24px -14px rgba(16, 24, 40, .3);
}
.stkz-searchpanel.is-open { display: block; }
.stkz-searchpanel__inner {
    display: flex; align-items: center; gap: 10px;
    max-width: var(--stkz-content-max); margin: 0 auto; padding: 14px 16px;
}

.stkz-search {
    display: flex; align-items: center; gap: 8px; flex: 1;
    padding: 6px 8px 6px 12px;
    background: var(--stkz-line-soft);
    border: 1px solid var(--stkz-line);
    border-radius: 10px;
}
.stkz-search .stkz-ico { color: var(--stkz-ink-3); flex-shrink: 0; }
.stkz-search__field {
    flex: 1; min-width: 0;
    background: none; border: 0; outline: none;
    font: inherit; font-size: 14px; color: var(--stkz-ink);
}

/* ==========================================================================
   Layout
   ========================================================================== */

.stkz-layout { display: flex; align-items: flex-start; }
.stkz-content { flex: 1; min-width: 0; }

.stkz-shell {
    display: flex; align-items: flex-start; gap: 24px;
    max-width: var(--stkz-content-max);
    margin: 0 auto; padding: 24px 16px 48px;
}
.stkz-main { flex: 1; min-width: 0; }
.stkz-aside { width: 300px; flex-shrink: 0; }
.stkz-aside .widget { padding: 16px; margin-bottom: 16px; }
.widget-title { font-size: 14px; font-weight: 700; margin-bottom: 10px; }

/* ==========================================================================
   Left panel
   ========================================================================== */

.stkz-sidebar {
    position: sticky;
    top: var(--stkz-header-h);
    height: calc(100vh - var(--stkz-header-h));
    width: var(--stkz-sidebar-w);
    flex-shrink: 0;
    display: flex; flex-direction: column;
    background: var(--stkz-panel);
    color: var(--stkz-panel-ink);
    overflow: hidden;
    transition: width .2s ease;
}
.admin-bar .stkz-sidebar { top: calc(var(--stkz-header-h) + 32px); height: calc(100vh - var(--stkz-header-h) - 32px); }

.stkz-sidebar__nav { flex: 1; overflow-y: auto; padding: 14px 10px; }

.stkz-sidenav, .stkz-subnav { list-style: none; margin: 0; padding: 0; }
.stkz-subnav { margin: 2px 0 2px 30px; }

.stkz-sidenav a {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; margin-bottom: 2px;
    border-radius: 9px;
    color: var(--stkz-panel-muted);
    font-size: 14px; font-weight: 600;
    text-decoration: none !important;
    white-space: nowrap;
}
.stkz-sidenav a:hover { background: var(--stkz-panel-hover); color: var(--stkz-panel-ink); }
.stkz-sidenav .is-current > a { background: var(--stkz-panel-active); color: var(--stkz-panel-ink); }
.stkz-sidenav .stkz-ico { flex-shrink: 0; }
.stkz-navitem__label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

.stkz-sidebar__collapse {
    display: flex !important; align-items: center; gap: 10px;
    width: 100%; padding: 13px 22px !important; margin: 0 !important;
    background: transparent !important; background-image: none !important;
    border: 0 !important; border-top: 1px solid var(--stkz-panel-hover) !important;
    box-shadow: none !important;
    color: var(--stkz-panel-muted) !important;
    font-size: 13px !important; font-weight: 600 !important;
    text-transform: none !important;
    cursor: pointer;
    -webkit-appearance: none; appearance: none;
}
.stkz-sidebar__collapse:hover { background: var(--stkz-panel-hover) !important; color: var(--stkz-panel-ink) !important; }
.stkz-sidebar__collapse .stkz-ico { transform: rotate(180deg); transition: transform .2s ease; }

/* Collapsed: icons only */
.sidebar-collapsed .stkz-sidebar { width: var(--stkz-sidebar-w-collapsed); }
.sidebar-collapsed .stkz-navitem__label,
.sidebar-collapsed .stkz-sidebar__collapse span,
.sidebar-collapsed .stkz-subnav { display: none; }
.sidebar-collapsed .stkz-sidenav a { justify-content: center; padding-inline: 0; }
.sidebar-collapsed .stkz-sidebar__collapse { justify-content: center; padding-inline: 0 !important; }
.sidebar-collapsed .stkz-sidebar__collapse .stkz-ico { transform: none; }

/* ==========================================================================
   Mobile drawer
   ========================================================================== */

.stkz-drawer { position: fixed; inset: 0; z-index: 940; visibility: hidden; }
.stkz-drawer.is-open { visibility: visible; }

.stkz-drawer__backdrop {
    position: absolute; inset: 0;
    background: rgba(15, 23, 42, .5);
    opacity: 0; transition: opacity .22s ease;
}
.stkz-drawer.is-open .stkz-drawer__backdrop { opacity: 1; }

.stkz-drawer__panel {
    position: absolute; left: 0; top: 0; bottom: 0;
    width: min(290px, 84vw);
    padding: 16px 10px;
    background: var(--stkz-panel); color: var(--stkz-panel-ink);
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform .26s cubic-bezier(.22, .61, .36, 1);
}
.stkz-drawer.is-open .stkz-drawer__panel { transform: none; }

/* ==========================================================================
   Bottom bar
   ========================================================================== */

.stkz-bottomnav {
    display: none;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 930;
    height: calc(var(--stkz-bottom-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: #fff;
    border-top: 1px solid var(--stkz-line);
    box-shadow: 0 -2px 14px -8px rgba(16, 24, 40, .3);
}

.stkz-bottomnav__list {
    display: flex; align-items: stretch;
    width: 100%; margin: 0; padding: 0; list-style: none;
}
.stkz-bottomnav__list > li { flex: 1; min-width: 0; }
.stkz-bottomnav__list a {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; height: 100%; padding: 6px 2px;
    color: var(--stkz-ink-3);
    font-size: 10.5px; font-weight: 600; line-height: 1.1;
    text-align: center; text-decoration: none !important;
}
.stkz-bottomnav__list .is-current > a { color: var(--stkz-accent); }
.stkz-bottomnav__list .stkz-navitem__label {
    max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ==========================================================================
   Content
   ========================================================================== */

.stkz-pagehead { margin-bottom: 18px; }
.stkz-pagehead__title { margin: 0 0 4px; }
.stkz-pagehead__sub { margin: 0; color: var(--stkz-ink-2); font-size: 14px; }

.stkz-meta { display: flex; gap: 7px; color: var(--stkz-ink-3); font-size: 12.5px; }

.stkz-article { padding: 26px; }
.stkz-article__media { margin: 0 0 20px; border-radius: var(--stkz-radius); overflow: hidden; }
.stkz-article__tags { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--stkz-line-soft); font-size: 13px; }

.stkz-prose > *:first-child { margin-top: 0; }
.stkz-prose > *:last-child { margin-bottom: 0; }
.stkz-prose p, .stkz-prose ul, .stkz-prose ol { margin: 0 0 1.1em; }
.stkz-prose img, .stkz-prose iframe { border-radius: var(--stkz-radius); max-width: 100%; }
.stkz-prose blockquote {
    margin: 1.4em 0; padding: 2px 0 2px 18px;
    border-left: 3px solid var(--stkz-accent);
    color: var(--stkz-ink-2);
}
.stkz-prose table { width: 100%; border-collapse: collapse; font-size: 14px; }
.stkz-prose th, .stkz-prose td { padding: 9px 11px; border: 1px solid var(--stkz-line); text-align: left; }

.stkz-postgrid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

.stkz-card { display: flex; flex-direction: column; overflow: hidden; }
.stkz-card__media { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--stkz-line-soft); }
.stkz-card__media img { width: 100%; height: 100%; object-fit: cover; }
.stkz-card__body { padding: 16px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.stkz-card__title { font-size: 16px; margin: 0; }
.stkz-card__title a { color: var(--stkz-ink); text-decoration: none; }
.stkz-card__title a:hover { color: var(--stkz-accent); }
.stkz-card__excerpt { margin: 0; color: var(--stkz-ink-2); font-size: 13.5px; }
.stkz-card__more {
    display: inline-flex; align-items: center; gap: 3px;
    margin-top: auto; padding-top: 6px;
    font-size: 13px; font-weight: 700; text-decoration: none;
}

.stkz-empty { padding: 40px 26px; text-align: center; }
.stkz-empty h1, .stkz-empty h2 { margin-bottom: 8px; }
.stkz-empty p { color: var(--stkz-ink-2); margin: 0 0 18px; }
.stkz-empty .stkz-search { max-width: 460px; margin: 0 auto 18px; }

.pagination, .stkz-postnav { margin-top: 26px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 6px; }
.pagination .page-numbers {
    display: grid; place-items: center;
    min-width: 38px; height: 38px; padding: 0 10px;
    background: #fff; border: 1px solid var(--stkz-line);
    border-radius: 9px;
    color: var(--stkz-ink-2); font-size: 13.5px; font-weight: 600; text-decoration: none;
}
.pagination .page-numbers.current { background: var(--stkz-accent); border-color: var(--stkz-accent); color: #fff; }

.stkz-comments { padding: 24px; margin-top: 20px; }
.stkz-commentlist { list-style: none; margin: 0 0 22px; padding: 0; }
.stkz-commentlist .children { list-style: none; margin: 0 0 0 22px; padding: 0; }
.stkz-commentlist .comment-body { padding: 14px 0; border-bottom: 1px solid var(--stkz-line-soft); }

/* ==========================================================================
   Footer
   ========================================================================== */

.stkz-footer { background: #fff; border-top: 1px solid var(--stkz-line); }
.stkz-footer .stkz-shell { display: block; padding-block: 32px; }
.stkz-footer__cols { display: grid; gap: 26px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-bottom: 26px; }
.stkz-footer__col .widget { border: 0; box-shadow: none; background: none; padding: 0; }

.stkz-footer__bar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
    padding-top: 18px; border-top: 1px solid var(--stkz-line-soft);
}
.stkz-footer__copy { margin: 0; color: var(--stkz-ink-3); font-size: 13px; }
.stkz-footernav { display: flex; flex-wrap: wrap; gap: 16px; list-style: none; margin: 0 0 0 auto; padding: 0; }
.stkz-footernav a { color: var(--stkz-ink-2); font-size: 13px; text-decoration: none; }

/* ==========================================================================
   Responsive
   ========================================================================== */

.stkz-only-sm { display: none !important; }

@media (max-width: 1024px) {
    :root { --stkz-header-h: 56px; }

    .stkz-only-sm { display: inline-flex !important; }
    .stkz-hide-sm { display: none !important; }

    .stkz-sidebar { display: none; }
    .stkz-bottomnav { display: block; }

    body { padding-bottom: calc(var(--stkz-bottom-h) + env(safe-area-inset-bottom)); }

    .stkz-shell { flex-direction: column; gap: 18px; padding: 16px 14px 32px; }
    .stkz-aside { width: 100%; }
    .stkz-article { padding: 18px; }
    .stkz-header__inner { gap: 8px; padding: 0 12px; }
    .stkz-brand img { max-height: 30px; }
    h1 { font-size: 22px; }
}

@media (max-width: 420px) {
    .stkz-postgrid { grid-template-columns: 1fr; }
    .stkz-dropdown { width: min(264px, calc(100vw - 24px)); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

@media print {
    .stkz-header, .stkz-sidebar, .stkz-bottomnav, .stkz-footer, .stkz-drawer { display: none !important; }
    body { background: #fff; padding: 0; }
}
