/* --- Footer Styling --- */
.main-footer {
    display: flex;
    flex-direction: column; /* Stack items vertically */
    justify-content: center;
    align-items: center;
    padding: 40px 20px; /* Increased padding */
    background-color: #242424;
    border-top: 1px solid #333;
    width: 100%;
    margin-top: 32px;
    gap: 20px; /* Space between links and social icons */
}

.main-footer span,
.main-footer p {
    color: var(--color-text-default);
}

.footer-links {
    font-family: inherit;
    font-size: var(--font-size-small);
    color: var(--color-text-secondary);
    display: flex;
    gap: 20px;
    align-items: center;
}

.footer-links a {
    font-family: inherit;
    font-size: inherit;
    font-weight: 400;
    color: inherit;
    text-decoration: none;
}

.footer-links a {
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: var(--font-size-small);
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--color-text-default);
    text-decoration: underline;
}


/* --- Footer Refactor --- */

/* Default (Desktop and Mobile) - All rows, full width */
.footer-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.footer-links-mobile {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0;
    align-items: center;
    justify-content: center;
    width: 100%;
}

/* CRITICAL FIX: Remove background from the span */
.footer-links-mobile span {
    background-color: transparent !important;
    font-weight: bold;
}

.footer-links-mobile span,
.footer-links-mobile a {
    display: inline-block;
    margin-right: 20px;
    margin-bottom: 10px;
}

.footer-social {
    display: flex;
    gap: 48px;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 16px;
    margin-bottom: 32px;
}

.footer-social a {
    color: #ffffff !important;
    transition: color 0.2s ease-in-out;
    text-decoration: none;
}

.footer-social a:hover {
    color: #ff9800 !important;
}

.footer-social svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.footer-meta-links {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    justify-content: center;
    font-size: inherit;
    color: var(--color-text-secondary);
    width: 100%;
}

.footer-meta-links p {
    margin: 0;
}

.footer-meta-link {
    color: var(--color-text-secondary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.2s;
}

.footer-meta-link:hover,
.footer-meta-link:hover span,
.footer-meta-link:hover svg {
    color: #ffffff;
    fill: #ffffff;
    text-decoration: none;
}

/* --- Scroll to Top Footer Button --- */
.scroll-to-top-footer-btn {
    display: none;
}

/* Mobile Overrides */
@media (max-width: 992px) {
    .scroll-to-top-footer-btn {
        display: block;
        margin-left: auto;
        margin-right: 32px;
        margin-bottom: 32px;
        background-color: #333;
        color: var(--color-text-default);
        border: 1px solid #444;
        border-radius: 8px;
        padding: 16px 32px;
        font-size: var(--font-size-standard);
        cursor: pointer;
        transition: background-color 0.2s, color 0.2s;
        width: fit-content;
    }

    .scroll-to-top-footer-btn:hover {
        background-color: #444;
        border-color: #ff9800;
    }

    .footer-meta-links {
        text-align: center;
    }

    .footer-meta-links .lang-title,
    .footer-meta-links a {
        display: inline;
        text-align: center;
    }

    .footer-meta-links p {
        display: block;
        width: 100%;
        text-align: center;
        margin: 10px 0;
    }

    /* Force line break after the colon separator */
    .lang-sep {
        display: block;
        height: 0;
        margin: 0;
        padding: 0;
    }

    .footer-grid {
        padding-left: 32px;
        padding-right: 32px;
        padding-bottom: 96px;
    }

    .footer-links-mobile {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: center;
        gap: 0;
    }

    .footer-links-mobile span {
        display: block;
        width: 100%;
        text-align: center;
        margin-right: 0;
        margin-bottom: 20px;
        font-weight: bold;
    }

    .footer-links-mobile a {
        display: inline-block;
        margin-right: 20px;
        margin-bottom: 20px;
        font-weight: bold;
    }


    .footer-social {
        justify-content: center;
        margin-top: 32px;
        margin-bottom: 32px;
    }

    .footer-social a {
        color: #ffffff !important;
        text-decoration: none;
    }

    .footer-social a:hover {
        color: #ff9800 !important;
    }

    .footer-social svg {
        width: 36px;
        height: 36px;
        fill: currentColor;
    }

    .footer-meta-links {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .footer-meta-links a {
        margin-bottom: 20px;
    }
}

