/* ==========================================================================
   KHALA STUDIO RESOURCE HUB — BRAND IDENTITY TOKENS (LIGHT & MONOCHROME DARK)
   ========================================================================== */

:root {
    --hub-gap: 12px;
    --hub-page-pad: 16px;
    --hub-radius: 20px;
    --hub-radius-flat: 0px;

    /* Light Theme Tokens */
    --hub-bg: var(--bg-body, #f8f9fa);
    --hub-soft: #F5F4F9;
    --hub-soft-hover: #EFEEF6;
    --hub-text: #5f6368;
    --hub-title: #202124;
    --hub-accent: #1A73E8;
    --hub-muted: #5f6368;
    --hub-border: transparent;

    --hub-font: "Google Sans", "Product Sans", -apple-system, BlinkMacSystemFont,
                "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ⚡ MONOCHROME DARK THEME (NO BLUE — PURE WHITE, DARK GRAYS & BLACK) */
[data-theme="dark"] {
    --hub-bg: var(--bg-body, #121214);
    --hub-soft: #18181a;
    --hub-soft-hover: #222226;
    --hub-text: #8c8c94;
    --hub-title: #f1f3f4;
    --hub-accent: #ffffff;
    --hub-muted: #8c8c94;
    --hub-border: transparent;
}

.hub-main-wrapper {
    width: 100% !important;
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 0 var(--hub-page-pad) !important;
    box-sizing: border-box !important;
    background: var(--hub-bg);
    color: var(--hub-text);
    font-family: var(--hub-font);
    font-size: 1rem;
    transition: background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1), color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.hub-main-wrapper *,
.hub-main-wrapper h1,
.hub-main-wrapper h2,
.hub-main-wrapper h3,
.hub-main-wrapper h4,
.hub-main-wrapper p,
.hub-main-wrapper button,
.hub-main-wrapper input {
    box-sizing: border-box;
    font-family: inherit;
}

.hub-main-title {
    margin: 0;
    font-size: 1.625rem !important;
    line-height: 1.15;
    font-weight: 500 !important;
    letter-spacing: -0.02em;
    color: var(--hub-title) !important;
}

@keyframes hubFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.hub-fade-in {
    animation: hubFadeIn .28s ease;
}

/* --------------------------------------------------------------------------
   Header & Search Shell (Borderless Surface Contrast)
   -------------------------------------------------------------------------- */
.hub-header-row {
    display: block;
    width: 100%;
    margin: 50px 0 22px;
}

.hub-header-actions {
    width: 100%;
    margin-top: 24px;
}

.hub-search-shell {
    width: 100%;
    height: 60px;
    display: flex;
    align-items: center;
    background: var(--hub-soft);
    border-radius: 32px;
    border: none;
    overflow: hidden;
    transition: background-color .18s ease;
}

.hub-search-shell:focus-within {
    background: var(--hub-soft-hover);
}

.hub-search-all {
    height: 100%;
    min-width: 120px;
    padding: 0 28px 0 42px;
    border: 0;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--hub-title);
    font-size: 1rem;
    font-weight: 400;
    cursor: pointer;
    position: relative;
}

.hub-search-all::after {
    content: "";
    position: absolute;
    right: 0;
    top: 16px;
    width: 2px;
    height: 28px;
    background: rgba(255, 255, 255, 0.08);
}

[data-theme="light"] .hub-search-all::after {
    background: rgba(0, 0, 0, 0.08);
}

.hub-search-all .material-symbols-outlined {
    font-size: 22px;
    font-variation-settings: 'wght' 400;
}

.hub-search-all-label {
    position: relative;
    padding-bottom: 4px;
}

.hub-search-all.is-active .hub-search-all-label::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -14px;
    height: 2px;
    border-radius: 1px;
    background: var(--hub-accent);
}

.hub-search-input-wrap {
    flex: 1;
    min-width: 0;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 20px 0 22px;
}

.hub-search-input-wrap .material-symbols-outlined {
    color: var(--hub-text);
    font-size: 28px;
    flex: 0 0 auto;
}

.hub-search-input {
    width: 100%;
    height: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--hub-title);
    font: inherit;
    font-size: 1.125rem;
}

.hub-search-input::placeholder {
    color: var(--hub-muted);
    opacity: 0.7;
}

.hub-search-submit {
    width: 70px;
    height: 100%;
    border: 0;
    background: transparent;
    color: var(--hub-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color .18s ease;
}

.hub-search-submit:hover {
    color: var(--hub-accent);
}

.hub-search-submit .material-symbols-outlined {
    font-size: 34px;
}

/* --------------------------------------------------------------------------
   Category Grid & Cards (Borderless & Unified Dark Surfaces)
   -------------------------------------------------------------------------- */
.hub-category-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--hub-gap);
    width: 100%;
}

.hub-cat-card {
    min-width: 0;
    aspect-ratio: 1.275 / 1;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 0;
    background: var(--hub-soft) !important;
    border-radius: var(--hub-radius) !important;
    border: 0;
    cursor: pointer;
    text-align: center;
}

.hub-cat-icon-wrap {
    width: 100%;
    flex: 1;
    min-height: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    overflow: hidden;
    background: var(--hub-soft);
}

.hub-cat-icon-wrap img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    object-position: center;
}

.hub-cat-label {
    width: 100%;
    min-height: 54px;
    padding: 14px 16px 15px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    background: var(--hub-soft);
    color: var(--hub-title) !important;
    font-size: 1rem !important;
    line-height: 1.15;
    font-weight: 500 !important;
    letter-spacing: -0.01em;
}

.hub-empty-state {
    grid-column: 1 / -1;
    min-height: 190px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--hub-text);
    font-size: 1.125rem;
    background: var(--hub-soft);
    border-radius: var(--hub-radius);
}

.hub-sub-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 104px 0 24px;
}

.btn-back-hub {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border: none;
    border-radius: 50% !important;
    background: var(--hub-soft);
    color: var(--hub-title);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color .18s ease;
}

.btn-back-hub:hover {
    background: var(--hub-soft-hover);
}

.coming-soon-box {
    min-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    border-radius: var(--hub-radius);
    background: var(--hub-soft);
    color: var(--hub-text);
    font-size: 1.5rem !important;
}

/* --------------------------------------------------------------------------
   Responsive Breakpoints
   -------------------------------------------------------------------------- */
@media (max-width: 1000px) {
    .hub-category-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    :root {
        --hub-page-pad: 10px;
        --hub-gap: 10px;
    }

    .hub-header-row,
    .hub-sub-header {
        margin-top: 48px;
    }

    .hub-main-title {
        font-size: 1.5rem !important;
    }

    .hub-search-shell {
        height: 54px;
    }

    .hub-search-all {
        min-width: 78px;
        padding: 0 12px;
        gap: 7px;
        font-size: 1rem;
    }

    .hub-search-all::after {
        top: 14px;
        height: 26px;
    }

    .hub-search-input-wrap {
        padding: 0 10px 0 14px;
        gap: 8px;
    }

    .hub-search-input {
        font-size: 1rem;
    }

    .hub-search-submit {
        width: 52px;
    }

    .hub-search-submit .material-symbols-outlined {
        font-size: 28px;
    }

    .hub-category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hub-cat-label {
        min-height: 46px;
        padding: 11px 12px;
        font-size: 1rem !important;
    }
}

@media (max-width: 420px) {
    .hub-search-all span:last-child {
        display: none;
    }

    .hub-search-all {
        min-width: 52px;
        padding: 0 14px;
    }
}