/* ==========================================================================
   CMU Frontend — Custom Menu UDSIS
   Base structural styles + animation foundation.
   Visual overrides applied via Elementor {{WRAPPER}} selectors.
   ========================================================================== */

/* ---------- Reset: menu is a <nav> containing <li> items ---------- */
.cmu-menu,
.cmu-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cmu-menu {
    width: 100%;
    box-sizing: border-box;
}

/* ---------- Menu items ---------- */
.cmu-item {
    position: relative;
    margin: 0;
    padding: 0;
}

/* ---------- Link row (link + toggle button) ---------- */
.cmu-item__link-wrap {
    display: flex;
    align-items: center;
    overflow: visible;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
    /* transition-duration overridden by Elementor selector */
}

.cmu-item__link {
    display: block;
    flex: 1;
    min-width: 0;
    text-decoration: none;
    color: inherit;
    padding: 10px 16px;
    position: relative;
    transition: color 0.3s ease, background-color 0.3s ease;
    line-height: 1.4;
}

/* ---------- Underline slide effect (::after pseudo-element) ---------- */
/* The ::after is invisible by default (transparent bg).
   Elementor selectors set background-color + height when user enables the effect. */
.cmu-item__link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 0;
    background-color: transparent;
    transition: width 0.3s ease;
}

.cmu-item__link-wrap:hover > .cmu-item__link::after {
    width: 100%;
}

/* ---------- Toggle button ---------- */
.cmu-item__toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: inherit;
    line-height: 1;
    flex-shrink: 0;
    transition: transform 0.3s ease, color 0.3s ease, background-color 0.3s ease;
}

/* Rotation on open — default 180deg, overridden by Elementor selectors. */
.cmu-item--open > .cmu-item__link-wrap > .cmu-item__toggle {
    transform: rotate(180deg);
}

/* ---------- Icon normalization ---------- */
.cmu-item__toggle i {
    font-size: inherit;
    color: inherit;
    line-height: 1;
    display: inline-block;
}

.cmu-item__toggle svg {
    height: 1em;
    width: auto;
    fill: currentColor;
    vertical-align: middle;
}

/* ---------- Submenu — HIDDEN BY DEFAULT ---------- */
.cmu-submenu {
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    opacity: 1;
}

/* ---------- Separator between items ---------- */
.cmu-item--has-separator {
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

/* ---------- Menu item icons (FA, Dashicons, images) ---------- */
.cmu-item-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
    vertical-align: middle;
    transition: color 0.3s ease;
}

.cmu-item-icon i {
    font-size: inherit;
    color: inherit;
    line-height: 1;
    display: inline-block;
}

.cmu-item-icon svg {
    height: 1em;
    width: auto;
    fill: currentColor;
    vertical-align: middle;
}

.cmu-item-icon img {
    height: 1em;
    width: auto;
    object-fit: contain;
    vertical-align: middle;
    display: block;
}

/* ---------- Accessibility: focus styles ---------- */
.cmu-item__link:focus-visible,
.cmu-item__toggle:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}
