/* The bundled stylesheet forces `html { direction: rtl }`, which overrides the dir attribute.
   Restore the direction the page actually requested. */
html[dir="ltr"] { direction: ltr; }
html[dir="rtl"] { direction: rtl; }

html[dir="ltr"] #hero-slider,
html[dir="ltr"] #hero-slider .embla__viewport,
html[dir="ltr"] #hero-slider .embla__container { direction: ltr; }
html[dir="rtl"] #hero-slider,
html[dir="rtl"] #hero-slider .embla__viewport,
html[dir="rtl"] #hero-slider .embla__container { direction: rtl; }

/* Language switcher — one compact segmented control */
.tb-lang-switcher {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px;
    border-radius: 999px;
    border: 1px solid rgba(10, 17, 40, 0.12);
    background: rgba(255, 255, 255, 0.92);
    line-height: 1;
    flex: 0 0 auto;
}
.tb-lang-switcher .tb-lang-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 26px;
    padding: 0 8px;
    border-radius: 999px;
    border: 0;
    text-decoration: none;
    color: #0A1128;
    background: transparent;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.02em;
    transition: background .2s ease, color .2s ease;
}
.tb-lang-switcher .tb-lang-link:hover {
    color: #ED1C24;
}
.tb-lang-switcher .tb-lang-link.is-active {
    background: #0A1128;
    color: #fff;
}
.tb-lang-switcher--admin .tb-lang-link.is-active,
.tb-lang-switcher--user .tb-lang-link.is-active {
    background: var(--primary, #1e3a8a);
    border-color: var(--primary, #1e3a8a);
}

/* Public site: inherit page direction from <html dir> */
html[dir="ltr"] body,
html[dir="rtl"] body {
    direction: inherit;
    text-align: start;
}
html[dir="ltr"] .text-right { text-align: left !important; }
html[dir="ltr"] .text-left { text-align: right !important; }

/* Header/nav blocks that were hard-locked to RTL */
html[dir="ltr"] .tb-header-nav,
html[dir="ltr"] .tb-header-shell,
html[dir="ltr"] nav.w-full,
html[dir="ltr"] .tb-public-topbar-shell,
html[dir="ltr"] .tb-public-topbar-side {
    direction: ltr;
}
html[dir="rtl"] .tb-header-nav,
html[dir="rtl"] .tb-header-shell,
html[dir="rtl"] .tb-public-topbar-shell,
html[dir="rtl"] .tb-public-topbar-side {
    direction: rtl;
}

/* Footer / public sections locked to RTL in CSS */
html[dir="ltr"] .tb-footer-final-grid,
html[dir="ltr"] .tb-companies-footer-heading,
html[dir="ltr"] footer,
html[dir="ltr"] .tb-home-faq,
html[dir="ltr"] .tb-success-partners,
html[dir="ltr"] .tb-branches,
html[dir="ltr"] .tb-success-mantra,
html[dir="ltr"] .tb-services-growth {
    direction: ltr;
}
html[dir="ltr"] .tb-footer-final-grid {
    direction: ltr;
}

/* Keep the language pill from collapsing into neighboring nav text */
.tb-header-nav .tb-lang-switcher,
nav .tb-lang-switcher {
    margin-inline: 4px;
    flex-shrink: 0;
    white-space: nowrap;
    overflow: visible;
}
.tb-lang-switcher .tb-lang-link {
    min-width: 34px;
}

/* Partners carousel: LTR layout, readable names, correct arrow sides */
html[dir="ltr"] .tb-sp-track {
    transform: translate3d(0, 0, 0);
}
html[dir="ltr"] .tb-sp-arrow--prev {
    left: 15px;
    right: auto;
}
html[dir="ltr"] .tb-sp-arrow--next {
    right: 15px;
    left: auto;
}
html[dir="ltr"] .tb-sp-name {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.35;
    min-height: 2.7em;
}
html[dir="ltr"] .tb-sp-bottom {
    flex-direction: row;
}
html[dir="ltr"] .tb-sp-all i.fa-arrow-left {
    transform: scaleX(-1);
}

@media (max-width: 1023px) {
    html, body { overflow-x: hidden; }
    .tb-lang-switcher--menu {
        margin: 0;
        background: #fff;
    }
    .tb-footer-final-grid,
    .tb-footer-sitemap-groups,
    .tb-services-growth,
    .tb-success-partners,
    .tb-home-faq {
        max-width: 100%;
    }
    .tb-footer-sitemap-groups {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 640px) {
    .tb-footer-sitemap-groups {
        grid-template-columns: 1fr;
    }
    .tb-lang-switcher .tb-lang-link {
        min-width: 40px;
        height: 30px;
    }
}

/* Reviews carousel cards: start-aligned copy in English */
html[dir="ltr"] [data-tb-review-carousel] .tb-review-card-text,
html[dir="ltr"] [data-tb-review-carousel] .text-right {
    text-align: left !important;
}
html[dir="ltr"] [data-tb-review-carousel] [data-tb-review-track] {
    direction: ltr;
}

/* Timeline intro: keep the long history blurb inside the container */
html[dir="ltr"] .tb-timeline-intro,
.tb-timeline-intro {
    max-width: 42rem;
    margin-inline: auto;
    display: -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

