/*==============================================================
  20. RTL Support
  Most of the layout already flips on its own: the stylesheets use
  logical properties (padding-inline-start, inset-inline-end, ...)
  that follow the page direction. This file only covers what logical
  properties can't express.

  Turn RTL on with <html dir="rtl"> (and set lang, e.g. lang="ar"),
  or with the Direction control in the theme switcher. Phone numbers
  and counter digits stay left to right on purpose.
================================================================*/
@use "breakpoints" as bp;

[dir="rtl"] {
  /* Hover underlines and wipes start from the right edge. */
  --cs-edge-start: 100%;
  --cs-edge-end: 0%;

  /* Bootstrap's reboot pads lists on the left; the template pads the
     inline start instead, so drop Bootstrap's side. */
  ul,
  ol {
    padding-left: 0;
  }

  /* Directional icons (arrows) point the other way. `scale` is separate
     from `transform`, so existing rotations and hover nudges still work
     and are mirrored with the icon. */
  .cs_rtl_flip {
    scale: -1 1;
  }

  /* Phone numbers read left to right, so line them up on the right. */
  input[type="tel"] {
    text-align: right;
  }
}

/* Numbered slider dots: the number sets both left and right, and RTL
   keeps the other one, which pushed it under the next dot's dash.
   Anchor it from the right instead, the mirror of the LTR layout. */
[dir="rtl"] .swiper-pagination.cs_style_1 .swiper-pagination-bullet::before {
  left: auto;
  right: 50%;
  transform: translateY(-50%);
}

/* Bootstrap parts used in the pages that are built left to right. */
[dir="rtl"] .breadcrumb-item + .breadcrumb-item {
  padding-left: 0;
  padding-right: var(--bs-breadcrumb-item-padding-x);

  &::before {
    float: right;
    padding-right: 0;
    padding-left: var(--bs-breadcrumb-item-padding-x);
  }
}

@include bp.up(xl) {
  [dir="rtl"] .offset-xl-1 {
    margin-left: 0;
    margin-right: 8.33333333%;
  }
}
