/*
Theme Name: عرب فايف
Theme URI: https://example.com
Author: فريق عرب فايف
Author URI: https://example.com
Description: قالب ووردبريس أخباري سريع، متوافق مع RankMath SEO وإعلانات Google AdSense، مبني بأكواد نظيفة بدون إضافات ثقيلة، مع دعم كامل للغة العربية RTL.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Tested up to: 6.6
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: arab-five
Tags: news, blog, grid-layout, right-to-left, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* ============================================
   1) إعادة ضبط أساسية (Reset) - بدون مكتبات خارجية
============================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  direction: rtl;
  text-align: right;
  font-family: "Tahoma", "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: #1a1a1a;
  background: #f7f7f8;
  overflow-x: hidden; /* حماية من أي عنصر أعرض من الشاشة (فيديو مضمّن، جدول، نص طويل بدون مسافات) */
  width: 100%;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* أي فيديو أو تضمين (يوتيوب، تويتر...) جوه محتوى المقال لازم يبقى Responsive */
.atlas-single__content iframe,
.atlas-single__content embed,
.atlas-single__content object,
.atlas-single__content video {
  max-width: 100%;
}

.atlas-single__content table {
  max-width: 100%;
  display: block;
  overflow-x: auto;
}

/* حماية من أي نص/رابط طويل بدون مسافات (زي رابط إنجليزي طويل) يكسر عرض الصفحة */
.atlas-single__content,
.atlas-breadcrumbs {
  overflow-wrap: break-word;
  word-wrap: break-word;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

h1, h2, h3, h4 {
  margin: 0 0 .5em;
  line-height: 1.3;
  font-weight: 700;
}

/* ============================================
   2) الحاوية العامة
============================================ */
.atlas-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ============================================
   3) الهيدر
============================================ */

/* شريط علوي داكن يعرض التاريخ */
.atlas-topbar {
  background: #0e2a4a;
  color: #cfd8e3;
  font-size: 12px;
}

.atlas-topbar__inner {
  padding: 6px 0;
  display: flex;
  justify-content: flex-start;
}

.atlas-header {
  background: #fff;
  border-bottom: 3px solid #f5821f;
}

.atlas-header__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  gap: 12px;
}

.atlas-logo {
  font-size: 26px;
  font-weight: 800;
  color: #f5821f;
}

.atlas-logo img {
  max-height: 50px;
}

.atlas-header__icons {
  display: flex;
  align-items: center;
  gap: 4px;
}

.atlas-menu-toggle,
.atlas-search-toggle {
  background: none;
  border: 0;
  font-size: 20px;
  cursor: pointer;
  color: #0e2a4a;
  padding: 6px 10px;
}

/* صندوق البحث المنسدل (مخفي افتراضيًا) */
.atlas-search-box {
  display: none;
  border-top: 1px solid #eee;
  padding: 14px 0;
}

.atlas-search-box.is-open {
  display: block;
}

.atlas-search-box form {
  display: flex;
  gap: 8px;
}

.atlas-search-box input[type="search"] {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.atlas-search-box button {
  background: #f5821f;
  color: #fff;
  border: 0;
  border-radius: 4px;
  padding: 0 16px;
  cursor: pointer;
}

/* قائمة التنقل */
.atlas-nav {
  border-top: 1px solid #eee;
}

.atlas-nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
}

.atlas-nav a {
  display: block;
  padding: 10px 14px;
  font-weight: 600;
  font-size: 14px;
}

.atlas-nav a:hover {
  color: #f5821f;
}

/* ============================================
   3.1) شريط "عاجل" المتحرك
============================================ */
.atlas-breaking {
  background: #0e2a4a;
}

.atlas-breaking__inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
}

.atlas-breaking__badge {
  background: #f5821f;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: 3px;
  white-space: nowrap;
  flex-shrink: 0;
}

.atlas-breaking__ticker {
  flex: 1;
  overflow: hidden;
  height: 20px;
  position: relative;
}

.atlas-breaking__ticker ul {
  position: relative;
}

.atlas-breaking__ticker li {
  display: none;
  height: 20px;
  line-height: 20px;
}

.atlas-breaking__ticker li.is-active {
  display: block;
}

.atlas-breaking__ticker a {
  color: #fff;
  font-size: 13px;
}

