/*
Theme Name: BCCO Custom Theme
Author: BCCO
Description: Custom theme for BCCO.
Version: 1.0
Text Domain: bcco-theme
*/

/* Basic Reset & Box Sizing to ensure elements fit within the screen */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    overflow-x: hidden; /* Ensures the sidebar doesn't cause horizontal scroll */
    width: 100%;
}

/* Specific styles to match the reference image */
.pill-header-container {
    background: #fff;
    border-radius: 100px;
    padding: 10px 40px;
    margin: 20px auto;
    max-width: 1400px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    width: 95%;
    position: relative;
    z-index: 1000;
}

#primary-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 35px;
    align-items: center;
}

#primary-menu li {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    font-weight: 600;
    position: relative; /* Essential for absolute positioning of sub-menu */
}

/* Only apply the hover-bridge padding to the top-level items */
#primary-menu > li {
    padding: 20px 0;
}

#primary-menu li a {
    text-decoration: none;
    color: #30839A;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Dropdown arrow for parent items */
#primary-menu li.menu-item-has-children > a:after {
    content: "\f107"; /* FontAwesome Down Arrow */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 14px;
}

/* --- Dropdown (Sub-menu) Styling --- */
#primary-menu .sub-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #6ea8b8; /* Specific requested color */
    min-width: 200px;
    border-radius: 20px;
    padding: 0;
    margin: 10px 0 0 0;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    text-align: center;
    display: flex;
    flex-direction: column; /* Ensure vertical stacking */
}

/* Show sub-menu on hover */
#primary-menu li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    top: 85%; /* Slightly overlaps for a smoother transition */
}

/* Adjust CTA hover position to ensure mouse can bridge the gap (button is shorter than normal items) */
#primary-menu li.menu-item-cta:hover > .sub-menu {
    top: 75%;
}

/* Reset padding for sub-menu items so they don't inherit top-level spacing */
#primary-menu .sub-menu li {
    padding: 0;
    margin: 0;
    display: block;
    width: 100%;
}

/* Faint divider between items */
#primary-menu .sub-menu li:not(:last-child) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

/* Round the corners of the first item to match the container */
#primary-menu .sub-menu li:first-child a {
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
}

#primary-menu .sub-menu li a {
    color: #ffffff;
    padding: 15px 20px;
    justify-content: center;
    font-weight: 500;
    font-size: 15px;
    display: flex;
}

/* Remove arrow from nested links if any */
#primary-menu .sub-menu li a:after {
    display: none;
}

#primary-menu .sub-menu li a:hover {
    background: rgba(255, 255, 255, 0.1);
}

.take-action-btn {
    background-color: #E2B92D !important;
    color: #000 !important;
    padding: 12px 28px !important;
    border-radius: 8px !important;
    text-decoration: none !important;
    font-weight: 700 !important;
    font-size: 15px !important;
    white-space: nowrap;
    display: inline-block;
}

/* --- Menu Item CTA (Take Action) Styling --- */
/* Apply this class 'menu-item-cta' in WP Admin > Menus */
#primary-menu li.menu-item-cta {
    padding: 0; /* Remove default menu padding */
}

#primary-menu li.menu-item-cta > a {
    background-color: #E2B92D !important;
    color: #000 !important;
    padding: 12px 28px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    font-size: 15px;
    white-space: nowrap;
    display: inline-block;
    gap: 0; /* Remove gap if icon logic applies */
}

#primary-menu li.menu-item-cta > a:hover {
    opacity: 0.9;
    background-color: #E2B92D !important; /* Maintain yellow on hover */
}

/* Remove dropdown arrow for the CTA button even if it has children */
#primary-menu li.menu-item-cta.menu-item-has-children > a:after {
    display: none;
}

.header-socials a {
    color: #30839A;
    transition: opacity 0.3s;
}

.header-socials a:hover {
    opacity: 0.8;
}

/* --- Mobile Menu Elements --- */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: #30839A;
    cursor: pointer;
    padding: 5px;
}

.mobile-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: auto; /* Ensure the overlay can capture the 'close' click */
}

