/* ===========================================
   MAS HEADER & MEGA MENU
   All rules scoped to .mas-header
   Measurements cloned from annuity.org desktop nav (March 2026)
   =========================================== */

/* --- Skip Link --- */
.skip-link.screen-reader-text {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
.skip-link.screen-reader-text:focus {
    position: fixed;
    top: 0;
    left: 0;
    width: auto;
    height: auto;
    padding: 8px 16px;
    background: #0157ff;
    color: #fff;
    font-size: 14px;
    z-index: 100000;
    overflow: visible;
}

/* --- Base Header --- */
.mas-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    font-family: 'DM Sans', sans-serif;
}
.mas-header--scrolled {
    box-shadow: 0 2px 16px rgba(0,0,0,0.10);
}

/* --- Inner container --- */
.mas-header__inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 28px;
    height: 72px;
    display: flex;
    align-items: stretch;   /* stretch so items fill full height for border-bottom indicator */
    justify-content: space-between;
}

/* --- Logo --- */
.mas-header__logo {
    text-decoration: none;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    margin-right: 16px;
}
.mas-header__logo-img {
    display: block;
    height: 44px;
    width: auto;
    max-width: 220px;
}

/* --- Desktop Nav --- */
.mas-header__nav {
    flex: 1;
    display: flex;
    justify-content: center;
    align-self: stretch;
}
.mas-nav {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: stretch;
}

/* Nav items — border-bottom indicator (annuity.org style) */
.mas-nav__item {
    display: flex;
    align-items: center;
    position: static;
    border-bottom: 3px solid transparent;
    margin: 0 2px;
    cursor: pointer;
    transition: border-color 0.15s ease;
}
.mas-nav__item:hover,
.mas-nav__item--open {
    border-bottom: 3px solid #0157ff;
}

/* Nav trigger buttons & links */
.mas-nav__trigger,
.mas-nav__link {
    background: none !important;
    border: none !important;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    font-size: 16px;           /* annuity.org: 0.85rem = ~13.6px */
    font-weight: 600;
    color: #1a1a2e !important;
    padding: 4px 14px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    letter-spacing: 0.03em;
    transition: color 0.15s ease;
    box-shadow: none !important;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    border-radius: 0;
    line-height: 1;
    text-shadow: none !important;
}
/* ID-scoped for maximum specificity over Elementor template CSS */
#mas-header .mas-nav__trigger,
#mas-header .mas-nav__link {
    color: #1a1a2e !important;
    text-shadow: none !important;
}
.mas-nav__item:hover .mas-nav__trigger,
.mas-nav__item:hover .mas-nav__link,
.mas-nav__item--open .mas-nav__trigger,
#mas-header .mas-nav__item:hover .mas-nav__trigger,
#mas-header .mas-nav__item:hover .mas-nav__link,
#mas-header .mas-nav__item--open .mas-nav__trigger {
    color: #0157ff !important;
}
.mas-nav__arrow {
    font-size: 9px;
    transition: transform 0.2s ease;
    opacity: 0.7;
}
.mas-nav__item--open .mas-nav__arrow {
    transform: rotate(180deg);
}

/* --- Mega Menu Panel --- */
/* DEFAULT: HIDDEN. Only shown when parent has .mas-nav__item--open */
.mas-mega {
    display: none;
    position: absolute;          /* relative to .mas-header (position:fixed) */
    top: 100%;                   /* just below the header bar */
    left: 0;
    right: 0;
    background: #ffffff;
    /* annuity.org exact shadow: */
    box-shadow: rgba(23,23,23,0.25) 0px 32px 38px, rgba(23,23,23,0.22) 0px 24px 12px;
    border-top: 1px solid #e5e7eb;
    z-index: 9998;
}
.mas-nav__item--open .mas-mega {
    display: block;
}

/* Mega menu inner wrapper */
.mas-mega__inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 28px;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
}

/* Columns — annuity.org: li.d2 { flex: 1 1 25%; padding: 0 2rem } */
.mas-mega__col {
    flex: 1 1 25%;
    min-width: 0;
    padding: 32px 28px;          /* 2rem (32px) top, 1.75rem sides */
    border-right: 1px solid #f0f0f0;
}
.mas-mega__col:first-child {
    padding-left: 0;
}
.mas-mega__col:last-child {
    flex: 1 0 50%;
    border-right: none;
    padding-right: 0;
    padding-left: 32px;
}

