/* ── Mega menu: overlay anchor ──────────────────────────────────────────────── */
.has-mega-menu {
    position: relative;
}

/* ── Overlay container: sits flush below the nav bar ───────────────────────── */
.mega-overlay {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 200;
    pointer-events: none; /* transparent until a panel opens */
}

/* ── Individual section panels ──────────────────────────────────────────────── */
.mega-panel {
    display: none;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba( 0, 0, 0, 0.14 );
    padding: 2rem;
}

.mega-panel.is-open {
    display: block;
    pointer-events: auto;
}

/* ── 3-column inner grid ────────────────────────────────────────────────────── */
.mega-panel .wp-block-columns.mega-panel__columns {
    gap: 2rem;
    align-items: flex-start;
    margin-bottom: 0;
}

/* ── Column 1: compact text-link list ──────────────────────────────────────── */
.mega-col-list .wp-block-post-template {
    margin: 0;
    padding: 0;
    list-style: none;
}

.mega-col-list .wp-block-post-template li {
    margin: 0;
    padding: 0;
}

.mega-col-list .wp-block-post-title {
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.5;
    margin: 0 0 0.45rem;
}

.mega-col-list .wp-block-post-title::before {
    content: '›';
    margin-right: 0.35em;
    opacity: 0.45;
}

.mega-col-list .wp-block-post-title a {
    text-decoration: none;
    color: inherit;
}

.mega-col-list .wp-block-post-title a:hover {
    text-decoration: underline;
}

/* ── Columns 2 & 3: featured post cards ────────────────────────────────────── */
.mega-col-featured .wp-block-post-featured-image {
    margin-bottom: 0.75rem;
}

.mega-col-featured .wp-block-post-featured-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
}

.mega-col-featured .wp-block-post-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
    margin: 0 0 0.4rem;
}

.mega-col-featured .wp-block-post-title a {
    text-decoration: none;
    color: inherit;
}

.mega-col-featured .wp-block-post-title a:hover {
    text-decoration: underline;
}

.mega-col-featured .wp-block-post-excerpt__excerpt {
    font-size: 0.875rem;
    line-height: 1.55;
    color: #555555;
    margin: 0;
}

/* ── Extras zone: hides itself when empty ───────────────────────────────────── */
.mega-extras:empty {
    display: none;
}

.mega-extras:not( :empty ) {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eeeeee;
}

/* ── Suppress the native WP nav dropdown on mega trigger items ──────────────── */
.has-mega-menu .wp-block-navigation-item[class*="has-mega--"] > .wp-block-navigation__submenu-container,
.has-mega-menu .wp-block-navigation-item[class*="has-mega--"] > button.wp-block-navigation-item__action {
    display: none !important;
}

/* ── Visual cue: active trigger ─────────────────────────────────────────────── */
.has-mega-menu .wp-block-navigation-item[class*="has-mega--"] > a[aria-expanded="true"] {
    opacity: 0.75;
}

/* ── Mobile: panels stack in document flow below the nav ────────────────────── */
@media ( max-width: 768px ) {
    .mega-overlay {
        position: static;
        pointer-events: auto;
    }

    .mega-panel.is-open {
        box-shadow: none;
        padding: 1rem 0;
    }

    /* wp:columns already stacks on mobile; ensure no awkward gap */
    .mega-panel .wp-block-columns.mega-panel__columns {
        flex-direction: column;
    }
}
