/**
 * RTL Stylesheet - المجد التعليمي
 * يُحمَّل تلقائياً في بيئة RTL
 */

/* Override any LTR remnants */
body, html { direction: rtl; text-align: right; }

/* Form inputs stay LTR for emails/URLs */
input[type="email"],
input[type="url"],
input[type="number"],
input[type="tel"],
input[dir="ltr"] {
  direction: ltr;
  text-align: left;
}

/* Pagination arrows flip */
.page-numbers.prev::before { content: '→'; }
.page-numbers.next::before { content: '←'; }

/* Comment indent */
.children { margin-right: 2rem; margin-left: 0; }

/* WP default alignment overrides */
.alignright { float: right; margin-left: 1.5rem; margin-right: 0; }
.alignleft  { float: left;  margin-right: 1.5rem; margin-left: 0; }

/* Blockquote */
blockquote {
  border-right: 4px solid hsl(var(--accent));
  border-left: none;
  padding-right: 1.5rem;
  padding-left: 0;
  margin-right: 0;
}

/* Admin bar offset */
body.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) {
  body.admin-bar .site-header { top: 46px; }
}

/* Dropdown menus */
.nav-dropdown-menu { right: 0; left: auto; }

/* Mobile menu from right */
.mobile-menu { right: 0; left: auto; border-left: 1px solid hsl(var(--border)); border-right: none; }

/* Footer bottom flex */
.footer-bottom { flex-direction: row-reverse; }

/* Tags flip */
.tag-pill { direction: rtl; }

/* Scroll to top: left side in RTL */
/* already set in JS */

/* Webkit scrollbar styling */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: hsl(var(--muted)); }
::-webkit-scrollbar-thumb { background: hsl(var(--primary)); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: hsl(var(--accent)); }

/* Focus visible */
:focus-visible {
  outline: 2px solid hsl(var(--primary));
  outline-offset: 2px;
}

/* Arabic number display */
.ar-num { font-variant-numeric: arabic-indic; }

/* Cairo font weight adjustments */
h1, h2, h3, h4, h5, h6 { font-family: 'Cairo', sans-serif; font-weight: 800; }
button, input, select, textarea { font-family: 'Cairo', sans-serif; }

/* Dark mode color overrides */
.dark body { color-scheme: dark; }
.dark .memo-card { box-shadow: 0 2px 12px rgba(0,0,0,0.4); }
.dark .site-header { box-shadow: 0 2px 12px rgba(0,0,0,0.4); }
.dark img { opacity: 0.9; }
.dark .badge-success { background: #14532d; color: #86efac; }
.dark .badge-warning { background: #713f12; color: #fde68a; }
.dark .badge-danger  { background: #7f1d1d; color: #fca5a5; }
.dark .badge-info    { background: #1e3a5f; color: #93c5fd; }

/* Print */
@media print {
  .site-header,
  .site-footer,
  .mobile-menu,
  .mobile-overlay,
  .header-actions,
  .memo-card-fav,
  .share-buttons,
  #rating-section,
  aside {
    display: none !important;
  }
  body { font-size: 12pt; }
  .memo-content-grid { grid-template-columns: 1fr; }
  a[href]::after { content: ' (' attr(href) ')'; font-size: 0.8em; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* High contrast */
@media (prefers-contrast: high) {
  .memo-card { border-width: 2px; }
  .nav-item { border: 1px solid transparent; }
  .nav-item:hover { border-color: currentColor; }
}
