/**
 * ZanCo. ltd Footer RTL Styles
 * Right-to-left language support (Arabic, Hebrew, etc.)
 *
 * @package ZanCo
 * @since 1.0.0
 */

/* ==========================================================================
   RTL Footer Custom Properties
   ========================================================================== */

:root {
    /* Keep same colors but adjust naming for clarity */
    --footer-rtl-gap: 4rem;
}

/* ==========================================================================
   Base Footer RTL Adjustments
   ========================================================================== */

/* RTL: Container padding */
[dir="rtl"] .site-footer__container,
.rtl .site-footer__container {
    padding-inline-start: 1.5rem;
    padding-inline-end: 1.5rem;
}

@media (min-width: 1024px) {
    [dir="rtl"] .site-footer__container,
    .rtl .site-footer__container{
        padding-inline-start: 3rem;
        padding-inline-end: 3rem;
    }
}

/* ==========================================================================
   RTL Footer Main Grid
   ========================================================================== */

/* RTL: Grid columns should flow in logical order */
[dir="rtl"] .site-footer__main,
.rtl .site-footer__main {
    /* Grid automatically handles RTL direction */
    direction: rtl;
}

/* ==========================================================================
   RTL Footer Brand
   ========================================================================== */

/* RTL: Brand name alignment */
[dir="rtl"] .site-footer__brand-name,
.rtl .site-footer__brand-name {
    /* Keep LTR for brand name even in RTL context */
    direction: ltr;
    unicode-bidi: isolate;
}

/* RTL: Brand description text alignment */
[dir="rtl"] .site-footer__brand-description,
.rtl .site-footer__brand-description {
    text-align: start;
    direction: rtl;
}

/* ==========================================================================
   RTL Footer Social Links
   ========================================================================== */

/* RTL: Social links should flow right-to-left */
[dir="rtl"] .site-footer__social-list,
.rtl .site-footer__social-list {
    direction: rtl;
    justify-content: flex-start;
}

[dir="rtl"] .site-footer__social-link,
.rtl .site-footer__social-link {
    margin-inline-start: 0;
    margin-inline-end: 0.75rem;
}

[dir="rtl"] .site-footer__social-list li:last-child .site-footer__social-link,
.rtl .site-footer__social-list li:last-child .site-footer__social-link {
    margin-inline-end: 0;
}

/* ==========================================================================
   RTL Footer Navigation
   ========================================================================== */

/* RTL: Navigation lists */
[dir="rtl"] .site-footer__nav-list,
.rtl .site-footer__nav-list {
    direction: rtl;
    text-align: start;
    padding-inline-start: 0;
}

[dir="rtl"] .site-footer__nav-list li,
.rtl .site-footer__nav-list li {
    margin-block-start: 0.75rem;
}

[dir="rtl"] .site-footer__nav-list li:first-child,
.rtl .site-footer__nav-list li:first-child {
    margin-block-start: 0;
}

/* ==========================================================================
   RTL Footer Newsletter
   ========================================================================== */

/* RTL: Newsletter intro text alignment */
[dir="rtl"] .site-footer__newsletter-intro,
.rtl .site-footer__newsletter-intro {
    text-align: start;
    direction: rtl;
}

/* RTL: Newsletter form layout */
[dir="rtl"] .site-footer__newsletter-form,
.rtl .site-footer__newsletter-form {
    direction: rtl;
}

/* RTL: Input placeholder alignment */
[dir="rtl"] .site-footer__newsletter-input::placeholder,
.rtl .site-footer__newsletter-input::placeholder {
    text-align: start;
}

/* ==========================================================================
   RTL Footer Bottom Bar
   ========================================================================== */

/* RTL: Bottom bar layout */
[dir="rtl"] .site-footer__bottom,
.rtl .site-footer__bottom {
    direction: rtl;
}

@media (min-width: 640px) {
    [dir="rtl"] .site-footer__bottom,
    .rtl .site-footer__bottom {
        flex-direction: row-reverse;
    }
}

/* RTL: Copyright text */
[dir="rtl"] .site-footer__copyright,
.rtl .site-footer__copyright {
    direction: rtl;
}

/* ==========================================================================
   RTL Footer Legal Links
   ========================================================================== */

/* RTL: Legal links flow */
[dir="rtl"] .site-footer__legal-list,
.rtl .site-footer__legal-list {
    direction: rtl;
}

