/* Custom Logo Responsive Styling */
.custom-logo-container {
    display: flex !important;
    align-items: center !important;
    flex-shrink: 0 !important;
    max-width: 200px;
}

.custom-logo-link {
    display: flex !important;
    align-items: center !important;
    text-decoration: none !important;
}

.custom-logo {
    display: block !important;
    height: auto !important;
    max-height: 2rem !important; /* 32px - mobile default */
    width: auto !important;
    max-width: 120px !important;
    object-fit: contain !important;
    transition: all 0.3s ease;
}

/* Responsive breakpoints for custom logo */
@media (min-width: 640px) {
    .custom-logo {
        max-height: 2.5rem !important; /* 40px - small screens */
        max-width: 150px !important;
    }
    
    .custom-logo-container {
        max-width: 250px;
    }
}

@media (min-width: 1024px) {
    .custom-logo {
        max-height: 3rem !important; /* 48px - large screens */
        max-width: 180px !important;
    }
    
    .custom-logo-container {
        max-width: 300px;
    }
}

/* Ensure logo doesn't overflow navbar */
.custom-logo-container .custom-logo {
    height: auto;
    min-height: 0;
}

/* Footer logo responsive styling */
footer .custom-logo,
footer img[alt*="Logo"] {
    object-fit: contain;
    height: auto;
    transition: all 0.3s ease;
}

/* Prevent logo from being too large on any screen */
@media (max-width: 639px) {
    .custom-logo {
        max-height: 1.75rem !important;
        max-width: 100px !important;
    }
    
    .custom-logo-container {
        max-width: 150px;
    }
}

/* Ensure proper alignment in navbar */
header .flex.items-center.flex-shrink-0 {
    min-width: 0 !important;
    overflow: hidden !important;
    flex: 0 0 auto !important;
}

/* Prevent logo from taking up too much navbar space */
header .custom-logo-container {
    flex: 0 0 auto !important;
    min-width: 0 !important;
    overflow: hidden !important;
}

/* Additional responsive fixes for very small screens */
@media (max-width: 480px) {
    .custom-logo {
        max-height: 1.5rem !important;
        max-width: 80px !important;
    }
    
    .custom-logo-container {
        max-width: 120px;
    }
    
    footer .custom-logo,
    footer img[alt*="Logo"] {
        max-height: 1.25rem !important;
        max-width: 70px !important;
    }
}

/* Ensure logo maintains aspect ratio */
.custom-logo,
footer img[alt*="Logo"] {
    aspect-ratio: auto;
    vertical-align: middle;
}

/* Fix for WordPress default custom logo classes */
.custom-logo-link img,
.custom-logo-link .custom-logo,
header .custom-logo {
    height: auto !important;
    width: auto !important;
    max-height: inherit !important;
    max-width: inherit !important;
    min-height: 0 !important;
    min-width: 0 !important;
}

/* Override any WordPress or theme default logo sizing */
.wp-custom-logo .custom-logo,
.site-logo img,
header img.custom-logo {
    height: auto !important;
    width: auto !important;
}

/* Mobile navigation logo adjustments */
@media (max-width: 1023px) {
    header .custom-logo-container {
        flex: 0 0 auto !important;
        margin-right: 1rem;
        max-width: 40% !important; /* Prevent logo from taking more than 40% of navbar width */
    }
}

/* Desktop logo container constraints */
@media (min-width: 1024px) {
    header .custom-logo-container {
        max-width: 25% !important; /* Prevent logo from taking more than 25% of navbar width on desktop */
    }
}

/* Critical: Ensure navbar layout doesn't break */
header .flex.justify-between.items-center.w-full > div:first-child {
    flex: 0 0 auto !important;
    max-width: 40% !important;
}