/* MisahaTech — Mega Menu (الحاسوب فقط) */
.mt-mega { display: none; }
@media (min-width: 769px) {
    .main-nav .nav-menu > li.mt-has-mega { position: static; }
    .main-nav .nav-menu > li.mt-has-mega > a::after { content: ''; width: 6px; height: 6px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: translateY(-1px) rotate(45deg); opacity: .7; transition: transform .2s ease; margin-inline-start: 2px; }
    .main-nav .nav-menu > li.mt-has-mega:hover > a::after { transform: translateY(1px) rotate(-135deg); opacity: 1; }
    .mt-mega {
        display: block; position: absolute; top: 100%; inset-inline: 0; z-index: 99;
        background: var(--clr-dark); color: rgba(var(--clr-on-dark-rgb, 255,255,255), .92);
        border-top: 1px solid rgba(var(--clr-on-dark-rgb, 255,255,255), .08);
        box-shadow: 0 22px 44px rgba(0,0,0,.3);
        opacity: 0; visibility: hidden; transform: translateY(8px); pointer-events: none;
        transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s;
        min-height: 150px;
    }
    .mt-mega::before { content: ''; position: absolute; inset-inline: 0; top: -16px; height: 16px; } /* جسر للماوس */
    .nav-menu > li.mt-has-mega:hover > .mt-mega,
    .nav-menu > li.mt-has-mega:focus-within > .mt-mega { opacity: 1; visibility: visible; transform: none; pointer-events: auto; transition: opacity .18s ease, transform .18s ease, visibility 0s; }
    .mt-mega.is-loading::after { content: ''; display: block; width: 26px; height: 26px; margin: 60px auto; border: 3px solid rgba(255,255,255,.2); border-top-color: var(--clr-primary); border-radius: 50%; animation: mt-mega-spin .7s linear infinite; }
    @keyframes mt-mega-spin { to { transform: rotate(360deg); } }
    .mt-mega__inner { max-width: var(--max-w, 1200px); margin: 0 auto; padding: 22px 20px 26px; display: flex; gap: 26px; align-items: flex-start; }
    .mt-mega__cats { list-style: none; margin: 0; min-width: 150px; padding-inline: 0 22px; border-inline-end: 1px solid rgba(var(--clr-on-dark-rgb, 255,255,255), .1); }
    .mt-mega__cats a { display: block; padding: 8px 4px; color: inherit; text-decoration: none; font-weight: 600; font-size: .92rem; border-radius: 6px; }
    .mt-mega__cats a:hover { color: var(--clr-primary); }
    .mt-mega__cats a.is-active { color: var(--clr-primary); }
    .mt-mega__posts { flex: 1; min-width: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px; transition: opacity .15s; }
    .mt-mega__posts.is-busy { opacity: .45; }
    .mt-mega__post { display: flex; flex-direction: column; gap: 8px; color: inherit; text-decoration: none; border: 0; }
    .mt-mega__meta { display: flex; flex-direction: column; gap: 4px; }
    .mt-mega__thumb { display: block; aspect-ratio: 8/5; border-radius: 10px; overflow: hidden; background: rgba(128,128,128,.18); }
    .mt-mega__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
    .mt-mega__post:hover .mt-mega__thumb img { transform: scale(1.05); }
    .mt-mega__title { font-size: .9rem; font-weight: 700; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    .mt-mega__post:hover .mt-mega__title { color: var(--clr-primary); }
    .mt-mega__date { font-size: .75rem; opacity: .6; }
    .mt-mega__empty { margin: 0; opacity: .7; grid-column: 1 / -1; }

    /* تبويبات: 4 مقالات */
    .mt-mega__posts--tabs, .mt-mega__posts--overlay { grid-template-columns: repeat(4, minmax(0, 1fr)); }

    /* بطاقات: العنوان فوق الصورة */
    .mt-mega__posts--overlay .mt-mega__post { position: relative; border-radius: 12px; overflow: hidden; aspect-ratio: 4/3; }
    .mt-mega__posts--overlay .mt-mega__thumb { position: absolute; inset: 0; aspect-ratio: auto; border-radius: 0; }
    .mt-mega__posts--overlay .mt-mega__meta { position: relative; margin-top: auto; padding: 40px 14px 14px; background: linear-gradient(to top, rgba(0,0,0,.85), rgba(0,0,0,0)); color: #fff; }
    .mt-mega__posts--overlay .mt-mega__post:hover .mt-mega__title { color: #fff; }

    /* مقال مميز + 4 صغار */
    .mt-mega__posts--featured { grid-template-columns: 1.15fr 1fr; grid-template-rows: repeat(4, auto); gap: 12px 26px; align-items: center; }
    .mt-mega__posts--featured .mt-mega__post:not(:first-child) { flex-direction: row; align-items: center; gap: 12px; }
    .mt-mega__posts--featured .mt-mega__post:not(:first-child) .mt-mega__thumb { flex: 0 0 110px; aspect-ratio: 4/3; border-radius: 8px; }
    .mt-mega__posts--featured .mt-mega__post:first-child { grid-row: 1 / span 4; align-self: stretch; position: relative; border-radius: 14px; overflow: hidden; min-height: 250px; }
    .mt-mega__posts--featured .mt-mega__post:first-child .mt-mega__thumb { position: absolute; inset: 0; aspect-ratio: auto; border-radius: 0; }
    .mt-mega__posts--featured .mt-mega__post:first-child .mt-mega__meta { position: relative; margin-top: auto; padding: 60px 18px 18px; background: linear-gradient(to top, rgba(0,0,0,.88), rgba(0,0,0,0)); color: #fff; }
    .mt-mega__posts--featured .mt-mega__post:first-child .mt-mega__title { font-size: 1.15rem; -webkit-line-clamp: 3; }
    .mt-mega__posts--featured .mt-mega__post:first-child:hover .mt-mega__title { color: #fff; }

    /* خلفية فاتحة */
    .mt-mega--light { background: #fff; color: #1f2430; border-top-color: rgba(0,0,0,.08); box-shadow: 0 22px 44px rgba(0,0,0,.15); }
    .mt-mega--light .mt-mega__cats { border-inline-end-color: rgba(0,0,0,.1); }
    .mt-mega--light.is-loading::after { border-color: rgba(0,0,0,.12); border-top-color: var(--clr-primary); }
    html[data-theme="dark"] .mt-mega--light { background: var(--clr-dark); color: rgba(var(--clr-on-dark-rgb, 255,255,255), .92); }
}
@media (prefers-reduced-motion: reduce) { .mt-mega { transition: none; } }
