/*
 * NPL Sports Pro Theme - Header & Footer Styles
 * File: Assets/css/footer.css
 * TABLE OF CONTENTS
 * 1. Footer Styles
 * 2. Responsive Styles - Footer
 * =================================================================== */

/* Force blue background on all footer widget elements to override global styles */
.footer-widgets-area .widget,
.footer-widgets-area .widget *,
.footer-widgets-area .widget ul li {
    background-color: #0010a0 !important;
    background: #0010a0 !important;
    border: none !important;
    box-shadow: none !important;
    padding: 2px 0 !important; /* Adjust padding for better spacing */
}

/* Set widget title text color to white */
.footer-widgets-area .widget .widget-title,
.footer-widgets-area .widget h2,
.footer-widgets-area .widget h3 {
    color: #ffffff !important;
    background-color: #0010a0 !important;
}

/* Set link text color to white */
.footer-widgets-area .widget ul li a {
    color: #ffffff !important;
    background-color: #0010a0 !important;
}

/* Set hover link text color to red */
.footer-widgets-area .widget ul li a:hover {
    color: #dd0000 !important;
    background-color: #0010a0 !important;
}

/* Remove default margins for cleaner spacing */
.footer-widgets-area .widget ul {
    margin-top: 5px !important;
}

/* --- Menu display logic with Wrap Fix --- */
.sub-footer-area .desktop-footer-nav .menu,
.sub-footer-area .mobile-footer-nav .menu { 
    display: flex; 
    flex-wrap: wrap; /* CRITICAL: Prevents overlapping by wrapping items */
    list-style: none; 
    margin: 0; 
    padding: 0; 
    gap: 5px 5px; /* Vertical and Horizontal gaps */
}

/* By default, show the desktop menu and hide the mobile one */
.mobile-footer-nav {
    display: none;
}
.desktop-footer-nav {
    display: block;
}

@media (max-width: 768px) { 
    .footer-widgets-grid { 
        grid-template-columns: 1fr; 
        gap: 10px;
    } 
    
    .sub-footer-area {
        padding: 20px 10px; /* More breathing room on mobile */
    }

    .sub-footer-area .container { 
        flex-direction: column; 
        gap: 20px; 
        text-align: center;
    } 

    .sub-footer-area .mobile-footer-nav .menu {
        justify-content: center; /* Center menu items on mobile */
        gap: 10px 15px;
    }
    
    .copyright-text { 
        order: 2; 
        text-align: center; 
        width: 100%;
        font-size: 13px;
        line-height: 1.6;
    } 
    
    /* On mobile, hide the desktop menu and show the mobile one */
    .desktop-footer-nav {
        display: none;
    }
    .mobile-footer-nav {
        display: block;
        order: 1; 
        width: 100%;
    }
}

/* ===================================================================
 * FIX: Custom HTML Widget inside Footer
 * =================================================================== */

/* ===================================================================
 * NPL CUSTOM HTML WIDGET STYLES
 * Handles Text, Lists, Tables, and Headings for both Sidebar & Footer
 * =================================================================== */

.npl-html-content p {
    margin-bottom: 15px !important;
    line-height: 1.6 !important;
}

.npl-html-content span {
    display: inline-block;
}

/* --- Lists (ul/li) --- */
.npl-html-content ul {
    list-style: none !important;
    padding-left: 0 !important;
    margin-bottom: 15px !important;
}

.npl-html-content ul li {
    margin-bottom: 8px !important;
    padding-left: 20px !important;
    position: relative !important;
}

/* Using a custom arrow icon for list items */
.npl-html-content ul li::before {
    content: "» ";
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* --- Tables --- */
.npl-html-content table {
    width: 100% !important;
    margin: 15px 0 !important;
    border-collapse: collapse !important;
}

.npl-html-content th, 
.npl-html-content td {
    padding: 10px !important;
    border: 1px solid rgba(255, 255, 255, 0.2); /* Light border */
}

/* Responsive Table Wrapper */
.npl-html-content {
    overflow-x: auto; /* Prevents table from breaking mobile layout */
}

/* --- Headings --- */
.npl-html-content h1, 
.npl-html-content h2, 
.npl-html-content h3, 
.npl-html-content h4, 
.npl-html-content h5 {
    margin: 20px 0 10px 0 !important;
    line-height: 1.3 !important;
}

/* ===================================================================
 * CONTEXT AWARE COLORING (Sidebar vs Footer)
 * =================================================================== */

/* 1. Sidebar Styles (Default/White background) */
.widget-wrapper:not(.footer-widgets-area *) .npl-html-content {
    color: #444 !important;
}
.widget-wrapper:not(.footer-widgets-area *) .npl-html-content h1,
.widget-wrapper:not(.footer-widgets-area *) .npl-html-content h2,
.widget-wrapper:not(.footer-widgets-area *) .npl-html-content h3 {
    color: #222 !important;
}

/* 2. Footer Styles (Dark Blue background #0010a0) */
.footer-widgets-area .npl-html-content {
    color: #ffffff !important;
}
.footer-widgets-area .npl-html-content h1,
.footer-widgets-area .npl-html-content h2,
.footer-widgets-area .npl-html-content h3,
.footer-widgets-area .npl-html-content h4,
.footer-widgets-area .npl-html-content h5 {
    color: #ffffff !important;
}
.footer-widgets-area .npl-html-content a {
    color: #ffcc00 !important; /* Gold links for visibility on Blue */
}

@media (max-width: 768px) { 
    .footer-widgets-grid { 
        grid-template-columns: 1fr; 
        gap: 20px;
    } 
    .sub-footer-area {
        padding: 30px 15px; 
    }
    .sub-footer-area .container { 
        flex-direction: column; 
        gap: 20px; 
        text-align: center;
    } 
    .sub-footer-area .mobile-footer-nav .menu {
        justify-content: center; 
        gap: 10px 15px;
    }
    .copyright-text { 
        order: 2; 
        text-align: center; 
        width: 100%;
        font-size: 13px;
        line-height: 1.6;
    } 
    .desktop-footer-nav {
        display: none;
    }
    .mobile-footer-nav {
        display: block;
        order: 1; 
        width: 100%;
    }
}