/* Column headings — annuity.org: a.d2 { font-size: 0.95rem; font-weight: 700; line-height: 1.8; margin-bottom: 1rem } */
.mas-mega__heading {
    font-size: 17px;             /* 0.95rem ≈ 15.2px */
    font-weight: 700;
    color: #171717;              /* annuity.org: rgb(23,23,23) */
    margin: 0 0 14px 0;
    padding: 0;
    line-height: 1.8;
    border: none;
    display: block;
    text-decoration: none;
}
a.mas-mega__heading:hover {
    text-decoration: underline;
    color: #0157ff;
}

/* Sub-group headings — bold clickable section labels */
.mas-mega__sub-heading {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: #171717;
    text-decoration: none;
    padding: 6px 0 4px 0;
    margin-top: 14px;
    line-height: 1.5;
    transition: color 0.15s ease;
}
.mas-mega__sub-heading:first-child,
.mas-mega__sub-heading:first-of-type {
    margin-top: 0;
}
.mas-mega__sub-heading:hover {
    color: #0157ff;
    text-decoration: underline;
}

/* Sub-link lists — annuity.org: a.d3 { font-size: 0.85rem; color: rgb(23,23,23) } li.d3 { padding-bottom: 1rem } */
.mas-mega__sub-links {
    list-style: none;
    margin: 0 0 4px 0;
    padding: 0;
}
.mas-mega__sub-links li {
    padding-bottom: 12px;        /* annuity.org: 1rem (16px), slightly tighter */
}
.mas-mega__sub-links li:last-child {
    padding-bottom: 0;
}
.mas-mega__sub-links li a {
    display: block;
    font-size: 15.5px;           /* annuity.org: 0.85rem = ~13.6px */
    color: #3d3d3d;
    text-decoration: none;
    padding: 0 0 0 10px;
    line-height: 1.5;
    transition: color 0.15s ease;
}
.mas-mega__sub-links li a:hover {
    color: #0157ff;
    text-decoration: underline;
}

/* Plain link lists (Annuities and Calculators columns) */
.mas-mega__col > ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.mas-mega__col > ul > li {
    padding-bottom: 12px;        /* annuity.org li.d3: padding-bottom: 1rem */
}
.mas-mega__col > ul > li:last-child {
    padding-bottom: 0;
}
.mas-mega__col > ul > li > a {
    display: block;
    font-size: 15.5px;           /* annuity.org a.d3: 0.85rem */
    color: #3d3d3d;
    text-decoration: none;
    line-height: 1.5;
    transition: color 0.15s ease;
}
.mas-mega__col > ul > li > a:hover {
    color: #0157ff;
    text-decoration: underline;
}

/* --- Featured article card (annuity.org: article flex: 1 0 50%; image left, text right) --- */
/* annuity.org: .c-post-block__inner { display: flex } image max-width: 18rem, content padding-left: 1.5rem */
.mas-mega__article {
    display: flex;
    flex-direction: row;
    gap: 0;
    align-items: flex-start;
    margin-top: 4px;
}
.mas-mega__article-img {
    width: 44%;                  /* annuity.org: image wrapper ~33-40% of article width */
    max-width: 250px;
    flex-shrink: 0;
    height: 165px;
    object-fit: cover;
    border-radius: 8px;          /* annuity.org: 0.5rem */
    display: block;
    background: #e5e7eb;
}
.mas-mega__article-body {
    flex: 1;
    min-width: 0;
    padding-left: 20px;          /* annuity.org: 1.5rem = 24px */
}
.mas-mega__article-cat {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #0157ff;
    display: block;
    margin-bottom: 8px;
}
/* annuity.org: .c-post-block__link h1 { font-size: 1.25rem; line-height: 1.4; margin-top: 0 } */
.mas-mega__article-title {
    font-size: 17px !important;  /* annuity.org: 1.25rem = 20px; we use 17px for tighter fit */
    font-weight: 700 !important;
    color: #171717 !important;
    margin: 0 0 8px 0 !important;
    line-height: 1.4 !important;
    padding: 0 !important;
}
.mas-mega__article-title a {
    color: inherit;
    text-decoration: none;
}
.mas-mega__article-title a:hover {
    color: #0157ff;
    text-decoration: underline;
}
.mas-mega__article-excerpt {
    font-size: 13px;
    color: #6b7280;
    margin: 0 0 12px 0;
    line-height: 1.55;
}
.mas-mega__article-more {
    font-size: 13.5px;
    font-weight: 600;
    color: #0157ff;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.mas-mega__article-more:hover {
    text-decoration: underline;
    color: #0046d6;
}

