body {
  margin: 0;
  font-family: "Scheherazade New","Amiri", serif;
  background: #f9f9f7;
  direction: rtl;
  color: #2d1c0d;
}

.page_wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

/* ✅ الشريط العلوي */
#r_topbar {
  display: flex;
  justify-content: space-around;
  background: #fff;
  border-bottom: 2px solid #d4a857;
  padding: 10px;
}
#r_topbar a {
  text-decoration: none;
  color: #2d1c0d;
  font-weight: bold;
}

/* ✅ التاريخ */
#r_datebar {
  display: inline-block;
  background: rgba(212,168,87,0.15);
  color: #6d4a1d;
  text-align: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
}

/* ✅ الشعار */
#r_logo {
  text-align: center;
  background: url("images/bg-palms.jpg") no-repeat center/cover;
  padding: 30px;
}
#r_logo img {
  max-width: 380px; /* الحجم الافتراضي على الكمبيوتر */
  height: auto;
}

.section_block {
  background: #fff;
  border-radius: 32px;
  padding: 30px;
  margin: 30px 0;
  box-shadow: 0 25px 60px rgba(12,57,100,0.08);
}

.section_header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.eyebrow {
  font-size: 14px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #b07b20;
  margin: 0 0 8px;
}

.section_header h2 {
  margin: 0;
  font-size: 28px;
  color: #0c3964;
}
.section_header small {
  color: #8c7a6b;
}

.section_hint {
  color: #7d6a52;
  font-size: 14px;
}

.hero_section {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  align-items: stretch;
  background: linear-gradient(125deg,#fff7e2,#f1e6d2 45%,#e5f4ff);
  border-radius: 45px;
  padding: 45px;
  margin: 35px 0;
  box-shadow: 0 35px 80px rgba(12,57,100,0.15);
}

.hero_content {
  flex: 2;
  min-width: 280px;
}

.hero_overline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.6);
  color: #b07b20;
  padding: 6px 16px;
  border-radius: 999px;
  font-weight: 700;
  margin-bottom: 18px;
}

.hero_section h1 {
  font-size: 40px;
  margin: 0 0 12px;
  color: #1a2d49;
}

.hero_section p {
  font-size: 18px;
  color: #4d4d4d;
  line-height: 1.7;
}

.hero_actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 25px 0;
}

.hero_btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 12px 24px;
  border: 1px solid transparent;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  background: rgba(255,255,255,0.4);
  color: #0c3964;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.hero_btn.primary {
  background: linear-gradient(135deg,#0c3964,#1e5c8a);
  color: #fff;
  box-shadow: 0 15px 35px rgba(12,57,100,0.3);
}
.hero_btn.ghost {
  border-color: rgba(12,57,100,0.2);
  background: rgba(255,255,255,0.6);
  color: #0c3964;
}
.hero_btn.small {
  padding: 8px 16px;
  font-size: 14px;
}
.hero_btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(12,57,100,0.2);
}

.hero_search {
  display: flex;
  gap: 12px;
  background: #fff;
  border-radius: 20px;
  padding: 12px;
  box-shadow: 0 12px 35px rgba(0,0,0,0.08);
}
.hero_search input {
  flex: 1;
  border: none;
  font-size: 16px;
  padding: 12px;
  border-radius: 12px;
  background: #f3f6fb;
}
.hero_search button {
  border-radius: 16px;
  border: none;
  background: #d4a857;
  color: #2d1c0d;
  font-weight: 700;
  padding: 12px 18px;
  cursor: pointer;
}

.hero_showcase {
  flex: 1.2;
  min-width: 260px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.hero_logo_card {
  background: rgba(255,255,255,0.85);
  border-radius: 30px;
  padding: 24px;
  text-align: center;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.6);
}
.hero_logo_card img {
  width: 160px;
  max-width: 100%;
  margin-bottom: 10px;
}
.hero_logo_card span {
  display: block;
  margin-top: 8px;
  font-size: 14px;
  color: #6d5a47;
}

.hero_stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}
.hero_stat {
  background: rgba(255,255,255,0.75);
  border-radius: 18px;
  padding: 16px;
  text-align: center;
  box-shadow: 0 10px 25px rgba(0,0,0,0.07);
}
.hero_stat span {
  display: block;
  font-size: 13px;
  color: #6d5a47;
}
.hero_stat strong {
  font-size: 26px;
  color: #0c3964;
}

.section_controls {
  display: flex;
  gap: 10px;
  align-items: center;
}

