/*
Music Artist Pro - Hebrew RTL Fixes - CLEAN VERSION
Organized and optimized fixes for Hebrew RTL layout
*/

/*--------------------------------------------------------------
# 1. HEADER LAYOUT - Keep EXACTLY like English
--------------------------------------------------------------*/
/* Force entire header to be LTR layout like English */
[dir="rtl"] header#masthead,
[dir="rtl"] .header-top {
    direction: ltr !important;
}

[dir="rtl"] header#masthead *,
[dir="rtl"] .header-top * {
    direction: ltr !important;
}

/* Logo positioning - same as English */
[dir="rtl"] .site-branding {
    float: left !important;
    text-align: left !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    direction: ltr !important;
}

/* Navigation positioning - same as English */
[dir="rtl"] nav#site-navigation,
[dir="rtl"] .navbar-nav {
    float: right !important;
    direction: ltr !important;
}

/* Menu positioning with much more margin */
html[dir="rtl"] body ul#menu-main {
    margin-left: 200px !important;
    margin-right: 0 !important;
    float: right !important;
    justify-content: flex-end !important;
}

/* Override navbar-center to push menu much more to the right */
html[dir="rtl"] body ul#menu-main.navbar-center {
    margin-left: 250px !important;
    margin-right: 0 !important;
    float: right !important;
    justify-content: flex-end !important;
    text-align: right !important;
}

/* Even more specific for navbar-collapse */
html[dir="rtl"] body .navbar-collapse ul#menu-main.navbar-center {
    margin-left: 250px !important;
    margin-right: 0 !important;
    justify-content: flex-end !important;
}

/* Nuclear option - maximum specificity */
html[dir="rtl"] body div#navbar-collapse ul#menu-main.nav.navbar-nav.navbar-center {
    margin-left: 250px !important;
    margin-right: 0 !important;
    float: right !important;
    justify-content: flex-end !important;
    display: flex !important;
}

/* Override inline styles with attribute selectors */
html[dir="rtl"] body ul#menu-main[style*="margin-left"] {
    margin-left: 370px !important;
    margin-right: 0 !important;
    float: right !important;
    justify-content: flex-end !important;
}

/* Target the exact inline style pattern */
html[dir="rtl"] body ul#menu-main.nav.navbar-nav.navbar-center[style*="margin-left: 60px"] {
    margin-left: 370px !important;
    margin-right: 0 !important;
    float: right !important;
    justify-content: flex-end !important;
    display: flex !important;
}

/* Even more specific with full path */
html[dir="rtl"] body header#masthead div.container div.row div#navbar-collapse ul#menu-main {
    margin-left: 250px !important;
    margin-right: 0 !important;
    float: right !important;
    justify-content: flex-end !important;
}

/* Only menu text should be RTL */
[dir="rtl"] .navbar-nav a {
    direction: rtl;
    text-align: center;
}

/* Social icons positioning - only for header, not homepage */
[dir="rtl"] header#masthead .header-social {
    float: right !important;
    direction: ltr !important;
    text-align: right !important;
    justify-content: flex-end !important;
    margin-left: 5px !important;
    margin-right: 0 !important;
    position: relative !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

[dir="rtl"] header#masthead .header-social .social-icon {
    margin-left: 0;
    margin-right: 12px !important;
}

/* Search wrap positioning - reduce left margins */
[dir="rtl"] header#masthead .search-wrap {
    margin-left: 0 !important;
    padding-left: 0 !important;
    float: right !important;
    width: auto !important;
    max-width: none !important;
}

[dir="rtl"] header#masthead .search-wrap .header-social {
    margin-left: 0 !important;
    padding-left: 0 !important;
    width: auto !important;
    max-width: none !important;
}

/* Target the specific search-wrap that contains social icons */
[dir="rtl"] header#masthead div.search-wrap:not(.show-mobile) {
    margin-left: 0 !important;
    padding-left: 0 !important;
    margin-right: 0 !important;
    padding-right: 0 !important;
}

[dir="rtl"] header#masthead div.search-wrap:not(.show-mobile) .header-social {
    margin-left: 0 !important;
    padding-left: 0 !important;
    margin-right: 0 !important;
    padding-right: 0 !important;
}

/* Additional super specific menu positioning to override everything */
[dir="rtl"] body header#masthead .navbar ul#menu-main {
    margin-left: 320px !important;
    margin-right: 0 !important;
    float: right !important;
    justify-content: flex-end !important;
}

