/*
 * RTL (Right-to-Left) Styles for Kolhakfar Theme
 * Hebrew Language Support
 */

/* General RTL Adjustments */
body.rtl {
    direction: rtl;
    text-align: right;
    font-family: 'Heebo', Arial, sans-serif;
}

/* Typography */
body.rtl,
body.rtl p,
body.rtl h1,
body.rtl h2,
body.rtl h3,
body.rtl h4,
body.rtl h5,
body.rtl h6,
body.rtl li,
body.rtl span,
body.rtl div {
    font-family: "Noto Sans Hebrew", Sans-serif;
}

/* Navigation */
body.rtl .site-navigation ul {
    text-align: right;
}

body.rtl .site-navigation li {
    float: right;
    margin-left: 0;
    margin-right: 1em;
}

/* Content */
body.rtl .site-content {
    text-align: right;
}

body.rtl .entry-content {
    text-align: right;
}

/* Forms */
body.rtl input[type="text"],
body.rtl input[type="email"],
body.rtl input[type="url"],
body.rtl input[type="password"],
body.rtl input[type="search"],
body.rtl input[type="number"],
body.rtl input[type="tel"],
body.rtl input[type="range"],
body.rtl input[type="date"],
body.rtl input[type="month"],
body.rtl input[type="week"],
body.rtl input[type="time"],
body.rtl input[type="datetime"],
body.rtl input[type="datetime-local"],
body.rtl input[type="color"],
body.rtl textarea,
body.rtl select {
    text-align: right;
    direction: rtl;
}

/* Buttons */
body.rtl .wp-block-button .wp-block-button__link {
    text-align: center;
}

/* Lists */
body.rtl ul,
body.rtl ol {
    padding-right: 1.5em;
    padding-left: 0;
}

body.rtl li {
    text-align: right;
}

/* Blockquotes */
body.rtl blockquote {
    border-right: 4px solid #ddd;
    border-left: none;
    padding-right: 1em;
    padding-left: 0;
    margin-right: 0;
    text-align: right;
}

/* Tables */
body.rtl table {
    text-align: right;
}

body.rtl th,
body.rtl td {
    text-align: right;
}

/* Images and Media */
body.rtl .alignleft {
    float: right;
    margin-left: 1.5em;
    margin-right: 0;
}

body.rtl .alignright {
    float: left;
    margin-right: 1.5em;
    margin-left: 0;
}

/* WordPress Specific */
body.rtl .wp-caption-text {
    text-align: right;
}

body.rtl .gallery-caption {
    text-align: right;
}

/* Comments */
body.rtl .comment-content {
    text-align: right;
}

body.rtl .comment-meta {
    text-align: right;
}

body.rtl .comment-author {
    float: right;
}

body.rtl .comment-metadata {
    text-align: right;
}

/* Widgets */
body.rtl .widget {
    text-align: right;
}

body.rtl .widget ul {
    padding-right: 0;
    list-style-position: inside;
}

body.rtl .widget li {
    text-align: right;
}

/* Footer */
body.rtl .site-footer {
    text-align: right;
}

/* Radio Player RTL Adjustments */
body.rtl .kolhakfar-radio-player {
    direction: rtl;
    padding: 0;
}

body.rtl .radio-controls {
    flex-direction: row-reverse;
}

body.rtl .radio-info {
    text-align: right;
}

body.rtl .radio-info h3 {
    text-align: right;
}

body.rtl .radio-metadata {
    text-align: right;
}

body.rtl .radio-metadata .current-song {
    text-align: right;
}

body.rtl .radio-metadata .station-info {
    text-align: right;
}

body.rtl .volume-control {
    flex-direction: row-reverse;
}

body.rtl .volume-control label {
    margin-left: 10px;
    margin-right: 0;
}

body.rtl .radio-actions {
    justify-content: flex-start;
}

body.rtl .popout-btn {
    margin-left: 0;
    margin-right: 10px;
}

/* Responsive RTL Adjustments */
@media (max-width: 768px) {
    body.rtl .kolhakfar-radio-player {
        text-align: right;
    }
    
    body.rtl .radio-controls {
        flex-direction: column;
        align-items: flex-end;
    }
    
    body.rtl .radio-info {
        order: 1;
        text-align: right;
    }
    
    body.rtl .radio-actions {
        order: 2;
        justify-content: flex-end;
        margin-top: 10px;
    }
}

/* Hebrew Font Optimization */
body.lang-hebrew {
    font-feature-settings: "kern" 1, "liga" 1;
    -webkit-font-feature-settings: "kern" 1, "liga" 1;
    -moz-font-feature-settings: "kern" 1, "liga" 1;
    text-rendering: optimizeLegibility;
}

/* Fix for Hebrew punctuation */
body.lang-hebrew .radio-metadata .current-song::before {
    content: "♪ ";
    margin-left: 5px;
    margin-right: 0;
}

body.lang-hebrew .radio-metadata .station-info::before {
    content: "📻 ";
    margin-left: 5px;
    margin-right: 0;
}

/* Ensure proper Hebrew text flow */
body.rtl * {
    unicode-bidi: embed;
}

body.rtl .radio-metadata * {
    unicode-bidi: plaintext;
}

/* Fix for mixed content (Hebrew + English) */
body.rtl .mixed-content {
    unicode-bidi: plaintext;
    text-align: right;
}

/* Print styles for RTL */
@media print {
    body.rtl {
        direction: rtl;
        text-align: right;
    }
    
    body.rtl .kolhakfar-radio-player {
        display: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    body.rtl .kolhakfar-radio-player {
        border: 2px solid;
    }
    
    body.rtl .radio-controls button {
        border: 2px solid;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    body.rtl .waveform-bar {
        animation: none;
    }
    
    body.rtl .radio-loading {
        animation: none;
    }
}

/* Dark mode RTL adjustments */
@media (prefers-color-scheme: dark) {
    body.rtl .kolhakfar-radio-player {
        background: rgba(30, 30, 30, 0.95);
        color: #ffffff;
    }
    
    body.rtl .radio-controls button {
        background: rgba(255, 255, 255, 0.1);
        color: #ffffff;
    }
    
    body.rtl .radio-controls button:hover {
        background: rgba(255, 255, 255, 0.2);
    }
}