/*
 * Custom CSS overrides — ad-hoc tweaks kept outside the compiled bundle
 * (enqueued after the theme stylesheet in functions.php).
 */

/* ---------------------------------------------------------------------------
 * Mobile submenu — allow tapping placeholder dropdown parents
 *
 * The theme disables placeholder menu links with `pointer-events: none`
 * (a[href="#"]). On mobile the dropdown submenu opens via a JS tap on the
 * parent link, but pointer-events:none swallows that tap, so those submenus
 * never open. Re-enable pointer events on the placeholder parent toggles at
 * mobile widths only. Desktop keeps its hover behaviour untouched.
 *
 * `!important` is used because the theme disables these links deep in a scoped
 * chain (`.theme-html .header #menu-main-menu li a[href="#"]`); as a dedicated
 * override layer this is appropriate and won't break on theme selector tweaks.
 * ------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .theme-html #menu-main-menu .menu-item-has-children > a[href="#"],
    .theme-html #menu-main-menu .menu-item-has-children > a[href=""] {
        pointer-events: auto !important;
        cursor: pointer !important;
    }
}

/* ---------------------------------------------------------------------------
 * Mobile submenu — chevron stuck "open" after closing
 *
 * The theme rotates the chevron 180deg on :hover AND :focus-within, not just
 * on .submenu-open. On touch devices those states linger after a tap (sticky
 * :hover, retained :focus-within), so once the submenu is toggled closed the
 * chevron stays flipped until you tap elsewhere. Make .submenu-open the sole
 * driver on mobile: when the item is hovered/focused but NOT open, force the
 * chevron back to its resting (0deg) position.
 * ------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .theme-html #menu-main-menu .menu-item-has-children:hover:not(.submenu-open) > a::after,
    .theme-html #menu-main-menu .menu-item-has-children:focus-within:not(.submenu-open) > a::after {
        transform: rotate(0deg) !important;
    }
}

/* ---------------------------------------------------------------------------
 * Emergency support phone number — remove the -17px pull-in on mobile
 * ------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .theme-html .emergency-support .item .number,
    .block-editor-block-list__layout .emergency-support .item .number {
        margin-left: 0;
    }
}
