/**
 * Mega Menu — białe panele submenu z granatowym tekstem
 *
 * Skonsolidowane reguły z 3 duplikatów które wcześniej były w functions.php.
 * Używa wysokiej specificity (html body) zamiast !important pandemii.
 *
 * @package    InstytutSI_Theme
 * @author     Wojciech Modzelewski <kontakt@instytutsi.pl>
 * @version    1.0.0
 * @since      2026-05-24
 */

/* ═══════════════════════════════════════════════════════
   PANEL — białe tło, cień, border-radius
   ═══════════════════════════════════════════════════════ */
html body .cis-mega-panel {
    background-color: #ffffff;
    background-image: none;
    border: 1px solid rgba(13, 46, 107, 0.15);
    border-radius: 14px;
    box-shadow: 0 24px 64px rgba(13, 46, 107, 0.2),
                0 4px 16px rgba(13, 46, 107, 0.08);
    padding: 12px;
    min-width: 280px;
    z-index: 9999;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: auto;
    transform: none;
}

/* Ostatnie items wyrównaj do prawej */
html body .cis-nav > li:last-child .cis-mega-panel,
html body .cis-nav > li:nth-last-child(2) .cis-mega-panel {
    left: auto;
    right: 0;
}

/* Widoczność panelu */
html body .cis-has-mega.is-open > .cis-mega-panel,
html body .cis-has-mega:hover > .cis-mega-panel,
html body .cis-has-mega:focus-within > .cis-mega-panel {
    display: block;
    visibility: visible;
    opacity: 1;
}

/* ═══════════════════════════════════════════════════════
   LISTA — czyste tło
   ═══════════════════════════════════════════════════════ */
html body .cis-mega-panel ul,
html body .cis-mega-panel li,
html body ul.cis-mega-list,
html body ul.cis-mega-list li,
html body .cis-mega-inner {
    background: transparent;
}

/* ═══════════════════════════════════════════════════════
   LINKI — granat na białym
   ═══════════════════════════════════════════════════════ */
html body .cis-mega-panel a,
html body .cis-mega-panel a:link,
html body .cis-mega-panel a:visited,
html body .cis-mega-panel li a,
html body .cis-mega-panel ul li a,
html body .cis-mega-link {
    color: #1a2e4a;
    background-color: transparent;
    background-image: none;
    text-decoration: none;
    text-shadow: none;
    -webkit-text-fill-color: #1a2e4a;
    font-weight: 700;
    display: block;
    padding: 12px 16px;
    border-radius: 8px;
    opacity: 1;
    transition: background 0.15s, color 0.15s;
}

/* Hover */
html body .cis-mega-panel a:hover,
html body .cis-mega-panel a:focus,
html body .cis-mega-panel li a:hover,
html body .cis-mega-link:hover,
html body .cis-mega-link:focus {
    color: #1B5FAA;
    background: linear-gradient(135deg, #E8F1FB 0%, #FAF0F2 100%);
    -webkit-text-fill-color: #1B5FAA;
}

/* ═══════════════════════════════════════════════════════
   ZAWARTOŚĆ LINKA (tytuł + opis)
   ═══════════════════════════════════════════════════════ */
html body .cis-mega-panel a span,
html body .cis-mega-link-title,
html body .cis-mega-panel h3,
html body .cis-mega-panel strong {
    color: #1a2e4a;
    -webkit-text-fill-color: #1a2e4a;
    background: transparent;
    font-weight: 800;
    opacity: 1;
}

html body .cis-mega-link-desc,
html body .cis-mega-panel a .cis-mega-link-desc,
html body .cis-mega-panel a span.cis-mega-link-desc {
    color: #6b7280;
    -webkit-text-fill-color: #6b7280;
    font-weight: 400;
    font-size: 11px;
}

html body .cis-mega-panel a:hover .cis-mega-link-title,
html body .cis-mega-panel a:hover span:not(.cis-mega-link-desc) {
    color: #1B5FAA;
    -webkit-text-fill-color: #1B5FAA;
}
html body .cis-mega-link:hover .cis-mega-link-desc {
    color: #4a6080;
}
