/* Wright Windows header — mega menu + mobile drawer styles */

.wright-megawrap { position: relative; }

/* Hover bridge: extend the trigger LI's interactive area downward so the
   cursor can travel from the nav item to the mega panel without crossing
   "dead space" that fires mouseleave and closes the menu. */
.wright-header__nav li.has-mega { position: relative; }
.wright-header__nav li.has-mega::before {
    content: "";
    position: absolute;
    top: 100%;
    left: -16px;
    right: -16px;
    height: 32px;
    z-index: 91;
    pointer-events: none;
}
/* Only activate the bridge while the menu is in an open/hovering state.
   Otherwise hovering over an LI's bridge could keep adjacent panels live. */
.wright-header__nav li.has-mega:hover::before,
.wright-header__nav li.has-mega.is-open::before {
    pointer-events: auto;
}

.wright-header__nav li.has-mega > a { position: relative; }
.wright-header__nav li.has-mega > a::after {
    content: "";
    display: inline-block;
    width: 6px; height: 6px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
    margin-left: 0.5rem;
    opacity: 0.6;
    transition: transform 0.2s ease;
    pointer-events: none;
}
.wright-header__nav li.has-mega.is-open > a::after,
.wright-header__nav li.has-mega:hover > a::after {
    transform: translateY(2px) rotate(225deg);
    opacity: 1;
}

.wright-mega {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background-color: #0A0A0A;
    color: #FFFFFF;
    box-shadow: 0 24px 50px rgba(0,0,0,0.5), 0 1px 0 rgba(255,255,255,0.05) inset;
    border-top: 1px solid rgba(255,255,255,0.06);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-12px);
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
    z-index: 90;
    pointer-events: none;
    display: block;
}
.wright-mega.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}
.wright-mega__inner {
    max-width: 1240px;
    margin: 0 auto;
    padding: clamp(2rem, 4vw, 3.25rem) var(--wp--preset--spacing--40, 2rem);
    display: grid;
    grid-template-columns: 1fr 1.4fr 1.1fr;
    gap: clamp(2rem, 4vw, 3.5rem);
}
.wright-mega__col-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--wp--preset--color--primary, #C8102E);
    margin: 0 0 1.5rem;
}
.wright-mega__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.4rem;
}
.wright-mega__list--cols {
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem 1.5rem;
}
.wright-mega__link {
    display: block;
    color: #FFFFFF !important;
    font-size: 0.98rem;
    font-weight: 500;
    line-height: 1.4;
    padding: 0.45rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    transition: color 0.15s ease, padding-left 0.15s ease;
    text-decoration: none;
}
.wright-mega__link:hover,
.wright-mega__link:focus-visible {
    color: var(--wp--preset--color--primary, #C8102E) !important;
    padding-left: 0.35rem;
    outline: none;
}
.wright-mega__link small {
    display: block;
    font-size: 0.78rem;
    font-weight: 400;
    opacity: 0.55;
    margin-top: 0.15rem;
    line-height: 1.35;
}
.wright-mega__link:hover small,
.wright-mega__link:focus-visible small { opacity: 0.85; }

.wright-mega__featured {
    position: relative;
    display: block;
    background-color: #1A1A1A;
    overflow: hidden;
    text-decoration: none;
    color: #FFFFFF !important;
    min-height: 280px;
    transition: transform 0.25s ease;
}
.wright-mega__featured:hover { transform: translateY(-3px); }
.wright-mega__featured-media {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0.45;
    transition: opacity 0.25s ease, transform 0.5s ease;
}
.wright-mega__featured:hover .wright-mega__featured-media {
    opacity: 0.6;
    transform: scale(1.04);
}
.wright-mega__featured-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(200,16,46,0.85) 0%, rgba(10,10,10,0.5) 60%, rgba(10,10,10,0) 100%);
}
.wright-mega__featured-body {
    position: relative;
    padding: 1.5rem 1.5rem 1.75rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 280px;
}
.wright-mega__featured-eyebrow {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: rgba(255,255,255,0.9);
    margin: 0 0 0.5rem;
}
.wright-mega__featured-title {
    font-family: var(--wp--preset--font-family--display, Inter, sans-serif);
    font-size: 1.6rem;
    font-weight: 900;
    margin: 0 0 0.5rem;
    line-height: 1.05;
    letter-spacing: -0.01em;
}
.wright-mega__featured-blurb {
    font-size: 0.88rem;
    line-height: 1.45;
    margin: 0 0 1rem;
    opacity: 0.92;
    max-width: 22ch;
}
.wright-mega__featured-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #FFFFFF;
}
.wright-mega__featured-cta::after { content: "→"; transition: transform 0.2s ease; }
.wright-mega__featured:hover .wright-mega__featured-cta::after { transform: translateX(4px); }

