/**
 * tabs.css — التبويبات ومكوّن hero-tabs
 * يغطي: sw-tabs (عادية + sidebar + grid-nav) + sw-tab-onebig + sw-hero-tabs
 * @package SW_Theme
 * @version 4.4.3
 */

/* ═══════════════════════════════════════════════════════════════════════════
   1. TABS — التبويبات الأساسية
   ═══════════════════════════════════════════════════════════════════════════ */
.sw-tabs { }

.sw-tabs .tabs-nav {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--sw-gray-200);
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.sw-tabs .tab-btn {
  background: none; border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  padding: 9px 16px;
  font-size: .875rem; font-weight: 700;
  color: var(--sw-gray-600);
  cursor: pointer;
  transition: all var(--sw-tr);
  font-family: inherit;
}

.sw-tabs .tab-btn:hover { color: var(--sw-primary); }

.sw-tabs .tab-btn.active {
  color: var(--sw-primary);
  border-bottom-color: var(--sw-red);
}

.tabs-body { position: relative; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.tab-empty { padding: 20px; text-align: center; color: var(--sw-gray-400); font-size: 0.85rem; }

/* ── نمط Grid Nav ───────────────────────────────────────────────────────── */
.sw-tabs.grid-nav .tabs-nav { border-bottom: none; margin-bottom: 16px; }

.sw-tabs.grid-nav .tabs-nav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px,1fr));
  gap: 8px;
}

.sw-tabs.grid-nav .tab-btn-grid {
  background: var(--sw-gray-100);
  border: 2px solid transparent;
  border-radius: var(--sw-radius);
  padding: 9px 14px;
  font-size: .82rem; font-weight: 700;
  color: var(--sw-gray-600);
  cursor: pointer;
  transition: all var(--sw-tr);
  font-family: inherit;
  text-align: center;
}

.sw-tabs.grid-nav .tab-btn-grid:hover { background: var(--sw-primary-lt); color: var(--sw-primary); }

.sw-tabs.grid-nav .tab-btn-grid.active {
  background: var(--sw-primary);
  color: #fff; border-color: var(--sw-primary);
}

.tab-btn-grid-text { display: block; }

/* ── نمط Sidebar (تبويبات عمودية) ──────────────────────────────────────── */
.sw-tabs-sidebar .tabs-nav {
  flex-direction: column; gap: 0;
  border-bottom: none;
  border-left: 3px solid var(--sw-primary);
  padding-left: 0;
  margin-bottom: 16px;
}

.sw-tabs-sidebar .tab-btn {
  border-bottom: 1px solid var(--sw-gray-100);
  border-left: 3px solid transparent;
  margin-left: -3px;
  padding: 10px 14px;
  text-align: right; font-size: .85rem;
  color: var(--sw-gray-600);
}

.sw-tabs-sidebar .tab-btn:last-child { border-bottom: none; }

.sw-tabs-sidebar .tab-btn.active {
  color: var(--sw-primary);
  border-left-color: var(--sw-red);
  background: var(--sw-primary-lt);
  border-bottom-color: var(--sw-gray-100);
}

/* ═══════════════════════════════════════════════════════════════════════════
   2. أنماط المحتوى الجديدة (Grid & List)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── 2.1 نمط الشبكة (Grid) ──────────────────────────────────────────────── */
.sw-tab-grid-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 20px;
  direction: rtl;
}

.sw-grid-card {
  background: #fff;
  border-radius: var(--sw-radius);
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  transition: transform var(--sw-tr), box-shadow var(--sw-tr);
}

.sw-grid-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.sw-grid-card-thumb img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  display: block;
}

.sw-grid-card-body {
  padding: 14px 16px 18px;
}

.sw-grid-card-body .sw-grid-cat {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
}

.sw-grid-card-title {
  font-size: 16px;
  line-height: 1.5;
  margin: 0;
  font-weight: 700;
}

.sw-grid-card-title a {
  color: var(--sw-gray-900);
  text-decoration: none;
  transition: color var(--sw-tr);
}

.sw-grid-card-title a:hover {
  color: var(--sw-primary);
}

