/*
 * RTL Support - أركان الخدمات المتقدمة
 * ملف دعم الاتجاه من اليمين لليسار
 * مستوحى من تصميم إتمام
 */

/* Base RTL */
html {
  direction: rtl;
}

body {
  direction: rtl;
  text-align: right;
}

/* Lists */
ul, ol {
  padding-right: 0;
  padding-left: 0;
}

/* Forms */
input[type="text"],
input[type="email"],
input[type="url"],
input[type="tel"],
input[type="search"],
input[type="password"],
textarea,
select {
  text-align: right;
}

/* Tables */
table {
  text-align: right;
}

th, td {
  text-align: right;
}

/* Blockquote */
blockquote {
  border-right: 4px solid var(--primary);
  border-left: none;
  padding-right: 20px;
  padding-left: 0;
  margin-right: 0;
  margin-left: 20px;
}

/* Top Bar */
.top-bar-inner {
  flex-direction: row;
}

.top-bar-contact {
  flex-direction: row;
}

/* Header */
.header-inner {
  flex-direction: row;
}

.site-branding {
  flex-direction: row;
}

/* Navigation */
.primary-nav {
  justify-content: flex-start;
}

.primary-nav ul {
  flex-direction: row;
}

.primary-nav .sub-menu {
  right: 0;
  left: auto;
}

/* Hero Section */
.hero-layout {
  direction: rtl;
}

.hero-panel li::before {
  margin-left: 0;
  margin-right: 0;
}

/* Metrics */
.metric:not(:last-child)::after {
  left: 0;
  right: auto;
}

/* Cards */
.card-link svg {
  margin-right: 0;
  margin-left: 0;
  transform: rotate(180deg);
}

.card-link:hover svg {
  transform: rotate(180deg) translateX(4px);
}

/* About Section */
.about-list li::before {
  margin-left: 0;
  margin-right: 0;
}

.about-image::before {
  right: -20px;
  left: auto;
}

/* CTA */
.cta {
  flex-direction: row;
}

/* Footer */
.footer-grid {
  direction: rtl;
}

.footer-links ul {
  text-align: right;
}

.footer-links a:hover {
  padding-right: 8px;
  padding-left: 0;
}

.footer-contact-item {
  flex-direction: row;
}

.footer-contact-item svg {
  margin-left: 12px;
  margin-right: 0;
}

.footer-bottom-inner {
  flex-direction: row;
}

/* WhatsApp Float */
.whatsapp-float {
  left: 24px;
  right: auto;
}

/* Mobile Menu */
.mobile-menu {
  right: -100%;
  left: auto;
}

.mobile-menu.active {
  right: 0;
}

.mobile-menu-nav .sub-menu {
  padding-right: 16px;
  padding-left: 0;
}

/* Breadcrumb */
.breadcrumb {
  flex-direction: row;
}

/* Form Row */
.form-row {
  direction: rtl;
}

/* Buttons with icons */
.button svg {
  margin-left: 0;
  margin-right: 0;
}

/* Skip Link */
.skip-link {
  right: 16px;
  left: auto;
}

/* Media queries */
@media (max-width: 1024px) {
  .hero-layout {
    direction: rtl;
  }

  .about-grid {
    direction: rtl;
  }

  .footer-grid {
    direction: rtl;
  }
}

@media (max-width: 768px) {
  .header-inner {
    flex-direction: row;
  }

  .cta {
    flex-direction: column;
    align-items: center;
  }

  .footer-bottom-inner {
    flex-direction: column;
  }

  .whatsapp-float {
    left: 16px;
    right: auto;
  }
}

/* WordPress specific */
.alignleft {
  float: right;
  margin-left: 1.5em;
  margin-right: 0;
}

.alignright {
  float: left;
  margin-right: 1.5em;
  margin-left: 0;
}

/* Pagination */
.nav-links {
  display: flex;
  flex-direction: row;
  gap: 8px;
}

.nav-previous {
  margin-left: auto;
  margin-right: 0;
}

.nav-next {
  margin-right: auto;
  margin-left: 0;
}

/* Comments */
.comment-list {
  padding-right: 0;
}

.comment-body {
  padding-right: 20px;
  padding-left: 0;
}

.comment-reply-link {
  float: left;
}

/* Search form */
.search-form {
  flex-direction: row;
}

.search-field {
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

.search-submit {
  border-radius: var(--border-radius) 0 0 var(--border-radius);
}

/* Widgets */
.widget ul {
  padding-right: 0;
}

.widget li {
  text-align: right;
}

/* Gutenberg blocks RTL */
.wp-block-quote {
  border-right: 4px solid var(--primary);
  border-left: none;
  padding-right: 20px;
  padding-left: 0;
}

.wp-block-pullquote {
  text-align: right;
}

.wp-block-code {
  direction: ltr;
  text-align: left;
}

.wp-block-preformatted {
  direction: ltr;
  text-align: left;
}

/* Keep numbers LTR */
.phone-number,
.price,
.metric strong,
.stat strong,
[dir="ltr"] {
  direction: ltr;
  unicode-bidi: embed;
}

/* Section Tags */
.section-tag {
  direction: rtl;
}

/* Service Icons */
.service-icon svg {
  stroke: var(--primary);
}

/* News Tags */
.news-tag {
  direction: rtl;
}

/* Hero Tag */
.hero-tag {
  direction: rtl;
}

.hero-tag svg {
  margin-left: 0;
}

/* Alert Icons */
.alert svg {
  margin-left: 12px;
  margin-right: 0;
}

/* Government Tabs */
.gov-tabs-nav {
  flex-direction: row;
}

.gov-tabs label {
  margin-left: 8px;
  margin-right: 0;
}