[dir="rtl"] body header#masthead .navbar ul#menu-main.navbar-center {
    margin-left: 370px !important;
    margin-right: 0 !important;
    float: right !important;
    justify-content: flex-end !important;
}

[dir="rtl"] body header#masthead .navbar-collapse ul#menu-main {
    margin-left: 320px !important;
    margin-right: 0 !important;
    float: right !important;
    justify-content: flex-end !important;
}

/* Override any center alignment classes */
html[dir="rtl"] body .navbar-center {
    justify-content: flex-end !important;
    text-align: right !important;
    margin-left: 370px !important;
    margin-right: 0 !important;
}

html[dir="rtl"] body .navbar-collapse {
    justify-content: flex-end !important;
    text-align: right !important;
}

/* Override navbar-center with inline styles */
html[dir="rtl"] body .navbar-center[style] {
    margin-left: 370px !important;
    margin-right: 0 !important;
    justify-content: flex-end !important;
    text-align: right !important;
}

/* FINAL NUCLEAR OPTION - Header specific overrides */
html[dir="rtl"] body header#masthead ul#menu-main[style*="margin-left"] {
    margin-left: 370px !important;
    margin-right: 0 !important;
    float: right !important;
    justify-content: flex-end !important;
}

html[dir="rtl"] body header#masthead .container ul#menu-main {
    margin-left: 320px !important;
    margin-right: 0 !important;
    float: right !important;
    justify-content: flex-end !important;
}

html[dir="rtl"] body header#masthead .container .navbar-center {
    margin-left: 370px !important;
    margin-right: 0 !important;
    float: right !important;
    justify-content: flex-end !important;
}

/*--------------------------------------------------------------
# 2. CONTENT TYPOGRAPHY & ALIGNMENT
--------------------------------------------------------------*/
/* General text alignment for Hebrew content */
[dir="rtl"] body {
    direction: rtl !important;
    text-align: right !important;
}

[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, 
[dir="rtl"] h4, [dir="rtl"] h5, [dir="rtl"] h6 {
    font-family: 'Heebo', 'Rubik', 'Assistant', 'Open Sans', Arial, sans-serif;
    text-align: right;
}

[dir="rtl"] p, [dir="rtl"] div:not(.btn):not(.button) {
    text-align: right;
    direction: rtl;
}

/*--------------------------------------------------------------
# 3. HEBREW CONTENT SPECIFIC CLASSES
--------------------------------------------------------------*/
/* Hebrew content positioning */
[dir="rtl"] .hebrew-content {
    text-align: right !important;
    direction: rtl !important;
}

/* Page title with hebrew-content class */
[dir="rtl"] .page-title.hebrew-content {
    text-align: right !important;
    direction: rtl !important;
    padding-right: 50px !important;
    width: 100% !important;
}

/* Section title with hebrew-content class should be centered */
[dir="rtl"] .section-title.hebrew-content {
    text-align: center !important;
    direction: rtl !important;
}

[dir="rtl"] .section-title.hebrew-content h2,
[dir="rtl"] .section-title.hebrew-content p {
    text-align: center !important;
    direction: rtl !important;
}

/*--------------------------------------------------------------
# 4. PROJECTS ARCHIVE PAGE
--------------------------------------------------------------*/
/* Entry content in projects archive */
[dir="rtl"] .entry-content.hebrew-content {
    text-align: right !important;
    direction: rtl !important;
}

/* Entry title in projects */
[dir="rtl"] .entry-title.hebrew-content {
    text-align: right !important;
    direction: rtl !important;
}

/* Read more button positioning */
[dir="rtl"] .entry-content .btn,
[dir="rtl"] .entry-content .btn-default,
[dir="rtl"] .entry-content .more-link,
[dir="rtl"] .more-link {
    float: left !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    text-align: center !important;
    direction: ltr !important;
}

/* Hebrew blog posts - buttons in entry-footer should be left-aligned */
[dir="rtl"] .entry-footer.hebrew-content .btn,
[dir="rtl"] .entry-footer.hebrew-content .btn-default,
[dir="rtl"] .entry-footer.hebrew-content > .btn,
[dir="rtl"] .entry-footer.hebrew-content > .btn-default {
    float: left !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    text-align: left !important;
    direction: ltr !important;
}

/* English blog posts - buttons in entry-footer should be right-aligned */
[dir="rtl"] .entry-footer.english-content .btn,
[dir="rtl"] .entry-footer.english-content .btn-default,
[dir="rtl"] .entry-footer.english-content > .btn,
[dir="rtl"] .entry-footer.english-content > .btn-default {
    float: right !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    text-align: right !important;
    direction: ltr !important;
}

/* Maximum specificity for Hebrew blog post buttons */
html[dir="rtl"] body .entry-footer.hebrew-content .btn.btn-default.hebrew-content {
    float: left !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    text-align: left !important;
    direction: ltr !important;
}

/* Maximum specificity for English blog post buttons */
html[dir="rtl"] body .entry-footer.english-content .btn.btn-default.english-content {
    float: right !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    text-align: right !important;
    direction: ltr !important;
}

/* Nuclear option - maximum specificity for Hebrew blog posts */
html[dir="rtl"] body .home .entry-footer.hebrew-content .btn.btn-default.hebrew-content,
html[dir="rtl"] body .blog .entry-footer.hebrew-content .btn.btn-default.hebrew-content,
html[dir="rtl"] body .archive .entry-footer.hebrew-content .btn.btn-default.hebrew-content {
    float: left !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    text-align: left !important;
    direction: ltr !important;
    display: block !important;
}

/* Nuclear option - maximum specificity for English blog posts */
html[dir="rtl"] body .home .entry-footer.english-content .btn.btn-default.english-content,
html[dir="rtl"] body .blog .entry-footer.english-content .btn.btn-default.english-content,
html[dir="rtl"] body .archive .entry-footer.english-content .btn.btn-default.english-content {
    float: right !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    text-align: right !important;
    direction: ltr !important;
    display: block !important;
}

/* Ultimate nuclear option with exact path - Hebrew */
html[dir="rtl"] body div.col-md-12 div#primary main#main article.post footer.entry-footer.hebrew-content a.btn.btn-default.hebrew-content {
    float: left !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    text-align: left !important;
    direction: ltr !important;
    display: block !important;
}

