/* ============================================================
   ACTOREIN — Apple-style mega menu
   Same language as the search drawer: quiet grey rail, hairline
   separators, large headings and flat link lists instead of
   bordered cards. Loaded after mega-menu.css (priority 220).
   ============================================================ */
@media (min-width: 901px) {
    body .nc-header .nc-mega {
        left: 0 !important;
        right: 0 !important;
        width: auto !important;
        max-width: none !important;
        top: calc(100% + 10px) !important;
        margin: 0 !important;
        border: 1px solid rgba(0, 0, 0, 0.08) !important;
        border-radius: 20px !important;
        background: #ffffff !important;
        box-shadow: 0 30px 80px -24px rgba(6, 18, 31, 0.35), 0 2px 6px rgba(0, 0, 0, 0.04) !important;
        overflow: hidden !important;
        max-height: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none;
        transform: translateY(-8px) scale(0.995) !important;
        transform-origin: 50% 0;
        transition: opacity 0.18s ease, visibility 0.22s, transform 0.3s cubic-bezier(0.22, 0.9, 0.24, 1) !important;
        will-change: opacity, transform;
    }
    body .nc-header .nc-mega.is-open,
    body .nc-header .nc-menu__item--mega:hover .nc-mega,
    body .nc-header .nc-menu__item--mega.is-open .nc-mega,
    body .nc-header .nc-menu__item--mega:focus-within .nc-mega {
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto;
        transform: none !important;
        transition: opacity 0.24s ease, visibility 0.3s, transform 0.4s cubic-bezier(0.22, 0.9, 0.24, 1) !important;
    }
    body .nc-header .nc-mega::after { display: none !important; content: none !important; }

    /* The panel itself scrolls as one calm sheet. */
    body .nc-header .nc-mega .nc-mega__inner {
        max-height: min(560px, calc(100dvh - var(--ac-mega-top, 180px) - 40px));
        overflow-y: auto;
        overflow-x: hidden;
        overscroll-behavior: contain;
        border-radius: inherit;
        scrollbar-width: thin;
        scrollbar-color: rgba(0, 0, 0, 0.18) transparent;
    }

    /* ---------- Slim caption bar ---------- */
    body .nc-header .nc-mega .ac-mega-head {
        position: sticky;
        top: 0;
        z-index: 2;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 20px;
        padding: 12px 22px;
        border-bottom: 1px solid rgba(0, 0, 0, 0.08);
        background: #ffffff;
        color: #86868b;
        font-size: 11px;
        font-weight: 600;
        line-height: 1.3;
        letter-spacing: 0.005em;
    }
    body .nc-header .nc-mega .ac-mega-head > a {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        color: #0071e3;
        font-size: 13px;
        font-weight: 500;
        text-decoration: none;
    }
    body .nc-header .nc-mega .ac-mega-head > a:hover { text-decoration: underline; text-underline-offset: 3px; }

    /* ---------- Two-pane body ---------- */
    body .nc-header .nc-mega .nc-mega__cols {
        grid-template-columns: 252px minmax(0, 1fr) !important;
        height: auto !important;
        min-height: 0 !important;
    }

    /* Left rail mirrors the search sidebar. */
    body .nc-header .nc-mega .nc-mega__cats {
        display: flex !important;
        flex-direction: column !important;
        gap: 1px !important;
        padding: 12px 10px !important;
        background: linear-gradient(180deg, #f4f4f6 0%, #eeeef1 100%) !important;
        border: 0 !important;
        border-inline-end: 1px solid rgba(0, 0, 0, 0.085) !important;
        overflow: visible !important;
    }
    body .nc-header .nc-mega .nc-mega__cats-title,
    body .nc-header .nc-mega .nc-mega__cats-title { display: none !important; }

    body .nc-header .nc-mega .nc-mega__cat {
        display: flex !important;
        align-items: center;
        gap: 9px !important;
        width: 100% !important;
        min-height: 34px !important;
        height: auto !important;
        padding: 7px 10px !important;
        border: 0 !important;
        border-radius: 7px !important;
        background: transparent !important;
        color: #1d1d1f !important;
        font-size: 13px !important;
        font-weight: 500 !important;
        line-height: 1.3 !important;
        letter-spacing: -0.005em !important;
        text-align: start;
        box-shadow: none !important;
        transition: background-color 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
    }
    body .nc-header .nc-mega .nc-mega__cat:hover { background: rgba(0, 0, 0, 0.05) !important; color: #1d1d1f !important; }
    body .nc-header .nc-mega .nc-mega__cat:active { background: rgba(0, 0, 0, 0.085) !important; }
    body .nc-header .nc-mega .nc-mega__cat.is-active {
        background: #ffffff !important;
        color: #1d1d1f !important;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.14), 0 0 0 0.5px rgba(0, 0, 0, 0.04) !important;
    }
    body .nc-header .nc-mega .nc-mega__cat-icon {
        display: grid;
        place-items: center;
        width: 20px !important;
        height: 20px !important;
        flex: 0 0 20px !important;
        color: #737378 !important;
    }
    body .nc-header .nc-mega .nc-mega__cat-icon svg { width: 16px; height: 16px; }
    body .nc-header .nc-mega .nc-mega__cat.is-active .nc-mega__cat-icon { color: #0071e3 !important; }
    body .nc-header .nc-mega .nc-mega__cat-label {
        flex: 1 1 auto;
        min-width: 0;
        font-size: 13px !important;
        line-height: 1.35 !important;
        white-space: normal;
        overflow-wrap: anywhere;
    }
    body .nc-header .nc-mega .nc-mega__cat-arrow {
        display: block !important;
        flex: 0 0 10px;
        color: #c7c7cc !important;
        font-size: 13px;
        line-height: 1;
        text-align: end;
        opacity: 1;
    }
    body .nc-header .nc-mega .nc-mega__cat:hover .nc-mega__cat-arrow,
    body .nc-header .nc-mega .nc-mega__cat.is-active .nc-mega__cat-arrow { color: #86868b !important; }

    /* Content pane. */
    body .nc-header .nc-mega .nc-mega__panels {
        padding: 24px 26px 22px !important;
        background: #ffffff !important;
        min-height: 0 !important;
        overflow: visible !important;
    }
    body .nc-header .nc-mega .nc-mega__panel h3 {
        margin: 0 0 4px !important;
        font-size: 24px !important;
        font-weight: 600 !important;
        line-height: 1.25 !important;
        letter-spacing: -0.03em !important;
        color: #1d1d1f !important;
    }
    body .nc-header .nc-mega .nc-mega__panel-rule { display: none !important; }
    body .nc-header .nc-mega .nc-mega__panel > p {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        max-width: 62ch;
        margin: 0 0 16px !important;
        overflow: hidden;
        color: #86868b !important;
        font-size: 13.5px !important;
        font-weight: 400 !important;
        line-height: 1.5 !important;
        letter-spacing: -0.005em;
    }
    body .nc-header .nc-mega .nc-mega__panel > p:empty { display: none !important; }

    /* Flat link lists, not cards. */
    body .nc-header .nc-mega .nc-mega__grid {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 4px 20px !important;
    }
    body .nc-header .nc-mega .nc-mega__item {
        display: flex !important;
        align-items: center;
        gap: 14px !important;
        min-height: 74px;
        padding: 12px !important;
        border: 0 !important;
        border-radius: 10px !important;
        background: transparent !important;
        box-shadow: none !important;
        transform: none !important;
        transition: background-color 0.14s ease;
    }
    body .nc-header .nc-mega .nc-mega__item:hover {
        background: #f5f5f7 !important;
        border: 0 !important;
        box-shadow: none !important;
        transform: none !important;
    }
    body .nc-header .nc-mega .nc-mega__item-media {
        display: grid;
        place-items: center;
        width: 56px !important;
        height: 68px !important;
        flex: 0 0 56px !important;
        padding: 6px;
        border: 0 !important;
        border-radius: 8px !important;
        background: #f5f5f7 !important;
        overflow: hidden;
    }
    body .nc-header .nc-mega .nc-mega__item-media img {
        width: 100% !important;
        height: 100% !important;
        object-fit: contain !important;
        mix-blend-mode: multiply;
        transition: transform 0.3s ease;
    }
    body .nc-header .nc-mega .nc-mega__item:hover .nc-mega__item-media img { transform: scale(1.04); }
    body .nc-header .nc-mega .nc-mega__item-body {
        display: flex;
        flex-direction: column;
        flex: 1 1 auto;
        min-width: 0;
        gap: 1px;
        padding: 0 !important;
    }
    body .nc-header .nc-mega .nc-mega__item-title {
        color: #1d1d1f !important;
        font-size: 14.5px !important;
        font-weight: 600 !important;
        line-height: 1.4 !important;
        letter-spacing: -0.01em !important;
        overflow-wrap: anywhere;
    }
    body .nc-header .nc-mega .nc-mega__item-desc {
        display: -webkit-box !important;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        color: #86868b !important;
        font-size: 12.5px !important;
        line-height: 1.45 !important;
    }
    body .nc-header .nc-mega .nc-mega__item-desc:empty { display: none !important; }
    body .nc-header .nc-mega .nc-mega__item-go {
        position: static !important;
        inset: auto !important;
        display: block !important;
        margin-inline-start: auto;
        transform: none !important;
        font-size: 18px;
        line-height: 1;
        color: #86868b !important;
        opacity: 1;
        transition: color 0.14s ease;
    }
    body .nc-header .nc-mega .nc-mega__item:hover .nc-mega__item-go,
    body .nc-header .nc-mega .nc-mega__item:focus-visible .nc-mega__item-go { color: #0071e3 !important; }

    body .nc-header .nc-mega .actorein-mega-all {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        margin-top: 14px !important;
        padding-top: 12px !important;
        border-top: 1px solid rgba(0, 0, 0, 0.08);
        color: #0071e3 !important;
        font-size: 13px !important;
        font-weight: 500 !important;
        line-height: 1.3;
        text-decoration: none;
    }
    body .nc-header .nc-mega .actorein-mega-all:hover { text-decoration: underline; text-underline-offset: 3px; }

    /* Focus rings match the search drawer. */
    body .nc-header .nc-mega :is(a, button):focus-visible {
        outline: 3px solid rgba(0, 113, 227, 0.5) !important;
        outline-offset: 1px;
    }

    /* The open trigger keeps the header underline, without a filled pill. */
    body .nc-header .nc-menu__item--mega.is-open > a,
    body .nc-header .nc-menu__item--mega:hover > a {
        background: transparent !important;
        color: #007ca8 !important;
        border-radius: 0 !important;
    }
    body .nc-header .nc-menu__item--mega.is-open > a::after {
        transform: scaleX(1) !important;
    }
}

/* ---------- Dark appearance, matching the search drawer ---------- */
html.ac-access-dark:not(.ac-access-contrast) body .nc-header .nc-mega {
    background: #1c1c1e !important;
    border-color: #3a3a3c !important;
    box-shadow: 0 30px 80px -24px rgba(0, 0, 0, 0.72), 0 0 0 0.5px rgba(255, 255, 255, 0.06) !important;
}
html.ac-access-dark:not(.ac-access-contrast) body .nc-header .nc-mega .ac-mega-head {
    background: #1c1c1e;
    border-bottom-color: #3a3a3c;
    color: #98989d;
}
html.ac-access-dark:not(.ac-access-contrast) body .nc-header .nc-mega .ac-mega-head > a { color: #0a84ff; }
html.ac-access-dark:not(.ac-access-contrast) body .nc-header .nc-mega .nc-mega__cats {
    background: linear-gradient(180deg, #242426 0%, #1f1f21 100%) !important;
    border-inline-end-color: rgba(255, 255, 255, 0.09) !important;
}
html.ac-access-dark:not(.ac-access-contrast) body .nc-header .nc-mega .nc-mega__cat { color: #e5e5ea !important; }
html.ac-access-dark:not(.ac-access-contrast) body .nc-header .nc-mega .nc-mega__cat:hover {
    background: rgba(255, 255, 255, 0.08) !important;
}
html.ac-access-dark:not(.ac-access-contrast) body .nc-header .nc-mega .nc-mega__cat.is-active {
    background: #3a3a3c !important;
    color: #ffffff !important;
    box-shadow: none !important;
}
html.ac-access-dark:not(.ac-access-contrast) body .nc-header .nc-mega .nc-mega__cat-icon { color: #a1a1a6 !important; }
html.ac-access-dark:not(.ac-access-contrast) body .nc-header .nc-mega .nc-mega__cat.is-active .nc-mega__cat-icon { color: #0a84ff !important; }
html.ac-access-dark:not(.ac-access-contrast) body .nc-header .nc-mega .nc-mega__panels { background: #1c1c1e !important; }
html.ac-access-dark:not(.ac-access-contrast) body .nc-header .nc-mega .nc-mega__panel h3 { color: #f5f5f7 !important; }
html.ac-access-dark:not(.ac-access-contrast) body .nc-header .nc-mega .nc-mega__panel > p { color: #98989d !important; }
html.ac-access-dark:not(.ac-access-contrast) body .nc-header .nc-mega .nc-mega__item:hover { background: #2c2c2e !important; }
html.ac-access-dark:not(.ac-access-contrast) body .nc-header .nc-mega .nc-mega__item-title { color: #f5f5f7 !important; }
html.ac-access-dark:not(.ac-access-contrast) body .nc-header .nc-mega .nc-mega__item-desc { color: #98989d !important; }
html.ac-access-dark:not(.ac-access-contrast) body .nc-header .nc-mega .nc-mega__item-media { background: #ffffff !important; }
html.ac-access-dark:not(.ac-access-contrast) body .nc-header .nc-mega .nc-mega__item-go { color: #0a84ff !important; }
html.ac-access-dark:not(.ac-access-contrast) body .nc-header .nc-mega .actorein-mega-all {
    color: #0a84ff !important;
    border-top-color: #3a3a3c;
}

/* ---------- Forced contrast ---------- */
html.ac-access-contrast body .nc-header .nc-mega { border-color: currentColor !important; }
html.ac-access-contrast body .nc-header .nc-mega .nc-mega__cat.is-active { outline: 2px solid currentColor !important; }
html.ac-access-contrast body .nc-header .nc-mega .nc-mega__item:hover { outline: 1px solid currentColor; }

/* ---------- RTL arrow ---------- */
html[dir="rtl"] body .nc-header .nc-mega .nc-mega__grid .nc-mega__item-go { transform: scaleX(-1) !important; }
html[lang^="fa"] body .nc-header .nc-mega .nc-mega__grid .nc-mega__item-go { transform: scaleX(-1) !important; }

/* ---------- Small desktop ---------- */
@media (min-width: 901px) and (max-width: 1100px) {
    body .nc-header .nc-mega .nc-mega__cols { grid-template-columns: 220px minmax(0, 1fr) !important; }
    body .nc-header .nc-mega .nc-mega__panels { padding: 18px !important; }
    body .nc-header .nc-mega .nc-mega__grid { grid-template-columns: minmax(0, 1fr) !important; }
}

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
    body .nc-header .nc-mega,
    body .nc-header .nc-mega.is-open,
    body .nc-header .nc-menu__item--mega:hover .nc-mega,
    body .nc-header .nc-menu__item--mega.is-open .nc-mega,
    body .nc-header .nc-menu__item--mega:focus-within .nc-mega {
        transform: none !important;
        transition: opacity 0.01s linear !important;
    }
    body .nc-header .nc-mega .nc-mega__item,
    body .nc-header .nc-mega .nc-mega__item-media img { transition: none !important; }
}
html.ac-access-motion body .nc-header .nc-mega,
html.ac-access-motion body .nc-header .nc-mega .nc-mega__item,
html.ac-access-motion body .nc-header .nc-mega .nc-mega__item-media img {
    transition: none !important;
    animation: none !important;
}
