/* Canonical mega-nav styles (STANDARDIZATION-PLAN task 22, D7) — extracted from the
   shipped inline copy, brand literals tokenized. This sheet is the ONLY home for
   .mega-* rules: every page links it and the per-page inline pastes were removed
   (2026-07-10, computed-style A/B verified). Don't re-paste rules into pages —
   page-specific nav tweaks go in the page <style> AFTER this sheet, as overrides. */

.mega-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgb(250 247 244 / 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgb(var(--midnight-eagle-rgb) / 0.08);
}
.mega-nav-item { position: relative; }
.mega-nav-item > a {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 1rem 0.5rem;
    font-weight: 500;
    color: var(--color-midnight-eagle);
    text-decoration: none;
    transition: color 0.2s ease;
}
.mega-nav-item > a:hover { color: var(--color-accent); }
.mega-nav-item[data-open] > a { color: var(--color-accent); }
.mega-dropdown {
    position: absolute;
    left: 0;
    transform: translateY(8px);
    top: 100%;
    min-width: min(90vw, 640px);
    padding: 1.25rem 1.5rem 1.5rem;
    background: var(--color-paper);
    border-radius: 12px;
    box-shadow: 0 20px 50px rgb(var(--midnight-eagle-rgb) / 0.12), 0 0 0 1px rgb(var(--midnight-eagle-rgb) / 0.06);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
}
/* Invisible bridge across the translateY(8px) gap between the trigger and the
   panel, so moving the cursor down into the dropdown never crosses a dead zone
   (which would fire mouseleave and close it). Inherits the panel's pointer-events:
   inert at rest, hoverable only while the panel is open. */
.mega-dropdown::before {
    content: "";
    position: absolute;
    top: -12px;
    left: 0;
    right: 0;
    height: 12px;
}
#mega-services {
    min-width: unset;
    width: min(92vw, 620px);
    max-width: calc(100vw - 1.5rem);
    left: 0;
    right: auto;
}
#mega-services .mega-dropdown-grid { grid-template-columns: 1fr; gap: 1rem; }
#mega-locations.mega-dropdown { min-width: min(90vw, 720px); }
#mega-membership.mega-dropdown {
    left: 0; right: auto;
    min-width: unset;
    width: min(90vw, 560px);
    max-width: calc(100vw - 1.5rem);
}
.mega-nav-item[data-open] .mega-dropdown {
    opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0);
}
.mega-dropdown-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.mega-locations-grid { grid-template-columns: 1fr minmax(280px, 380px); min-width: min(90vw, 720px); }
.mega-locations-map { display: block; }
.us-map-wrap { width: 100%; max-width: 320px; margin-left: auto; }
.us-map-img { width: 100%; height: auto; display: block; border-radius: 8px; }
@media (max-width: 1023px) {
    .mega-locations-map { display: none; }
    .mega-locations-grid { grid-template-columns: 1fr; min-width: auto; }
}
.mega-col h4 {
    font-family: 'New Spirit', Georgia, serif;
    font-size: 0.75rem; font-weight: 500;
    text-transform: uppercase; letter-spacing: 0.12em;
    color: var(--color-midnight-eagle); margin-bottom: 1rem;
}
.mega-col ul { list-style: none; padding: 0; margin: 0; }
.mega-col ul li { margin-bottom: 0.5rem; }
.mega-col ul.mega-locations-list li { margin-bottom: 0; }
.mega-col a {
    color: var(--color-midnight-eagle); text-decoration: none;
    font-size: 0.9375rem; font-weight: 500;
    transition: color 0.2s ease;
}
.mega-col a:hover { color: var(--color-accent); }
.mega-insight { background: var(--color-mint); border-radius: 10px; padding: 1rem 1.25rem; margin-top: 0.5rem; }
.mega-insight p { font-size: 0.875rem; color: var(--color-midnight-eagle); margin: 0 0 0.5rem 0; line-height: 1.4; }
.mega-insight a { font-size: 0.8125rem; font-weight: 600; color: var(--color-accent); }
.mega-cta {
    display: inline-flex; align-items: center; gap: 0.5rem;
    background: var(--color-accent); color: #fff !important;
    padding: 0.5rem 1rem; border-radius: 9999px;
    font-weight: 600; font-size: 0.875rem;
    text-decoration: none;
    transition: box-shadow 0.2s ease, transform 0.1s ease;
}
.mega-cta:hover { box-shadow: 0 4px 14px rgb(var(--opal-rgb) / 0.4); transform: translateY(-1px); }
.mega-mobile-toggle { display: none; padding: 0.5rem; border: none; background: none; color: var(--color-midnight-eagle); cursor: pointer; }
.mega-mobile-menu {
    display: none; background: var(--color-paper);
    border-top: 1px solid rgb(var(--midnight-eagle-rgb) / 0.08);
    padding: 0 1rem; max-height: 0; overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}
