/* ============================================
   UNIFIED FIXES - Header, Footer, SPA Assets
   ============================================ */

/* HEADER FIX - Ensure header is always visible - HIGHEST PRIORITY */
.site-header,
header#masthead,
#masthead,
body.cola-home-template #masthead,
body.cola-home-template .site-header,
body.cola-home-template header#masthead {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Override inline styles */
#masthead[style*="display: none"],
.site-header[style*="display: none"],
header#masthead[style*="display: none"],
body.cola-home-template #masthead[style*="display: none"],
body.cola-home-template .site-header[style*="display: none"] {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* FOOTER FIX - Ensure footer is always visible and at bottom */
html, body {
    height: 100% !important;
    min-height: 100vh !important;
}

body {
    display: flex !important;
    flex-direction: column !important;
}

#page, #page.site, .site {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
}

#content, #primary, #main, .site-main, main#main, main {
    flex: 1 1 auto !important;
    min-height: 0 !important;
}

footer.nembien-footer {
    display: block !important;
    position: static !important;
    order: 999999 !important; /* Highest order to ensure footer is always last */
    margin-top: auto !important;
    z-index: auto !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    flex-shrink: 0 !important;
    clear: both !important;
}

body.cola-home-template > footer,
body.cola-home-template footer.nembien-footer {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: static !important;
    order: 999999 !important; /* Highest order to ensure footer is always last */
    margin-top: auto !important;
    z-index: auto !important;
    width: 100% !important;
    flex-shrink: 0 !important;
    clear: both !important;
}

/* Hide footer if incorrectly placed inside #cola-app */
body.cola-home-template #cola-app footer,
body.cola-home-template #cola-app footer.nembien-footer,
body.cola-home-template .cola-home-page footer {
    display: none !important;
}

/* Hide other footers */
.fy-footer,
.cola-footer,
.footerbar {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Ensure body/page is flex container for footer positioning */
body.cola-home-template {
    display: flex !important;
    flex-direction: column !important;
    min-height: 100vh !important;
}

body.cola-home-template #cola-app {
    flex: 1 1 auto !important;
    order: 1 !important;
    min-height: auto !important;
}

body.cola-home-template > footer,
body.cola-home-template footer.nembien-footer {
    order: 999999 !important; /* Highest order to ensure footer is always last */
    flex-shrink: 0 !important;
    margin-top: auto !important;
}

