/**
 * Footer Styles for VicReturns MVP Theme
 * Customizable footer with 4-column grid layout
 */

/* ========================================
   Footer Container
   ======================================== */

.site-footer {
    background: var(--Brand-Primary, #052E5E);
    color: var(--Primary-P9, #FDFBFF);
    padding: 60px 0;
    width: 100%;
    max-width: 100% !important; /* Override parent theme's max-width constraints */
    margin: 0;
    overflow: hidden; /* Clip arrow at footer boundary */
}

/* Override parent theme's max-width constraints for .site-footer:not(.dynamic-footer) */
.site-footer:not(.dynamic-footer) {
    max-width: 100% !important;
}

.footer-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 1392px; /* Constrain content, not background */
    margin: 0 auto; /* Center the content */
    padding: 64px 24px;
    box-sizing: border-box;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr; /* 2/5, 1/5, 1/5, 1/5 */
    gap: 24px;
    width: 100%;
    max-width: 1392px;
}

/* ========================================
   Column Titles (Universal)
   ======================================== */

.footer-column-title {
    color: var(--Brand-Secondary, #FF8200);
    font-family: "Asap Condensed", sans-serif;
    font-size: 16px;
    font-style: normal;
    font-weight: 600;
    line-height: 120%; /* 19.2px */
    letter-spacing: 0.48px;
    text-transform: uppercase;
    margin: 0 0 20px 0;
}

/* ========================================
   Column 1: Search (2/5 width)
   ======================================== */

.footer-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.footer-column .locations-search-container {
    width: 100%;
    max-width: 329px;
}

/* ========================================
   Columns 2 & 3: Link Menus (1/5 width each)
   ======================================== */

.footer-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-menu li {
    margin: 0;
}

.footer-menu a {
    color: var(--Primary-P9, #FDFBFF) !important;
    text-decoration: none !important;

    font-family: "Source Sans 3", sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 130%; /* 20.8px */
    transition: color 0.3s ease;
    display: inline-block;
}

.footer-menu a:hover {
    /* color: var(--Brand-Secondary, #FF8200); */
    text-decoration: underline !important;
}

.footer-menu a:focus {
    outline: 2px solid #FF8200;
    outline-offset: 2px;
    border-radius: 2px;
    text-decoration: none !important;
}

/* ========================================
   Column 4: Contact & Social (1/5 width)
   ======================================== */

.footer-column:last-child {
    align-items: center;
}

.footer-contact-button {
    display: flex;
    align-items: center;
    border-radius: 100px;
    border: 1px solid var(--Brand-Secondary, #FF8200);
    background: var(--Secondary-S4, #FFE7D8);
    padding: 1px 1px 1px 24px;
    gap: 12px;
    text-decoration: none !important;
    transition: all 0.3s ease;
    width: fit-content;
}

.footer-contact-button:hover {
    background: #FF8200;
    text-decoration: none !important;
}

.footer-contact-button:hover .button-text {
    color: #FDFBFF;
    text-decoration: none !important;
}

.footer-contact-button:focus {
    outline: 2px solid #FF8200;
    outline-offset: 2px;
    text-decoration: none !important;
}

.footer-contact-button .button-text {
    color: var(--Secondary-S2, #6E390D);
    font-family: "Source Sans 3", sans-serif;
    font-size: 16px;
    font-weight: 600;
    line-height: 150%; /* 24px */
    letter-spacing: 0.48px;
    transition: color 0.3s ease;
}

.footer-contact-button .button-icon {
    position: relative;
    width: 50px;
    height: 50px;
    flex-shrink: 0;
}

.footer-contact-button .icon-circle {
    position: absolute;
    top: 0;
    left: 0;
    width: 50px;
    height: 50px;
}

.footer-contact-button .icon-arrow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 57px;
    height: 56px;
}

/* Social Media Icons */
.footer-social-icons {
    display: flex;
    align-items: center;
    gap: 16px;
}

.footer-social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.footer-social-icon svg {
    width: 100%;
    height: 100%;
}

.footer-social-icon:hover {
    opacity: 0.8;
    transform: translateY(-2px);
}

.footer-social-icon:focus {
    outline: 2px solid #FF8200;
    outline-offset: 4px;
    border-radius: 2px;
}

/* ========================================
   Footer Logo Section (Below Grid)
   ======================================== */

.footer-logo-section {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 20px;
    margin-top: 50px;
    position: relative;
    width: 100%;
}

.footer-logo-section img {
    max-height: 24px;
    object-fit: contain;
    object-position: right;
}

.footer-arrow {
    position: absolute;
    right: 169px; /* 149px logo + 20px gap */
    width: calc(100% + 500px); /* Extend beyond left edge */
    max-width: none;
    height: auto;
    transform: translateX(-50px); /* Shift left so tail spills off */
}

.footer-cds-logo {
    width: 149px;
    height: 42px;
    position: relative;
    z-index: 1;
}

/* ========================================
   Footer Bottom Row (Copyright & Links)
   ======================================== */

.footer-bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 50px;
    width: 100%;
}

.footer-copyright, 
.footer-acknowledgement {
    color: var(--Primary-P9, #FDFBFF);
    font-family: "Source Sans 3", sans-serif;
    font-size: 16px;
    font-style: normal;
    font-weight: 400;
    line-height: 130%; /* 20.8px */

    max-width: 80ch;
}

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

.footer-bottom-link {
    color: var(--Primary-P9, #FDFBFF) !important;
    text-decoration: none !important;
    font-family: "Source Sans 3", sans-serif;
    font-size: 16px;
    font-style: normal;
    font-weight: 400;
    line-height: 130%; /* 20.8px */
    transition: color 0.3s ease;
}

.footer-bottom-link:hover {
    text-decoration: underline !important;
}

.footer-bottom-link:focus {
    outline: 2px solid #FF8200;
    outline-offset: 2px;
    border-radius: 2px;
    text-decoration: none !important;
}

/* ========================================
   Responsive Adjustments
   ======================================== */

@media (max-width: 1440px) {
    .footer-container {
        padding: 0 40px;
    }
}

@media (max-width: 1024px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr; /* 2 columns on tablet */
        gap: 30px;
    }
    
    .footer-search-bar {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .site-footer {
        padding: 0;
        width: 100%;
        max-width: 100% !important; /* Override parent theme's max-width constraints */
        background: var(--Brand-Primary, #052E5E);
    }
    
    /* Override parent theme's max-width constraints for .site-footer:not(.dynamic-footer) on mobile */
    .site-footer:not(.dynamic-footer) {
        max-width: 100% !important;
    }
    
    .footer-container {
        display: flex;
        width: 100%;
        max-width: 100%; /* Full width on mobile */
        padding: 64px 24px; /* Adjust padding as needed */
        flex-direction: column;
        align-items: flex-start;
        gap: 40px;
    }
    
    /* Mobile Grid Layout */
    .footer-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 40px 20px;
        width: 100%;
    }
    
    /* Column 1: Search (full width row) */
    .footer-grid > .footer-column:nth-child(1) {
        grid-column: 1 / -1; /* Span full width */
        order: 1;
    }
    
    /* Columns 2 & 3: Share a row */
    .footer-grid > .footer-column:nth-child(2) {
        grid-column: 1;
        order: 2;
    }
    
    .footer-grid > .footer-column:nth-child(3) {
        grid-column: 2;
        order: 3;
    }
    
    /* Column 4: Keep in touch (full width row) */
    .footer-grid > .footer-column:nth-child(4) {
        grid-column: 1 / -1; /* Span full width */
        order: 4;
    }
    
    /* Mobile Typography - Column Titles */
    .footer-column-title {
        color: var(--Brand-Secondary, #FF8200);
        font-feature-settings: 'liga' off, 'clig' off;
        font-family: "Asap Condensed", sans-serif;
        font-size: 20px;
        font-style: normal;
        font-weight: 700;
        line-height: 120%; /* 24px */
        letter-spacing: 0.4px;
        text-transform: uppercase;
        margin-bottom: 16px;
    }
    
    /* Mobile Typography - Links */
    .footer-menu li a,
    .footer-bottom-link {
        flex: 1 0 0;
        color: var(--Primary-P9, #FDFBFF); /* Changed to white for WCAG AA compliance */
        font-family: "Source Sans 3", sans-serif;
        font-size: 18px;
        font-style: normal;
        font-weight: 400;
        line-height: 125%; /* 22.5px */
        letter-spacing: -0.36px;
    }
    
    /* Search Bar Mobile Adjustments */
    .footer-search-bar {
        width: 100%;
    }
    
    /* Keep in Touch Column - Left Justified */
    .footer-grid > .footer-column:nth-child(4) {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .footer-contact-button {
        margin-bottom: 20px;
    }
    
    .footer-social-icons {
        justify-content: flex-start;
    }
    
    /* Logo Section - Arrow and Icon Row */
    .footer-logo-section {
        order: 10;
        width: 100%;
        justify-content: flex-end;
        margin-top: 0;
        overflow: visible; /* Allow arrow to overflow */
    }
    
    .footer-arrow {
        position: absolute;
        right: 169px; /* 149px logo + 20px gap */
        width: calc(100% + 500px); /* Keep full size, extend beyond left */
        transform: translateX(-50px); /* Shift left so tail spills off */
    }
    
    .footer-cds-logo {
        flex-shrink: 0;
        position: relative;
        z-index: 1;
    }
    
    /* Bottom Row - Copyright and Links */
    .footer-bottom-row {
        flex-direction: column;
        gap: 16px;
        margin-top: 0;
        align-items: flex-start;
    }
    
    .footer-copyright, 
    .footer-acknowledgement {
        order: 1;
        width: 100%;
    }
    
    .footer-bottom-links {
        order: 2;
        flex-direction: row;
        gap: 20px;
        width: 100%;
    }
    
    /* Hide Cookies Settings on Mobile */
    .footer-bottom-link:nth-child(3) {
        display: none;
    }
}

