/* ============================================================
   Right-to-left (Arabic)
   Loaded by the layout only when the page is in Arabic.
   style.css is the template's file and is written for left-to-right;
   the rules here flip the parts that cannot follow the direction by themselves.
   Add a section here whenever a new page is translated.
   ============================================================ */

/* ---- Arabic font (icons keep their own icon fonts) ---- */
html[dir="rtl"] body,
html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3,
html[dir="rtl"] h4, html[dir="rtl"] h5, html[dir="rtl"] h6,
html[dir="rtl"] p, html[dir="rtl"] a, html[dir="rtl"] span, html[dir="rtl"] label,
html[dir="rtl"] input, html[dir="rtl"] button, html[dir="rtl"] select, html[dir="rtl"] textarea {
	font-family: "Tajawal", "Nunito", "HelveticaNeue", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

/* ---- Whole page ---- */
/* The template sets text to the left on the page; in Arabic everything starts from the right */
html[dir="rtl"] body { text-align: right; }

/* ---- Login, Register, Forgot password, Reset password ---- */

/* The form column keeps the same place, mirrored */
@media (min-width: 1200px) {
	html[dir="rtl"] .login-register-page { margin-inline-start: 0; }
	html[dir="rtl"] .col-xl-5.offset-xl-3 { margin-left: 0; margin-right: 25%; }
}

/* "Forgot Password?" and other plain text in the form start from the right */
html[dir="rtl"] .login-register-page form { text-align: right; }

/* Field icon sits at the start of the field (the right side in Arabic) */
html[dir="rtl"] .input-with-icon-left input {
	padding-left: 20px;
	padding-right: 65px;
}

html[dir="rtl"] .input-with-icon-left i {
	right: 0;
	border-radius: 0 4px 4px 0;
}

/* Freelancer / Employer buttons */
html[dir="rtl"] .account-type div {
	margin-right: 0;
	margin-left: 20px;
}

html[dir="rtl"] .account-type label i {
	margin-right: 0;
	margin-left: 2px;
}

@media (max-width: 480px) {
	html[dir="rtl"] .login-register-page .account-type div { margin-left: 0; }
}

/* The arrow inside the buttons points to the left and slides in from the other side */
html[dir="rtl"] .button-sliding-icon i { transform: translateX(20px) scaleX(-1); }
html[dir="rtl"] .button-sliding-icon:hover i,
html[dir="rtl"] .button.button-sliding-icon:hover i { transform: translateX(0) scaleX(-1); }

html[dir="rtl"] .button.button-sliding-icon {
	padding-left: 10px;
	padding-right: 20px;
}

html[dir="rtl"] .button.button-sliding-icon:hover { padding-left: 20px; }

html[dir="rtl"] .button.button-sliding-icon i {
	padding-right: 0;
	padding-left: 5px;
}

/* Message boxes */
html[dir="rtl"] .notification {
	padding-right: 26px;
	padding-left: 50px;
	text-align: right;
}

/* Facebook / Google buttons */
html[dir="rtl"] .social-login-buttons button i {
	margin-right: 0;
	margin-left: 7px;
}

/* An email address is always read left to right */
html[dir="rtl"] input[name="Email"] { direction: ltr; text-align: right; }

/* ---- Header ---- */

/* Logo and menu start from the right, the Log In button / user menu sits on the left */
html[dir="rtl"] #header .left-side { float: right; text-align: right; }

html[dir="rtl"] #header .right-side {
	float: left;
	text-align: left;
	right: auto;
	left: 25px;
}

html[dir="rtl"] #logo {
	border-right-width: 0;
	border-left-width: 1px;
	border-left-style: solid;
	padding-right: 0;
	padding-left: 35px;
	margin-right: 0;
	margin-left: 20px;
}

html[dir="rtl"] #navigation ul,
html[dir="rtl"] #navigation ul li { float: right; }

html[dir="rtl"] #navigation ul ul li { float: none; text-align: right; }

/* Drop-down menus open under the right edge, and their sub-menus open to the left */
html[dir="rtl"] #navigation ul li ul {
	left: auto;
	right: 9px;
}

html[dir="rtl"] #navigation ul ul ul {
	left: auto;
	right: 100%;
	margin: 0 15px 0 0;
	transform: translate3d(-15px,0,0);
}

html[dir="rtl"] #navigation ul ul li:hover > ul { transform: translate3d(0,0,0); }

html[dir="rtl"] #navigation ul ul ul:before,
html[dir="rtl"] #navigation ul ul ul:after {
	left: auto;
	right: -15px;
}

/* Bell, messages and user menu */
html[dir="rtl"] .header-widget {
	border-left-width: 0;
	border-right-width: 1px;
	border-right-style: solid;
	text-align: right;
	float: right;
}

html[dir="rtl"] .fullwidth .header-widget:last-of-type {
	padding-right: 30px;
	padding-left: 5px;
	float: left;
}

