/* ---------------------------------------------------------------------------
   Public-site footer.

   Desktop: 4-column flex (brand block + 3 link sections).
   Tablet  (≤1024px): brand stacks above a 3-column links grid.
   Mobile  (≤640px): 2-column links grid; the social-links section spans
   both columns at the bottom so social icons sit centered, no awkward gap.
--------------------------------------------------------------------------- */

.footer {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 4rem 0 1.5rem;
    border-top: 1px solid var(--border-color);
}

.footer .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-content {
    display: flex;
    gap: 3rem;
    flex-wrap: wrap;
    margin-bottom: 2.5rem;
}

/* --- Brand block --------------------------------------------------------- */

.footer-brand {
    flex: 0 1 300px;
    min-width: 0;
}

.footer-brand .logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent-primary);
}

.footer-brand .brand-icon {
    width: 40px;
    height: 40px;
}

.footer-brand p {
    color: var(--text-secondary);
    line-height: 1.65;
    max-width: 320px;
    margin: 0;
}

/* --- Link sections ------------------------------------------------------- */

.footer-links {
    flex: 1 1 480px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    min-width: 0;
}

.footer-section {
    min-width: 0;
}

.footer-section h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 1rem;
    letter-spacing: 0.01em;
}

.footer-section ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.footer-section a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

.footer-section a:hover {
    color: var(--accent-primary);
}

/* --- Social icons -------------------------------------------------------- */

.social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.social-links a {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--accent-primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    margin: 0;
    transition: transform 0.2s ease, background 0.2s ease;
}

.social-links a:hover {
    transform: translateY(-2px);
    background: var(--accent-secondary);
    color: #fff;
}

/* --- Bottom strip -------------------------------------------------------- */

.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding-top: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer-bottom p {
    margin: 0;
}

.footer-controls {
    display: flex;
    gap: 0.5rem;
}

/* --- Responsive ---------------------------------------------------------- */

@media (max-width: 1024px) {
    .footer-content {
        flex-direction: column;
        gap: 2.5rem;
    }

    .footer-brand {
        flex: 1 1 auto;
        text-align: center;
    }

    .footer-brand .logo {
        justify-content: center;
    }

    .footer-brand p {
        margin: 0 auto;
    }

    .footer-links {
        flex: 1 1 auto;
    }
}

@media (max-width: 640px) {
    .footer {
        padding: 3rem 0 1.25rem;
    }

    .footer-content {
        gap: 2rem;
        margin-bottom: 2rem;
    }

    .footer-links {
        grid-template-columns: 1fr 1fr;
        gap: 1.75rem 1.5rem;
        text-align: left;
    }

    /* Social section stretches across both columns and centers itself,
       so the social icons sit nicely beneath the link lists. */
    .footer-section:last-child {
        grid-column: 1 / -1;
        text-align: center;
        margin-top: 0.5rem;
    }

    .footer-section:last-child h4 {
        margin-bottom: 0.85rem;
    }

    .social-links {
        justify-content: center;
    }

    .footer-bottom {
        flex-direction: column-reverse;
        text-align: center;
        gap: 0.75rem;
    }

    .footer-controls {
        justify-content: center;
    }
}

@media (max-width: 380px) {
    .footer-links {
        grid-template-columns: 1fr;
        text-align: center;
    }
}
