/**
 * Footer Styles - Flexible Footer System
 */

/* Site Footer Container */

/* Footer Section (Footer 1 & Footer 2) */
.footer-section {
    border-top: 1px solid var(--color-border);
}

.footer-section.footer-1 {
    background-color: var(--footer1-bg-color, #ffffff);
    color: var(--footer1-text-color, #1f2937);
    padding-top: var(--footer1-padding-top, 48px);
    padding-bottom: var(--footer1-padding-bottom, 48px);
}

.footer-section.footer-2 {
    background-color: var(--footer2-bg-color, #f9fafb);
    color: var(--footer2-text-color, #1f2937);
    padding-top: var(--footer2-padding-top, 48px);
    padding-bottom: var(--footer2-padding-bottom, 48px);
}

/* Footer Widgets Grid */
.footer-widgets {
    display: grid;
    gap: 3rem;
    margin: 0;
}

/* Dynamic column layouts based on data-columns attribute */
.footer-section[data-columns="1"] .footer-widgets {
    grid-template-columns: 1fr;
}

.footer-section[data-columns="2"] .footer-widgets {
    grid-template-columns: repeat(2, 1fr);
}

.footer-section[data-columns="3"] .footer-widgets {
    grid-template-columns: repeat(3, 1fr);
}

.footer-section[data-columns="4"] .footer-widgets {
    grid-template-columns: repeat(4, 1fr);
}

/* Footer Columns */
.footer-column {
    min-height: 50px;
}

/* Widget Styling */
.footer-column .widget {
    margin-bottom: 2rem;
}

.footer-column .widget:last-child {
    margin-bottom: 0;
}

.footer-column .widget-title {
    font-family: var(--font-heading);
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Footer 1 Text Colors */
.footer-section.footer-1 .widget-title,
.footer-section.footer-1 p,
.footer-section.footer-1 a {
    color: var(--footer1-text-color, #1f2937);
}

/* Footer 2 Text Colors */
.footer-section.footer-2 .widget-title,
.footer-section.footer-2 p,
.footer-section.footer-2 a {
    color: var(--footer2-text-color, #1f2937);
}

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

.footer-column .menu li,
.footer-menu li {
    margin-bottom: 0.75rem;
}

.footer-column .menu a,
.footer-menu a {
    text-decoration: none;
    font-size: 0.938rem;
    transition: opacity var(--transition-speed) ease;
    display: inline-block;
}

.footer-column .menu a:hover,
.footer-column .menu a:focus,
.footer-menu a:hover,
.footer-menu a:focus {
    opacity: 0.7;
}

.footer-column .menu a:focus,
.footer-menu a:focus {
    outline: 2px solid currentColor;
    outline-offset: 4px;
    border-radius: 2px;
}

/* Widget Lists */
.footer-column ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-column ul li {
    margin-bottom: 0.75rem;
}

.footer-column ul li:last-child {
    margin-bottom: 0;
}

.footer-column ul a {
    text-decoration: none;
    transition: opacity var(--transition-speed) ease;
}

.footer-column ul a:hover,
.footer-column ul a:focus {
    opacity: 0.7;
}

.footer-column ul a:focus {
    outline: 2px solid currentColor;
    outline-offset: 4px;
}

/* Widget Paragraphs */
.footer-column p {
    font-size: 0.938rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.footer-column p:last-child {
    margin-bottom: 0;
}

/* Footer Logo (if added via widget) */
.footer-column img {
    max-width: 200px;
    height: auto;
    margin-bottom: 1rem;
}

/* Text Widget Styling */
.footer-column .textwidget {
    font-size: 0.938rem;
    line-height: 1.6;
}

/* Custom HTML Widget */
.footer-column .widget_custom_html {
    font-size: 0.938rem;
}

/* Social Icons (if using a social icons widget) */
.footer-column .social-icons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.footer-column .social-icons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    transition: background-color var(--transition-speed) ease,
                transform var(--transition-speed) ease;
}

.footer-column .social-icons a:hover,
.footer-column .social-icons a:focus {
    background-color: var(--color-primary);
    transform: translateY(-2px);
}

.footer-column .social-icons a:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 4px;
}

/* Bottom Footer */
.bottom-footer {
    background-color: var(--bottom-footer-bg-color, #ffffff);
    color: var(--bottom-footer-text-color, #6b7280);
    padding-top: var(--bottom-footer-padding-top, 32px);
    padding-bottom: var(--bottom-footer-padding-bottom, 32px);
    border-top: 1px solid var(--color-border);
}

/* Single Column Bottom Footer */
.bottom-footer-single {
    /* Text alignment controlled by customizer settings */
}

.bottom-footer-single p {
    font-size: 0.875rem;
    margin: 0;
    color: var(--bottom-footer-text-color, #6b7280);
}

.bottom-footer-single .widget {
    margin-bottom: 1rem;
}

.bottom-footer-single .widget:last-child {
    margin-bottom: 0;
}

/* Double Column Bottom Footer */
.bottom-footer-double {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: center;
}

/* Bottom footer left/right alignment overrides global alignment on desktop */
.bottom-footer-left {
    text-align: left !important;
}

.bottom-footer-right {
    text-align: right !important;
}

.bottom-footer-double p {
    font-size: 0.875rem;
    margin: 0;
    color: var(--bottom-footer-text-color, #6b7280);
}

.bottom-footer-double .widget {
    margin-bottom: 0.5rem;
}

.bottom-footer-double .widget:last-child {
    margin-bottom: 0;
}

/* Bottom Footer Links */
.bottom-footer a {
    color: var(--bottom-footer-text-color, #6b7280);
    text-decoration: none;
    transition: opacity var(--transition-speed) ease;
}

.bottom-footer a:hover,
.bottom-footer a:focus {
    opacity: 0.7;
}

.bottom-footer a:focus {
    outline: 2px solid currentColor;
    outline-offset: 4px;
}

/* Bottom Footer Menu (if added as widget) */
.bottom-footer .menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.bottom-footer-single .menu {
    justify-content: center;
}

.bottom-footer-right .menu {
    justify-content: flex-end;
}

.bottom-footer .menu li {
    margin: 0;
}

.bottom-footer .menu a {
    font-size: 0.875rem;
}

/* Responsive - Tablet */
@media (max-width: 1024px) {
    .footer-section[data-columns="4"] .footer-widgets {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-section[data-columns="3"] .footer-widgets {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    .site-footer {
        margin-top: 3rem;
    }

    .footer-section.footer-1 {
        padding-top: calc(var(--footer1-padding-top, 48px) * 0.67);
        padding-bottom: calc(var(--footer1-padding-bottom, 48px) * 0.67);
    }

    .footer-section.footer-2 {
        padding-top: calc(var(--footer2-padding-top, 48px) * 0.67);
        padding-bottom: calc(var(--footer2-padding-bottom, 48px) * 0.67);
    }

    .footer-widgets {
        grid-template-columns: 1fr !important;
        gap: 2rem;
    }

    /* Bottom Footer Mobile */
    .bottom-footer {
        padding-top: calc(var(--bottom-footer-padding-top, 32px) * 0.75);
        padding-bottom: calc(var(--bottom-footer-padding-bottom, 32px) * 0.75);
    }

    .bottom-footer-double {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    /* On mobile, bottom footer columns follow global alignment setting */
    .bottom-footer-left,
    .bottom-footer-right {
        text-align: inherit !important;
    }

    .bottom-footer .menu {
        justify-content: center;
        flex-direction: column;
        gap: 0.75rem;
    }

    .bottom-footer-single p,
    .bottom-footer-double p {
        font-size: 0.813rem;
    }
}

/* Responsive - Small Mobile */
@media (max-width: 480px) {
    .footer-section.footer-1 {
        padding-top: calc(var(--footer1-padding-top, 48px) * 0.5);
        padding-bottom: calc(var(--footer1-padding-bottom, 48px) * 0.5);
    }

    .footer-section.footer-2 {
        padding-top: calc(var(--footer2-padding-top, 48px) * 0.5);
        padding-bottom: calc(var(--footer2-padding-bottom, 48px) * 0.5);
    }

    .footer-widgets {
        gap: 1.5rem;
    }

    .footer-column .widget-title {
        font-size: 1rem;
    }

    .footer-column .menu a,
    .footer-column p {
        font-size: 0.875rem;
    }

    .bottom-footer {
        padding-top: calc(var(--bottom-footer-padding-top, 32px) * 0.5);
        padding-bottom: calc(var(--bottom-footer-padding-bottom, 32px) * 0.5);
    }
}

/* Widget Title Styling for Both Footers */
.footer-section .widget-title {
    color: inherit;
}

/* Ensure proper spacing for nav menus in widgets */
.footer-column nav {
    margin: 0;
}

.footer-column .widget_nav_menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-column .widget_nav_menu li {
    margin-bottom: 0.75rem;
}

.footer-column .widget_nav_menu li:last-child {
    margin-bottom: 0;
}
