/* =========================================================
   1. HEADER HIDING & GLOBAL RESET
   ========================================================= */

/* Hide theme header completely */
header.site-header, #masthead, header#masthead, .main-header, .ast-desktop-header, .elementor-location-header {
  display: none !important;
}

/* Reset Body default padding to prevent double-spacing */
body { 
  padding-top: 0 !important; 
  margin-top: 0 !important;
}

/* =========================================================
   2. HERO SAFE ZONE (Fixes "Cut Off" Content)
   Description: Adds fluid spacing to the top so content 
   doesn't hide behind the browser edge.
   ========================================================= */

:root {
  /* Dynamic buffer: 30px on mobile, scales to 60px on large screens */
  --ew-top-buffer: clamp(30px, 6vh, 60px); 
}

/* Apply buffer to the main content wrappers */
#primary, 
.site-content, 
.ast-container, 
#content,
.ast-theme-ast-blog .site-content {
  margin-top: var(--ew-top-buffer) !important;
  padding-top: 0 !important;
}

/* Remove Astra's invisible spacers that might cause layout shifts */
.ast-header-spacer,
.ast-title-spacer,
.ast-page-title-spacer {
  display: none !important;
  height: 0 !important;
}

/* =========================================================
   3. EVERWISE FOOTER RECOVERY (Force-Fix v7)
   Description: Overrides Astra/Theme sub-page defaults.
   ========================================================= */

/* THE BREAKOUT (Forces Full Width on Narrow Pages) */
#ew-footer-replacement {
    all: unset; /* Nukes Astra's white background/padding */
    display: block !important;
    position: relative !important;
    
    /* Force Full Screen Width */
    width: 100vw !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
    left: 0 !important;
    right: 0 !important;
    max-width: 100vw !important;
    
    /* Brand Styling */
    background-color: #002F6C !important;
    color: #ffffff !important;
    border-top: 5px solid #D4AF37 !important;
    padding-top: 60px !important;
    padding-bottom: 0 !important;
    z-index: 99999 !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important; /* Prevents scrollbars */
}

/* THE GRID (Restores Columns) */
#ew-footer-replacement .ew-footer-grid {
    display: grid !important;
    grid-template-columns: 1.4fr 0.8fr 0.8fr 1fr !important;
    gap: 40px !important;
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 0 20px 50px 20px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* FIX LISTS (Removes Bullets/Indents) */
#ew-footer-replacement ul,
#ew-footer-replacement li {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    text-indent: 0 !important;
}
#ew-footer-replacement li {
    margin-bottom: 12px !important;
    display: block !important;
}
#ew-footer-replacement li::before {
    content: none !important; /* Kills Astra bullets */
    display: none !important;
}

/* FIX TEXT & LINKS */
#ew-footer-replacement p {
    color: #8da2b5 !important;
    margin-bottom: 25px !important;
    line-height: 1.5 !important;
}
#ew-footer-replacement a {
    color: #E6EAF2 !important;
    text-decoration: none !important;
    font-family: 'Lato', system-ui, sans-serif !important;
    font-weight: 500 !important;
    font-size: 16px !important;
    box-shadow: none !important;
    background-image: none !important;
}
#ew-footer-replacement a:hover {
    color: #D4AF37 !important;
    background: transparent !important;
    padding-left: 4px !important;
}

/* HEADINGS & IMAGES */
#ew-footer-replacement h4 {
    font-family: 'Montserrat', system-ui, sans-serif !important;
    font-weight: 800 !important;
    color: #ffffff !important;
    text-transform: uppercase !important;
    font-size: 1.1rem !important;
    margin-bottom: 22px !important;
    border: none !important;
    padding: 0 !important;
}
#ew-footer-replacement img {
    max-width: 100% !important;
    height: auto !important;
    box-shadow: none !important;
    border: none !important;
    margin: 0 !important;
    display: inline-block !important;
}
#ew-footer-replacement .ew-brand-col img {
    filter: brightness(0) invert(1) !important;
    margin-bottom: 20px !important;
    display: block !important;
    width: auto !important;
    height: 55px !important;
}

/* BUTTONS */
#ew-footer-replacement .ew-btn-link {
    display: inline-flex !important;
    align-items: center !important;
    font-weight: 800 !important;
    color: #D4AF37 !important;
    text-transform: uppercase !important;
    font-size: 0.85rem !important;
}
.ew-portal-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(255,255,255,0.1) !important;
    border: 1px solid rgba(255,255,255,0.2) !important;
    padding: 12px !important;
    border-radius: 8px !important;
    color: #fff !important;
    font-weight: 700 !important;
    margin-bottom: 15px !important;
    width: 100% !important;
    text-align: center !important;
}
.ew-portal-btn:hover {
    background: #D4AF37 !important;
    color: #002F6C !important;
    border-color: #D4AF37 !important;
}

/* COPYRIGHT BAR */
#ew-footer-replacement .ew-copyright-bar {
    border-top: 1px solid rgba(255,255,255,0.1) !important;
    background: rgba(0,0,0,0.1) !important;
    padding: 20px 0 !important;
    width: 100% !important;
}
#ew-footer-replacement .ew-copyright-inner {
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 0 20px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 15px !important;
}
#ew-footer-replacement .ew-copy-text,
#ew-footer-replacement .ew-legal-links a {
    color: rgba(255,255,255,0.5) !important;
    font-size: 0.85rem !important;
    margin: 0 !important;
}
#ew-footer-replacement .ew-legal-links {
    display: flex !important;
    gap: 20px !important;
}

/* MOBILE RESPONSIVENESS */
@media (max-width: 980px) {
    #ew-footer-replacement .ew-footer-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 30px !important;
    }
    #ew-footer-replacement .ew-brand-col {
        grid-column: 1 / -1 !important;
    }
}
@media (max-width: 600px) {
    #ew-footer-replacement .ew-footer-grid {
        grid-template-columns: 1fr !important;
        text-align: center !important;
    }
    #ew-footer-replacement .ew-brand-col img {
        margin: 0 auto 20px auto !important;
    }
    #ew-footer-replacement .ew-btn-link {
        justify-content: center !important;
    }
    #ew-footer-replacement .ew-copyright-inner {
        flex-direction: column !important;
        text-align: center !important;
        gap: 10px !important;
    }
}
/* ================= END FIXED CODE ================= */