/* Ultimate nuclear option with exact path - English */
html[dir="rtl"] body div.col-md-12 div#primary main#main article.post footer.entry-footer.english-content a.btn.btn-default.english-content {
    float: right !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    text-align: right !important;
    direction: ltr !important;
    display: block !important;
}

/* ABSOLUTE FINAL NUCLEAR OPTION - Hebrew blog buttons with max possible specificity */
html[dir="rtl"] body .col-md-12 .content-area .site-main article.post footer.entry-footer.hebrew-content a.btn.btn-default.hebrew-content {
    float: left !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    text-align: left !important;
    direction: ltr !important;
    display: block !important;
    clear: left !important;
}

/* ABSOLUTE FINAL NUCLEAR OPTION - English blog buttons with max possible specificity */
html[dir="rtl"] body .col-md-12 .content-area .site-main article.post footer.entry-footer.english-content a.btn.btn-default.english-content {
    float: right !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    text-align: right !important;
    direction: ltr !important;
    display: block !important;
    clear: right !important;
}

/* Force the entry-footer itself to cooperate */
html[dir="rtl"] body .col-md-12 .content-area .site-main article.post footer.entry-footer.hebrew-content {
    text-align: left !important;
    direction: ltr !important;
    clear: both !important;
}

html[dir="rtl"] body .col-md-12 .content-area .site-main article.post footer.entry-footer.english-content {
    text-align: right !important;
    direction: ltr !important;
    clear: both !important;
}

/* Override any styles from entry-content that might affect buttons */
html[dir="rtl"] body .entry-content.hebrew-content + footer.entry-footer.hebrew-content a.btn.btn-default.hebrew-content {
    float: left !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    text-align: left !important;
    direction: ltr !important;
    display: block !important;
}

html[dir="rtl"] body .entry-content.hebrew-content + footer.entry-footer.english-content a.btn.btn-default.english-content {
    float: right !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    text-align: right !important;
    direction: ltr !important;
    display: block !important;
}

/* Simple and direct selectors for all blog post buttons */
html[dir="rtl"] .post footer.entry-footer.hebrew-content a.btn {
    float: left !important;
    text-align: left !important;
    display: block !important;
}

html[dir="rtl"] .post footer.entry-footer.english-content a.btn {
    float: right !important;
    text-align: right !important;
    display: block !important;
}

/* Target the exact structure we see in HTML */
html[dir="rtl"] article.post footer.entry-footer.hebrew-content a.btn.btn-default.hebrew-content {
    float: left !important;
    text-align: left !important;
    margin: 0 !important;
    direction: ltr !important;
}

html[dir="rtl"] article.post footer.entry-footer.english-content a.btn.btn-default.english-content {
    float: right !important;
    text-align: right !important;
    margin: 0 !important;
    direction: ltr !important;
}

