/* Scoped styles for tag-archive */
.ms-tag-archive, .ms-tag-archive * { box-sizing: border-box; }
.ms-tag-archive {
  direction: rtl;
  font-family: iransans, sans-serif;
  color: #0f172a;
  --wrap: min(1200px, 94vw);
  --radius: 18px;
  --ink: #0f172a;
  --muted: #6b7280;
  --bd: rgba(17,24,39,.08);
  --bg: #ffffff;
  --brand: #5b6cff;
}

.ms-ta-wrap {
  width: var(--wrap);
  margin-inline: auto;
  background: var(--bg);
  border: 1px solid #eef2ff;
  border-radius: 22px;
  padding: 18px;
  box-shadow: 0 14px 40px rgba(23,43,99,.08);
}

.ms-ta-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
  border-bottom: 1px solid #eef2ff;
  padding-bottom: 10px; margin-bottom: 14px;
}
.ms-ta-title { margin: 0; font-size: 1.25rem; font-weight: 900; color: #111827; }
.ms-ta-count { font-weight: 700; color: #374151; opacity: .8; }

.ms-ta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
@media (max-width: 1024px){
  .ms-ta-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px){
  .ms-ta-grid { grid-template-columns: 1fr; }
}

.ms-ta-card {
  background: #fff;
  border: 1px solid var(--bd);
  border-radius: var(--radius);
  overflow: clip;
  transition: transform .15s ease, box-shadow .15s ease;
}
.ms-ta-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(23,43,99,.10);
}

.ms-ta-thumb {
  display: block; aspect-ratio: 16 / 9; background: #f8fafc;
}
.ms-ta-thumb img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.ms-ta-thumb--ph {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, #f8fafc, #eef2ff);
}

.ms-ta-body { padding: 12px 12px 14px; }
.ms-ta-post-title { margin: 0 0 6px 0; font-size: 1rem; line-height: 1.5; }
.ms-ta-post-title a {
  color: var(--ink); text-decoration: none; font-weight: 900;
}
.ms-ta-post-title a:hover { color: var(--brand); }

.ms-ta-excerpt {
  margin: 0; color: var(--muted); font-size: .92rem; line-height: 1.7;
}

.ms-ta-empty {
  text-align: center; padding: 18px; border-radius: 14px;
  background: #fafafa; color: #6b7280; font-weight: 700;
  border: 1px dashed #e5e7eb;
}

/* Pager */
.ms-ta-pager {
  margin-top: 16px; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center;
}
.ms-ta-page {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; height: 36px; padding: 0 10px;
  border-radius: 999px; border: 1px solid var(--bd);
  background: #fff; text-decoration: none; color: #111827; font-weight: 800;
}
.ms-ta-page:hover { border-color: #c7d2fe; }
.ms-ta-page.is-active {
  background: #eef2ff; border-color: #c7d2fe; color: #111827;
}