/* ── 2.2 نمط القائمة (List) ─────────────────────────────────────────────── */
.sw-tab-list-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 10px;
}

.sw-list-card {
  display: flex;
  align-items: flex-start;
  background: #fff;
  padding: 16px;
  border-radius: var(--sw-radius);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  border: 1px solid var(--sw-gray-100);
  transition: box-shadow var(--sw-tr);
}

.sw-list-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.sw-list-card-body {
  flex: 1;
  padding-left: 16px; /* في الاتجاه RTL، اليسار هو الفراغ بعد العنصر */
}

.sw-list-card-body .sw-list-cat {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  margin-bottom: 4px;
}

.sw-list-card-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 8px;
  line-height: 1.4;
}

.sw-list-card-title a {
  color: var(--sw-gray-900);
  text-decoration: none;
}

.sw-list-card-title a:hover {
  color: var(--sw-primary);
}

.sw-list-card-thumb {
  width: 110px;
  height: 80px;
  flex-shrink: 0;
  border-radius: var(--sw-radius);
  overflow: hidden;
}

.sw-list-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ═══════════════════════════════════════════════════════════════════════════
   3. نمط onebig — مقال كبير + مقالات جانبية
   ═══════════════════════════════════════════════════════════════════════════ */
.sw-tab-onebig { display: flex; gap: 20px; }
.sw-tab-onebig-main { flex: 0 0 50%; max-width: 50%; }
.sw-tab-onebig-side { flex: 1; display: flex; flex-direction: column; gap: 0; }

.tab-ob-main { }

.tab-ob-thumb {
  position: relative; border-radius: var(--sw-radius); overflow: hidden; margin-bottom: 12px;
}

.tab-ob-thumb img { width: 100%; aspect-ratio: 16/10; object-fit: cover; display: block; }

.tab-ob-cat {
  position: absolute; bottom: 10px; right: 10px;
  background: var(--sw-primary); color: #fff;
  padding: 2px 10px; border-radius: 3px;
  font-size: .7rem; font-weight: 700; text-decoration: none;
}

.tab-ob-title { font-size: 1rem; font-weight: 800; margin: 0 0 8px; line-height: 1.5; }
.tab-ob-title a { color: var(--sw-gray-900); text-decoration: none; }
.tab-ob-title a:hover { color: var(--sw-red); }
.tab-ob-excerpt { font-size: .82rem; color: var(--sw-gray-600); line-height: 1.65; margin: 0 0 8px; }

.tab-ob-meta,
.tab-ob-item-meta { font-size: 0.75rem; color: var(--sw-gray-400); display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }

.tab-ob-item {
  display: flex; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--sw-gray-100);
  text-decoration: none;
  transition: background var(--sw-tr);
}

.tab-ob-item:last-child { border-bottom: none; }
.tab-ob-item:hover { background: var(--sw-primary-lt); padding-inline: 6px; }

.tab-ob-item-thumb { flex: 0 0 84px; }
.tab-ob-item-thumb img { width: 84px; height: 60px; object-fit: cover; border-radius: 4px; display: block; }
.tab-ob-item-body { flex: 1; min-width: 0; }
.tab-ob-item-title { font-size: .85rem; font-weight: 700; line-height: 1.5; margin: 0 0 4px; color: var(--sw-gray-900); }
.tab-ob-item-title:hover { color: var(--sw-red); }

/* ═══════════════════════════════════════════════════════════════════════════
   4. HERO TABS (sw_tabs_hero) — سلايدر مع تبويبات
   ═══════════════════════════════════════════════════════════════════════════ */
.sw-section--hero-tabs { }

.sw-ht-wrap {
  display: grid;
  grid-template-columns: 1fr 240px;
  min-height: 420px;
  border-radius: var(--sw-radius-lg);
  overflow: hidden;
  box-shadow: var(--sw-shadow-lg);
}

.sw-ht-slides { position: relative; }

.sw-ht-slide { display: none; position: relative; height: 420px; overflow: hidden; }
.sw-ht-slide.sw-ht-active { display: block; }
.sw-ht-slide img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.sw-ht-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.82) 0%, transparent 55%); }

