/**
 * Footer Component Styles
 * 
 * Contains all styles related to the site footer
 */

/* Footer Structure */
.site-footer {
    background-color: var(--lubinik-footer-primary-bg-color);
    color: var(--lubinik-footer-primary-text-color);
    padding: var(--lubinik-spacing-lg) 0 var(--lubinik-spacing-sm);
}

/* Footer container width control */
.site-footer .container {
    max-width: var(--lubinik-container-width);
    width: 90%;
    margin: 0 auto;
}

/* Main footer layout */
.footer-content {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1.5fr;
    gap: var(--lubinik-spacing-md);
    margin-bottom: var(--lubinik-spacing-md);
}

/* Column styling */
.footer-branding,
.footer-menu,
.footer-contact,
.footer-map {
    padding: 0;
}

/* Footer Headings */
.footer-title,
.footer-heading {
    color: var(--lubinik-footer-primary-heading-color);
    font-size: var(--lubinik-font-size-lg);
    margin-top: 0;
    margin-bottom: var(--lubinik-spacing-md);
    position: relative;
    padding-bottom: var(--lubinik-spacing-sm);
    font-weight: 600;
    border-bottom: 2px solid var(--lubinik-footer-primary-border-color);
    display: inline-block;
}

/* Remove the decorative line */
.footer-title:after,
.footer-heading:after {
    display: none;
}

/* Logo styling */
.footer-logo-container {
    margin-bottom: var(--lubinik-spacing-sm);
}

.footer-logo {
    max-width: 120px;
    height: auto;
}

/* Social links */
.site-footer .social-links {
    display: flex;
    gap: var(--lubinik-spacing-sm);
    margin-top: var(--lubinik-spacing-sm);
}

.site-footer .social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background-color: var(--lubinik-footer-primary-social-bg-color);
    color: var(--lubinik-footer-primary-social-text-color);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.site-footer .social-link:hover {
    transform: translateY(-3px);
    background-color: var(--lubinik-footer-secondary-social-bg-color) ;
    color: var(--lubinik-footer-secondary-social-text-color) ;
}

/* Menu styling */
.footer-menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-menu-list li {
    margin-bottom: var(--lubinik-spacing-sm);
}

