/* ============================================
   FOOTER.CSS — Site-wide footer
   All rules below set alignment explicitly (text-align, align-items,
   justify-content) rather than relying on inheritance, so this
   component can never be knocked out of alignment by rules defined
   in other stylesheets (sections.css, header.css, etc).
   ============================================ */

.site-footer {
    background-color: #12121f;
    color: #cbd1dc;
    padding: 4.5rem 2rem 0;
    margin-top: 4rem;
    text-align: left;
    border-top: none; /* guards against any bare `footer {...}` rule elsewhere */
}

body.dark-mode .site-footer {
    background-color: #0a0a12;
}

.footer-top {
    max-width: var(--container-width, 1200px);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.2fr 0.8fr 1fr;
    column-gap: 2.5rem;
    row-gap: 2.5rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-col {
    text-align: left;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

/* ---- Brand column ---- */
.footer-logo {
    display: inline-block;
    font-size: 1.6rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 1rem;
    line-height: 1;
}

.footer-logo .highlight {
    color: var(--primary-color);
}

.footer-tagline {
    color: #9aa1b0;
    font-size: 0.95rem;
    line-height: 1.7;
    max-width: 320px;
    margin-bottom: 1.5rem;
    text-align: left;
}

.footer-socials {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.footer-socials a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd1dc;
    font-size: 1.05rem;
    flex-shrink: 0;
    transition: background-color 0.3s, border-color 0.3s, color 0.3s, transform 0.3s;
}

.footer-socials a:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
    transform: translateY(-3px);
}

/* ---- Links / Contact columns ---- */
.footer-links h4,
.footer-contact h4 {
    color: #ffffff;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    margin-bottom: 1.4rem;
    text-align: left;
    width: 100%;
}

.footer-links ul,
.footer-contact ul {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.9rem;
    width: 100%;
}

.footer-links li,
.footer-contact li {
    text-align: left;
    width: 100%;
}

.footer-links a {
    display: inline-block;
    color: #9aa1b0;
    font-size: 0.95rem;
    transition: color 0.3s, transform 0.3s;
}

.footer-links a:hover {
    color: var(--primary-color);
    transform: translateX(4px);
}

.footer-contact li {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    color: #9aa1b0;
    font-size: 0.92rem;
    line-height: 1.5;
}

.footer-contact li i {
    color: var(--primary-color);
    margin-top: 3px;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
}

.footer-contact a {
    color: #9aa1b0;
    word-break: break-word;
    transition: color 0.3s;
}

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

/* ---- Bottom bar ---- */
.footer-bottom {
    max-width: var(--container-width, 1200px);
    margin: 0 auto;
    padding: 1.75rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    text-align: left;
}

.footer-bottom p {
    color: #7c8394;
    font-size: 0.88rem;
    margin: 0;
}

/* ---- Back to top button ---- */
#back-to-top {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd1dc;
    cursor: pointer;
    font-size: 1rem;
    flex-shrink: 0;
    transition: background-color 0.3s, border-color 0.3s, color 0.3s, transform 0.3s;
}

#back-to-top:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
    transform: translateY(-3px);
}

/* ---- Fallback footer (shown only if footer.html fails to load) ---- */
.site-footer--fallback .footer-bottom {
    justify-content: center;
    border-top: none;
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
    .footer-top {
        grid-template-columns: 1fr 1fr;
    }

    .footer-brand {
        grid-column: 1 / -1;
    }

    .footer-tagline {
        max-width: none;
    }
}

@media (max-width: 600px) {
    .site-footer {
        padding: 3.5rem 1.25rem 0;
    }

    .footer-top {
        grid-template-columns: 1fr;
        row-gap: 2.25rem;
    }

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

    .footer-bottom p {
        text-align: center;
    }
}