/* =====================================================================
   Language switcher + right-to-left support
   Loaded site-wide (the switcher lives in the header).
   ===================================================================== */

.r1h-lang {
    position: relative;
    display: inline-block;
}
.r1h-lang__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.75rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
    color: #e2e8f0;
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    list-style: none;
    white-space: nowrap;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}
.r1h-lang__btn::-webkit-details-marker { display: none; }
.r1h-lang__btn:hover { border-color: var(--primary-color, #10b981); background: rgba(255, 255, 255, 0.1); }
.r1h-lang__caret { font-size: 0.7rem; transition: transform 0.2s ease; }
.r1h-lang[open] .r1h-lang__caret { transform: rotate(180deg); }

.r1h-lang__list {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    z-index: 1050;
    min-width: 210px;
    margin: 0;
    padding: 0.4rem;
    list-style: none;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: #131c2e;
    box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.8);
}
.r1h-lang__item {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.5rem 0.7rem;
    border-radius: 9px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.9rem;
}
.r1h-lang__item:hover { background: rgba(255, 255, 255, 0.07); color: #fff; text-decoration: none; }
.r1h-lang__item.is-active { background: rgba(16, 185, 129, 0.14); color: #6ee7b7; }
.r1h-lang__native { font-weight: 600; }
.r1h-lang__name { font-size: 0.78rem; color: #94a3b8; }

/* the switcher also appears in the mobile menu, where it must not float */
.r1bbit-mobile-menu .r1h-lang { display: block; }
.r1bbit-mobile-menu .r1h-lang__btn { width: 100%; justify-content: space-between; }
.r1bbit-mobile-menu .r1h-lang__list { position: static; margin-top: 0.5rem; min-width: 0; }

/* ---------------------------------------------------------------------
   RTL — Arabic and Urdu. Only the pieces that actually carry a direction:
   the rest of the home page is built with logical properties or is centred.
   --------------------------------------------------------------------- */
.r1h-rtl .r1h-lang__list { right: auto; left: 0; }

.r1h-rtl .r1h-head--left,
.r1h-rtl .r1h-story__text,
.r1h-rtl .r1h-mobile__text { text-align: right; }

.r1h-rtl .r1h-story__facts li,
.r1h-rtl .r1h-points li,
.r1h-rtl .r1h-mobile__feature,
.r1h-rtl .r1h-family__list li { direction: rtl; }

.r1h-rtl .r1h-story__against {
    padding-left: 0;
    padding-right: 0.9rem;
    border-left: 0;
    border-right: 2px solid rgba(255, 255, 255, 0.15);
}
.r1h-rtl .r1h-pillar__num { right: auto; left: 1.5rem; }
.r1h-rtl .r1h-flow__step::after { right: auto; left: -0.95rem; transform: translateY(-50%) rotate(180deg); }
.r1h-rtl .r1h-hero__badge { left: auto; right: -1.25rem; }
.r1h-rtl .r1h-link:hover i { transform: translateX(-3px); }
.r1h-rtl .r1h-board__link i,
.r1h-rtl .r1h-btn i.bi-arrow-right { transform: scaleX(-1); }

/* code, command names and CONFIG blocks stay left-to-right in every language */
.r1h-rtl .r1h-code,
.r1h-rtl .r1h-code pre,
.r1h-rtl .r1h-chip--mono,
.r1h-rtl .r1h-window__title,
.r1h-rtl .r1h-code__file { direction: ltr; text-align: left; }
