/* ============================================================
   BarqNews Pro — 09 — Sidebar & Widgets
   ============================================================ */

.sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.sidebar-header {
  margin-bottom: 4px;
}
.sidebar-header h2 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  font-weight: 600;
  margin: 0;
}

/* ---------- Widget ---------- */
.widget {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--glob-border-radius);
  padding: 20px;
}

.widget-content > ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.widget-content > ul > li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 14px;
}
.widget-content > ul > li:last-child { border-bottom: none; padding-bottom: 0; }
.widget-content > ul > li:first-child { padding-top: 0; }
.widget-content > ul > li > a {
  color: var(--text-color);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color var(--transition-fast);
}
.widget-content > ul > li > a::before {
  content: "\2190";  /* ← للـ RTL */
  color: var(--site-color);
  font-size: 12px;
  opacity: 0.7;
}
.ltr .widget-content > ul > li > a::before { content: "\2192"; }
.widget-content > ul > li > a:hover { color: var(--site-color); }

/* ---------- Popular posts (numbered) ---------- */
.widget-popular .post-list {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: popular;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.widget-popular .post-list li {
  counter-increment: popular;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 0;
  border: none;
  position: relative;
}
.widget-popular .post-list .count {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  color: var(--site-color);
  line-height: 1;
  flex-shrink: 0;
  width: 28px;
  text-align: center;
  opacity: 0.85;
}
.widget-popular .post-list .count::before {
  content: counter(popular, decimal-leading-zero);
}
.widget-popular .post-list .post-thumb {
  width: 70px;
  height: 70px;
  border-radius: 6px;
  flex-shrink: 0;
  aspect-ratio: auto;
}
.widget-popular .post-list .post-info {
  flex: 1;
  min-width: 0;
}
.widget-popular .post-list .post-title {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.5;
  margin: 0 0 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--text-color);
  text-decoration: none;
  transition: color var(--transition-fast);
}
.widget-popular .post-list .post-title:hover { color: var(--site-color); }
.widget-popular .post-list .post-meta {
  font-size: 11.5px;
  color: var(--text-muted);
}

/* ---------- Tags cloud ---------- */
.widget-tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.widget-tags-cloud a {
  background: var(--light-bg);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition-fast);
}
.widget-tags-cloud a:hover {
  background: var(--site-color);
  color: white;
}

/* ---------- Categories list with counts ---------- */
.widget-categories ul li {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.widget-categories ul li .count {
  background: var(--light-bg);
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- Newsletter widget ---------- */
.widget-newsletter {
  background: linear-gradient(135deg,
    rgba(var(--site-color-rgb), 0.08),
    rgba(var(--site-color-rgb), 0.02));
  border: 1px solid rgba(var(--site-color-rgb), 0.18);
}
.widget-newsletter .newsletter-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--site-color);
  color: white;
  display: grid;
  place-items: center;
  font-size: 18px;
  margin-bottom: 12px;
}
.widget-newsletter p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0 0 12px;
  line-height: 1.6;
}
.widget-newsletter form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.widget-newsletter input[type="email"] {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--glob-border-radius);
  border: 1px solid var(--border-color);
  background: var(--card-bg);
  font-family: var(--site-font);
  font-size: 13px;
  color: var(--text-color);
}
.widget-newsletter input[type="email"]:focus {
  outline: none;
  border-color: var(--site-color);
}
.widget-newsletter button {
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: var(--glob-border-radius);
  background: var(--site-color);
  color: white;
  font-family: var(--site-font);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: background var(--transition-fast);
}
.widget-newsletter button:hover { background: var(--site-color-darker-2); }

/* ---------- Social follow ---------- */
.widget-social {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}
.widget-social a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: var(--glob-border-radius);
  background: var(--light-bg);
  color: var(--text-color);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition-fast);
}
.widget-social a:hover {
  background: var(--site-color);
  color: white;
  transform: translateY(-2px);
}
.widget-social a i { font-size: 14px; }
.widget-social .count {
  margin-right: auto;
  font-size: 11px;
  opacity: 0.7;
  font-variant-numeric: tabular-nums;
}
.ltr .widget-social .count { margin-right: 0; margin-left: auto; }
