/* ==========================================================================
   Footer v3
   World-class clean footer, Fiddler-inspired, injected globally via partial.
   Provides standalone CSS variables.
   ========================================================================== */

:root {
    --footer-bg: #e9eef5;
    --footer-text: #111827;
    --footer-muted: #334155;
    --footer-meta: #475569;
    --footer-link: #1e3a8a;
    --footer-border: #bcc8d8;
    --footer-divider: #c7d2e4;
    --footer-cta-bg: #f8fafc;
    --footer-btn-primary-bg: #1d4ed8;
    --footer-btn-primary-text: #ffffff;
    --footer-btn-secondary-bg: #dbeafe;
    --footer-btn-secondary-text: #1e3a8a;
    --footer-icon-hover: #0f172a;
    --footer-hover-bg: #bfdbfe;
    --footer-heading: #0b1220;
    --footer-brand: #0b1220;
}

/* Dark Mode Overrides - matching site's global [data-theme="dark"] or body.dark */
[data-theme="dark"],
body.dark,
html.dark {
    --footer-bg: #0b1220;
    --footer-text: #dbe6f7;
    --footer-muted: #c2d0e6;
    --footer-meta: #9fb3cf;
    --footer-link: #93c5fd;
    --footer-border: #243347;
    --footer-divider: #2f425e;
    --footer-cta-bg: #121d31;
    --footer-btn-primary-bg: #1d4ed8;
    --footer-btn-primary-text: #f8fafc;
    --footer-btn-secondary-bg: rgba(147, 197, 253, 0.14);
    --footer-btn-secondary-text: #dbeafe;
    --footer-icon-hover: #f8fafc;
    --footer-hover-bg: rgba(147, 197, 253, 0.2);
    --footer-heading: #f1f5ff;
    --footer-brand: #f1f5ff;
}

/* Base Wrapper Specificity */
.site-footer {
    background-color: var(--footer-bg);
    color: var(--footer-text);
    font-family: var(--font-primary, system-ui, -apple-system, sans-serif);
    border-top: 1px solid var(--footer-border);
    transition: background-color 0.3s ease, border-color 0.3s ease;
    width: 100%;
}

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

/* Container Utility */
.site-footer .footer-container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ==========================================================================
   CTA BAND
   ========================================================================== */
.site-footer .footer-cta-band {
    background-color: var(--footer-cta-bg);
    padding: 64px 0;
    text-align: center;
    border-bottom: 1px solid var(--footer-border);
}

.site-footer .footer-cta-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 32px 0;
    color: var(--footer-text);
    letter-spacing: -0.02em;
}

.site-footer .footer-cta-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
}

.site-footer .footer-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 48px;
    padding: 0 24px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    transition: transform 0.2s ease, background-color 0.2s ease, opacity 0.2s ease, border-color 0.2s ease;
    border: 1px solid transparent;
}

.site-footer .footer-btn:active {
    transform: scale(0.98);
}

.site-footer .primary-btn {
    background-color: var(--footer-btn-primary-bg);
    color: var(--footer-btn-primary-text);
    border-color: var(--footer-btn-primary-bg);
}

.site-footer .primary-btn:hover {
    opacity: 0.9;
}

.site-footer .secondary-btn {
    background-color: var(--footer-btn-secondary-bg);
    color: var(--footer-btn-secondary-text);
    border-color: var(--footer-btn-secondary-text);
}

.site-footer .secondary-btn:hover {
    background-color: var(--footer-hover-bg);
}

/* ==========================================================================
   MAIN GRID
   ========================================================================== */
.site-footer .footer-main-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    gap: 40px;
    padding: 80px 24px;
}

.site-footer .footer-main-grid > *:not(.footer-brand-col) {
    border-left: 1px solid var(--footer-divider);
    padding-left: 24px;
}

.site-footer .footer-brand-col {
    padding-right: 40px;
}