.sw-ht-content { position: absolute; bottom: 0; right: 0; left: 0; padding: 24px 20px; color: #fff; }

.sw-ht-cat { display: inline-block; color: #fff; padding: 2px 9px; border-radius: 3px; font-size: .7rem; font-weight: 700; margin-bottom: 8px; }
.sw-ht-title { font-size: 1.4rem; font-weight: 900; line-height: 1.4; margin: 0 0 8px; }
.sw-ht-title a { color: #fff; text-decoration: none; }
.sw-ht-meta { font-size: .82rem; color: rgba(255,255,255,.72); }

.sw-ht-thumbs { background: #12182b; display: flex; flex-direction: column; overflow-y: auto; }

.sw-ht-thumb {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border: none; background: transparent;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,.07);
  text-align: right;
  transition: background var(--sw-tr);
}

.sw-ht-thumb:hover,
.sw-ht-thumb.sw-ht-active { background: rgba(255,255,255,.1); }

.sw-ht-thumb img { width: 54px; height: 40px; object-fit: cover; border-radius: 3px; flex-shrink: 0; }

.sw-ht-thumb-title {
  font-size: .78rem; color: #ccc; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ── sw_tabs_hero (الـ layout المختلف عن hero_tabs) ────────────────────── */
.sw-hero-tabs { position: relative; margin-bottom: 30px; }

.sw-hero-tabs-nav {
  display: flex; gap: 8px; margin-bottom: 20px;
  border-bottom: 2px solid var(--sw-gray-200);
  overflow-x: auto; white-space: nowrap;
  scrollbar-width: none;
}
.sw-hero-tabs-nav::-webkit-scrollbar { display: none; }

.sw-hero-tab-btn {
  background: none; border: none;
  padding: 8px 16px;
  font-weight: 700; font-size: .875rem;
  color: var(--sw-gray-600);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color var(--sw-tr), border-color var(--sw-tr);
  font-family: inherit;
  white-space: nowrap; flex-shrink: 0;
}

.sw-hero-tab-btn:hover { color: var(--sw-primary); }
.sw-hero-tab-btn.active { color: var(--sw-primary); border-bottom-color: var(--sw-red); }

.sw-hero-tab-panel { display: none; }
.sw-hero-tab-panel.active { display: block; }

.sw-hero-tab-slider {
  display: flex; gap: 20px;
  overflow-x: auto; scroll-snap-type: x mandatory;
  padding-bottom: 10px; scrollbar-width: none;
}
.sw-hero-tab-slider::-webkit-scrollbar { display: none; }

.sw-hero-tab-slide { flex: 0 0 calc(33.333% - 14px); scroll-snap-align: start; min-width: 0; }

/* ═══════════════════════════════════════════════════════════════════════════
   5. Responsive
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 860px) {
  /* --- تعديلات الهيرو --- */
  .sw-ht-wrap { grid-template-columns: 1fr; }
  .sw-ht-thumbs { flex-direction: row; overflow-x: auto; background: #f0f2f8; }
  .sw-ht-thumb { flex-direction: column; min-width: 100px; border-bottom: none; border-left: 1px solid var(--sw-gray-200); }
  .sw-ht-thumb-title { font-size: .7rem; color: var(--sw-gray-600); }
  .sw-tabs-sidebar .tabs-nav { flex-direction: row; border-left: none; border-bottom: 2px solid var(--sw-gray-200); overflow-x: auto; }
  .sw-tabs-sidebar .tab-btn { border-left: none; border-bottom: 2px solid transparent; margin-left: 0; margin-bottom: -2px; }
  .sw-tab-onebig { flex-direction: column; }
  .sw-tab-onebig-main { max-width: 100%; flex: none; }
  .sw-hero-tab-slide { flex: 0 0 calc(50% - 10px); }
  
  /* --- تعديلات الشبكة (Grid) --- */
  .sw-tab-grid-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .sw-tabs.grid-nav .tabs-nav-grid { grid-template-columns: repeat(2,1fr); }
  .sw-hero-tab-slide { flex: 0 0 100%; }
  
  /* --- تعديلات الشبكة (Grid) للجوال --- */
  .sw-tab-grid-container {
    grid-template-columns: 1fr;
  }
  
  /* --- تعديلات القائمة (List) للجوال --- */
  .sw-list-card {
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 10px;
  }
  .sw-list-card-body {
    padding-left: 0;
  }
  .sw-list-card-thumb {
    width: 100%;
    height: 160px;
  }
}

@media (min-width: 1200px) {
  .sw-tabs.grid-nav .tabs-nav-grid { grid-template-columns: repeat(4,1fr); }
}

/* ============================================================
   تبويبات - واحد كبير + صغار (نمط الشبكة الاحترافي)
   ============================================================ */

.sw-tab-onebig--grid {
    display: flex;
    gap: 24px;
    align-items: stretch;
    margin-top: 10px;
}
.sw-onebig-main {
    flex: 0 0 50%;
    max-width: 50%;
}
.sw-onebig-side {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* بطاقة الأخبار الأساسية */
.sw-news-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    color: inherit;
}
.sw-news-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}
.sw-news-card img,
.sw-news-card .sw-news-img-placeholder {
    width: 100%;
    aspect-ratio: 16/10;
    object-fit: cover;
    display: block;
}
.sw-news-img-placeholder {
    background: #f0f0f1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: #ccc;
}

/* شارة التصنيف (تظهر فوق الصورة أو أسفلها حسب CSS) */
.sw-news-cat {
    display: inline-block;
    padding: 3px 12px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    align-self: flex-start; /* إذا أردتها فوق الصورة، ضعها في البطاقة قبل الصورة */
    /* أو يمكنك استخدام position: absolute إذا أردتها داخل الصورة */
}

/* جسم البطاقة */
.sw-news-body {
    padding: 14px 16px 16px;
}
.sw-news-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 6px;
    line-height: 1.4;
    color: #1a202c;
}
.sw-news-title:hover {
    color: var(--sw-primary, #2E3192);
}
.sw-news-excerpt {
    font-size: 14px;
    color: #555;
    line-height: 1.6;
    margin: 0 0 12px;
}
.sw-news-footer {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 13px;
    color: #888;
}
.sw-news-footer span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* البطاقة الرئيسية (Featured) */
.sw-news-featured .sw-news-title {
    font-size: 20px;
}
.sw-news-featured .sw-news-excerpt {
    font-size: 15px;
}

/* التجاوب */
@media (max-width: 860px) {
    .sw-tab-onebig--grid {
        flex-direction: column;
    }
    .sw-onebig-main {
        flex: none;
        max-width: 100%;
    }
    .sw-onebig-side {
        width: 100%;
        grid-template-columns: 1fr 1fr;
    }
}
@media (max-width: 600px) {
    .sw-onebig-side {
        grid-template-columns: 1fr;
    }
}

.sw-onebig-side .sw-news-footer { display: none;}

.sw-tab-more {
    margin: 1.2rem 0 0 0;             
    padding: 0.7rem 1.2rem;
    background: rgba(200, 168, 75, 0.06);
    border-top: 1px solid rgba(200, 168, 75, 0.18);
    border-radius: 0 0 12px 12px;  
    text-align: start;
}


.sw-tab-onebig--grid + .sw-tab-more,
.sw-tab-grid-container + .sw-tab-more,
.sw-tab-list-container + .sw-tab-more,
.tab-panel > .sw-tab-more {
    margin-left: -20px;
    margin-right: -20px;
    padding-left: 20px;
    padding-right: 20px;
    border-radius: 0 0 12px 12px;
}

/* الرابط نفسه */
.sw-tab-more-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--yrp-gold, #c8a84b);
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    transition: color 0.2s;
}

.sw-tab-more-link:hover {
    color: var(--yrp-gold-light, #e2c97e);
}

.sw-tab-more-link i {
    font-size: 12px;
    transition: transform 0.2s;
}

.sw-tab-more-link:hover i {
    transform: translateX(-3px); 
}