/* ============================================
   FOOTER POSITION FIX - Ensure footer always at bottom
   ============================================ */

/* Ensure HTML and Body are full height */
html {
    height: 100% !important;
    min-height: 100vh !important;
}

body {
    min-height: 100vh !important;
    display: flex !important;
    flex-direction: column !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Page wrapper as flex container */
#page,
#page.site,
.site {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
}

/* Content area grows to fill space */
#content,
#primary,
#main,
.site-main,
main#main,
main {
    flex: 1 1 auto !important;
    min-height: 0 !important;
}

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

/* For cola-home-template */
body.cola-home-template {
    display: flex !important;
    flex-direction: column !important;
    min-height: 100vh !important;
}

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

body.cola-home-template > footer,
body.cola-home-template footer.nembien-footer {
    order: 999999 !important; /* Highest order - always last */
    flex-shrink: 0 !important;
    margin-top: auto !important;
    width: 100% !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 {
    display: none !important;
}

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

