/* ===============================================
   HEBREW (RTL) SUPPORT
   =============================================== */

/* הגדרת גופן עברי מומלץ שמשתלב טוב עם העיצוב הקיים */
@import url('https://fonts.googleapis.com/css2?family=Assistant:wght@300;400;600;700&display=swap');

html[dir="rtl"], html[dir="rtl"] body {
    font-family: 'Assistant', 'Inter', 'Segoe UI', sans-serif;
    text-align: right;
}

/* היפוך הלוגו */
html[dir="rtl"] .logo {
    gap: 0.75rem;
}
html[dir="rtl"] .logo-image + .logo-text {
    margin-left: 0;
    margin-right: 0;
}

/* Desktop nav ul - flex row reversed for RTL */
@media (min-width: 769px) {
    html[dir="rtl"] nav ul {
        display: flex !important;
        flex-direction: row-reverse !important;
        justify-content: flex-start !important;
        width: 100%;
    }
}

/* ============================================
   MOBILE FIX - Override all conflicting rules
   ============================================ */
@media (max-width: 768px) {
    /* Force hamburger button visible */
    html[dir="rtl"] .menu-toggle {
        display: block !important;
    }
    
    /* Hide menu by default, show only when .show class is added */
    html[dir="rtl"] nav ul {
        display: none !important;
        flex-direction: column !important;
        position: fixed !important;
        top: 70px !important;
        left: 0 !important;
        right: 0 !important;
        width: auto !important;
        background: rgba(255, 255, 255, 0.98) !important;
        backdrop-filter: blur(15px) !important;
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1) !important;
        padding: 2rem !important;
        z-index: 200 !important;
        max-height: calc(100vh - 70px) !important;
        gap: 0 !important;
        margin-top: 0 !important;
        border-radius: 0 !important;
        grid-template-columns: none !important;
    }
    
    /* Show menu when toggled */
    html[dir="rtl"] nav ul.show {
        display: flex !important;
    }
    
    html[dir="rtl"] nav ul li {
        text-align: center !important;
        margin: 1rem 0 !important;
    }
    
    /* Hide language switcher list item from collapsed menu */
    html[dir="rtl"] nav ul li.language-switch {
        display: none !important;
    }
    
    /* Header layout */
    html[dir="rtl"] .header-content {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        gap: 1rem !important;
    }
    
    html[dir="rtl"] .header-controls {
        display: flex !important;
        align-items: center !important;
        gap: 1rem !important;
    }
}

@media (max-width: 480px) {
    html[dir="rtl"] nav ul {
        display: none !important;
        grid-template-columns: none !important;
    }
    html[dir="rtl"] nav ul.show {
        display: flex !important;
    }
}

/* List item bullets adjustments */
html[dir="rtl"] .pattern-card li,
html[dir="rtl"] .science-card li,
html[dir="rtl"] .opportunity-card li,
html[dir="rtl"] .recognition-tier li {
    padding-left: 0;
    padding-right: 1.8rem;
    text-align: right;
}

html[dir="rtl"] .pattern-card li:before,
html[dir="rtl"] .science-card li:before,
html[dir="rtl"] .recognition-tier li:before {
    left: auto;
    right: 0;
    transform: scaleX(-1);
}

/* Card border flips */
html[dir="rtl"] .pattern-card::before {
    left: auto;
    right: 0;
}

html[dir="rtl"] .treatment,
html[dir="rtl"] .research-note,
html[dir="rtl"] .research-item,
html[dir="rtl"] .trauma-integration,
html[dir="rtl"] .blog-post,
html[dir="rtl"] .recognition-tier {
    border-left: none;
    border-right: 4px solid;
    text-align: right;
}

/* Grid flips */
@media (min-width: 769px) {
    html[dir="rtl"] .problem-solution,
    html[dir="rtl"] .two-patterns,
    html[dir="rtl"] .story-content {
        direction: rtl;
    }
}

/* Hero section */
html[dir="rtl"] .hero h1, 
html[dir="rtl"] .hero p, 
html[dir="rtl"] .hero-subtitle {
    text-align: center;
}

/* Icon position fixes */
html[dir="rtl"] .core-principle::before {
    right: auto;
    left: 1.5rem;
}

html[dir="rtl"] .highlight-card h4::after {
    right: auto;
    left: -25px;
}
