/* css/site-footer.css
 *
 * Footer global del sitio público (auto-montado por js/site-footer.js).
 * Responsive grid de 4 columnas → 2 (tablet) → 1 (móvil). Fondo oscuro
 * con borde superior accent. Solo se ve cuando settings.footerEnabled = true
 * (el atributo `hidden` del <footer> se quita en JS al renderizar).
 */

/* Fondo y color base = mismo patrón que #topbar (styles.css). El footer
   espejea el tema activo del body (default oscuro / light-theme-active /
   bright-theme-active) para fusionar con la cabecera y el fondo de página. */
.site-footer {
    background: #1e1e2a;
    color: #cbd5e1;
    margin-top: auto;
    width: 100%;
    transition: background 0.3s ease, color 0.3s ease;
}

.site-footer[hidden] {
    display: none !important;
}

/* === Tema claro (color de marca) === */
body.light-theme-active .site-footer {
    background: var(--color-accent, #7e22ce);
    color: rgba(255, 255, 255, 0.9);
}

body.light-theme-active .site-footer-name,
body.light-theme-active .site-footer-heading {
    color: #fff;
}

body.light-theme-active .site-footer-tagline {
    color: rgba(255, 255, 255, 0.75);
}

body.light-theme-active .site-footer-link,
body.light-theme-active .site-footer-bottom,
body.light-theme-active .site-footer-copy,
body.light-theme-active .site-footer-powered a {
    color: rgba(255, 255, 255, 0.9);
}

body.light-theme-active .site-footer-link:hover {
    color: #fff;
    text-decoration: underline;
}

body.light-theme-active .site-footer-legal-text {
    color: rgba(255, 255, 255, 0.6);
}

body.light-theme-active .site-footer-bottom {
    border-top-color: rgba(255, 255, 255, 0.15);
}

/* === Tema claro brillante (fondo de tarjeta) === */
body.bright-theme-active .site-footer {
    background: var(--color-bg-card, #e5e7eb);
    color: #374151;
}

body.bright-theme-active .site-footer-name,
body.bright-theme-active .site-footer-heading {
    color: #111827;
}

body.bright-theme-active .site-footer-tagline {
    color: #4b5563;
}

body.bright-theme-active .site-footer-link,
body.bright-theme-active .site-footer-copy,
body.bright-theme-active .site-footer-powered a {
    color: #374151;
}

body.bright-theme-active .site-footer-link:hover {
    color: var(--color-accent, #7e22ce);
}

body.bright-theme-active .site-footer-legal-text {
    color: #6b7280;
}

body.bright-theme-active .site-footer-bottom {
    border-top-color: rgba(0, 0, 0, 0.1);
    color: #4b5563;
}

.site-footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 3rem 1.5rem 1.25rem;
}

/* Layout en Flexbox: más robusto que grid auto-fit cuando una columna
   necesita ocupar el doble de ancho (caso de Navegación con muchos enlaces).
   `flex: 1 1 140px` reparte espacio igualitario con un mínimo razonable;
   .site-footer-col-nav-wide pide más espacio (`flex: 2 1 260px`) para
   acomodar 2 sub-columnas internas. `flex-wrap` colapsa en móvil sin media
   queries. Anchos calibrados para que las 5 columnas (Marca + Multimedia +
   Navegación wide + Contacto + Legal) quepan en una sola fila en un
   viewport ≥ ~1100px y wrappeen ordenadamente por debajo. */
.site-footer-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 2rem;
    align-items: flex-start;
}

.site-footer-col {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0;
    flex: 1 1 140px;
}

.site-footer-col-brand {
    flex: 1 1 180px;
    max-width: 280px;
}

/* Columna Navegación con muchos enlaces: el doble de flex-grow + ancho base
   mayor para acomodar 2 sub-columnas internas. */
.site-footer-col-nav-wide {
    flex: 2 1 260px;
}

/* Lista interna a 2 sub-columnas en grid puro. Especificidad compuesta
   (.site-footer-list.site-footer-list-2col) para ganar a la regla base
   de .site-footer-list que define display: flex. */
.site-footer-list.site-footer-list-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem 1.5rem;
}

/* ── Columna marca ── */
.site-footer-col-brand .site-footer-logo {
    max-width: 120px;
    max-height: 60px;
    object-fit: contain;
    margin-bottom: 0.5rem;
    opacity: 0.95;
}

.site-footer-name {
    font-size: 1.125rem;
    font-weight: 700;
    color: #f1f5f9;
    margin-bottom: 0.25rem;
}

.site-footer-tagline {
    font-size: 0.875rem;
    color: #94a3b8;
    line-height: 1.5;
    margin: 0 0 0.75rem;
}

.site-footer-socials {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.site-footer-social {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
    transition: background-color 0.15s, color 0.15s, transform 0.15s;
}

.site-footer-social:hover {
    background: var(--color-accent, #6366f1);
    color: #fff;
    transform: translateY(-2px);
}

.site-footer-social svg {
    width: 18px;
    height: 18px;
}

/* ── Headings de columna ── */
.site-footer-heading {
    font-size: 0.875rem;
    font-weight: 600;
    color: #f1f5f9;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 0.5rem;
}

/* ── Listas (navegación, contacto, legal) ── */
.site-footer-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.site-footer-link,
.site-footer-contact-item {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.site-footer-link:hover,
.site-footer-contact-item:hover {
    color: var(--color-accent, #818cf8);
}

.site-footer-contact-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: #94a3b8;
}

.site-footer-contact-icon svg {
    width: 100%;
    height: 100%;
}

/* ── Bottom bar (copyright) ── */
.site-footer-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.8125rem;
    color: #94a3b8;
}

.site-footer-copy {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    align-items: baseline;
}

.site-footer-legal-text {
    color: #64748b;
    font-size: 0.75rem;
}

.site-footer-powered a {
    color: #cbd5e1;
    text-decoration: none;
    font-weight: 500;
}

.site-footer-powered a:hover {
    color: var(--color-accent, #818cf8);
}

/* ── Responsive ── */
/* El auto-fit del .site-footer-grid ya colapsa columnas automáticamente.
   Solo ajustamos padding y centrado en móvil. */
@media (max-width: 1024px) {
    .site-footer-inner {
        padding: 2.5rem 1.25rem 1rem;
    }
    .site-footer-grid {
        gap: 2rem;
    }
}

@media (max-width: 640px) {
    .site-footer-grid {
        gap: 1.75rem;
    }
    .site-footer-bottom {
        justify-content: center;
        text-align: center;
    }
    .site-footer-copy {
        justify-content: center;
    }
}