.section_controls .r_slider-btn {
  position: static;
  transform: none;
  background: rgba(12,57,100,0.08);
  color: #0c3964;
  border: none;
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
}
.recent_header {
  align-items: flex-start;
}
.recent_filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.recent_filter {
  border: 1px solid rgba(12,57,100,0.2);
  background: #fff;
  color: #0c3964;
  border-radius: 999px;
  padding: 8px 18px;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s ease;
}
.recent_filter.active {
  background: #0c3964;
  color: #fff;
  box-shadow: 0 10px 25px rgba(12,57,100,0.2);
}
.recent_materials_grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.recent_card {
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 15px 40px rgba(0,0,0,0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(12,57,100,0.05);
  transition: transform .25s ease, box-shadow .25s ease;
}
.recent_card:hover {
  transform: translateY(-6px);
  box-shadow: 0 30px 65px rgba(12,57,100,0.15);
}
.recent_card_media {
  position: relative;
  height: 180px;
  overflow: hidden;
}
.recent_card_media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.recent_card_badge {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(0,0,0,0.65);
  color: #fff;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}
.recent_card_body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.recent_card_body h3 {
  margin: 0;
  font-size: 20px;
  color: #0c3964;
}
.recent_card_body p {
  margin: 0;
  color: #5c5c5c;
  line-height: 1.6;
  font-size: 15px;
}
.recent_card_meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  color: #8c7e6b;
}
.recent_card_actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
}
.recent_card_btn {
  flex: 1;
  text-align: center;
  border-radius: 12px;
  padding: 10px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid rgba(12,57,100,0.15);
  color: #0c3964;
  transition: background .2s ease, color .2s ease;
}
.recent_card_btn.primary {
  background: #0c3964;
  color: #fff;
  border-color: #0c3964;
}
.recent_card_btn:hover {
  background: #0c3964;
  color: #fff;
}
.recent_placeholder {
  grid-column: 1 / -1;
  text-align: center;
  padding: 30px;
  color: #6b5a40;
  background: #f9f1e3;
  border-radius: 18px;
  border: 1px dashed rgba(180,130,50,0.6);
}

.subscribe_block {
  display: flex;
  flex-direction: column;
  gap: 15px;
  background: none;
  box-shadow: none;
  padding: 0;
}

#r_subscribe {
  text-align: right;
  background: linear-gradient(135deg,#0c3964,#153b5f);
  color: #fff;
  padding: 35px;
  border-radius: 28px;
  max-width: none;
  box-shadow: 0 35px 60px rgba(12,57,100,0.3);
}
#r_subscribe h2 {
  margin: 0;
  color: #fff;
}
#r_subscribe .section_hint {
  color: rgba(255,255,255,0.8);
}
.subscribe_block .r_subscribe-box {
  width: 100%;
  justify-content: flex-start;
}
.subscribe_block .r_input {
  max-width: 420px;
}
.subscribe_block .r_btn {
  background: #d4a857;
  color: #2d1c0d;
}
.subscribe_block .r_social-btn {
  background: rgba(255,255,255,0.2);
  color: #fff;
}
/* ✅ على الشاشات المتوسطة (تابلت) */
@media (max-width: 992px) {
  #r_logo img {
    max-width: 300px;
  }
}

/* ✅ على الموبايل */
@media (max-width: 600px) {
  #r_logo img {
    max-width: 220px;
  }
}

/* 🎨 تنسيقات الاشتراك */
#r_subscribe {
  text-align: center;
  background: #f7fafd;
  padding: 30px 15px;
  border-radius: 16px;
  max-width: 420px;
  margin: 30px auto;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
  font-family: "Cairo", sans-serif;
}

.r_subscribe-text {
  font-size: 18px;
  margin-bottom: 15px;
  color: #0c3964;
}

.r_subscribe-box {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 20px;
}

.r_input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #b7ccd9;
  border-radius: 8px;
  font-size: 15px;
  outline: none;
}
.r_input:focus {
  border-color: #0a856b;
  box-shadow: 0 0 4px #0a856b44;
}

.r_btn {
  background: #0a856b;
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 15px;
}
.r_btn:hover {
  background: #086d56;
}

.r_social {
  display: flex;
  justify-content: center;
  gap: 15px;
}

.r_social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 20px;
  color: #fff;
  transition: 0.3s;
}

.r_social-btn.telegram {
  background: #229ed9;
}
.r_social-btn.whatsapp {
  background: #25d366;
}
.r_social-btn:hover {
  transform: scale(1.1);
}