html[dir="rtl"] .header-widget:last-of-type {
	padding-left: 0;
	margin-right: 0;
	margin-left: -5px;
}

html[dir="rtl"] .header-widget .log-in-button i {
	margin-right: -1px;
	margin-left: 4px;
	display: inline-block;
	transform: scaleX(-1);
}

/* ---- Drop-down boxes (Service, language) ---- */
html[dir="rtl"] .bootstrap-select.btn-group .dropdown-toggle .filter-option {
	text-align: right;
	float: right;
}

html[dir="rtl"] .language-switcher.bootstrap-select.btn-group .dropdown-toggle {
	padding-right: 18px;
	padding-left: 35px;
}

html[dir="rtl"] .bootstrap-select.btn-group .dropdown-toggle .caret,
html[dir="rtl"] .language-switcher.bootstrap-select.btn-group .dropdown-toggle .caret {
	right: auto;
	left: 20px;
}

html[dir="rtl"] .bootstrap-select .dropdown-menu li a { text-align: right; }

/* ---- Footer ---- */
html[dir="rtl"] .footer-rows-right { float: left; }
html[dir="rtl"] .footer-row { float: right; }

html[dir="rtl"] .footer-rows-right .footer-row:first-child {
	padding-left: 0;
	padding-right: 40px;
	border-left: none;
	border-right: 1px solid #484848;
}

html[dir="rtl"] .footer-links ul { text-align: right; }

html[dir="rtl"] #footer h3 i {
	margin-right: 0;
	margin-left: 5px;
}

/* The line under a footer link grows from the right */
html[dir="rtl"] .footer-links ul li a span:before {
	left: auto;
	right: 0;
}

/* Newsletter: the button is on the left of the box, its arrow points left */
html[dir="rtl"] .newsletter button {
	margin-left: 0;
	margin-right: 10px;
}

html[dir="rtl"] .newsletter button i {
	display: inline-block;
	transform: scaleX(-1);
}

/* The language box is on the left in Arabic, so its menu opens toward the inside of the page */
html[dir="rtl"] .language-switcher.bootstrap-select .dropdown-menu {
	right: auto;
	left: 0;
}

html[dir="rtl"] .language-switcher.bootstrap-select .dropdown-menu:before {
	right: auto;
	left: 20px;
}

/* ---- Phone menu (the panel that slides in from the menu button) ---- */
/* The page slides to the right to uncover the panel, so the panel must stay on the left in Arabic too.
   Its texts still read right-to-left. */
html[dir="rtl"] .mm-menu {
	left: 0;
	right: auto;
}

/* ---- Header panels: bell, messages and the user menu (signed-in users) ---- */
/* In Arabic these buttons are at the left edge of the header, so their panels must open toward
   the right (the inside of the page). Left as they were, most of each panel is off the screen. */
html[dir="rtl"] .header-notifications {
	padding-right: 0;
	padding-left: 15px;
}

html[dir="rtl"] .header-notifications:last-child {
	margin-right: 0;
	margin-left: -15px;
}

html[dir="rtl"] .header-notifications-dropdown {
	right: auto;
	left: -15px;
	text-align: right;
}

html[dir="rtl"] .user-menu .header-notifications-dropdown {
	right: auto;
	left: -10px;
}

/* The small pointer above a panel */
html[dir="rtl"] .header-notifications-dropdown:before {
	right: auto;
	left: 43px;
}

html[dir="rtl"] .user-menu .header-notifications-dropdown:before {
	right: auto;
	left: 23px;
}

/* The number on the bell and the envelope */
html[dir="rtl"] .header-notifications-trigger span {
	margin-left: 0;
	margin-right: -10px;
}

/* Inside the panels */
html[dir="rtl"] button.mark-as-read {
	float: left;
	right: auto;
	left: -8px;
}

html[dir="rtl"] .header-notifications-content .notification-text {
	padding-left: 5px;
	padding-right: 20px;
}

html[dir="rtl"] a.header-notifications-button i {
	margin-left: 0;
	margin-right: 7px;
}

html[dir="rtl"] ul.user-menu-small-nav li a i {
	margin-right: 0;
	margin-left: 2px;
}

@media (max-width: 768px) {
	html[dir="rtl"] .user-menu .header-notifications-dropdown,
	html[dir="rtl"] .header-notifications-dropdown {
		right: auto;
		left: -10px;
	}
}

/* ---------- The Online / Invisible switch in the user menu ----------
   In Arabic the first choice (Online) sits on the right. The coloured block that marks the choice
   starts there by itself, so for "Invisible" it has to slide to the left, not further right. */
html[dir="rtl"] .status-switch label { float: right; }
html[dir="rtl"] .status-switch span.status-indicator { left: 0; border-radius: 0 4px 4px 0; }
html[dir="rtl"] .status-switch span.status-indicator.right { left: -50%; border-radius: 4px 0 0 4px; }