.site-footer .footer-logo {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 16px;
    letter-spacing: -0.01em;
    color: var(--footer-brand);
}

.site-footer .footer-address {
    font-style: normal;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--footer-text);
}

.site-footer .footer-address p {
    margin: 0;
}

.site-footer .footer-contact-info {
    margin-top: 8px !important;
}

.site-footer .footer-nav-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 24px 0;
    color: var(--footer-heading);
    letter-spacing: 0.02em;
}

.site-footer .footer-link-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.site-footer .footer-link-list li {
    margin-bottom: 16px;
}

.site-footer .footer-link {
    color: var(--footer-link);
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-thickness: 0.09em;
    font-size: 0.95rem;
    transition: color 0.2s ease;
    display: inline-flex;
    min-height: 44px;
    align-items: center;
}

.site-footer .footer-link:hover,
.site-footer .footer-link:focus-visible {
    color: var(--footer-text);
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* ==========================================================================
   BOTTOM BAR
   ========================================================================== */
.site-footer .footer-bottom-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: 32px 24px;
    border-top: 1px solid var(--footer-border);
    gap: 24px;
}

.site-footer .footer-copyright {
    font-size: 0.875rem;
    color: var(--footer-meta);
}

.site-footer .footer-legal-links {
    display: flex;
    align-items: center;
    gap: 12px;
}

.site-footer .footer-legal-link {
    font-size: 0.875rem;
    color: var(--footer-link);
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-thickness: 0.09em;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}

.site-footer .footer-legal-link:hover,
.site-footer .footer-legal-link:focus-visible {
    color: var(--footer-text);
    text-decoration: underline;
    text-underline-offset: 4px;
}

.site-footer .footer-legal-divider {
    color: var(--footer-border);
    font-size: 0.875rem;
}

/* Social Row */
.site-footer .footer-social-row {
    display: flex;
    gap: 16px;
    align-items: center;
}

.site-footer .footer-social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    color: var(--footer-muted);
    background-color: transparent;
    transition: all 0.2s ease;
}

.site-footer .footer-social-link svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    transition: transform 0.2s ease;
}

.site-footer .footer-social-link:hover,
.site-footer .footer-social-link:focus-visible {
    background-color: var(--footer-hover-bg);
    color: var(--footer-icon-hover);
    outline: none;
}

.site-footer .footer-social-link:active svg {
    transform: scale(0.9);
}

/* Focus Utility */
.site-footer a:focus-visible {
    outline: 3px solid #f59e0b;
    outline-offset: 3px;
    border-radius: 6px;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.3);
}

/* ==========================================================================
   RESONSIVE OVERRIDES
   ========================================================================== */
@media (max-width: 1024px) {
    .site-footer .footer-main-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }

    .site-footer .footer-main-grid > *:not(.footer-brand-col) {
        border-left: none;
        padding-left: 0;
    }

    .site-footer .footer-brand-col {
        grid-column: 1 / -1;
        padding-right: 0;
        margin-bottom: 16px;
    }
}

@media (max-width: 768px) {
    .site-footer .footer-cta-band {
        padding: 48px 0;
    }

    .site-footer .footer-main-grid {
        grid-template-columns: 1fr 1fr;
        gap: 40px 24px;
        padding: 64px 24px;
    }

    .site-footer .footer-bottom-bar {
        flex-direction: column;
        text-align: center;
        padding: 32px 24px 48px;
        /* Extra bottom padding for mobile safe area */
    }

    .site-footer .footer-social-row {
        justify-content: center;
        order: -1;
        /* Move icons to top of bottom bar */
        margin-bottom: 8px;
    }
}

@media (max-width: 480px) {
    .site-footer .footer-cta-title {
        font-size: 1.75rem;
    }

    .site-footer .footer-cta-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .site-footer .footer-btn {
        width: 100%;
    }

    .site-footer .footer-main-grid {
        grid-template-columns: 1fr;
    }
}
