/**
 * Pie de Página Institucional Oficial (Footer)
 * H. Ayuntamiento de Escárcega
 * Fuente Única de Verdad: web-app-gen
 */

/* ==================================================
   1. AISLAMIENTO Y ESPECIFICIDAD DEL FOOTER
   Nivel 1: #571124 (--brand-wine-dark)
   Nivel 2: #3F0F1E (--brand-wine-deep)
   ================================================== */
.site-footer {
    background-color: var(--brand-wine-dark, #571124);
    color: rgba(255, 255, 255, 0.72);
    font-size: var(--font-size-sm, 0.875rem);
    line-height: var(--line-height-normal, 1.5);
    width: 100%;
    font-family: var(--font-family-sans, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);
    box-sizing: border-box;
}

.site-footer *,
.site-footer *::before,
.site-footer *::after {
    box-sizing: border-box;
}

.site-footer .container,
.site-footer .footer-grid,
.site-footer .footer-bottom-container {
    width: 100%;
    max-width: var(--container-max-width, 1280px);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--spacing-4, 1rem);
    padding-right: var(--spacing-4, 1rem);
}

.site-footer ul,
.site-footer ol {
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-footer li {
    margin: 0;
    padding: 0;
}

.site-footer a {
    text-decoration: none;
}

.site-footer p {
    margin: 0;
}

/* ==================================================
   2. NIVEL 1: FOOTER PRINCIPAL Y REJILLA DE 4 COLUMNAS
   ================================================== */
.footer-main {
    padding: 3.5rem 0 3rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr 1.2fr 1fr;
    gap: 2.5rem;
}

.footer-col {
    display: flex;
    flex-direction: column;
}

.footer-col-title {
    color: #FFFFFF;
    font-size: var(--font-size-base, 1rem);
    font-weight: 700;
    margin-bottom: 1.25rem;
    position: relative;
    padding-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.footer-col-title::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 28px;
    height: 2px;
    background-color: rgba(255, 255, 255, 0.35);
}

/* ==================================================
   3. COLUMNA 1: IDENTIDAD CON ESCUDO HISTÓRICO
   ================================================== */
.footer-brand {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.footer-escudo {
    width: 85px;
    height: auto;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
}

.footer-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.footer-entity {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.72);
    text-transform: uppercase;
}

.footer-municipality {
    font-size: 1.35rem;
    font-weight: 900;
    letter-spacing: 0.05em;
    color: #FFFFFF;
    text-transform: uppercase;
}

.footer-state {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.86);
    letter-spacing: 0.03em;
}

.footer-period {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--brand-gold, #cfa052);
    margin-top: 0.2rem;
}

.footer-tagline {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.72);
    line-height: 1.45;
    max-width: 320px;
}

/* ==================================================
   4. COLUMNA 2: ENLACES DE INTERÉS
   ================================================== */
.footer-link-list,
.footer-social-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.site-footer .footer-link {
    color: rgba(255, 255, 255, 0.86) !important;
    font-size: var(--font-size-sm, 0.875rem);
    transition: color var(--transition-fast, 150ms ease), padding-left var(--transition-fast, 150ms ease);
    display: inline-block;
    text-decoration: none !important;
}

.site-footer .footer-link:hover,
.site-footer .footer-link:focus {
    color: #FFFFFF !important;
    padding-left: 4px;
    text-decoration: none !important;
}

/* ==================================================
   5. COLUMNA 3: CONTACTO
   ================================================== */
.footer-address {
    font-style: normal;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    font-size: var(--font-size-sm, 0.875rem);
}

.contact-line {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    color: rgba(255, 255, 255, 0.86);
    line-height: 1.4;
    margin: 0;
}

.contact-icon {
    width: 18px;
    height: 18px;
    color: var(--brand-gold, #cfa052);
    flex-shrink: 0;
    margin-top: 2px;
}

.site-footer .contact-link {
    color: rgba(255, 255, 255, 0.86) !important;
    text-decoration: none !important;
    transition: color var(--transition-fast, 150ms ease);
}

.site-footer .contact-link:hover,
.site-footer .contact-link:focus {
    color: #FFFFFF !important;
    text-decoration: underline !important;
}

/* ==================================================
   6. COLUMNA 4: REDES SOCIALES
   ================================================== */
.footer-social-desc {
    margin-bottom: 1rem;
    font-size: var(--font-size-sm, 0.875rem);
    color: rgba(255, 255, 255, 0.72);
}

.social-link {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: rgba(255, 255, 255, 0.86) !important;
    text-decoration: none !important;
    transition: all var(--transition-fast, 150ms ease);
    font-size: var(--font-size-sm, 0.875rem);
}

.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm, 6px);
    background-color: rgba(255, 255, 255, 0.12);
    color: #FFFFFF;
    transition: all var(--transition-fast, 150ms ease);
    flex-shrink: 0;
}

.social-icon svg {
    width: 16px;
    height: 16px;
}

.social-link:hover,
.social-link:focus {
    color: #FFFFFF !important;
}

.social-link:hover .social-icon {
    background-color: var(--brand-wine, #790B27);
    color: #FFFFFF;
    transform: translateY(-2px);
}

/* ==================================================
   7. NIVEL 2: BARRA INFERIOR DEL FOOTER
   ================================================== */
.footer-bottom {
    background-color: var(--brand-wine-deep, #3F0F1E);
    padding: 1.25rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: var(--font-size-xs, 0.75rem);
    color: rgba(255, 255, 255, 0.72);
}

.footer-bottom-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.footer-copyright {
    color: rgba(255, 255, 255, 0.72);
    margin: 0;
    font-size: var(--font-size-xs, 0.75rem);
}

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

.site-footer .footer-legal-link {
    color: rgba(255, 255, 255, 0.86) !important;
    text-decoration: none !important;
    font-size: var(--font-size-xs, 0.75rem);
    transition: color var(--transition-fast, 150ms ease);
}

.site-footer .footer-legal-link:hover,
.site-footer .footer-legal-link:focus {
    color: #FFFFFF !important;
    text-decoration: underline !important;
}

/* ==================================================
   8. REGLAS RESPONSIVE DEL FOOTER
   ================================================== */
@media (max-width: 1024px) {
    .footer-grid {
        grid-template-columns: 1.2fr 1fr 1.2fr 1fr;
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .footer-main {
        padding: 2.5rem 0 2rem;
    }

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

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

    .footer-escudo {
        width: 75px;
    }

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

    .footer-legal-list {
        flex-wrap: wrap;
        gap: 1rem;
    }
}
