/**
 * widgets.css — أنماط حزمة ودجات SW
 * كلها على متغيرات --sw-* فتتبع الهوية والوضع الداكن تلقائياً.
 *
 * @package SW_Theme @version 1.0.0
 */

/* ═══ عنصر المقال المشترك ═══════════════════════════════════════════════ */
.sw-w-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--sw-gray-100);
}
.sw-w-item:last-child { border-bottom: none; }

.sw-w-thumb {
  flex: 0 0 64px;
  width: 64px;
  height: 48px;
  border-radius: var(--sw-radius);
  overflow: hidden;
  background: var(--sw-gray-100);
}
.sw-w-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.sw-w-num {
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--sw-blue-lite);
  color: var(--sw-blue);
  font-weight: 900;
  font-size: .8rem;
  border-radius: var(--sw-radius);
  margin-top: 2px;
}
.sw-w-item:first-child .sw-w-num { background: var(--sw-red); color: #fff; }

.sw-w-body { min-width: 0; flex: 1; }
.sw-w-title {
  margin: 0 0 4px;
  font-size: .88rem;
  font-weight: 700;
  line-height: 1.5;
}
.sw-w-title a { color: var(--sw-gray-900); text-decoration: none; transition: color var(--sw-transition); }
.sw-w-title a:hover { color: var(--sw-blue); }
.sw-w-meta { font-size: .72rem; color: var(--sw-gray-400); }
.sw-w-empty { font-size: .85rem; color: var(--sw-gray-400); padding: 12px 0; margin: 0; }

/* ═══ 1. التبويبات ══════════════════════════════════════════════════════ */
.sw-w-tabs-nav {
  display: flex;
  gap: 4px;
  background: var(--sw-gray-100);
  padding: 4px;
  border-radius: var(--sw-radius);
  margin-bottom: 6px;
}
.sw-w-tab {
  flex: 1;
  border: none;
  background: transparent;
  padding: 8px 6px;
  font-family: inherit;
  font-size: .8rem;
  font-weight: 700;
  color: var(--sw-gray-600);
  border-radius: var(--sw-radius);
  cursor: pointer;
  transition: background var(--sw-transition), color var(--sw-transition);
  white-space: nowrap;
}
.sw-w-tab:hover { color: var(--sw-blue); }
.sw-w-tab.sw-active {
  background: var(--sw-white);
  color: var(--sw-blue);
  box-shadow: var(--sw-shadow-sm);
}
.sw-w-tab-panel { display: none; }
.sw-w-tab-panel.sw-active { display: block; animation: sw-w-fade .25s ease; }
@keyframes sw-w-fade {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ═══ 3. البحث ══════════════════════════════════════════════════════════ */
.sw-w-search {
  display: flex;
  background: var(--sw-white);
  border: 2px solid var(--sw-gray-200);
  border-radius: var(--sw-radius);
  overflow: hidden;
  transition: border-color var(--sw-transition), box-shadow var(--sw-transition);
}
.sw-w-search:focus-within {
  border-color: var(--sw-blue);
  box-shadow: 0 0 0 3px var(--sw-blue-lite);
}
.sw-w-search input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  padding: 11px 14px;
  font-family: inherit;
  font-size: .9rem;
  color: var(--sw-gray-900);
}
.sw-w-search button {
  border: none;
  background: var(--sw-blue);
  color: #fff;
  padding: 0 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  transition: background var(--sw-transition);
}
.sw-w-search button:hover { background: var(--sw-red); }

/* ═══ 4. نبذة الموقع ════════════════════════════════════════════════════ */
.sw-w-about { text-align: center; }
.sw-w-about-logo img { max-height: 64px; width: auto; margin: 0 auto 10px; }
.sw-w-about-name {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--sw-blue);
  margin-bottom: 8px;
}
.sw-w-about-text {
  font-size: .85rem;
  color: var(--sw-gray-600);
  line-height: 1.8;
  margin: 0 0 14px;
}
.sw-w-about-social { display: flex; justify-content: center; gap: 8px; }
.sw-w-about-social a {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--sw-gray-100);
  color: var(--sw-gray-600);
  text-decoration: none;
  font-size: .85rem;
  transition: background var(--sw-transition), color var(--sw-transition), transform var(--sw-transition);
}
.sw-w-about-social a:hover {
  background: var(--sw-blue);
  color: #fff;
  transform: translateY(-2px);
}

/* ═══ 5. التصنيفات الملونة ══════════════════════════════════════════════ */
.sw-w-cats { list-style: none; margin: 0; padding: 0; }
.sw-w-cats li { margin: 0 0 6px; }
.sw-w-cats a {
  --sw-w-cat: var(--sw-blue);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  padding-right: 16px;
  background: var(--sw-white);
  border: 1px solid var(--sw-gray-100);
  border-right: 4px solid var(--sw-w-cat);
  border-radius: var(--sw-radius);
  text-decoration: none;
  transition: transform var(--sw-transition), box-shadow var(--sw-transition);
}
.sw-w-cats a:hover {
  transform: translateX(-3px);
  box-shadow: var(--sw-shadow-sm);
}
.sw-w-cat-name {
  font-size: .87rem;
  font-weight: 700;
  color: var(--sw-gray-900);
}
.sw-w-cat-count {
  font-size: .72rem;
  font-weight: 800;
  background: var(--sw-w-cat);
  color: #fff;
  min-width: 26px;
  text-align: center;
  padding: 2px 8px;
  border-radius: 999px;
  opacity: .9;
}