[dir="rtl"] .site-footer__legal-list li,
.rtl .site-footer__legal-list li {
    margin-inline-start: 0;
    margin-inline-end: 1.5rem;
}

[dir="rtl"] .site-footer__legal-list li:last-child,
.rtl .site-footer__legal-list li:last-child {
    margin-inline-end: 0;
}

/* ==========================================================================
   RTL Footer Language Switcher
   ========================================================================== */

/* RTL: Language switcher */
[dir="rtl"] .site-footer__language-list,
.rtl .site-footer__language-list {
    direction: rtl;
}

[dir="rtl"] .site-footer__language-list li,
.rtl .site-footer__language-list li {
    margin-inline-start: 0;
    margin-inline-end: 1rem;
}

[dir="rtl"] .site-footer__language-list li:last-child,
.rtl .site-footer__language-list li:last-child {
    margin-inline-end: 0;
}

/* ==========================================================================
   RTL Block Theme Footer Adjustments
   ========================================================================== */

/* RTL: Block theme footer columns */
[dir="rtl"] .site-footer--home2 .footer-main-columns,
.rtl .site-footer--home2 .footer-main-columns {
    direction: rtl;
}

/* RTL: Block theme brand title */
[dir="rtl"] .site-footer--home2 .footer-brand-title,
.rtl .site-footer--home2 .footer-brand-title {
    direction: ltr;
    unicode-bidi: isolate;
}

/* RTL: Block theme brand description */
[dir="rtl"] .site-footer--home2 .footer-brand-description,
.rtl .site-footer--home2 .footer-brand-description {
    text-align: start;
    direction: rtl;
}

/* RTL: Block theme social links */
[dir="rtl"] .site-footer--home2 .footer-social-links,
.rtl .site-footer--home2 .footer-social-links {
    justify-content: flex-start;
}

/* RTL: Block theme navigation columns */
[dir="rtl"] .site-footer--home2 .footer-nav,
.rtl .site-footer--home2 .footer-nav {
    direction: rtl;
    text-align: start;
}

/* RTL: Block theme newsletter form */
[dir="rtl"] .site-footer--home2 .footer-newsletter-form,
.rtl .site-footer--home2 .footer-newsletter-form {
    direction: rtl;
}

[dir="rtl"] .site-footer--home2 .footer-newsletter-input::placeholder,
.rtl .site-footer--home2 .footer-newsletter-input::placeholder {
    text-align: start;
}

/* RTL: Block theme bottom bar */
[dir="rtl"] .site-footer--home2 .footer-bottom,
.rtl .site-footer--home2 .footer-bottom {
    direction: rtl;
}

@media (min-width: 640px) {
    [dir="rtl"] .site-footer--home2 .footer-bottom,
    .rtl .site-footer--home2 .footer-bottom {
        flex-direction: row-reverse;
    }
}

/* RTL: Block theme legal links */
[dir="rtl"] .site-footer--home2 .footer-legal-links,
.rtl .site-footer--home2 .footer-legal-links {
    direction: rtl;
}

/* ==========================================================================
   RTL Responsive Adjustments
   ========================================================================== */

@media (max-width: 781px) {
    [dir="rtl"] .footer-main-columns .wp-block-column,
    .rtl .footer-main-columns .wp-block-column {
        flex-basis: 100% !important;
    }
}

@media (min-width: 782px) and (max-width: 1023px) {
    [dir="rtl"] .footer-main-columns .wp-block-column,
    .rtl .footer-main-columns .wp-block-column {
        flex-basis: 50% !important;
    }
}

/* ==========================================================================
   Arabic Typography Enhancements
   ========================================================================== */

/* Improve Arabic text rendering */
html[lang="ar"] .site-footer,
html[lang="ar"] .site-footer * {
    font-family: 'Noto Sans Arabic', 'Tahoma', 'Arial', sans-serif;
}

html[lang="ar"] .site-footer__brand-name {
    font-family: 'Playfair Display', 'Amiri', 'Traditional Arabic', serif;
}

/* Adjust font weights for Arabic */
html[lang="ar"] .site-footer__column-title {
    font-weight: 700; /* Bold for Arabic titles */
}

html[lang="ar"] .site-footer__brand-description,
html[lang="ar"] .site-footer__newsletter-intro,
html[lang="ar"] .site-footer__copyright {
    font-weight: 400; /* Regular for body text in Arabic */
}