.mega-mobile-menu[data-open] {
    max-height: calc(100vh - 4rem); padding: 0;
    overflow: hidden; display: flex; flex-direction: column;
}
.mega-mobile-menu[data-open] .mega-mobile-nav-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 1rem; }
.mega-mobile-menu .mega-call-now-sticky { flex-shrink: 0; padding: 0.5rem 1rem 1rem; margin-top: auto; margin-bottom: 0.5rem; }
.mega-mobile-menu .mega-call-now-sticky .mega-call-now-box { padding: 0.5rem 0.75rem; border-radius: 1rem; }
.mega-mobile-menu .mega-call-now-sticky .mega-call-now-box h4 { font-size: 0.9375rem; margin-bottom: 0.125rem; }
.mega-mobile-menu .mega-call-now-sticky .mega-call-now-box p { font-size: 0.75rem; margin-bottom: 0.5rem; }
.mega-mobile-menu .mega-call-now-sticky .mega-call-now-box a { padding: 0.375rem 0.75rem; font-size: 0.8125rem; }
.mega-mobile-menu .mega-col { margin-bottom: 1rem; }
.mega-mobile-menu .mega-dropdown-grid { grid-template-columns: 1fr; }
.mega-services-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem 1rem; }
@media (max-width: 1280px) {
    #mega-services { width: min(92vw, 560px); }
    .mega-services-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
    .mega-service-desc { display: none; }
}
@media (max-width: 1100px) {
    #mega-services { width: min(92vw, 520px); }
    #mega-services .mega-dropdown-grid { grid-template-columns: 1fr; gap: 1rem; }
    .mega-services-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.mega-service-item {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.6rem; border-radius: 12px;
    text-decoration: none; transition: background 0.2s ease;
}
.mega-service-item:hover { background: var(--color-mint); }
.mega-service-icon {
    flex-shrink: 0; width: 1.75rem; height: 1.75rem;
    border-radius: 8px; background: var(--color-paper);
    display: flex; align-items: center; justify-content: center; color: var(--color-accent);
}
.mega-service-item:hover .mega-service-icon { background: #fff; }
.mega-service-text { display: flex; flex-direction: column; min-width: 0; }
.mega-service-title { color: var(--color-midnight-eagle); font-size: 0.8125rem; font-weight: 700; margin-bottom: 0.125rem; line-height: 1.2; }
.mega-service-desc { color: rgb(var(--midnight-eagle-rgb) / 0.6); font-size: 0.7rem; line-height: 1.25; }
.mega-locations-list { display: flex; flex-direction: column; gap: 0.125rem; }
.mega-locations-list li { margin-bottom: 0; }
.mega-location-item {
    display: block; font-size: 1.05rem;
    padding: 0.375rem 0.75rem; margin-left: -0.75rem; margin-right: -0.75rem;
    border-radius: 8px; transition: background 0.2s ease;
}
.mega-location-item:hover { background: var(--color-mint); }
.mega-locations-divider { height: 1px; background-color: rgb(var(--midnight-eagle-rgb) / 0.08); margin: 1.5rem 0; }
.mega-insight-link {
    display: block; text-decoration: none; border-radius: 10px;
    transition: transform 0.2s ease; cursor: pointer; position: relative;
}
.mega-insight-link::before {
    content: ''; position: absolute; inset: 0; border-radius: 10px;
    border: 1.5px solid rgb(var(--midnight-eagle-rgb) / 0.2);
    pointer-events: none; opacity: 0; transition: opacity 0.3s ease; z-index: 10;
}
.mega-insight-link:hover { transform: translateY(-2px); }
.mega-insight-link:hover::before { opacity: 1; }
.mega-insight-link .mega-insight { margin-top: 0; }
.mega-insight-link.mega-insight-link--coral::before { border-color: rgb(var(--opal-rgb) / 0.4); }
.mega-insight-link .mega-action-link { transition: color 0.2s ease; }
.mega-insight-link:hover .mega-action-link { color: var(--opal-hover); }
.mega-insight-link--coral .mega-insight-cta-text { color: var(--color-accent); font-size: 0.8125rem; font-weight: 600; transition: color 0.2s ease; }
.mega-insight-link--coral:hover .mega-insight-cta-text { color: var(--opal-hover); }
.mega-action-link {
    position: relative; display: inline-flex; align-items: center; gap: 0.375rem;
    color: var(--color-accent); text-decoration: none; font-size: 0.875rem; font-weight: 600;
    padding-bottom: 0.125rem; transition: color 0.2s ease;
}
.mega-action-link::after { display: none; }
@media (max-width: 1023px) {
    .mega-nav-list { display: none; }
    .mega-mobile-toggle { display: flex; align-items: center; justify-content: center; }
    .mega-mobile-menu { display: block; }
}
@media (min-width: 1024px) {
    .mega-mobile-menu[data-open] { display: none; }
}
/* Closed mobile menu must not steal clicks (was blocking footer links on small viewports) */
@media (max-width: 1023px) {
    #mega-mobile-menu:not([data-open]) {
        pointer-events: none;
    }
    #mega-mobile-menu[data-open] {
        pointer-events: auto;
    }
    /* Open menu overlays the page instead of growing the sticky header (which pushed
       content down). Absolute + top:100% anchors it just below the header bar; the
       header is position:sticky so it's the positioning context. Shadow lifts it. */
    .mega-mobile-menu[data-open] {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        box-shadow: 0 16px 28px rgb(var(--midnight-eagle-rgb) / 0.14);
    }
}
