/* Học Toán 123 v2.2.5 — category dropdown visibility fix
 * Root cause: category-specific rules colored every menu anchor white,
 * including submenu links on a white dropdown background.
 */

/* Keep the top-level category menu white, but do not leak that color into dropdowns. */
html body.category #nav-main ul.nav-main > li > a,
html body.category #nav-main .nav-main > li > a {
    color: #fff !important;
}

/* Make dropdown layers reliable above Grade Hub hero/cards. */
html body.category #nav-main,
html body.category #nav-main ul.nav-main,
html body.category #nav-main ul.nav-main > li {
    overflow: visible !important;
}
html body.category #nav-main {
    z-index: 1000 !important;
}
html body.category #nav-main ul.nav-main > li:hover,
html body.category #nav-main ul.nav-main > li:focus-within {
    z-index: 1010 !important;
}

/* Explicit submenu presentation on category archives. */
html body.category #nav-main ul.nav-main ul,
html body.category #nav-main ul.nav-main .sub-menu {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    z-index: 1020 !important;
    min-width: 230px !important;
    width: max-content !important;
    max-width: 320px !important;
    margin: 0 !important;
    padding: 6px 0 !important;
    list-style: none !important;
    border: 1px solid #d8e2ed !important;
    border-top: 0 !important;
    border-radius: 0 0 10px 10px !important;
    background: #fff !important;
    box-shadow: 0 14px 30px rgba(14,42,72,.18) !important;
}

html body.category #nav-main ul.nav-main ul li,
html body.category #nav-main ul.nav-main .sub-menu > li {
    display: block !important;
    float: none !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: #fff !important;
}

html body.category #nav-main ul.nav-main ul li + li,
html body.category #nav-main ul.nav-main .sub-menu > li + li {
    border-top: 1px solid #edf2f7 !important;
}

html body.category #nav-main ul.nav-main ul li > a,
html body.category #nav-main ul.nav-main .sub-menu > li > a {
    display: block !important;
    box-sizing: border-box !important;
    width: 100% !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 10px 13px !important;
    color: #233b57 !important;
    background: #fff !important;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif !important;
    font-size: 12.5px !important;
    line-height: 1.35 !important;
    font-weight: 650 !important;
    letter-spacing: 0 !important;
    text-align: left !important;
    text-shadow: none !important;
    text-decoration: none !important;
    white-space: normal !important;
    box-shadow: none !important;
}

html body.category #nav-main ul.nav-main ul li:hover > a,
html body.category #nav-main ul.nav-main ul li:focus-within > a,
html body.category #nav-main ul.nav-main .sub-menu > li > a:hover,
html body.category #nav-main ul.nav-main .sub-menu > li > a:focus {
    color: #0d5c98 !important;
    background: #f3f8fd !important;
    outline: none !important;
}

/* Reinforce the parent's show/hide mechanism without changing homepage behavior. */
html body.category #nav-main ul.nav-main li:hover > ul,
html body.category #nav-main ul.nav-main li:focus-within > ul {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* Nested dropdowns, if any. */
html body.category #nav-main ul.nav-main ul ul {
    top: 0 !important;
    left: 100% !important;
    border-top: 1px solid #d8e2ed !important;
    border-radius: 10px !important;
}

@media (max-width: 840px) {
    /* On mobile, dropdowns belong to the expanded menu flow rather than floating panels. */
    html body.category #nav-main.drop ul.nav-main ul,
    html body.category #nav-main.drop ul.nav-main .sub-menu {
        position: static !important;
        width: 100% !important;
        max-width: none !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }
}