/* Final solution based on exact HTML structure */
html[dir="rtl"] body.rtl.blog article#post-445.post.type-post footer.entry-footer.hebrew-content a.btn.btn-default.hebrew-content {
    float: left !important;
    text-align: left !important;
    margin: 0 !important;
    padding: 8px 16px !important;
}

/* Generic but powerful selector for ALL Hebrew blog buttons */  
html[dir="rtl"] body.rtl article.post footer.entry-footer.hebrew-content > a[class*="btn"] {
    float: left !important;
    text-align: left !important;
    direction: ltr !important;
}

/* Generic but powerful selector for ALL English blog buttons */
html[dir="rtl"] body.rtl article.post footer.entry-footer.english-content > a[class*="btn"] {
    float: right !important;
    text-align: right !important;
    direction: ltr !important;
}

/* WPForms submit button positioning - Contact page */
[dir="rtl"] #wpforms-form-488 .wpforms-submit-container {
    text-align: left !important;
    direction: ltr !important;
}

[dir="rtl"] #wpforms-form-488 .wpforms-submit {
    direction: rtl !important;
    float: left !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Additional specificity for contact form submit button */
html[dir="rtl"] body #wpforms-form-488 .wpforms-submit-container {
    text-align: left !important;
    direction: ltr !important;
    display: flex !important;
    justify-content: flex-start !important;
}

html[dir="rtl"] body #wpforms-form-488 .wpforms-submit-container .wpforms-submit {
    float: left !important;
    margin-left: 0 !important;
    margin-right: auto !important;
    direction: rtl !important;
}

/* Nuclear option for contact form button positioning */
html[dir="rtl"] body.rtl #wpforms-form-488 .wpforms-submit-container button.wpforms-submit {
    float: left !important;
    margin-left: 0 !important;
    margin-right: auto !important;
    text-align: center !important;
    direction: ltr !important;
}

/* Blog posts full width styling when sidebar is hidden */
[dir="rtl"] .col-md-12 .entry-content {
    max-width: 100%;
}

/*--------------------------------------------------------------
# 5. SINGLE PROJECT PAGE LAYOUT
--------------------------------------------------------------*/
/* Single album header layout - Hebrew: TEXT LEFT, IMAGE RIGHT */
[dir="rtl"] .single-album-header-wrap {
    display: block !important;
    overflow: hidden !important;
}

[dir="rtl"] .single-album-header-wrap .post-thumbnail {
    float: right !important;
    margin-left: 30px !important;
    margin-right: 0 !important;
    max-width: 50% !important;
}

[dir="rtl"] .single-album-header-wrap .entry-header {
    float: left !important;
    width: 45% !important;
    text-align: right !important;
    direction: rtl !important;
}

/* Clearfix for single album header */
[dir="rtl"] .single-album-header-wrap:after {
    content: "" !important;
    display: table !important;
    clear: both !important;
}

/* Center album info for Hebrew version */
[dir="rtl"] .single-album-infos {
    text-align: center !important;
}

[dir="rtl"] .single-album-infos .album-infos-wrap {
    text-align: center !important;
    display: flex !important;
    justify-content: center !important;
    flex-direction: row !important;
    align-items: center !important;
    flex-wrap: wrap !important;
}

[dir="rtl"] .single-album-infos .album-info-item {
    text-align: center !important;
    margin: 0 15px !important;
    display: inline-block !important;
}

/*--------------------------------------------------------------
# 6. OVERRIDE INLINE STYLES (Maximum Specificity)
--------------------------------------------------------------*/
/* Override flexbox inline styles with maximum specificity */
html[dir="rtl"] body .single-album-header-wrap[style*="display: flex"] {
    display: block !important;
}

html[dir="rtl"] body .single-album-header-wrap[style*="flex-direction"] {
    flex-direction: unset !important;
}

/* Override order and flex inline styles with exact patterns */
html[dir="rtl"] body .single-album-header-wrap .post-thumbnail[style*="order: 2"][style*="flex: 0 0 auto"] {
    order: unset !important;
    flex: unset !important;
    float: right !important;
    margin-left: 30px !important;
    margin-right: 0 !important;
    max-width: 50% !important;
}

html[dir="rtl"] body .single-album-header-wrap .entry-header[style*="order: 1"][style*="flex: 1 1 0%"] {
    order: unset !important;
    flex: unset !important;
    float: left !important;
    width: 45% !important;
    text-align: right !important;
    direction: rtl !important;
}