.atlas-breaking__nav {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.atlas-breaking__prev,
.atlas-breaking__next {
  background: rgba(255,255,255,.1);
  border: 0;
  color: #fff;
  width: 24px;
  height: 24px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 14px;
}

/* ============================================
   4) مساحات الإعلانات - أبعاد ثابتة لمنع Layout Shift (CLS)
   مهم جدًا لتوافق AdSense وCore Web Vitals
============================================ */
.atlas-ad-slot {
  width: 100%;
  margin: 20px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0f0f0;
  overflow: hidden;
}

.atlas-ad-slot--header {
  min-height: 90px; /* leaderboard 728x90 */
}

.atlas-ad-slot--in-content {
  min-height: 250px; /* medium rectangle 300x250 */
  max-width: 300px;
}

.atlas-ad-slot--sidebar {
  min-height: 250px;
}

.atlas-ad-slot--footer {
  min-height: 90px;
}

.atlas-ad-slot span {
  font-size: 11px;
  color: #999;
}

/* ============================================
   5) الشبكة الإخبارية (Grid) - الصفحة الرئيسية
============================================ */
.atlas-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  padding: 24px 0;
}

@media (min-width: 992px) {
  .atlas-layout {
    grid-template-columns: 2.2fr 1fr;
    align-items: start;
  }
}

.atlas-news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.atlas-card {
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
  transition: transform .15s ease;
}

.atlas-card:hover {
  transform: translateY(-3px);
}

.atlas-card__thumb {
  display: block;
  aspect-ratio: 16 / 9; /* يحجز المساحة قبل تحميل الصورة لمنع CLS */
  background: #e5e5e5;
  overflow: hidden;
}

.atlas-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.atlas-card__body {
  padding: 14px;
}

.atlas-card__cat {
  display: inline-block;
  background: #f5821f;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 3px;
  margin-bottom: 8px;
}

.atlas-card__title {
  font-size: 17px;
  margin-bottom: 6px;
}

.atlas-card__meta {
  font-size: 12px;
  color: #777;
}

/* ============================================
   5.1) الهيرو - الخبر الرئيسي + قائمة آخر الأخبار
============================================ */
.atlas-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  max-width: 1200px;
  margin: 20px auto;
  padding: 0 16px;
}

@media (min-width: 992px) {
  .atlas-hero {
    grid-template-columns: 2.2fr 1fr;
    align-items: stretch;
  }
}

/* بطاقة الهيرو الكبيرة - صورة مع تراكب نص */
.atlas-hero-card {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  min-height: 320px;
  background: #1a1a1a;
}

.atlas-hero-card__thumb {
  display: block;
  position: relative;
  height: 100%;
  min-height: 320px;
}

.atlas-hero-card__thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.atlas-hero-card__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px;
  background: linear-gradient(0deg, rgba(0,0,0,.85) 0%, rgba(0,0,0,.15) 65%, transparent 100%);
  color: #fff;
}

.atlas-hero-card__title {
  font-size: 26px;
  color: #fff;
  margin: 8px 0;
}

.atlas-hero-card__meta {
  font-size: 12px;
  opacity: .85;
}

