/**
 * Aqarsky Premium Footer Styles
 * Minimal, RTL/LTR ready, responsive
 * 
 * @version 2.0.0
 */

/* === CSS Variables - Uses Theme's --site-color === */
.site-footer {
    --footer-bg: var(--site-color, #3d5a80);
    --footer-bg-alt: color-mix(in srgb, var(--site-color, #3d5a80) 85%, #000);
    --footer-text: #ffffff;
    --footer-text-muted: rgba(255,255,255,0.75);
    --footer-accent: color-mix(in srgb, var(--site-color, #3d5a80) 70%, #fff);
    --footer-border: rgba(255,255,255,0.15);
    --footer-gap: clamp(1rem, 3vw, 2rem);
    --footer-max-width: 1280px;
    --footer-radius: 6px;
}

/* === Base Footer === */
.site-footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    font-size: 0.9375rem;
    line-height: 1.6;
}

.site-footer a {
    color: var(--footer-text);
    text-decoration: none;
    transition: color 0.2s ease;
}

.site-footer a:hover,
.site-footer a:focus {
    color: var(--footer-accent);
}

/* === Container === */
.footer-container {
    max-width: var(--footer-max-width);
    margin-inline: auto;
    padding-inline: var(--footer-gap);
}

/* === Trust Bar === */
.footer-trust-bar {
    background: var(--footer-bg-alt);
    color: #fff;
    padding: 1rem 0;
    border-bottom: 1px solid var(--footer-border);
}

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

.trust-message {
    margin: 0;
    font-weight: 500;
}

.trust-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.btn-trust {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--footer-radius);
    font-weight: 500;
    font-size: 0.875rem;
    transition: background 0.2s ease, transform 0.15s ease;
}

.btn-trust:hover,
.btn-trust:focus {
    color: #fff;
    transform: translateY(-1px);
}

.btn-contact {
    background: #fff;
    color: var(--site-color, #3d5a80) !important;
}

.btn-contact:hover,
.btn-contact:focus {
    background: #f0f4f8;
    color: var(--site-color, #3d5a80) !important;
}

.btn-pdf {
    background: rgba(255,255,255,0.15);
    color: #fff !important;
    border: 1px solid rgba(255,255,255,0.3);
}

.btn-pdf:hover,
.btn-pdf:focus {
    background: rgba(255,255,255,0.25);
}

.pdf-badge,
.pdf-indicator {
    font-size: 0.65rem;
    text-transform: uppercase;
    padding: 0.15rem 0.35rem;
    border-radius: 3px;
    background: rgba(255,255,255,0.25);
    font-weight: 600;
    letter-spacing: 0.02em;
}

.pdf-indicator {
    background: var(--footer-accent);
    color: #fff;
    margin-inline-start: 0.5rem;
}

/* === Main Footer Grid === */
.footer-main {
    padding: 3rem 0;
    border-bottom: 1px solid var(--footer-border);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--footer-gap) calc(var(--footer-gap) * 1.5);
}

/* === Footer Columns === */
.footer-col {
    min-width: 0;
}

.footer-heading {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 1rem;
    color: #fff;
    border: none;
    background: none;
    padding: 0;
    text-align: inherit;
    width: 100%;
    cursor: default;
}

/* === Brand Block === */
.footer-brand {
    padding-inline-end: 1rem;
}

.brand-description {
    margin: 0 0 1rem;
    color: var(--footer-text-muted);
}

.brand-contact {
    font-style: normal;
}

.brand-contact p {
    margin: 0.35rem 0;
}

.brand-contact a {
    color: var(--footer-text);
}

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

/* === Footer Links === */
.footer-links {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--footer-text-muted);
}

.footer-links a svg {
    flex-shrink: 0;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.footer-links a:hover svg,
.footer-links a:focus svg {
    opacity: 1;
}

.footer-links a:hover,
.footer-links a:focus {
    color: #fff;
}

/* === Footer Links Grid (Two Columns) === */
.footer-links-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.footer-subsection {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-subsection-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--footer-accent);
    margin: 0 0 0.25rem 0;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--footer-border);
}

.footer-subsection ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-subsection li {
    margin-bottom: 0.35rem;
}

.footer-subsection a {
    color: var(--footer-text-muted);
    font-size: 0.9rem;
}

.footer-subsection a:hover,
.footer-subsection a:focus {
    color: #fff;
}

/* === Methodology Button === */
.btn-methodology {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.65rem 1.25rem;
    background: #fff;
    border: 2px solid #fff;
    border-radius: var(--footer-radius);
    color: var(--site-color, #3d5a80) !important;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s ease;
    width: auto;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.btn-methodology:hover,
.btn-methodology:focus {
    background: transparent;
    border-color: #fff;
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

@media (max-width: 480px) {
    .footer-links-grid {
        grid-template-columns: 1fr;
    }
}

/* === Bottom Bar === */
.footer-bottom {
    background: var(--footer-bg-alt);
    padding: 1rem 0;
}

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

.footer-copyright {
    margin: 0;
    color: var(--footer-text-muted);
    font-size: 0.875rem;
}

/* === Social Links === */
.footer-social {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    color: #fff;
    transition: background 0.2s ease, color 0.2s ease;
}

.footer-social a:hover,
.footer-social a:focus {
    background: var(--footer-accent);
    color: #fff;
}

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

/* === Language Switch === */
.footer-lang-switch {
    font-size: 0.875rem;
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--footer-border);
    border-radius: var(--footer-radius);
    color: var(--footer-text-muted) !important;
}

.footer-lang-switch:hover,
.footer-lang-switch:focus {
    border-color: var(--footer-accent);
    background: rgba(255,255,255,0.1);
    color: #fff !important;
}

/* === Accordion (Mobile Only) === */
.accordion-icon {
    display: none;
}

/* === Responsive: Tablet (2 columns) === */
@media (max-width: 992px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-brand {
        grid-column: span 2;
        padding-inline-end: 0;
        padding-bottom: 1rem;
        border-bottom: 1px solid var(--footer-border);
        margin-bottom: 0.5rem;
    }
}

/* === Responsive: Mobile === */
@media (max-width: 640px) {
    .footer-main {
        padding: 1.5rem 0;
    }

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

    .footer-brand {
        grid-column: auto;
        text-align: center;
        padding-bottom: 1.5rem;
        border-bottom: 1px solid var(--footer-border);
    }

    .footer-brand .footer-heading {
        font-size: 1.5rem !important;
    }

    /* Section Styles */
    .footer-section {
        text-align: center;
    }

    .footer-section .footer-heading {
        font-size: 1rem;
        margin-bottom: 0.75rem;
        color: #fff;
    }

    .footer-links {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .footer-links li {
        margin-bottom: 0.6rem;
    }

    .footer-links a {
        justify-content: center;
    }

    /* Property Search Grid - Stack on mobile */
    .footer-links-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
        text-align: start;
    }

    .footer-subsection {
        text-align: center;
    }

    .footer-subsection ul {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    /* Methodology Button Mobile */
    .btn-methodology {
        margin-top: 1.25rem;
        width: auto;
        padding: 0.7rem 1.5rem;
    }

    /* Bottom bar mobile */
    .footer-bottom-inner {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .footer-social {
        order: -1;
    }

    .footer-copyright {
        font-size: 0.8rem;
    }
}

/* === RTL Support === */
[dir="rtl"] .footer-brand {
    padding-inline-start: 0;
    padding-inline-end: 1rem;
}

@media (max-width: 992px) {
    [dir="rtl"] .footer-brand {
        padding-inline-end: 0;
    }
}

/* === Focus States (Accessibility) === */
.site-footer a:focus,
.site-footer button:focus {
    outline: 2px solid var(--footer-accent);
    outline-offset: 2px;
}

.site-footer a:focus:not(:focus-visible),
.site-footer button:focus:not(:focus-visible) {
    outline: none;
}

/* === Print Styles === */
@media print {
    .site-footer {
        background: #fff;
        color: #000;
        border-top: 1px solid #ccc;
    }

    .footer-trust-bar,
    .footer-social,
    .accordion-icon {
        display: none;
    }
}