/* Nuclear option - target exact inline style patterns */
html[dir="rtl"] body div[style*="display: flex !important"][style*="flex-direction: row-reverse !important"] {
    display: block !important;
}

html[dir="rtl"] body div[style*="order: 2 !important"][style*="flex: 0 0 auto !important"] {
    order: unset !important;
    flex: unset !important;
    float: right !important;
    margin-left: 30px !important;
    margin-right: 0 !important;
    max-width: 50% !important;
}

html[dir="rtl"] body header[style*="order: 1 !important"][style*="flex: 1 1 0% !important"] {
    order: unset !important;
    flex: unset !important;
    float: left !important;
    width: 45% !important;
    text-align: right !important;
    direction: rtl !important;
}

/*--------------------------------------------------------------
# 7. HOMEPAGE SECTIONS
--------------------------------------------------------------*/
/* Center homepage sections in Hebrew */
[dir="rtl"] .home .section-title,
[dir="rtl"] .home .hero-section .stuff {
    text-align: center !important;
    direction: ltr !important;
    margin: 0 auto !important;
}

/* Homepage social icons should stay centered - BUT ONLY in hero section */
[dir="rtl"] .home .hero-section .header-social {
    text-align: center !important;
    direction: ltr !important;
    margin: 0 auto !important;
    float: none !important;
    justify-content: center !important;
}

[dir="rtl"] .home .hero-section .header-social .social-icon {
    margin-left: 12px !important;
    margin-right: 12px !important;
}

/*--------------------------------------------------------------
# 8. FOOTER
--------------------------------------------------------------*/
/* Center footer content in Hebrew */
[dir="rtl"] .site-footer .without-widgets {
    text-align: center !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
}

[dir="rtl"] .site-footer .header-social {
    text-align: center !important;
    justify-content: center !important;
    margin: 20px auto !important;
    float: none !important;
}

/*--------------------------------------------------------------
# 9. MOBILE RESPONSIVE
--------------------------------------------------------------*/
@media (max-width: 991px) {
    [dir="rtl"] .site-branding {
        float: left !important;
        margin-left: 0 !important;
        text-align: left !important;
    }
    
    [dir="rtl"] .header-social {
        float: right !important;
        text-align: right;
    }
    
    [dir="rtl"] .navbar-collapse {
        text-align: right;
    }
}

@media (max-width: 768px) {
    [dir="rtl"] .hero-section .stuff,
    [dir="rtl"] .section-title {
        text-align: center;
        margin: 0 auto;
    }
}

/*--------------------------------------------------------------
# 10. GENERAL RTL FIXES
--------------------------------------------------------------*/
/* Preserve LTR for buttons - BUT NOT for Hebrew/English blog post buttons */
[dir="rtl"] .btn:not(.hebrew-content):not(.english-content),
[dir="rtl"] .button:not(.hebrew-content):not(.english-content),
[dir="rtl"] input[type="submit"] {
    direction: ltr;
    text-align: center;
}

/* Dropdown menus */
[dir="rtl"] .dropdown-menu {
    left: auto !important;
    right: 0 !important;
}

/* Pagination */
[dir="rtl"] .nav-previous {
    float: right;
}

[dir="rtl"] .nav-next {
    float: left;
}

/* Search form */
[dir="rtl"] .search-form .search-field {
    text-align: right;
    padding-right: 15px;
    padding-left: 40px;
}

/* תיקון כפתור Read More בעמוד הבלוג - יישור לשמאל בעברית */
[dir="rtl"] .blog a.btn.btn-default,
[dir="rtl"] .blog a.btn-default,
[dir="rtl"] .archive:not(.post-type-archive-albums) a.btn.btn-default,
[dir="rtl"] .archive:not(.post-type-archive-albums) a.btn-default {
    right: auto !important;
    left: 30px !important;
}

/* תיקון כפתור שלח בדף צור קשר - כפתור צריך להיות משמאל */
[dir="rtl"] .page-template .wpforms-container .wpforms-submit-container,
[dir="rtl"] .page .wpforms-container .wpforms-submit-container,
[dir="rtl"] body.page .wpforms-container .wpforms-submit-container {
    text-align: left !important;
    direction: ltr !important;
}

[dir="rtl"] .page-template .wpforms-container .wpforms-submit,
[dir="rtl"] .page .wpforms-container .wpforms-submit,
[dir="rtl"] body.page .wpforms-container .wpforms-submit {
    float: left !important;
    margin-left: 0 !important;
    margin-right: auto !important;
}