.footer-menu-list a {
    color: var(--lubinik-footer-secondary-link-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-menu-list a:hover {
    color: var(--lubinik-footer-secondary-link-hover-color);
    padding-left: var(--lubinik-spacing-tiny);
}

/* Contact info styling */
.contact-info {
    list-style: none;
    padding: 0;
    margin: 0;
}

.contact-info li {
    margin-bottom: var(--lubinik-spacing-sm);
    display: flex;
    align-items: flex-start;
    color: var(--lubinik-footer-primary-text-color);
}

.contact-info i {
    color: var(--lubinik-footer-primary-link-color);
    margin-right: var(--lubinik-spacing-sm);
    font-size: var(--lubinik-font-size-base);
    margin-top: 3px;
}

.contact-info a {
    color: var(--lubinik-footer-secondary-link-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-info a:hover {
    color: var(--lubinik-footer-secondary-link-hover-color);
}

/* Map styling */
.footer-map .map-container {
    height: 200px ;
    border-radius: var(--lubinik-border-radius-sm);
    overflow: hidden;
}

/* Description section */
.footer-description-container {
    padding-top: var(--lubinik-spacing-md);
    margin-top: var(--lubinik-spacing-sm);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-description {
    color: var(--lubinik-footer-primary-text-color);
    font-size: var(--lubinik-font-size-base);
    line-height: 1.6;
    margin: 0;
}

/* Footer bottom */
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: var(--lubinik-spacing-md);
    margin-top: var(--lubinik-spacing-md);
    text-align: center;
    color: var(--lubinik-footer-secondary-text-color);
    font-size: var(--lubinik-font-size-base);
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 40px;
    height: 40px;
    background-color: var(--lubinik-footer-back-to-top-bg-color);
    color: var(--lubinik-footer-back-to-top-text-color);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: var(--lubinik-footer-back-to-top-hover-bg-color);
    color: var(--lubinik-footer-back-to-top-hover-text-color);
    transform: translateY(-3px);
}

.back-to-top .arrow-up {
    font-size: var(--lubinik-footer-back-to-top-font-size);
    line-height: 1;
}

/* Responsive adjustments */

/* Landscape tablets */
@media (min-width: 769px) and (max-width: 992px) {
    /* Fix the gap between footer and shape dividers */
    .site-footer {
        margin-top: -1px ; /* Eliminate any gap between footer and shape divider */
        position: relative;
        z-index: 1;
    }
    
    /* Ensure shape divider connects properly with footer */
    .shape-divider-container + .site-footer {
        margin-top: -2px ;
    }
    
    /* Add padding to the container for better spacing */
    .site-footer .container {
        width: 85% ;
        padding: 0 20px ;
        box-sizing: border-box ;
    }
    
    /* Complete reset of the footer layout for iPad Pro portrait */
    .footer-content {
        display: grid ;
        grid-template-columns: 1fr 1fr ;
        grid-template-rows: auto auto ;
        gap: 20px ;
    }
    
    /* Explicitly position each section */
    .footer-branding {
        grid-column: 1 ;
        grid-row: 1 ;
    }
    
    .footer-menu {
        grid-column: 2 ;
        grid-row: 1 ;
    }
    
    .footer-contact {
        grid-column: 1 ;
        grid-row: 2 ;
    }
    
    .footer-map {
        grid-column: 2 ;
        grid-row: 2 ;
        height: auto ;
    }
    
    /* Adjust content sizing for better fit */
    .footer-branding img {
        max-width: 120px ;
    }
    
    .footer-menu ul {
        padding-left: 0 ;
        margin-top: 0 ;
    }
    
    .footer-menu ul li {
        margin-bottom: 8px ;
        font-size: 14px ;
    }
    
    /* Adjust map height */
    .footer-map .map-container {
        height: 200px ;
        width: 100% ;
    }
    
    /* Ensure text fits in columns */
    .footer-title, 
    .footer-heading {
        font-size: 16px ;
        margin-bottom: 10px ;
    }
    
    .footer-contact p {
        font-size: 14px ;
        margin-bottom: 5px ;
    }
}

/* Portrait tablets */
@media (min-width: 600px) and (max-width: 768px) {
    /* Fix the gap between footer and shape dividers */
    .site-footer {
        margin-top: -1px ; /* Eliminate any gap between footer and shape divider */
        position: relative;
        z-index: 1;
    }
    
    /* Ensure shape divider connects properly with footer */
    .shape-divider-container + .site-footer {
        margin-top: -2px ;
    }
    
    /* Add padding to the container for better spacing */
    .site-footer .container {
        width: 85% ;
        padding: 0 20px ;
        box-sizing: border-box ;
    }
    
    /* Adjust footer grid for portrait tablets */
    .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: var(--lubinik-spacing-md);
    }
    
    /* Make map span full width */
    .footer-map {
        grid-column: span 2;
    }
    
    .footer-map .map-container {
        height: 250px ;
    }
    
    /* Improve spacing */
    .footer-branding,
    .footer-menu,
    .footer-contact {
        padding-bottom: var(--lubinik-spacing-sm);
    }
}

/* Mobile devices */
@media (max-width: 599px) {
    /* Add padding to the container for better spacing */
    .site-footer .container {
        width: 90% ;
        padding: 0 15px ;
        box-sizing: border-box ;
    }
    
    /* Fix the gap between footer and shape dividers */
    .site-footer {
        margin-top: -1px ; /* Eliminate any gap between footer and shape divider */
        position: relative;
        z-index: 1;
    }
    
    /* Ensure shape divider connects properly with footer */
    .shape-divider-container + .site-footer {
        margin-top: -2px ;
    }

    /* Center all content */
    .footer-content {
        display: grid !important; /* ensure grid context even if other files set flex */
        grid-template-columns: 1fr !important; /* win over child/base columns */
        gap: var(--lubinik-spacing-md);
        text-align: center ;
    }

    /* Reset any explicit grid placement so items stack as 1 column */
    .footer-branding,
    .footer-menu,
    .footer-contact,
    .footer-map {
        grid-column: 1 !important;
        grid-row: auto !important;
    }
    
    /* Center all section titles and headings */
    .footer-title, 
    .footer-heading,
    h3.footer-title,
    .footer-contact h3,
    .footer-menu h3 {
        text-align: center ;
        width: 100% ;
        display: block ;
        margin-left: auto ;
        margin-right: auto ;
    }
    
    /* Center the red underline for titles */
    .footer-title:after,
    .footer-heading:after,
    h3.footer-title:after,
    .footer-contact h3:after,
    .footer-menu h3:after {
        margin-left: auto ;
        margin-right: auto ;
        left: 0 ;
        right: 0 ;
    }
    
    /* Center the logo */
    .footer-branding {
        display: flex ;
        flex-direction: column ;
        align-items: center ;
        justify-content: center ;
    }
    
    /* Center social icons */
    .footer-social-icons {
        display: flex ;
        justify-content: center ;
        margin-top: 15px ;
    }
    
    /* Center menu items */
    .footer-menu ul {
        padding-left: 0 ;
        list-style: none ;
        display: flex ;
        flex-direction: column ;
        align-items: center ;
    }

    
    /* Center contact info - more specific selectors */
    .footer-contact {
        text-align: center ;
    }
    
    /* Center the contact heading but align content properly */
    .footer-contact p,
    .footer-contact a,
    .footer-contact address {
        text-align: left ;
        width: auto ;
        display: inline-block ;

    }
    
    /* Fix for contact items with icons */
    .footer-contact .contact-item,
    .footer-contact p {
        display: flex ;
        justify-content: flex-start ;
        align-items: center ;
        margin-bottom: 10px ;
        width: auto ;
        max-width: 300px ;
        margin-left: auto ;
        margin-right: auto ;
    }
    
    .footer-contact i,
    .footer-contact .fa,
    .footer-contact .fas,
    .footer-contact .far,
    .footer-contact svg {
        margin-right: 12px ;
        text-align: center ;
        min-width: 20px ;
        display: inline-block ;
    }
    
    /* Map settings */
    .footer-map {
        grid-column: 1;
    }
    
    .footer-map .map-container {
        height: 200px ;
        width: 100% ;
    }
    
    /* Spacing adjustments */
    .footer-branding,
    .footer-menu,
    .footer-contact {
        padding-bottom: var(--lubinik-spacing-sm);
    }
    
    .footer-title, 
    .footer-heading {
        margin-bottom: var(--lubinik-spacing-sm);
        text-align: center ;
    }
    
    /* Center the back to top button */
    .back-to-top {
        right: 20px;
        transform: translateX(-50%) ;
    }
    
    .back-to-top:hover {
        transform: translateX(-50%) translateY(-3px) ;
    }
}
