/* Phone menu (.mobile-menu) sections, opened by js/mobile-menu.js.
   Scoped to .mobile-menu throughout, so the desktop navbar is untouched. */

/* the category row's edge fades (see .pm-types); registered so they can transition.
   Without @property support the fade just switches instead of gliding. */
@property --pm-fl { syntax: "<length>"; inherits: false; initial-value: 0px; }
@property --pm-fr { syntax: "<length>"; inherits: false; initial-value: 28px; }

/* ── a section: closed = 0 height; .m-open = natural height (the script animates between) ── */
.mobile-menu .navigation > li.dropdown > ul,
.mobile-menu .navigation > li.dropdown > .pm-panel {
    display: block;
    height: 0;
    overflow: hidden;
}
.mobile-menu .navigation > li.dropdown.m-open > ul,
.mobile-menu .navigation > li.dropdown.m-open > .pm-panel {
    height: auto;
}

/* ── the logo: the mark is drawn for a light page, so on the dark panel it sits on a white
   tile (the theme placed it straight on --theme-color-dark, where it nearly vanished) ── */
.mobile-menu .nav-logo { width: auto; }
.mobile-menu .nav-logo a {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}
.mobile-menu .nav-logo img { display: block; max-height: 42px; width: auto; }
/* the theme nudged the close button 10px up; level it with the tile */
.mobile-menu .close-btn { top: 0; }

/* the arrow turns instead of swapping its icon */
.mobile-menu .navigation li.dropdown .dropdown-btn i { transition: transform .3s ease; }
.mobile-menu .navigation li.dropdown .dropdown-btn.active i { transform: rotate(180deg); }
.mobile-menu .navigation li.dropdown .dropdown-btn.active i:before { content: "\f107"; }
.mobile-menu .navigation > li.dropdown.m-open > a { color: var(--theme-color1); }

/* the label must not run under the arrow */
.mobile-menu .navigation > li.dropdown > a { padding-right: 52px; }

/* The you-are-here tag ("Our Company [Reviews]"). Its -2px top/bottom margins exist to keep
   the DESKTOP pill from growing; on a plain phone row they lifted the tag above the text.
   Here the row is a centred flex line and the tag carries no vertical margin. */
.mobile-menu .navigation > li.dropdown > a {
    display: flex;
    align-items: center;
}
/* .menu-box adds specificity: header.cshtml's rule for the same tag sits in an inline <style>
   that loads AFTER this file, so an equal selector would lose to it */
.mobile-menu .menu-box .navigation > li.dropdown > a .nav-here {
    margin: 0 0 0 10px;
    font-size: 10px;
    padding: 3px 8px;
    line-height: 1.2;
}
/* the desktop carets: the phone menu has its own arrow */
.mobile-menu .pm-caret,
.mobile-menu .nav-caret { display: none; }

/* ── a plain submenu (Our Company) ── */
.mobile-menu .navigation > li.dropdown > ul { background: rgba(255, 255, 255, 0.03); }
.mobile-menu .navigation > li.dropdown > ul > li > a {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.82);
}
.mobile-menu .navigation > li.dropdown > ul > li.current > a {
    color: var(--theme-color1);
    font-weight: 600;
}

/* ── Our Projects: category pills that swipe sideways, projects listed below ──
   The desktop mega menu's panel is absolute, hidden until hover, and has pointer-events
   off, so inside the phone menu every one of those is reset. */
.mobile-menu .proj-mega .pm-panel {
    position: static;
    display: block;
    min-width: 0;
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: rgba(255, 255, 255, 0.03);
}
.mobile-menu .proj-mega .pm-types {
    display: flex;
    flex: none;
    flex-wrap: nowrap;   /* the mega menu's own <=991px rule wraps them; here they swipe */
    gap: 8px;
    position: relative;   /* offsetLeft in mobile-menu.js is measured against this */
    padding: 12px 20px;
    overflow-x: auto;
    background: transparent;
    border: 0;
    scrollbar-width: none;
    /* a pill always comes to rest inside the 20px padding, never sliced at the edge */
    scroll-snap-type: x proximity;
    scroll-padding-inline: 20px;
    /* Each edge fades only while there are pills hidden past it: mobile-menu.js sets
       --pm-fl / --pm-fr to 28px or 0 as the row scrolls, and @property lets them glide. */
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 var(--pm-fl), #000 calc(100% - var(--pm-fr)), transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 var(--pm-fl), #000 calc(100% - var(--pm-fr)), transparent 100%);
    transition: --pm-fl .25s ease-out, --pm-fr .25s ease-out;
}
    .mobile-menu .proj-mega .pm-types::-webkit-scrollbar { display: none; }
.mobile-menu .proj-mega .pm-type {
    scroll-snap-align: start;
    flex: 0 0 auto;
    width: auto;
    padding: 7px 14px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 30px;
    background: transparent;
    color: rgba(255, 255, 255, 0.82);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}
    .mobile-menu .proj-mega .pm-type i { display: none; }
    /* touch leaves :hover stuck on the last tapped pill, so only .on may look selected */
    .mobile-menu .proj-mega .pm-type:hover { background: transparent; color: rgba(255, 255, 255, 0.82); }
    .mobile-menu .proj-mega .pm-type.on {
        background: var(--theme-color1);
        border-color: var(--theme-color1);
        color: #fff;
    }

.mobile-menu .proj-mega .pm-lists {
    min-width: 0;
    max-height: none;
    overflow: visible;
    padding: 0 0 8px;
}
.mobile-menu .proj-mega .pm-proj {
    gap: 10px;
    padding: 11px 20px 11px 34px;
    border-radius: 0;
    color: rgba(255, 255, 255, 0.86);
    font-size: 14.5px;
    font-weight: 500;
    line-height: 1.35;
}
    .mobile-menu .proj-mega .pm-proj i { color: var(--theme-color1); }
    .mobile-menu .proj-mega .pm-proj:hover {
        padding-left: 34px;
        background: rgba(255, 255, 255, 0.05);
        color: #fff;
    }
.mobile-menu .proj-mega .pm-empty {
    padding: 10px 20px 14px 34px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 13.5px;
}

@media (prefers-reduced-motion: reduce) {
    .mobile-menu .navigation li.dropdown .dropdown-btn i { transition: none; }
}
