/* ==========================================================================
   FOOTER STYLES
   ========================================================================== */

.site-footer {
    /* Using a deep charcoal/green-black. Fallback if vars are missing */
    background-color: var(--footer-bg, #0f172a);
    color: var(--text-light, #f8fafc);
    font-family: var(--font-primary, "Inter", sans-serif);
    padding: 5rem 0 3rem;
    overflow-x: hidden;
    margin-top: 4rem; /* Buffer from previous section */
}

.site-footer__container {
    max-width: var(--container-width, 1200px);
    margin: 0 auto;
    padding: 0 var(--container-padding, 2rem);
}

/* -----------------------------------------
   LAYER 1: NEWSLETTER
----------------------------------------- */
.footer-newsletter {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.newsletter-content {
    flex: 1;
    min-width: 300px;
    max-width: 500px;
}

.newsletter-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #ffffff;
}

.newsletter-desc {
    font-size: 0.95rem;
    color: #cbd5e1;
    line-height: 1.5;
}

.newsletter-form-wrapper {
    flex: 1;
    min-width: 320px;
    max-width: 450px; /* Reduced width for professional proportions */
    display: flex;
    justify-content: flex-end;
}

.newsletter-form {
    width: 100%;
}

.newsletter-input-group {
    display: flex;
    background-color: #ffffff;
    border-radius: 999px;
    padding: 4px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.newsletter-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0.875rem 1.5rem; /* Increased padding slightly for proportion */
    font-size: 0.95rem;
    color: #1e293b;
    outline: none;
    width: 100%;
}

.newsletter-input::placeholder {
    color: #94a3b8;
}

.newsletter-submit {
    background-color: var(--primary-green, #10b981);
    color: #ffffff;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.newsletter-submit:hover:not(:disabled) {
    background-color: var(--primary-hover, #059669);
    transform: translateY(-1px);
}

.newsletter-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Success & Error States */
.newsletter-success {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background-color: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #10b981;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    width: 100%;
    font-size: 0.95rem;
}

.success-icon {
    flex-shrink: 0;
}

.newsletter-error {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    padding-left: 1rem;
}

/* -----------------------------------------
   DIVIDER
----------------------------------------- */
.footer-divider {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 3.5rem 0;
}

/* -----------------------------------------
   LAYER 2: NAVIGATION
----------------------------------------- */
.footer-navigation {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 2rem;
}

.footer-nav-title {
    color: #f8fafc;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.footer-nav-list a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.footer-nav-list a:hover {
    color: var(--primary-green, #10b981);
}

/* -----------------------------------------
   LAYER 3: BOTTOM BAR
----------------------------------------- */
.footer-bottom {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.footer-brand-legal {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-logo .logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.02em;
}

.footer-separator {
    color: #475569;
    font-size: 0.8rem;
}

.footer-legal-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-legal-links a {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s ease;
}

.footer-legal-links a:hover {
    color: #ffffff;
}

.legal-dot {
    color: #475569;
}

.footer-copyright {
    color: #64748b;
    font-size: 0.85rem;
}

.footer-social {
    display: flex;
    gap: 1.25rem;
    align-items: center;
}

.footer-social a {
    color: #94a3b8;
    transition: color 0.2s ease, transform 0.2s ease;
    display: inline-flex;
}

.footer-social a:hover {
    color: var(--primary-green, #10b981);
    transform: translateY(-2px);
}

/* Desktop layout adjustment for bottom row */
@media (min-width: 1024px) {
    .footer-bottom {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .footer-brand-legal {
        flex: 1;
        min-width: max-content;
    }
    
    .footer-copyright {
        flex: 1;
        text-align: center;
        min-width: max-content;
    }

    .footer-social {
        flex: 1;
        justify-content: flex-end;
    }
}

/* -----------------------------------------
   RESPONSIVE LAYOUTS
----------------------------------------- */

/* Tablet (Max 1024px) */
@media (max-width: 1024px) {
    .footer-navigation {
        grid-template-columns: repeat(3, 1fr);
        row-gap: 3rem;
    }
}

/* Mobile (Max 768px) */
@media (max-width: 768px) {
    .site-footer {
        padding: 3rem 0 2rem;
    }

    .footer-newsletter {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
    }

    .newsletter-content,
    .newsletter-form-wrapper {
        width: 100%;
        max-width: 100%;
    }

    .footer-navigation {
        grid-template-columns: 1fr;
        gap: 0;
    }

    /* Mobile Accordion Logic */
    .footer-nav-col {
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }
    
    .footer-nav-col:last-child {
        border-bottom: none;
    }

    .footer-nav-title {
        margin-bottom: 0;
        padding: 1.25rem 0;
        cursor: pointer;
        display: flex;
        justify-content: space-between;
        align-items: center;
        user-select: none;
    }

    .footer-nav-title::after {
        content: '+';
        font-size: 1.25rem;
        font-weight: 400;
        color: #94a3b8;
        transition: transform 0.2s ease;
    }

    .footer-nav-list {
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        visibility: hidden;
        transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
        padding: 0;
    }

    .footer-nav-col.is-open .footer-nav-title::after {
        transform: rotate(45deg);
    }

    .footer-nav-col.is-open .footer-nav-list {
        max-height: 400px;
        opacity: 1;
        visibility: visible;
        padding: 0 0 1.25rem 0;
    }

    /* Bottom Row Mobile Adjustments */
    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
        gap: 2rem;
    }

    .footer-brand-legal {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .footer-separator {
        display: none;
    }

    .footer-social {
        width: 100%;
        justify-content: flex-start;
        margin-top: 0.5rem;
    }
}

/* Small Mobile Stacking for Newsletter */
@media (max-width: 480px) {
    .newsletter-input-group {
        flex-direction: column;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        gap: 0.75rem;
        padding: 0;
    }
    .newsletter-input {
        background: #ffffff;
        border-radius: 8px;
        padding: 1rem 1.25rem;
        box-sizing: border-box;
    }
    .newsletter-submit {
        width: 100%;
        border-radius: 8px;
        padding: 1rem;
    }
}
