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

/* ═══════════════════════════════════════════════════════════════════════════
   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. نمط 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); }

/* ═══════════════════════════════════════════════════════════════════════════
   3. 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; }

/* ═══════════════════════════════════════════════════════════════════════════
   4. 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); }
}

@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%; }
}

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