@charset "UTF-8";
/* ==========================================================================
   Luma / right to left
   --------------------------------------------------------------------------
   Loaded only when the active language reads right to left.

   Deliberately tiny. The layout is authored with logical properties
   (margin-inline, inset-inline, border-start-*, text-align: start) and with
   grid source order, so dir="rtl" on the html element already produces the
   mirrored layout. Only the things logic cannot express live here.

   A new rule that merely swaps left for right belongs in the main stylesheet
   as a logical property instead.
   ========================================================================== */

/* -- Directional glyphs -------------------------------------------------
   An arrow, a chevron or a back caret points the other way when the reading
   direction flips. Icons with no direction, a bell or a heart, are untouched.
   -------------------------------------------------------------------- */

html[dir="rtl"] .lm-icon-directional,
html[dir="rtl"] [data-icon-flip] {
  transform: scaleX(-1);
}

/* -- Latin runs inside Arabic text -------------------------------------
   An address, a version or a handle keeps its own direction, or its parts are
   reordered on screen.
   -------------------------------------------------------------------- */

html[dir="rtl"] input[type="email"],
html[dir="rtl"] input[type="url"],
html[dir="rtl"] input[type="tel"],
html[dir="rtl"] input[type="password"],
html[dir="rtl"] input[name="username"],
html[dir="rtl"] input[name="username_or_email"] {
  direction: ltr;
  text-align: start;
}

/* -- Gradients -----------------------------------------------------------
   A diagonal leans a specific way, so it is mirrored to keep the visual
   weight on the same side of the reading flow.
   -------------------------------------------------------------------- */

/* Only the angle is mirrored. The two colours stay wherever tokens.css put
   them for the active scheme, so this rule needs no dark variant and declares
   no colour value outside the token file. */
html[dir="rtl"] {
  --lm-gradient-angle: 225deg;
}

/* -- Transform origin ----------------------------------------------------
   transform-origin only takes physical keywords, so the growth anchor of a
   menu has to be named explicitly.
   -------------------------------------------------------------------- */

html[dir="rtl"] .lm-dropdown__menu        { transform-origin: top left; }
html[dir="rtl"] .lm-dropdown__menu--start { transform-origin: top right; }
html[dir="rtl"] .lm-dropdown__menu--up    { transform-origin: bottom left; }

/* -- Shimmer -------------------------------------------------------------
   The skeleton sweep should travel with the reading direction.
   -------------------------------------------------------------------- */

html[dir="rtl"] .lm-skeleton { animation-direction: reverse; }

/* -- Scroll containers ---------------------------------------------------
   WebKit needs the hint on the element that scrolls so the bar and the start
   edge land correctly.
   -------------------------------------------------------------------- */

html[dir="rtl"] .lm-stories__track,
html[dir="rtl"] .lm-modal__dialog,
html[dir="rtl"] .lm-nav,
html[dir="rtl"] .lm-widgets {
  direction: rtl;
}

/* -- Profile header ------------------------------------------------------
   The reference fixes the profile header's two anchors to physical sides:
   the portrait at the left of the card and the actions at the right, in
   both directions. A logical layout would put the portrait at the reading
   start, which in Arabic is the right, and that is not what the design
   shows. So the row is reversed here, and the identity block that sits
   under the portrait is pushed to the same physical side with it.
   -------------------------------------------------------------------- */

/* Only where the desktop shape applies. On a phone the row stacks and the
   block reads from the start, and this file loads last, so without the
   media query it would win over the phone rules. */
@media (min-width: 768px) {
  html[dir="rtl"] .lm-profile__bar {
    flex-direction: row-reverse;
  }

  html[dir="rtl"] .lm-profile__identity {
    margin-inline-start: auto;
  }
}

/* The cover button and the presence dot are anchored to the physical right
   at every width. components.css and responsive.css write them as inline-end
   (the right in English); here they move to inline-start, the right in
   Arabic, with the same offsets at each size. */
html[dir="rtl"] .lm-profile__cover-edit {
  inset-inline-end: auto;
  inset-inline-start: var(--lm-space-5);
}

html[dir="rtl"] .lm-profile__online {
  inset-inline-end: auto;
  inset-inline-start: 14px;
}

@media (max-width: 767px) {
  html[dir="rtl"] .lm-profile__cover-edit {
    inset-inline-start: var(--lm-space-3);
  }

  html[dir="rtl"] .lm-profile__online {
    inset-inline-start: 6px;
  }
}

/* -- Signed-in chip ------------------------------------------------------
   The reference reads the chip name first, then the chevron, then the
   portrait at the far end. In English the portrait leads. Source order
   serves English; this reorders it for Arabic.
   -------------------------------------------------------------------- */

html[dir="rtl"] .lm-user-chip .lm-avatar         { order: 3; }
html[dir="rtl"] .lm-user-chip .lm-user-chip__avatar  { order: 3; }
html[dir="rtl"] .lm-user-chip .lm-user-chip__name    { order: 1; }
html[dir="rtl"] .lm-user-chip .lm-user-chip__chevron { order: 2; }

/* -- Phase 77: the owner's camera on the portrait -------------------------
   Opposite the presence dot, which this file moves to the physical right in
   Arabic: the camera goes to the physical left with it. */
html[dir="rtl"] .lm-profile__avatar-edit {
  inset-inline-start: auto;
  inset-inline-end: 10px;
}

@media (max-width: 767px) {
  html[dir="rtl"] .lm-profile__avatar-edit {
    inset-inline-end: 2px;
  }
}
