/*
 Theme Name:   point-five-labs
 Description:  Child theme encompassing all of 0.5 Labs Changes
 Author:       0.5 Labs
 Template:     Divi
 Version:      1.0.1
 Text Domain:  divi-child

 Custom styles for navigation, the mobile menu, and Divi Mega Pro.
*/

/* =========================================================================
 * 1. GLOBAL NAVIGATION
 * ===================================================================== */

/* Remove Divi's default dropdown arrows on desktop parent menu items. */
.et_pb_menu .nav li.menu-item-has-children > a:after {
    display: none !important;
}

/* Remove Divi's default arrows on the MOBILE menu (handled by custom toggle). */
.et_mobile_menu li.menu-item-has-children > a:after,
.et_mobile_menu li.page_item_has_children > a:after {
    display: none !important;
}


/* =========================================================================
 * 2. DESKTOP MENU  (>= 981px)
 * ===================================================================== */
@media (min-width: 981px) {

    /* Remove the default bottom margin from the header menu module. */
    .et_pb_menu_0_tb_header.et_pb_module {
        margin-bottom: 0 !important;
    }

    /* Hide default WP dropdowns for items handled by Divi Mega Pro,
       so only the Mega Pro panels show on desktop. */
    .et_pb_menu .nav li > a[rel^="divimegapro-"] ~ ul.sub-menu,
    .et_pb_fullwidth_menu .nav li > a[rel^="divimegapro-"] ~ ul.sub-menu {
        display: none !important;
        visibility: hidden !important;
    }

    /* Make Tippy.js tooltip containers transparent so custom Mega Pro
       content shows without default tooltip styling. */
    .tippy-content,
    .tippy-tooltip {
        background-color: transparent;
        background: none !important;
        box-shadow: none !important;
        overflow-y: visible !important;
    }

    /* Pointer cursor for desktop menu items (moved from head). */
    .et_pb_menu .nav li > a,
    .et_pb_fullwidth_menu .nav li > a {
        cursor: pointer !important;
    }
}


/* =========================================================================
 * 3. MOBILE MENU  (< 981px)
 * ===================================================================== */

/* Mobile dropdown container background. */
.et_mobile_menu,
.et_mobile_menu ul {
    background-color: #ffffff !important;
}

/* Padding when the mobile menu is open. */
.opened .et_mobile_menu {
    padding: 5% !important;
}

/* Hamburger -> close (X) icon when the menu is open. */
#et_mobile_nav_menu .mobile_nav.opened .mobile_menu_bar::before,
.et_pb_module.et_pb_menu .et_mobile_nav_menu .mobile_nav.opened .mobile_menu_bar::before {
    content: '\4d';
}

/* Positioning context for custom toggle buttons. */
ul.et_mobile_menu > li.menu-item-has-children,
ul.et_mobile_menu > li.menu-item-has-children .sub-menu li.menu-item-has-children {
    position: relative;
}

.et_mobile_menu .menu-item-has-children > a {
    background-color: transparent;
}

/* Clickable toggle overlay on the right of a parent item. */
ul.et_mobile_menu li.menu-item-has-children .mobile-toggle,
ul.et_mobile_menu li.page_item_has_children .mobile-toggle {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    max-height: 60px;
    padding: 0 !important;
    border: none;
    background-color: transparent;
    text-align: right;
    z-index: 999;
    cursor: pointer !important;
}

/* Chevron icon for the mobile submenu toggle. */
ul.et_mobile_menu li.menu-item-has-children .mobile-toggle::after,
ul.et_mobile_menu li.page_item_has_children .mobile-toggle::after {
    content: "\33" !important; /* down arrow */
    display: inline-block !important;
    position: relative !important;
    top: 15px !important;
    right: 30px !important;
    padding: 3px !important;
    font-family: "ETModules" !important;
    font-size: 24px !important;
    color: #ff9900 !important;
    font-weight: normal !important;
    line-height: 1 !important;
    font-style: normal !important;
    font-variant: normal !important;
    text-transform: none !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

/* Flip the chevron up when the submenu is open. */
ul.et_mobile_menu li.menu-item-has-children.dt-open > .mobile-toggle::after,
ul.et_mobile_menu li.page_item_has_children.dt-open > .mobile-toggle::after {
    content: "\32" !important; /* up arrow */
}

/* Blue chevrons for the High Income Shares menu branch.
   Requires the `hhis-menu` CSS class on the relevant menu item. */
ul.et_mobile_menu li.hhis-menu .mobile-toggle::after,
ul.et_mobile_menu li.hhis-menu.menu-item-has-children .mobile-toggle::after,
ul.et_mobile_menu li.hhis-menu li.menu-item-has-children .mobile-toggle::after {
    color: #0099FF !important;
}

/* Hide submenus by default; JS adds `.visible` to open them. */
ul.et_mobile_menu .menu-item-has-children .sub-menu {
    display: none !important;
    visibility: hidden !important;
}

ul.et_mobile_menu .menu-item-has-children .sub-menu.visible {
    display: block !important;
    visibility: visible !important;
}

@media (max-width: 980px) {

    .et_pb_menu_0_tb_header.et_pb_module {
        margin-bottom: 10px !important;
    }

    /* Full-width mobile menu, fixed relative to viewport. */
    .et_mobile_menu {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        width: 100vw !important;
        margin: 0 !important;
    }

    /* Position the dropdown directly below the header. */
    .et_mobile_nav_menu .et_mobile_menu {
        top: 100%;
    }

    /* Triangular pointer position. */
    .et_mobile_menu:after {
        right: 5%;
        left: auto;
    }
}


/* =========================================================================
 * 4. DIVI MEGA PRO INTEGRATION
 * ===================================================================== */

/* Hide the default Mega Pro close button. */
.divimegapro-close-container,
.divimegapro-close {
    display: none !important;
}

@media (min-width: 981px) {

    /* Remove horizontal centering inside Mega Pro panels for full-width menus. */
    .divimegapro .et_pb_row {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .divimegapro .et_pb_section {
        margin: 0 !important;
    }
}

/* =========================================================================
 * 4. Fix Logo
 * ===================================================================== */
.et_pb_menu__logo img[src$=".svg"] {
filter: none;
height: 34px !important;
width: auto;
display: block;
}