/**
 * توافق WordPress والقوائم و Tutor LMS
 * هذا الملف يُحمَّل عبر wp_enqueue_scripts في الواجهة فقط — ليس في wp-admin.
 */

/* RTL للواجهة الأمامية فقط (الملف لا يُحمّل في لوحة التحكم) */
html[dir="rtl"],
body.rehab-hussein-rtl,
body.rtl {
  direction: rtl;
  text-align: right;
}

/* شعار مخصص من لوحة التحكم */
.logo__image {
  display: block;
  max-height: 52px;
  width: auto;
}

/* قائمة WordPress بنفس شكل الروابط الأصلية */
.nav-wrap {
  display: flex;
  align-items: center;
}

.nav {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav > li {
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav a.nav__link,
.nav .nav__link {
  position: relative;
  font-weight: 600;
  color: #4b5563;
  transition: color 0.25s ease;
  display: inline-block;
}

.nav a.nav__link::after,
.nav .nav__link::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -6px;
  width: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--grad);
  transition: width 0.25s ease;
}

.nav a.nav__link:hover,
.nav .nav__link:hover,
.nav .current-menu-item > a,
.nav .current_page_item > a,
.nav .current-menu-item > .nav__link,
.nav a.is-active {
  color: var(--purple);
}

.nav .current-menu-item > a::after,
.nav .current_page_item > a::after,
.nav a.is-active::after,
.nav a.nav__link:hover::after {
  width: 100%;
}

/* قائمة الموبايل */
@media (max-width: 960px) {
  .nav-wrap {
    display: contents;
  }

  .nav.is-open {
    display: flex;
    position: absolute;
    top: calc(var(--header-h) + 8px);
    right: 16px;
    left: 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 14px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow);
    z-index: 60;
  }

  .nav.is-open > li > a {
    padding: 12px 14px;
    border-radius: 12px;
  }

  .nav.is-open > li > a:hover,
  .nav.is-open .current-menu-item > a {
    background: var(--purple-soft);
  }
}

/* محتوى الصفحات الداخلية */
.content-wrap {
  max-width: 920px;
}

.content-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: var(--shadow-soft);
}

.entry-content > * + * {
  margin-top: 1em;
}

.entry-content h2,
.entry-content h3 {
  line-height: 1.4;
  margin-top: 1.4em;
}

.entry-content ul,
.entry-content ol {
  padding-inline-start: 1.4em;
  list-style: disc;
}

.entry-content a {
  color: var(--purple);
  text-decoration: underline;
}

.pagination-wrap {
  margin-top: 32px;
  display: flex;
  justify-content: center;
}

.pagination-wrap .nav-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pagination-wrap a,
.pagination-wrap span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--border);
  font-weight: 700;
}

.pagination-wrap .current {
  background: var(--grad);
  color: #fff;
  border-color: transparent;
}

/* بطاقات كورسات Tutor */
.tutor-courses-grid {
  margin-top: 10px;
}

.tutor-course-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
}

.tutor-course-card__media {
  display: block;
  border-radius: 18px;
  overflow: hidden;
  background: var(--purple-soft);
  aspect-ratio: 16 / 10;
}

.tutor-course-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tutor-course-card__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.tutor-course-card__title {
  font-size: 1.05rem;
  margin: 0;
}

.tutor-course-card__title a:hover {
  color: var(--purple);
}

.tutor-course-card__price {
  font-weight: 800;
  color: var(--purple);
}

.tutor-course-card .btn {
  margin-top: auto;
  align-self: flex-start;
}

.tutor-notice {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  text-align: center;
  box-shadow: var(--shadow-soft);
  color: var(--text-muted);
  font-weight: 600;
}

/* إداري ووردبريس */
.admin-bar .header {
  top: 32px;
}

@media (max-width: 782px) {
  .admin-bar .header {
    top: 46px;
  }
}