/* ✅ الأخبار */
#r_news {
  background: #2d1c0d;
  color: #ffd966;
  height: 35px;
  line-height: 35px;
  overflow: hidden;
  white-space: nowrap;
  position: relative;
  border-top: 2px solid #d4a857;
  border-bottom: 2px solid #d4a857;
  border-radius: 18px;
  padding: 0 10px;
}
.r_news-track {
  display: inline-block;
  padding-left: 100%;
  animation: scrollX 20s linear infinite;
}
#r_news:hover .r_news-track { animation-play-state: paused; }
@keyframes scrollX {
  from { transform: translateX(-100%); }
  to   { transform: translateX(100%); }
}
/* ✅ السلايدر الكاروسيل */
#r_slider_wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
}
#r_slider_main {
  display: flex;
  transition: transform 0.5s ease-in-out;
}
.r_slide {
  flex: 0 0 33.3%; /* 3 على الشاشات الكبيرة */
  box-sizing: border-box;
  padding: 5px;
}
.r_slide a {
  display: block;
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none;
}
.r_slide img {
  width: 100%;
  height: 200px;
  object-fit: cover;   /* ✅ احتواء الصورة كاملة */
  background: #000;      /* خلفية فارغة إذا الصورة ما غطت الإطار */
  border-radius: 10px;
}

.r_slide-caption {
  position: absolute;
  bottom: 0;
  right: 0;
  left: 0;
  background: rgba(0,0,0,0.6); /* ضل خلف العنوان */
  color: #fff;
  font-family: "Cairo", "Amiri", serif;
  font-size: 15px;
  padding: 8px;
  text-align: center;
}

.r_slider {
  position: relative;
  overflow: hidden;
  width: 100%;
  margin: 0;
  border-radius: 24px;
  background: linear-gradient(135deg,#0c3964,#102b44);
  padding: 20px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
}

.r_slider-track {
  display: flex;
  transition: transform 0.5s ease;
}

.r_card {
  flex: 0 0 100%;
  box-sizing: border-box;
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  text-align: right;
  box-shadow: 0 15px 35px rgba(0,0,0,0.18);
}

.r_card img {
  width: 100%;
  height: 240px;
  object-fit: cover;
}

.r_card-body {
  padding: 16px 18px 24px;
}

.r_card-body h3 {
  margin: 0 0 8px;
  color: #0c3964;
  font-size: 20px;
}
.r_card-body p {
  margin: 0;
  color: #555;
  font-size: 15px;
  line-height: 1.6;
}

.r_slider-btn {
  background: rgba(12,57,100,0.08);
  color: #0c3964;
  border: none;
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
}

/* ✅ النقاط */
#r_slider_dots {
  text-align: center;
  margin-top: 8px;
}
.r_dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin: 0 3px;
  background: #ccc;
  border-radius: 50%;
  cursor: pointer;
}
.r_dot.active {
  background: #d4a857;
}

/* ✅ استجابة للموبايل */
@media (max-width: 768px) {
  .r_slide { flex: 0 0 50%; } /* بطاقتين */
}


/* ✅ عناوين الأقسام */
.r_section-title {
  text-align: center;
  margin: 20px 0 10px;
  font-size: 18px;
  color: #2d1c0d;
}


.r_search-box {
  display: flex;
  justify-content: center;
  margin: 20px 0;
}

.r_search-box input {
  width: 60%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 8px 0 0 8px;
  font-size: 16px;
}

.r_search-box button {
  padding: 10px 20px;
  border: none;
  background: #0c3964;
  color: #fff;
  border-radius: 0 8px 8px 0;
  cursor: pointer;
}

/* ✅ شبكة التصنيفات */
#r_grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  padding: 0;
}
.r_grid-item {
  background: #fff;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 20px 45px rgba(0,0,0,0.08);
  transition: transform 0.3s, box-shadow 0.3s;
  position: relative;
}
.r_grid-item:hover {
  transform: translateY(-6px);
  box-shadow: 0 30px 60px rgba(0,0,0,0.12);
}
.r_grid-item img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}
.r_grid-caption {
  padding: 18px;
  text-align: center;
  background: #fff;
  color: #0c3964;
  font-size: 16px;
  font-family: "Amiri", serif;
  font-weight: 700;
}