/* SEAI Grants banner pinned to the bottom of each mega panel */
.wright-mega__grants {
    display: flex;
    align-items: center;
    gap: clamp(0.75rem, 2vw, 1.75rem);
    background: var(--wp--preset--color--primary, #C8102E);
    color: #FFFFFF;
    text-decoration: none;
    padding: 0.85rem clamp(1.5rem, 4vw, 3.25rem);
    max-width: 1240px;
    margin: 0 auto;
    border-top: 1px solid rgba(255,255,255,0.08);
    transition: background-color 0.15s ease;
}
.wright-mega__grants:hover { background: #A60E26; color: #FFFFFF; }
.wright-mega__grants-eyebrow {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    background: rgba(255,255,255,0.18);
    padding: 0.3rem 0.7rem;
    flex-shrink: 0;
}
.wright-mega__grants-title {
    font-size: 0.98rem;
    font-weight: 700;
    flex: 1;
    line-height: 1.3;
}
.wright-mega__grants-cta {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    opacity: 0.95;
    flex-shrink: 0;
}

.wright-mega-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(0,0,0,0);
    pointer-events: none;
    transition: background-color 0.22s ease;
    z-index: 60;
}
.wright-mega-backdrop.is-active {
    background-color: rgba(0,0,0,0.45);
    pointer-events: auto;
}

@media (max-width: 1180px) {
    .wright-mega__inner {
        grid-template-columns: 1fr 1.2fr 1fr;
        gap: 2rem;
        padding: 2rem var(--wp--preset--spacing--40, 2rem);
    }
    .wright-mega__featured-title { font-size: 1.4rem; }
}

@media (max-width: 1024px) {
    .wright-mega { display: none !important; }
    .wright-header__nav li.has-mega > a::after { display: none; }
}

.wright-mobile-section {
    padding: 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.wright-mobile-section__toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 1rem var(--wp--preset--spacing--40, 2rem);
    background: transparent;
    border: 0;
    color: #FFFFFF;
    font-size: 1rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}
.wright-mobile-section__toggle::after {
    content: "+";
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--wp--preset--color--primary, #C8102E);
}
.wright-mobile-section.is-open .wright-mobile-section__toggle::after { content: "−"; }
.wright-mobile-section__body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background-color: rgba(255,255,255,0.02);
}
.wright-mobile-section.is-open .wright-mobile-section__body { max-height: 1000px; }
.wright-mobile-section__body a {
    display: block;
    padding: 0.75rem var(--wp--preset--spacing--40, 2rem) 0.75rem calc(var(--wp--preset--spacing--40, 2rem) + 1rem);
    font-size: 0.95rem;
    color: rgba(255,255,255,0.88);
    font-weight: 500;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.wright-mobile-section__body a:hover {
    background-color: rgba(255,255,255,0.04);
    color: var(--wp--preset--color--primary, #C8102E);
}
.wright-mobile-section__group-label {
    padding: 0.6rem var(--wp--preset--spacing--40, 2rem);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--wp--preset--color--primary, #C8102E);
    margin-top: 0.4rem;
}
