/* ==========================================================================
   Training Fields mega menu (المجالات التدريبية)
   Replaces the tall single-column dropdown with a multi-column panel.
   Loaded after style.css / style-rtl.css so it can override the theme.
   ========================================================================== */

/* Anchor exactly like the theme's other mega menu: full width of the menu
   column, left:0 in LTR / right:0 in RTL (style-rtl.css flips it). Do NOT use
   left:50% + translateX here — style-rtl.css pins right:0, which makes the
   `left` offset a no-op and the transform pushes the panel off-screen. */
.main-menu > ul > li.mega-menu-has > .fields-mega {
    width: 100%;
    max-width: none;
    transform: none;
    padding: 0;
    border-radius: 10px;
    box-shadow: 0 18px 50px rgba(35, 61, 99, 0.14);
    overflow: hidden;
}

/* ---------- head ---------- */
.fields-mega__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 28px;
    /* translucent so it blends with any panel background (e.g. founding-day theme) */
    background-color: rgba(35, 61, 99, 0.04);
    border-bottom: 1px solid rgba(128, 137, 150, 0.16);
}

.fields-mega__title {
    font-size: 16px;
    font-weight: 700;
    color: #233d63;
}

.main-menu > ul > li .fields-mega .fields-mega__all {
    font-size: 14px;
    font-weight: 600;
    color: #1361a1;
    padding-bottom: 0;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.fields-mega__all .icon {
    margin-right: 6px;
    margin-left: 0;
    font-size: 15px;
    transition: transform 0.25s;
}

[dir="ltr"] .fields-mega__all .icon {
    margin-right: 0;
    margin-left: 6px;
    transform: scaleX(-1);
}

.fields-mega__all:hover .icon {
    transform: translateX(-3px);
}

[dir="ltr"] .fields-mega__all:hover .icon {
    transform: scaleX(-1) translateX(-3px);
}

/* ---------- list ---------- */
.main-menu > ul > li .fields-mega .fields-mega__list {
    display: grid;
    /* fills the panel width and re-flows on its own instead of a fixed count */
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 2px 10px;
    padding: 18px 22px;
    margin: 0;
    list-style: none;
    max-height: calc(100vh - 220px);
    overflow-y: auto;
}

/* neutralise the generic .mega-menu > ul > li column rules */
.main-menu > ul > li .fields-mega .fields-mega__list > li,
.main-menu > ul > li .fields-mega .fields-mega__list > li.field-menu-item {
    display: block;
    margin: 0;
    padding: 0;
    border: 0;
    text-transform: none;
}

.main-menu > ul > li .fields-mega .fields-mega__list > li > a {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 8px;
    padding: 9px 12px;
    margin: 0;
    font-size: 14px;
    line-height: 1.45;
    color: #55627a;
    border-radius: 8px;
    transition: background-color 0.2s, color 0.2s;
}

/* small bullet marker */
.main-menu > ul > li .fields-mega .fields-mega__list > li > a:before {
    content: "";
    flex: 0 0 auto;
    width: 6px;
    height: 6px;
    margin-top: 7px;
    border-radius: 50%;
    background-color: #c9d4e2;
    transition: background-color 0.2s;
}

.main-menu > ul > li .fields-mega .fields-mega__list > li > a:hover {
    background-color: rgba(19, 97, 161, 0.07);
    color: #1361a1;
}

.main-menu > ul > li .fields-mega .fields-mega__list > li > a:hover:before {
    background-color: #1361a1;
}

.field-menu-item__text {
    display: block;
}

/* ---------- scrollbar ---------- */
.fields-mega__list::-webkit-scrollbar {
    width: 6px;
}

.fields-mega__list::-webkit-scrollbar-thumb {
    background-color: rgba(35, 61, 99, 0.2);
    border-radius: 3px;
}

/* ---------- responsive ---------- */
@media (max-width: 1199px) {
    .main-menu > ul > li .fields-mega .fields-mega__list {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        padding: 14px 16px;
    }

    .fields-mega__head {
        padding: 12px 18px;
    }
}

/* ---------- mobile / off-canvas list ---------- */
.off-canvas-menu-list .sub-menu > li.field-menu-item > a {
    display: block;
    line-height: 1.5;
}