/* ✅ الشارة */
.r_badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: #d4a857;
  color: #2d1c0d;
  font-size: 13px;
  font-weight: bold;
  padding: 3px 7px;
  border-radius: 12px;
}

/* شبكة البطاقات كما اتفقنا */
.r_cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.r_card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
.r_card:hover { transform: translateY(-5px); box-shadow: 0 6px 15px rgba(0,0,0,.1); }

.r_card-img { width: 100%; height: 150px; object-fit: cover; display: block; }

.r_card-body { padding: 12px; }
.r_card-body h3 { font-size: 16px; margin: 0 0 8px; color: #0c3964; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r_card-body p  { font-size: 14px; color: #555; margin: 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* Skeleton */
.r_card--skeleton .r_card-img { background: #eef2f7; }
.sk-line { height: 12px; background: #eef2f7; border-radius: 6px; margin: 8px 0; }
.sk-line--title { width: 70%; height: 14px; }
.sk-line--text  { width: 90%; }

.r_empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 24px;
  background: #f7fafc;
  border: 1px dashed #cbd5e0;
  border-radius: 12px;
  color: #4a5568;
}




/* ✅ الفوتر */
/* ثابت أسفل الصفحة عند قلة المحتوى ويبدو متسقًا */
#r_footer {
  background: #2d1c0d;
  color: #fff;
  text-align: center;
  padding: 12px 10px;
  font-size: 14px;
}

html, body { height: 100%; }
body { display: flex; flex-direction: column; }
/* اجعل المحتوى يأخذ المتبقي ليدفع الفوتر للأسفل */
body > :not(#r_footer) { flex-shrink: 0; }
#r_footer { margin-top: auto; }


/* ✅ الكاروسيل المعدل */
#r_slider_wrapper {
  width: 100%;
  overflow: hidden;
}

#r_slider_main {
  display: flex;
  gap: 16px;
  transition: transform 0.5s ease-in-out;
  will-change: transform;
}

/* كل شريحة ثابتة 400×400 */
.r_slide_item { flex: 0 0 400px; }


.r_slide_item a {
  display: block;
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none;
}

.r_slide_item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
  border-radius: 10px;
}

/* النص أسفل الصورة */
.r_slide-caption {
  position: absolute;
  bottom: 0;
  right: 0;
  left: 0;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-family: "Cairo","Amiri",serif;
  font-size: 15px;
  padding: 8px;
  text-align: center;
}

@media (max-width: 992px) {
  .hero_section {
    padding: 30px;
  }
  .hero_search {
    flex-direction: column;
  }
  .hero_search button {
    width: 100%;
  }
  .hero_showcase {
    width: 100%;
    order: -1;
  }
  .section_block {
    padding: 24px;
  }
}

@media (max-width: 600px) {
  #r_topbar {
    flex-direction: column;
    gap: 6px;
  }
  .hero_section h1 {
    font-size: 30px;
  }
  .hero_actions {
    flex-direction: column;
  }
  .hero_btn {
    width: 100%;
    justify-content: center;
  }
  .section_header {
    flex-direction: column;
    align-items: flex-start;
  }
  .section_controls {
    width: 100%;
    justify-content: flex-start;
  }
  .recent_filters {
    width: 100%;
    justify-content: flex-start;
  }
  .recent_card_actions {
    flex-direction: column;
  }
  .recent_card_btn {
    width: 100%;
  }
  #r_news {
    height: auto;
    line-height: 1.6;
    padding: 12px;
  }
}

/* حساب عدد العناصر الظاهرة حسب العرض */
/* تخطيط مرن: على الديسكتوب 3، تابلت 2، موبايل 1 */
@media (min-width: 993px) {
  .r_slide_item { flex-basis: calc((100% - 2 * 16px) / 3); }
}
@media (min-width: 601px) and (max-width: 992px) {
  .r_slide_item { flex-basis: calc((100% - 1 * 16px) / 2); }
}
@media (max-width: 600px) {
  .r_slide_item { flex-basis: 100%; }
}

/* نقاط المؤشر للسلايدر */
#r_slider_dots { display: flex; gap: 8px; justify-content: center; margin: 10px 0 0; }
.r_dot { width: 8px; height: 8px; border-radius: 50%; background: #c8c8c8; cursor: pointer; transition: background .2s; }
.r_dot.active { background: #d4a857; }

#r_news .r_news-item {
  color: #ffd966;
  text-decoration: none;
  margin: 0 10px;
  white-space: nowrap;
}
#r_news .r_news-item:hover {
  text-decoration: underline;
}