/* قائمة "آخر الأخبار" الجانبية بجانب الهيرو */
.atlas-hero__rail {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.atlas-rail-card {
  display: flex;
  gap: 10px;
  background: #fff;
  border-radius: 6px;
  padding: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

.atlas-rail-card__thumb {
  display: block;
  flex-shrink: 0;
  width: 90px;
  aspect-ratio: 4 / 3;
  border-radius: 4px;
  overflow: hidden;
  background: #e5e5e5;
}

.atlas-rail-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.atlas-rail-card__title {
  font-size: 14px;
  margin: 2px 0 4px;
  line-height: 1.5;
}

/* ============================================
   5.2) أقسام الصفحة الرئيسية (تجارة وأعمال، مصر، رياضة...)
============================================ */
.atlas-section {
  margin: 32px 0;
}

.atlas-section__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 19px;
  background: linear-gradient(90deg, rgba(245,130,31,.08), rgba(14,42,74,.03));
  border-inline-start: 4px solid #f5821f;
  border-radius: 4px;
  padding: 12px 16px;
  margin-bottom: 18px;
}

.atlas-section__more {
  font-size: 13px;
  font-weight: 600;
  color: #f5821f;
}

.atlas-section__footer {
  text-align: center;
  margin-top: 20px;
}

.atlas-btn {
  display: inline-block;
  background: #0e2a4a;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 26px;
  border-radius: 4px;
}

/* ============================================
   5.3) قائمة "أحدث الأخبار" الأفقية (صورة + مقتطف)
============================================ */
.atlas-news-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.atlas-list-item {
  display: flex;
  gap: 16px;
  background: #fff;
  border-radius: 6px;
  padding: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

.atlas-list-item__thumb {
  display: block;
  flex-shrink: 0;
  width: 160px;
  aspect-ratio: 4 / 3;
  border-radius: 5px;
  overflow: hidden;
  background: #e5e5e5;
}

.atlas-list-item__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.atlas-list-item__title {
  font-size: 18px;
  margin: 6px 0;
}

.atlas-list-item__excerpt {
  font-size: 14px;
  color: #555;
  margin: 0 0 8px;
}

/* ============================================
   6) الشريط الجانبي
============================================ */
.atlas-widget {
  background: #fff;
  border-radius: 6px;
  padding: 16px;
  margin-bottom: 20px;
}

.atlas-widget__title {
  font-size: 15px;
  font-weight: 800;
  background: linear-gradient(90deg, rgba(245,130,31,.08), rgba(14,42,74,.03));
  border-inline-start: 4px solid #f5821f;
  border-radius: 4px;
  padding: 10px 12px;
  margin-bottom: 12px;
}

.atlas-widget li {
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 14px;
}

/* سحابة الوسوم */
.atlas-tagcloud a {
  display: inline-block;
  background: #f2f2f2;
  color: #0e2a4a;
  padding: 5px 12px;
  margin: 0 4px 8px;
  border-radius: 20px;
  font-weight: 600;
  text-decoration: none;
}

.atlas-tagcloud a:hover {
  background: #f5821f;
  color: #fff;
}

/* ============================================
   7) صفحة المقال المفرد
============================================ */
.atlas-single {
  background: #fff;
  padding: 24px;
  border-radius: 6px;
}

.atlas-single__title {
  font-size: 28px;
}

.atlas-single__meta {
  color: #777;
  font-size: 13px;
  margin-bottom: 16px;
}

.atlas-single__updated {
  display: block;
  margin-top: 4px;
  color: #999;
}

.atlas-single__thumb {
  max-width: 800px;
  margin: 0 auto 20px;
  border-radius: 6px;
  overflow: hidden;
}

.atlas-single__content {
  font-size: 17px;
  line-height: 1.9;
}

.atlas-single__content p {
  margin: 0 0 1.2em;
}

/* جدول محتويات المقال التلقائي */
.atlas-toc {
  background: linear-gradient(90deg, rgba(245,130,31,.06), rgba(14,42,74,.03));
  border-inline-start: 4px solid #f5821f;
  border-radius: 4px;
  padding: 14px 16px;
  margin: 0 0 20px;
}

.atlas-toc summary {
  cursor: pointer;
  font-weight: 800;
  font-size: 16px;
  color: #0e2a4a;
  outline: none;
}

.atlas-toc[open] summary {
  margin-bottom: 10px;
}

.atlas-toc__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.atlas-toc__item {
  padding: 6px 0;
  border-bottom: 1px solid rgba(14,42,74,.08);
  font-size: 14px;
}

.atlas-toc__item:last-child {
  border-bottom: none;
}

.atlas-toc__item a {
  color: #0e2a4a;
}

.atlas-toc__item a:hover {
  color: #f5821f;
}

.atlas-toc__item--3 {
  padding-inline-start: 18px;
  font-size: 13px;
}

/* العناوين الفرعية جوه محتوى المقال (اللي الكاتب بيحطها من المحرر)
   بنفس شكل ترويسة الأقسام (خلفية متدرجة شفافة + خط تمييز جانبي) */
.atlas-single__content h2,
.atlas-single__content h3 {
  background: linear-gradient(90deg, rgba(245,130,31,.08), rgba(14,42,74,.03));
  border-inline-start: 4px solid #f5821f;
  border-radius: 4px;
  padding: 10px 14px;
  margin: 28px 0 14px;
}

.atlas-single__content h2 {
  font-size: 21px;
}

.atlas-single__content h3 {
  font-size: 18px;
}

.atlas-single__content h4 {
  font-size: 16px;
  border-inline-start: 3px solid #f5821f;
  padding-inline-start: 10px;
  margin: 22px 0 10px;
}

/* استعادة القوائم النقطية/الرقمية جوه محتوى المقال فقط
   (الريست العام بتاع ul في أول الملف بيشيلها من كل الموقع افتراضيًا،
   عشان قايمة الناف والفوتر متطلعش بعلامات نقطية غير مرغوبة) */
.atlas-single__content ul,
.atlas-single__content ol {
  margin: 0 0 1.2em;
  padding-inline-start: 24px;
}

.atlas-single__content ul {
  list-style: disc;
}

.atlas-single__content ol {
  list-style: decimal;
}

.atlas-single__content ul ul,
.atlas-single__content ol ol,
.atlas-single__content ul ol,
.atlas-single__content ol ul {
  margin: 6px 0 0;
}

.atlas-single__content li {
  margin-bottom: 6px;
}

.atlas-breadcrumbs {
  font-size: 13px;
  color: #888;
  margin-bottom: 12px;
}

/* أزرار مشاركة المقال */
.atlas-share {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 22px 0 4px;
}

.atlas-share__label {
  font-size: 14px;
  font-weight: 700;
  color: #555;
}

.atlas-share__btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  line-height: 1;
  flex-shrink: 0;
}

.atlas-share__btn:hover {
  opacity: .85;
}

.atlas-share__btn--facebook {
  background: #1877f2;
}

.atlas-share__btn--twitter {
  background: #000;
}

.atlas-share__btn--whatsapp {
  background: #25d366;
  font-size: 17px;
}

/* مربع نبذة عن الكاتب */
.atlas-author-box {
  display: flex;
  gap: 16px;
  background: #fff;
  border-radius: 6px;
  padding: 18px;
  margin-top: 20px;
  border-inline-start: 4px solid #f5821f;
}

.atlas-author-box__avatar img {
  border-radius: 50%;
  display: block;
}

.atlas-author-box__label {
  display: block;
  font-size: 11px;
  color: #999;
  margin-bottom: 4px;
}

.atlas-author-box__name {
  font-size: 17px;
  margin: 0 0 6px;
}

.atlas-author-box__desc {
  font-size: 14px;
  color: #555;
  margin: 0 0 8px;
}

.atlas-author-box__link {
  font-size: 13px;
  font-weight: 700;
  color: #f5821f;
}

.atlas-author-box--archive {
  margin-top: 20px;
  margin-bottom: 28px;
}

.atlas-author-box--archive .atlas-author-box__name {
  font-size: 22px;
}

/* ترويسة صفحات الأرشيف والبحث */
.atlas-archive-header {
  background: linear-gradient(90deg, rgba(245,130,31,.08), rgba(14,42,74,.03));
  border-inline-start: 4px solid #f5821f;
  border-radius: 4px;
  padding: 16px 18px;
  margin: 20px 0;
}

.atlas-archive-header h1 {
  font-size: 22px;
  margin: 0;
}

.atlas-archive-desc {
  font-size: 14px;
  color: #555;
  margin-top: 8px;
}

/* مقالات ذات صلة */
.atlas-related {
  margin-top: 28px;
}

/* ============================================
   8) الفوتر
============================================ */
.atlas-footer {
  background: #0e2a4a;
  color: #cfd8e3;
  padding: 30px 0;
  margin-top: 30px;
  font-size: 14px;
  text-align: center;
}

.atlas-footer a {
  color: #fff;
}

.atlas-footer__nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
  margin-bottom: 14px;
  font-size: 13px;
}