.mobile-sidebar {
    position: fixed;
    top: 0;
    right: -360px; /* Hidden off-screen */
    width: 300px;
    height: 100vh;
    background: #6ea8b8;
    z-index: 10000;
    padding: 30px;
    box-shadow: -5px 0 20px rgba(0,0,0,0.1);
    transition: right 0.4s cubic-bezier(0.77, 0, 0.175, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    pointer-events: auto; /* Ensure links and buttons inside the sidebar work */
}

.mobile-sidebar-close {
    background: none;
    border: none;
    font-size: 24px;
    align-self: flex-end;
    margin-bottom: 20px;
    cursor: pointer;
    color: #ffffff;
}

/* Mobile Nav Styling */
.mobile-navigation ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.mobile-navigation ul li {
    position: relative;
}

.mobile-navigation ul li a {
    text-decoration: none;
    color: #ffffff;
    font-weight: 600;
    font-size: 18px;
    display: block;
    pointer-events: auto;
}

/* Mobile Submenu Styling */
.submenu-toggle {
    position: absolute;
    top: -5px; /* Align with text */
    right: 0;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 18px;
    padding: 10px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.submenu-toggle.active {
    transform: rotate(180deg);
}

.mobile-navigation .sub-menu {
    display: none;
    background: rgba(0, 0, 0, 0.05);
    margin-top: 15px;
    border-radius: 8px;
    padding: 5px 0;
    gap: 0; /* Remove gap inherited from parent ul to stack items neatly */
}

.mobile-navigation .sub-menu li a {
    font-size: 16px;
    font-weight: 500;
    padding: 12px 25px;
    padding-left: 35px; /* Indent for visual hierarchy */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0.95;
}

.mobile-navigation .sub-menu li:last-child a {
    border-bottom: none;
}

/* Re-use CTA style in mobile if needed, or override */
.mobile-navigation li.menu-item-cta > a {
    background-color: #E2B92D;
    color: #000;
    text-align: center;
    border-radius: 8px;
    padding: 12px;
}

/* Hide the dropdown arrow for the CTA button in mobile menu */
.mobile-navigation li.menu-item-cta .submenu-toggle {
    display: none;
}

.mobile-socials {
    margin-top: 40px;
    display: flex;
    gap: 20px;
    justify-content: center;
    font-size: 24px;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.mobile-socials a {
    color: #ffffff;
}

/* Active States for Mobile Menu */
body.mobile-menu-open {
    overflow: hidden; /* Prevent body scroll */
}

body.mobile-menu-open .mobile-sidebar {
    right: 0;
}

body.mobile-menu-open .mobile-sidebar-overlay {
    opacity: 1;
    visibility: visible;
}

/* --- Footer Grid Default (Desktop) --- */
.footer-grid {
    display: grid;
    grid-template-columns: 1.2fr 1.2fr 0.8fr 0.8fr;
    gap: 40px;
    margin-bottom: 30px;
    align-items: start;
}

/* --- Footer Bottom Bar (Copyright & Links) --- */
/* This styling assumes your footer.php has a container wrapping the copyright text and the footer menu.
   For example: <div class="footer-bottom-container"> ...copyright and menu... </div>
*/
.footer-bottom-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Good for responsiveness on medium screens */
}

.footer-bottom-container .menu {
    display: flex;
    gap: 30px; /* Adjust space between your 3 URL links */
}

.footer-bottom-links {
    display: flex;
    gap: 40px;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .pill-header-container {
        padding: 10px 20px;
        border-radius: 20px;
    }
    
    /* Hide desktop nav and socials */
    #primary-menu {
        display: none;
    }
    .header-socials {
        display: none !important;
    }

    /* Show mobile toggles */
    .mobile-menu-toggle {
        display: block;
    }
    
    /* Footer: Maintain horizontal layout for tablets */
    .footer-grid {
        grid-template-columns: repeat(4, 1fr); /* 2x2 grid for better fit on tablets */
        gap: 40px;
    }

    .footer-bottom-container {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
        gap: 20px;
    }

    .footer-bottom-links {
        justify-content: flex-end;
        gap: 20px;
        flex-wrap: wrap;
    }
}

/* Mobile Stacking (Vertical) */
@media (max-width: 767px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .footer-bottom-container {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .footer-bottom-links {
        justify-content: center;
    }
}

/* --- Sticky Header & Scroll Effects --- */
.sticky-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 9999;
    pointer-events: none; /* Allow clicks through the transparent areas around the pill */
}

.sticky-header .pill-header-container {
    pointer-events: auto; /* Re-enable clicks on the header content */
    transition: all 0.3s ease;
}

/* Scrolled State: Blue Background, White Text, but still rounded */
.sticky-header.scrolled .pill-header-container {
    background-color: #30839A;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin: 20px auto; /* Keep it centered and add some space from top */
}

.sticky-header.scrolled #primary-menu li a,
.sticky-header.scrolled .header-socials a {
    color: #ffffff;
}

/* Ensure burger icon turns white on scroll */
.sticky-header.scrolled .mobile-menu-toggle {
    color: #ffffff;
}

/* Logo Toggling */
.sticky-header.scrolled .logo-dark { display: none; }
.sticky-header.scrolled .logo-white { display: block !important; }

/* Typography Updates */
body {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 24px;
}

h1, h1.font-heading {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 48px;
}

h2, h2.font-heading {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 32px;
}

h3, h3.font-heading {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 28px;
}

/* Ensure the mobile menu toggle correctly receives pointer events when the header is sticky */
@media (max-width: 1024px) {
    .sticky-header.scrolled .mobile-menu-toggle,
    .sticky-header .mobile-menu-toggle {
        pointer-events: auto !important;
        display: block; /* Ensure it's not hidden by an ancestor's display setting */
    }
}