/* Services mega menu (desktop) + accordion (mobile). Shared by index.php and every page using site_render_header(). */

.nav-has-mega { display: inline-flex; align-items: center; gap: 0.4rem; }
.nav-has-mega i { font-size: 0.6rem; transition: transform 0.3s ease; }
.nav-has-mega[aria-expanded="true"] { color: #673A89; }
.nav-has-mega[aria-expanded="true"] i { transform: rotate(180deg); }

.mega {
    display: none;
    position: absolute;
    z-index: 60;
    left: 0.85rem;
    right: 0.85rem;
    top: calc(100% - 0.45rem);
    max-width: 80rem;
    margin-inline: auto;
    padding-top: 0.75rem; /* hover bridge between pill and panel */
    visibility: hidden;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.25s ease, transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s linear 0.3s;
    pointer-events: none;
}
@media (min-width: 640px) { .mega { left: 1.25rem; right: 1.25rem; } }
@media (min-width: 1024px) { .mega { display: block; } }
.mega.is-open { visibility: visible; opacity: 1; transform: none; pointer-events: auto; transition-delay: 0s; }

.mega__inner {
    display: grid;
    grid-template-columns: 18rem 1fr;
    background: #fff;
    border: 1px solid #E8E2EF;
    border-radius: 1.4rem 1.4rem 0 0;
    border-bottom: 0;
    overflow: hidden;
    box-shadow: 0 30px 70px -20px rgba(78, 44, 104, 0.35);
}
.mega__feature { background: #3F2254; color: #fff; padding: 1.8rem; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.mega__feature::after { content: ""; position: absolute; inset: 0; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='52' height='90' viewBox='0 0 52 90'%3E%3Cpath d='M26 0L52 15V45L26 60L0 45V15Z M26 60V90' fill='none' stroke='%23ffffff' stroke-opacity='.22' stroke-width='1'/%3E%3C/svg%3E"); background-size: 52px 90px; background-position: 50% 0; -webkit-mask-image: linear-gradient(200deg, transparent 32%, rgba(0,0,0,.55) 60%, #000 100%); mask-image: linear-gradient(200deg, transparent 32%, rgba(0,0,0,.55) 60%, #000 100%); pointer-events: none; }
.mega__feature > * { position: relative; z-index: 1; }
.mega__eyebrow { font-size: 0.68rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: #C9B5E0; margin: 0 0 0.7rem; }
.mega__feature h3 { margin: 0 0 0.6rem; font-size: 2rem; font-weight: 600; letter-spacing: -0.03em; line-height: 1; }
.mega__feature > p:not(.mega__eyebrow) { margin: 0; font-size: 0.9rem; line-height: 1.6; color: rgba(255, 255, 255, 0.78); }
.mega__cta { margin-top: 1.4rem; display: inline-flex; align-items: center; gap: 0.6rem; align-self: flex-start; padding: 0.7rem 1.1rem; background: #fff; color: #4E2C68; font-size: 0.85rem; font-weight: 600; text-decoration: none; transition: transform 0.25s ease, background-color 0.25s ease; }
.mega__cta:hover { background: #F0EBF5; transform: translateY(-1px); }
.mega__cta i { font-size: 0.7rem; transition: transform 0.25s ease; }
.mega__cta:hover i { transform: translateX(3px); }
.mega__help { margin-top: auto; padding-top: 1.6rem; font-size: 0.8rem; color: rgba(255, 255, 255, 0.65); position: relative; z-index: 1; }
.mega__help span { display: block; margin-bottom: 0.2rem; }
.mega__help a { color: #fff; font-weight: 600; text-underline-offset: 3px; }

.mega__cols { display: grid; grid-template-columns: 1fr 1.25fr 1fr; gap: 0; padding: 1.4rem 0.6rem 1.2rem; }
.mega__group { padding: 0 0.9rem; }
.mega__group + .mega__group { border-left: 1px solid #F0EBF5; }
.mega__label { margin: 0 0 0.7rem 0.6rem; font-size: 0.66rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: #4A4454; }
.mega ul { list-style: none; margin: 0; padding: 0; }
.mega__item { display: grid; grid-template-columns: 2.2rem 1fr auto; align-items: center; gap: 0.75rem; padding: 0.6rem 0.6rem; border-radius: 0.7rem; text-decoration: none; color: #16131C; transition: background-color 0.2s ease; }
.mega__item:hover, .mega__item:focus-visible { background: #F0EBF5; outline: none; }
.mega__item[aria-current="page"] { background: #F0EBF5; }
.mega__ico { display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 0.6rem; background: #F0EBF5; color: #673A89; font-size: 0.85rem; transition: background-color 0.25s ease, color 0.25s ease, transform 0.25s ease; }
.mega__item:hover .mega__ico, .mega__item:focus-visible .mega__ico { background: #673A89; color: #fff; transform: scale(1.06); }
.mega__txt b { display: block; font-size: 0.88rem; font-weight: 600; line-height: 1.25; }
.mega__txt small { display: block; margin-top: 0.15rem; font-size: 0.74rem; line-height: 1.4; color: #4A4454; }
.mega__arrow { font-size: 0.65rem; color: #673A89; opacity: 0; transform: translateX(-6px); transition: opacity 0.2s ease, transform 0.2s ease; }
.mega__item:hover .mega__arrow, .mega__item:focus-visible .mega__arrow { opacity: 1; transform: none; }

.mega__foot { position: relative; display: flex; justify-content: flex-end; padding: 0.8rem 1.6rem; background: #F8F6FA; border: 1px solid #E8E2EF; border-top: 1px solid #F0EBF5; border-top: 1px solid #F0EBF5; border-radius: 0 0 1.4rem 1.4rem; box-shadow: 0 30px 70px -20px rgba(78, 44, 104, 0.35); }
.mega__foot a { font-size: 0.82rem; font-weight: 600; color: #673A89; text-decoration: none; display: inline-flex; gap: 0.5rem; align-items: center; }
.mega__foot a i { font-size: 0.65rem; transition: transform 0.25s ease; }
.mega__foot a:hover i { transform: translateX(3px); }

/* Items rise in one after another when the panel opens */
.mega.is-open .mega__item, .mega.is-open .mega__feature > * { animation: mega-rise 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.mega.is-open li:nth-child(2) .mega__item { animation-delay: 0.04s; } .mega.is-open li:nth-child(3) .mega__item { animation-delay: 0.08s; }
.mega.is-open li:nth-child(4) .mega__item { animation-delay: 0.12s; } .mega.is-open li:nth-child(5) .mega__item { animation-delay: 0.16s; } .mega.is-open li:nth-child(6) .mega__item { animation-delay: 0.2s; }
@keyframes mega-rise { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { .mega, .mega * { animation: none !important; transition-duration: 0.001ms !important; } }

/* Mobile accordion */
.mobile-mega { border-bottom: 1px solid rgba(232, 226, 239, 0.7); }
.mobile-mega summary { display: flex; justify-content: space-between; align-items: center; cursor: pointer; list-style: none; border-bottom: 0 !important; }
.mobile-mega summary::-webkit-details-marker { display: none; }
.mobile-mega summary i { font-size: 0.7rem; transition: transform 0.3s ease; }
.mobile-mega[open] summary i { transform: rotate(180deg); }
.mobile-mega ul { list-style: none; margin: 0 0 0.6rem; padding: 0 0 0 0.2rem; display: grid; gap: 0.1rem; }
.mobile-mega ul a { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0.4rem; font-weight: 500; color: #4A4454; border-radius: 0.5rem; text-decoration: none; }
.mobile-mega ul a i { width: 1.1rem; text-align: center; color: #673A89; font-size: 0.8rem; }
.mobile-mega ul a:hover, .mobile-mega ul a[aria-current="page"] { background: #F0EBF5; color: #673A89; }
.mobile-mega .mobile-mega__all { color: #673A89; font-weight: 600; padding-left: 2.15rem; }

.mega__start { margin-top: 1.4rem; padding-top: 1.1rem; border-top: 1px solid #F0EBF5; display: grid; gap: 0.15rem; }
.mega__start a { display: flex; justify-content: space-between; align-items: baseline; gap: 0.8rem; padding: 0.5rem 0.6rem; border-radius: 0.6rem; text-decoration: none; color: #4A4454; font-size: 0.78rem; line-height: 1.35; transition: background-color 0.2s ease; }
.mega__start a b { flex: none; font-size: 0.74rem; color: #673A89; font-weight: 600; }
.mega__start a:hover { background: #F0EBF5; }
.mega__start a:hover span { color: #16131C; }

/* Font Awesome loads after Tailwind and its display rule beat .hidden, so both burger icons showed at once */
.fa-solid.hidden { display: none !important; }
/* Tall accordion must scroll inside the phone menu instead of running off screen */
#mobile-menu { max-height: calc(100dvh - 7.5rem); }
.mobile-mega summary { padding-top: .75rem; padding-bottom: .75rem; border-bottom: 1px solid rgba(232,226,239,.7) !important; -webkit-tap-highlight-color: transparent; }
.mobile-mega[open] summary { border-bottom-color: transparent !important; }
