/* BlogHash Child Theme: RTL adjustments for child-added components only. */

html[dir="rtl"] .bhc2-header-notice { text-align: right; }
html[dir="rtl"] .bhc2-preloader { direction: ltr; }

/* Equal top-level navigation spacing in the native BlogHash RTL header. */
@media only screen and (min-width: 869px) {
    html[dir="rtl"] #bloghash-header-inner .bloghash-nav > ul {
        display: flex;
        align-items: center;
        gap: 20px;
    }

    html[dir="rtl"] #bloghash-header-inner .bloghash-nav > ul > li {
        margin-right: 0;
        margin-left: 0;
    }
}

/* Horizontal post card: preserve right-side RTL media without parent offset overlap. */
@media only screen and (min-width: 869px) {
    html[dir="rtl"] body.bloghash-layout__boxed-separated.bloghash-blog-image-wrap .bloghash-blog-horizontal .bloghash-article:not(.format-quote) .bloghash-blog-entry-wrapper.bloghash-thumb-left .entry-media,
    html[dir="rtl"] body.bloghash-layout__boxed-separated.bloghash-blog-image-wrap.bloghash-blog-horizontal .bloghash-article:not(.format-quote) .bloghash-blog-entry-wrapper.bloghash-thumb-left .entry-media {
        margin-right: 0;
        margin-left: 3rem;
    }
}

/* Single-product gallery spacing: mirror BlogHash's LTR 5rem image-to-summary gap in RTL. */
@media screen and (min-width: 769px) {
    html[dir="rtl"] .woocommerce div.product .bloghash-wc-product-wrap .images {
        margin-right: 0;
        margin-left: 5rem;
    }
}

/* Preserve BlogHash header geometry when external typography assigns a font in RTL. */
@media only screen and (min-width: 869px) {
    html[dir="rtl"] #bloghash-header-inner,
    html[dir="rtl"] #bloghash-header-inner .bloghash-header-container,
    html[dir="rtl"] #bloghash-header-inner .bloghash-logo,
    html[dir="rtl"] #bloghash-header-inner .bloghash-nav,
    html[dir="rtl"] #bloghash-header-inner .bloghash-nav > ul {
        direction: rtl !important;
    }

    html[dir="rtl"] #bloghash-header-inner .bloghash-header-container {
        flex-direction: row !important;
    }

    html[dir="rtl"] body.bloghash-header-layout-1 #bloghash-header-inner .bloghash-header-container .bloghash-logo {
        margin-right: 0 !important;
        margin-left: auto !important;
        text-align: right !important;
    }

    html[dir="rtl"] #bloghash-header-inner .bloghash-logo .site-title,
    html[dir="rtl"] #bloghash-header-inner .bloghash-logo .site-description,
    html[dir="rtl"] #bloghash-header-inner .bloghash-nav {
        text-align: right !important;
    }

    html[dir="rtl"] #bloghash-header-inner .bloghash-nav > ul {
        justify-content: flex-start !important;
    }
}

/* Header layout 1: keep branding and navigation beside one another in RTL. */
@media only screen and (min-width: 869px) {
    html[dir="rtl"] body.rtl.bloghash-header-layout-1:not(.bloghash-is-mobile) #bloghash-header-inner .bloghash-header-container {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: flex-start !important;
    }

    html[dir="rtl"] body.rtl.bloghash-header-layout-1:not(.bloghash-is-mobile) #bloghash-header-inner .bloghash-header-container .bloghash-logo {
        flex: 0 0 auto !important;
        margin-right: 0 !important;
        margin-left: 2.4rem !important;
        text-align: right !important;
    }

    html[dir="rtl"] body.rtl.bloghash-header-layout-1:not(.bloghash-is-mobile) #bloghash-header-inner .bloghash-header-container .bloghash-nav {
        flex: 1 1 auto !important;
        min-width: 0;
        align-self: center;
        text-align: right !important;
    }

    html[dir="rtl"] body.rtl.bloghash-header-layout-1:not(.bloghash-is-mobile) #bloghash-header-inner .bloghash-header-container .bloghash-nav > ul {
        justify-content: flex-start !important;
    }
}

/* My Account/sidebar gap: retain the parent LTR-sized separation in RTL when the sidebar is visually left. */
@media only screen and (min-width: 769px) {
    html[dir="rtl"] body.bloghash-sidebar-position__right-sidebar #primary {
        padding-right: 0 !important;
        padding-left: 5rem !important;
    }
}


/* My Account navigation: place the RTL icon gap between the native pseudo-icon and its menu label. */
html[dir="rtl"] #main .woocommerce-MyAccount-navigation ul li:before {
    margin-right: 0;
    margin-left: 1.6rem;
}


/* Cart and Checkout notices: mirror BlogHash's native left-border/icon arrangement in RTL. */
html[dir="rtl"] body.woocommerce-cart #page .woocommerce-error,
html[dir="rtl"] body.woocommerce-cart #page .woocommerce-info,
html[dir="rtl"] body.woocommerce-cart #page .woocommerce-message,
html[dir="rtl"] body.woocommerce-checkout #page .woocommerce-error,
html[dir="rtl"] body.woocommerce-checkout #page .woocommerce-info,
html[dir="rtl"] body.woocommerce-checkout #page .woocommerce-message {
    border-left-width: 0;
    border-right-width: .4rem;
    border-radius: .3rem 0 0 .3rem;
    padding: 1.28rem 5rem 1.28rem 3.2rem;
}

html[dir="rtl"] body.woocommerce-cart #page .woocommerce-error:before,
html[dir="rtl"] body.woocommerce-cart #page .woocommerce-info:before,
html[dir="rtl"] body.woocommerce-cart #page .woocommerce-message:before,
html[dir="rtl"] body.woocommerce-checkout #page .woocommerce-error:before,
html[dir="rtl"] body.woocommerce-checkout #page .woocommerce-info:before,
html[dir="rtl"] body.woocommerce-checkout #page .woocommerce-message:before {
    right: 2rem;
    left: auto;
}


/* Cart checkout button: place BlogHash's native RTL arrow at the physical left edge. */
html[dir="rtl"] body.woocommerce-cart .bloghash-woo-checkout.btn-right-icon > svg {
    position: absolute;
    right: auto;
    left: 1.28rem;
    margin-right: 0;
    margin-left: 0;
}
