/* Thmanyah Arabic Font Family */
@font-face {
  font-family: 'Thmanyah';
  src: url('/fonts/thmanyah-300.woff2') format('woff2');
  font-display: swap;
  font-style: normal;
  font-weight: 300;
}
@font-face {
  font-family: 'Thmanyah';
  src: url('/fonts/thmanyah-400.woff2') format('woff2');
  font-display: swap;
  font-style: normal;
  font-weight: 400;
}
@font-face {
  font-family: 'Thmanyah';
  src: url('/fonts/thmanyah-500.woff2') format('woff2');
  font-display: swap;
  font-style: normal;
  font-weight: 500;
}
@font-face {
  font-family: 'Thmanyah';
  src: url('/fonts/thmanyah-700.woff2') format('woff2');
  font-display: swap;
  font-style: normal;
  font-weight: 700;
}
@font-face {
  font-family: 'Thmanyah';
  src: url('/fonts/thmanyah-800.woff2') format('woff2');
  font-display: swap;
  font-style: normal;
  font-weight: 800;
}
@font-face {
  font-family: 'Thmanyah';
  src: url('/fonts/thmanyah-900.woff2') format('woff2');
  font-display: swap;
  font-style: normal;
  font-weight: 900;
}

/* Arabic (RTL) Mode — activated via html[dir="rtl"] */
html[dir="rtl"] {
  --font-sans: 'Thmanyah', 'Inter', system-ui, sans-serif;
  --font-display: 'Thmanyah', 'Outfit', system-ui, sans-serif;
  overflow-x: hidden;
}

html[dir="rtl"] body {
  font-family: var(--font-sans);
  text-align: right;
  overflow-x: hidden;
}

/* Apply Thmanyah to all heading/display font classes */
html[dir="rtl"] .font-display,
html[dir="rtl"] .font-display-lg,
html[dir="rtl"] .font-headline-lg,
html[dir="rtl"] .font-headline-md,
html[dir="rtl"] .font-label-caps,
html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3,
html[dir="rtl"] h4, html[dir="rtl"] h5, html[dir="rtl"] h6 {
  font-family: var(--font-display);
}

html[dir="rtl"] .font-sans {
  font-family: var(--font-sans);
}

/* Centered text sections stay centered in RTL */
html[dir="rtl"] .text-center {
  text-align: center;
}

/* Flip certain layout elements for RTL */
html[dir="rtl"] .btn-primary .material-symbols-outlined {
  transform: scaleX(-1);
}

html[dir="rtl"] .btn-outline .material-symbols-outlined {
  transform: scaleX(-1);
}

/* RTL adjustments for border-left accent bars */
html[dir="rtl"] .border-l-4 {
  border-left-width: 0;
  border-right-width: 4px;
}

html[dir="rtl"] .border-l-emerald-500 {
  border-left-color: transparent;
  border-right-color: #10b981;
}

html[dir="rtl"] .hover\:translate-x-2:hover {
  transform: translateX(-0.5rem);
}

/* Mobile nav RTL fix */
html[dir="rtl"] nav.active {
  left: auto;
  right: 0;
}

html[dir="rtl"] nav.active .nav-link {
  text-align: right;
}

/* Prevent horizontal overflow from decorative elements & marquee */
html[dir="rtl"] .marquee-container {
  overflow: hidden;
}

html[dir="rtl"] main {
  overflow-x: hidden;
}

/* Hero section mobile RTL fixes */
@media (max-width: 768px) {
  html[dir="rtl"] .hero-content,
  html[dir="rtl"] section {
    overflow-x: hidden;
  }
}

/* Language toggle button */
.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  border-radius: 9999px;
  border: 1px solid var(--border-color);
  background: var(--surface-color);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-base);
  white-space: nowrap;
}

.lang-toggle:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
}

.lang-toggle .lang-active {
  color: var(--accent-color);
  font-weight: 700;
}

.lang-toggle .lang-divider {
  width: 1px;
  height: 14px;
  background: var(--border-color);
}

/* Smooth transition for the entire page during language swaps to prevent jumbled layouts */
body {
  transition: opacity 0.15s ease-in-out;
}

body.i18n-swapping {
  opacity: 0 !important;
}