/* Personal Takes (About Us — thumbnail + title) */
.mas-mega__takes {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.mas-mega__take-item {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 16px;
}
.mas-mega__take-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}
.mas-mega__take-img {
    width: 64px;
    height: 48px;
    object-fit: cover;
    border-radius: 5px;
    flex-shrink: 0;
    background: #e5e7eb;
}
.mas-mega__take-title {
    font-size: 15px;
    color: #1a1a2e;
    font-weight: 600;
    text-decoration: none;
    line-height: 1.45;
}
.mas-mega__take-title:hover {
    color: #0157ff;
    text-decoration: underline;
}

/* --- Search (desktop inline-expand) --- */
.mas-header__search {
    display: flex;
    align-items: center;
    position: relative;
    align-self: center;
    margin-left: 4px;
}
.mas-header__search-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #1a1a2e;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: color 0.15s ease, background 0.15s ease;
    flex-shrink: 0;
}
.mas-header__search-btn:hover {
    color: #0157ff;
    background: #f3f4f6;
}
.mas-header__search-form {
    display: flex;
    align-items: center;
    overflow: hidden;
    max-width: 0;
    opacity: 0;
    transition: max-width 0.3s ease, opacity 0.2s ease;
    pointer-events: none;
}
.mas-header__search--open .mas-header__search-form {
    max-width: 260px;
    opacity: 1;
    pointer-events: auto;
}
.mas-header__search-input {
    border: 1px solid #e5e7eb;
    border-right: none;
    border-radius: 6px 0 0 6px;
    padding: 7px 12px;
    font-family: 'DM Sans', sans-serif;
    font-size: 13.5px;
    color: #1a1a2e;
    background: #f8f9fa;
    width: 210px;
    outline: none;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.mas-header__search-input:focus {
    border-color: #0157ff;
    background: #fff;
}
.mas-header__search-submit {
    background: #0157ff;
    border: none;
    border-radius: 0 6px 6px 0;
    padding: 8px 11px;
    cursor: pointer;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
    flex-shrink: 0;
}
.mas-header__search-submit:hover {
    background: #0046d6;
}

/* --- CTA Button --- */
.mas-header__cta {
    background: #0157ff;
    color: #ffffff !important;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    align-self: center;
    transition: background 0.15s ease;
    margin-left: 16px;
}
.mas-header__cta:hover {
    background: #0046d6;
}

/* --- Hamburger (hidden on desktop) --- */
.mas-header__hamburger {
    display: none;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #1a1a2e;
    padding: 8px;
    line-height: 1;
    align-self: center;
}

/* --- Mobile Nav (hidden on desktop) --- */
.mas-header__mobile-nav {
    display: none;
}

/* --- Body offset for fixed header --- */
body {
    padding-top: 72px !important;
}

/* --- WordPress admin bar offset ---
   Since .mas-mega uses position:absolute top:100%, it follows the header automatically.
   No explicit mega-top offset needed. */
.admin-bar .mas-header {
    top: 32px;
}
@media screen and (max-width: 782px) {
    .admin-bar .mas-header {
        top: 46px;
    }
    body {
        padding-top: calc(60px + 46px) !important;
    }
}

/* ===========================================
   MOBILE — 768px and below
   =========================================== */
@media (max-width: 768px) {
    .mas-header__inner {
        height: 60px;
        padding: 0 16px;
        align-items: center;
    }
    body {
        padding-top: 60px !important;
    }
    .mas-header__nav,
    .mas-header__cta {
        display: none;
    }
    .mas-header__hamburger {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    /* Mobile nav drawer */
    .mas-header__mobile-nav {
        display: block;
        background: #ffffff;
        border-top: 1px solid #e5e7eb;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    .mas-header__mobile-nav--open {
        max-height: 85vh;
        overflow-y: auto;
    }
    /* Mobile accordion items */
    .mas-mobile-item {
        border-bottom: 1px solid #e5e7eb;
    }
    .mas-mobile-item__trigger {
        background: none;
        border: none;
        width: 100%;
        text-align: left;
        font-family: 'DM Sans', sans-serif;
        font-size: 15px;
        font-weight: 600;
        color: #1a1a2e;
        padding: 16px;
        cursor: pointer;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    .mas-mobile-item__arrow {
        font-size: 12px;
        transition: transform 0.2s ease;
        color: #6b7280;
    }
    .mas-mobile-item--open .mas-mobile-item__arrow {
        transform: rotate(180deg);
    }
    .mas-mobile-item__links {
        list-style: none;
        margin: 0;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.25s ease;
    }
    .mas-mobile-item--open .mas-mobile-item__links {
        max-height: 600px;
    }
    .mas-mobile-item__links li a {
        display: block;
        padding: 10px 16px 10px 24px;
        font-size: 14px;
        color: #1a1a2e;
        text-decoration: none;
        border-top: 1px solid #f3f4f6;
    }
    .mas-mobile-item__links li a:hover {
        color: #0157ff;
        background: #f8f9fa;
    }
    .mas-mobile-item__direct {
        display: block;
        padding: 16px;
        font-size: 15px;
        font-weight: 600;
        color: #1a1a2e;
        text-decoration: none;
        border-bottom: 1px solid #e5e7eb;
    }
    .mas-mobile-cta {
        display: block;
        margin: 16px;
        background: #0157ff;
        color: #ffffff !important;
        text-align: center;
        padding: 14px;
        border-radius: 6px;
        font-size: 15px;
        font-weight: 600;
        text-decoration: none;
    }
    /* Article cards and takes hidden on mobile */
    .mas-mega__article,
    .mas-mega__takes {
        display: none;
    }
    /* Desktop search hidden on mobile */
    .mas-header__search {
        display: none;
    }
    /* Mobile search bar inside drawer */
    .mas-mobile-search {
        padding: 12px 16px;
        border-bottom: 1px solid #e5e7eb;
    }
    .mas-mobile-search form {
        display: flex;
        align-items: center;
    }
    .mas-mobile-search input[type="search"] {
        flex: 1;
        border: 1px solid #e5e7eb;
        border-right: none;
        border-radius: 6px 0 0 6px;
        padding: 9px 12px;
        font-family: 'DM Sans', sans-serif;
        font-size: 14px;
        color: #1a1a2e;
        background: #f8f9fa;
        outline: none;
    }
    .mas-mobile-search input[type="search"]:focus {
        border-color: #0157ff;
        background: #fff;
    }
    .mas-mobile-search button[type="submit"] {
        background: #0157ff;
        border: none;
        border-radius: 0 6px 6px 0;
        padding: 9px 12px;
        cursor: pointer;
        color: #fff;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}


/* --- Click-to-call CTA --- */
.mas-header__cta--phone {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    letter-spacing: 0.02em;
    padding: 10px 18px;
    font-size: 14px;
}

/* --- Mega menu footer banner --- */
.mas-mega__footer {
    background: #0b1f4a;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.mas-mega__footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 18px 28px;
    display: flex;
    align-items: center;
    gap: 18px;
}
.mas-mega__footer-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mas-mega__footer-text {
    flex: 1;
    min-width: 0;
}
.mas-mega__footer-text strong {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.4;
    margin-bottom: 3px;
}
.mas-mega__footer-text span {
    display: block;
    font-size: 13px;
    color: rgba(255,255,255,0.72);
    line-height: 1.5;
}
.mas-mega__footer-btn {
    flex-shrink: 0;
    background: #0157ff;
    color: #ffffff !important;
    text-decoration: none;
    padding: 10px 22px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.15s ease;
    display: inline-block;
}
.mas-mega__footer-btn:hover {
    background: #0046d6;
    text-decoration: none;
}
@media (max-width: 768px) {
    .mas-mega__footer {
        display: none;
    }
}