.atlas-footer__copy {
  color: #9fb0c3;
  font-size: 13px;
  margin: 0;
}

/* زر الرجوع لأعلى الصفحة */
.atlas-to-top {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #f5821f;
  color: #fff;
  border: 0;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
  display: none;
  z-index: 50;
}

.atlas-to-top.is-visible {
  display: block;
}

/* ============================================
   9) استجابة الموبايل
============================================ */
@media (max-width: 767px) {
  .atlas-nav ul {
    display: none;
    flex-direction: column;
  }

  .atlas-nav.is-open ul {
    display: flex;
  }

  .atlas-hero-card__title {
    font-size: 19px;
  }

  .atlas-hero-card,
  .atlas-hero-card__thumb {
    min-height: 220px;
  }

  .atlas-list-item {
    flex-direction: column;
  }

  .atlas-list-item__thumb {
    width: 100%;
  }

  .atlas-to-top {
    left: 12px;
    bottom: 12px;
  }
}

/* ============================================
   10) قسم المقترحات في صفحة 410
============================================ */
.atlas-suggested {
  margin-top: 40px;
  padding-top: 30px;
  border-top: 1px solid #e5e5e5;
}
.skip-link {
  position: absolute;
  right: -9999px;
  top: 0;
  background: #f5821f;
  color: #fff;
  padding: 10px 16px;
  z-index: 999;
}

.skip-link:focus {
  right: 10px;
}
