/* ==========================================================================
   The Arab Cultural Foundation — RTL & Arabic Typography Overrides
   Registered Charity No. 327877
   ========================================================================== */

/* --------------------------------------------------------------------------
   RTL Document Direction
   -------------------------------------------------------------------------- */
[dir="rtl"] {
  font-family: var(--font-arabic-body);
}

[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3,
[dir="rtl"] h4,
[dir="rtl"] h5,
[dir="rtl"] h6 {
  font-family: var(--font-arabic-display);
  letter-spacing: 0; /* Arabic has no letter-spacing */
  line-height: 1.35;
}

/* --------------------------------------------------------------------------
   Header RTL
   -------------------------------------------------------------------------- */
[dir="rtl"] .header-container {
  flex-direction: row-reverse;
}

[dir="rtl"] .brand {
  flex-direction: row-reverse;
}

[dir="rtl"] .brand-info {
  text-align: right;
}

[dir="rtl"] .header-actions {
  flex-direction: row-reverse;
}

[dir="rtl"] .main-nav {
  flex-direction: row-reverse;
}

/* --------------------------------------------------------------------------
   Navigation RTL
   -------------------------------------------------------------------------- */
[dir="rtl"] .mobile-drawer-content {
  right: auto;
  left: 0;
  transform: translateX(-100%);
}

[dir="rtl"] .mobile-drawer.open .mobile-drawer-content {
  transform: translateX(0);
}

[dir="rtl"] .mobile-nav-link {
  border-left: none;
  border-right: 2px solid transparent;
  text-align: right;
}

[dir="rtl"] .mobile-nav-link:hover,
[dir="rtl"] .mobile-nav-link.active {
  border-right-color: var(--clr-gold-500);
  border-left: none;
  padding-right: 1rem;
  padding-left: 1rem;
}

[dir="rtl"] .mobile-nav-link:hover {
  padding-right: 1rem;
}

/* --------------------------------------------------------------------------
   Hero RTL
   -------------------------------------------------------------------------- */
[dir="rtl"] .hero-inner {
  direction: rtl;
}

[dir="rtl"] .hero-title {
  text-align: right;
}

[dir="rtl"] .hero-subtitle {
  text-align: right;
}

[dir="rtl"] .hero-ctas {
  flex-direction: row-reverse;
  justify-content: flex-end;
}

[dir="rtl"] .hero-arabic-callout {
  flex-direction: row-reverse;
  justify-content: flex-end;
}

/* --------------------------------------------------------------------------
   Section RTL
   -------------------------------------------------------------------------- */
[dir="rtl"] .section-header {
  text-align: right;
}

[dir="rtl"] .section-header .lead {
  text-align: right;
  margin-left: 0;
}

[dir="rtl"] .gold-divider--center {
  margin-left: auto;
  margin-right: auto;
}

[dir="rtl"] .gold-divider:not(.gold-divider--center) {
  margin-left: auto;
  margin-right: 0;
}

/* --------------------------------------------------------------------------
   Typography RTL
   -------------------------------------------------------------------------- */
[dir="rtl"] .eyebrow {
  text-align: right;
  letter-spacing: 0;
}

[dir="rtl"] .lead {
  text-align: right;
}

[dir="rtl"] .pull-quote {
  border-inline-start: 3px solid var(--clr-gold-500);
  border-inline-end: none;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

[dir="rtl"] blockquote {
  text-align: right;
}

/* --------------------------------------------------------------------------
   Cards RTL
   -------------------------------------------------------------------------- */
[dir="rtl"] .card {
  text-align: right;
}

[dir="rtl"] .card-icon {
  margin-right: 0;
}

[dir="rtl"] .pillar-item {
  flex-direction: row-reverse;
}

[dir="rtl"] .pillar-content h3,
[dir="rtl"] .pillar-content p {
  text-align: right;
}

/* --------------------------------------------------------------------------
   Buttons & Links RTL
   -------------------------------------------------------------------------- */
[dir="rtl"] .link-arrow {
  flex-direction: row-reverse;
}

[dir="rtl"] .link-arrow svg {
  transform: rotate(180deg);
}

[dir="rtl"] .btn {
  flex-direction: row-reverse;
}

/* --------------------------------------------------------------------------
   Footer RTL
   -------------------------------------------------------------------------- */
[dir="rtl"] .footer-grid {
  direction: rtl;
}

[dir="rtl"] .footer-links a:hover {
  padding-left: 0;
  padding-right: 0.35rem;
}

[dir="rtl"] .footer-meta-item {
  flex-direction: row-reverse;
  text-align: right;
}

[dir="rtl"] .footer-bottom-inner {
  flex-direction: row-reverse;
}

/* --------------------------------------------------------------------------
   Forms RTL
   -------------------------------------------------------------------------- */
[dir="rtl"] .form-label {
  text-align: right;
}

[dir="rtl"] .form-input,
[dir="rtl"] .form-select,
[dir="rtl"] .form-textarea {
  text-align: right;
  direction: rtl;
}

[dir="rtl"] .newsletter-form {
  direction: rtl;
}

/* --------------------------------------------------------------------------
   Support Pathways RTL
   -------------------------------------------------------------------------- */
[dir="rtl"] .support-pathway {
  text-align: right;
}

/* --------------------------------------------------------------------------
   Breadcrumb RTL
   -------------------------------------------------------------------------- */
[dir="rtl"] .breadcrumb {
  flex-direction: row-reverse;
  justify-content: flex-end;
}

/* --------------------------------------------------------------------------
   Arabic Typography Refinements
   -------------------------------------------------------------------------- */
[dir="rtl"] p {
  word-spacing: 0.05em;
  line-height: 1.9;
}

[dir="rtl"] .card-desc {
  line-height: 1.85;
}

[dir="rtl"] .editorial-body p {
  line-height: 2;
}

/* Arabic font override for specific elements */
[lang="ar"],
[dir="rtl"] .brand-arabic {
  font-family: var(--font-arabic-display);
}

/* Hero Arabic typography */
[dir="rtl"] .hero-title {
  font-family: var(--font-arabic-display);
  font-size: clamp(2.4rem, 5vw, 4rem);
  line-height: 1.3;
  font-weight: 800;
}

[dir="rtl"] .hero-tag {
  flex-direction: row-reverse;
  margin-right: 0;
}

/* --------------------------------------------------------------------------
   Stat Cards RTL
   -------------------------------------------------------------------------- */
[dir="rtl"] .stat-card {
  text-align: right;
}

/* --------------------------------------------------------------------------
   Project Meta RTL
   -------------------------------------------------------------------------- */
[dir="rtl"] .project-meta {
  flex-direction: row-reverse;
}

[dir="rtl"] .page-hero-meta {
  flex-direction: row-reverse;
}

/* --------------------------------------------------------------------------
   Toast RTL
   -------------------------------------------------------------------------- */
[dir="rtl"] .toast-container {
  right: auto;
  left: 1.5rem;
}

[dir="rtl"] .toast {
  flex-direction: row-reverse;
}

/* --------------------------------------------------------------------------
   Mobile adjustments RTL
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  [dir="rtl"] .hero-ctas {
    flex-direction: column;
    align-items: flex-end;
  }
}
