:root {
  --np-ink: #123c3d;
  --np-ink-2: #1b5253;
  --np-ink-3: #0b2b2c;

  --np-paper: #f2f6f4;
  --np-card: #ffffff;

  /* رنگ تأکیدی: آبی پزشکی */
  --np-accent: #287a8f;
  --np-accent-hover: #1d6273;
  --np-accent-soft: #e1f2f6;
  --np-accent-border: #b9dce5;

  --np-coral: #dd5f52;

  --np-text: #17211f;
  --np-text-muted: #5d6e6c;
  --np-text-faint: #8a9997;

  --np-line: #dee7e3;
  --np-line-strong: #c6d3ce;

  --np-success: #2f8f6b;
  --np-success-soft: #e3f3eb;

  --np-radius-lg: 22px;
  --np-radius-md: 14px;
  --np-radius-sm: 9px;

  --np-shadow-sm:
    0 1px 2px rgba(18, 60, 61, 0.06), 0 1px 1px rgba(18, 60, 61, 0.04);

  --np-shadow-md: 0 10px 30px -12px rgba(18, 60, 61, 0.18);
  --np-shadow-lg: 0 24px 60px -20px rgba(18, 60, 61, 0.28);
}

/* ================================
   Base
================================ */
.np-blog-wrapper {
  direction: rtl;
  min-height: 100vh;
  padding: 48px 0 72px;
  overflow: visible !important;
  color: var(--np-text);
  text-align: right;
  font-family: "Vazirmatn", Tahoma, Arial, sans-serif;
  background:
    radial-gradient(
      circle at 90% 0%,
      rgba(40, 122, 143, 0.11),
      transparent 25%
    ),
    radial-gradient(circle at 5% 30%, rgba(27, 82, 83, 0.09), transparent 24%),
    var(--np-paper);
}

.np-blog-wrapper *,
.np-blog-wrapper *::before,
.np-blog-wrapper *::after {
  box-sizing: border-box;
}

.np-blog-wrapper a {
  -webkit-tap-highlight-color: transparent;
}

.np-container {
  width: min(100%, 1240px);
  margin: 0 auto;
  padding: 0 20px;
  margin-top: 82px;
}

/* ================================
   Layout
================================ */
.np-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 28px;
  align-items: start;
}

.np-main,
.np-sidebar {
  min-width: 0;
}

.np-main {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.np-sidebar {
  position: sticky;
  top: 100px; /* این مقدار باید برابر با ارتفاع هدر شما + کمی فاصله باشد */

  display: flex;
  flex-direction: column;
  gap: 20px;

  /* مهم: تعیین حداکثر ارتفاع برای اینکه اسکرول فعال شود */
  max-height: calc(100vh - 120px);
  overflow-y: auto;

  /* بهبود اسکرول */
  scrollbar-width: thin;
  scrollbar-color: var(--np-line-strong) transparent;

  /* نکته طلایی: جلوگیری از انتقال اسکرول به صفحه اصلی */
  overscroll-behavior: contain;

  padding-left: 5px; /* فضای خالی برای اسکرول‌بار */
  padding-bottom: 20px; /* فاصله برای اینکه آیتم آخر نچسبد */
}

/* برای مرورگرهای Webkit (کروم، اج، سافاری) */
.np-sidebar::-webkit-scrollbar {
  width: 5px;
}

.np-sidebar::-webkit-scrollbar-thumb {
  border-radius: 20px;
  background: var(--np-line-strong);
}
/* ================================
   Cards
================================ */
.np-glass-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(198, 211, 206, 0.72);
  border-radius: var(--np-radius-lg);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--np-shadow-md);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease;
}

.np-glass-card:hover {
  border-color: var(--np-line-strong);
  box-shadow: var(--np-shadow-lg);
}

.np-card-body {
  padding: 26px;
}

.np-article-card .np-card-body {
  padding: 30px;
}

/* ================================
   Typography
================================ */
.np-title {
  max-width: 900px;
  margin: 14px 0 20px;
  color: var(--np-ink);
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  font-weight: 900;
  line-height: 1.55;
  letter-spacing: -0.4px;
}

.np-sidebar-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  padding-right: 10px;
  color: var(--np-ink);
  border-right: 4px solid var(--np-accent);
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.4;
}

.np-content {
  overflow-wrap: anywhere;
  color: var(--np-text);
  font-size: 1rem;
  line-height: 2.2;
}

.np-content > *:first-child {
  margin-top: 0;
}

.np-content p {
  margin: 0 0 1.6rem;
  font-size: 1.03rem;
  line-height: 2.2;
}

.np-content h2,
.np-content h3,
.np-content h4 {
  position: relative;
  margin: 2.5rem 0 1rem;
  padding-right: 14px;
  color: var(--np-ink);
  font-weight: 900;
  line-height: 1.6;
}

.np-content h2::before,
.np-content h3::before,
.np-content h4::before {
  position: absolute;
  top: 0.45em;
  right: 0;
  width: 5px;
  height: 1.2em;
  border-radius: 50px;
  background: var(--np-accent);
  content: "";
}

.np-content h2 {
  font-size: 1.65rem;
}

.np-content h3 {
  font-size: 1.35rem;
}

.np-content h4 {
  font-size: 1.12rem;
}

.np-content a {
  color: var(--np-ink-2);
  font-weight: 700;
  text-decoration-color: rgba(40, 122, 143, 0.72);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.np-content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 28px auto;
  border: 1px solid var(--np-line);
  border-radius: var(--np-radius-md);
}

.np-content ul,
.np-content ol {
  margin: 0 0 1.6rem;
  padding-right: 1.4rem;
}

.np-content li {
  margin-bottom: 0.75rem;
  padding-right: 0.25rem;
}

.np-content blockquote {
  margin: 1.8rem 0;
  padding: 18px 20px;
  color: var(--np-ink);
  border-right: 4px solid var(--np-accent);
  border-radius: 0 var(--np-radius-md) var(--np-radius-md) 0;
  background: var(--np-accent-soft);
  font-weight: 600;
}

.np-content table {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 24px 0;
  overflow-x: auto;
  border-collapse: collapse;
  border: 1px solid var(--np-line);
  border-radius: var(--np-radius-sm);
}

.np-content th,
.np-content td {
  padding: 12px;
  border: 1px solid var(--np-line);
  text-align: right;
}

/* ================================
   Tags & Meta
================================ */
.np-post-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.np-tag-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 31px;
  padding: 6px 13px;
  color: var(--np-ink);
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--np-accent-soft);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
  transition: 0.22s ease;
}

.np-read-time {
  background: var(--np-paper);
  color: var(--np-text-muted);
}

.np-tag-pill.outline {
  border-color: var(--np-line);
  background: var(--np-card);
}

.np-tag-pill.outline:hover {
  color: var(--np-ink);
  border-color: var(--np-accent);
  background: var(--np-accent-soft);
  transform: translateY(-2px);
}

.np-meta-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  margin: 0 0 24px;
  padding: 0 0 20px;
  color: var(--np-text-muted);
  border-bottom: 1px solid var(--np-line);
  font-size: 0.78rem;
}

.np-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.np-meta-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  color: var(--np-ink);
  border-radius: 50%;
  background: var(--np-paper);
  font-size: 0.75rem;
}

/* ================================
   Article Image
================================ */
.np-post-image {
  position: relative;
  width: 100%;
  height: clamp(230px, 38vw, 420px);
  margin-bottom: 28px;
  overflow: hidden;
  border: 1px solid var(--np-line);
  border-radius: var(--np-radius-md);
  background: var(--np-paper);
}

.np-post-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.np-post-image:hover img {
  transform: scale(1.035);
}

.np-post-image::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 42%;
  pointer-events: none;
  background: linear-gradient(to top, rgba(11, 43, 44, 0.32), transparent);
  content: "";
}

.np-post-admin-actions {
  position: absolute;
  z-index: 2;
  top: 14px;
  right: 14px;
  display: flex;
  gap: 8px;
}

.np-post-admin-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 37px;
  height: 37px;
  color: var(--np-ink);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--np-shadow-sm);
  text-decoration: none;
  backdrop-filter: blur(8px);
  transition: 0.2s ease;
}

.np-post-admin-actions a:hover {
  color: #fff;
  background: var(--np-ink);
  transform: translateY(-2px);
}

/* ================================
   Share
================================ */
.np-share-card .np-card-body {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.np-share-card .np-sidebar-title {
  margin: 0;
}

.np-social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.np-social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  color: var(--np-ink);
  border: 1px solid var(--np-line);
  border-radius: 50%;
  background: var(--np-paper);
  text-decoration: none;
  transition: 0.25s ease;
}

.np-social-links a:hover {
  color: #fff;
  border-color: var(--np-ink);
  background: var(--np-ink);
  box-shadow: 0 8px 18px rgba(18, 60, 61, 0.2);
  transform: translateY(-3px);
}

/* ================================
   Summary
================================ */
.np-summary-card {
  border-color: var(--np-accent-border);
  background: linear-gradient(135deg, #f8fcfd, var(--np-accent-soft));
}

.np-summary-card .np-card-body {
  display: flex;
  align-items: center;
  gap: 18px;
}

.np-summary-icon {
  display: inline-flex;
  flex: 0 0 62px;
  align-items: center;
  justify-content: center;
  width: 62px;
  height: 62px;
  color: var(--np-ink);
  border: 4px solid #fff;
  border-radius: 50%;
  background: var(--np-accent);
  box-shadow: var(--np-shadow-sm);
  font-size: 1.35rem;
}

.np-summary-content .np-sidebar-title {
  margin-bottom: 7px;
  padding: 0;
  border: 0;
}

.np-summary-content p {
  margin: 0;
  color: var(--np-text-muted);
  font-size: 0.88rem;
  line-height: 1.9;
}

/* ================================
   Lists / Sidebar Posts
================================ */
.np-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.np-list-item {
  display: flex;
  gap: 12px;
  min-width: 0;
}

.np-list-item > a {
  display: block;
  flex: 0 0 68px;
  width: 68px;
  height: 68px;
  overflow: hidden;
  border-radius: 12px;
  background: var(--np-paper);
}

.np-list-item > a img,
.np-list-item > img {
  display: block;
  width: 68px;
  height: 68px;
  border: 1px solid var(--np-line);
  border-radius: 12px;
  object-fit: cover;
}

.np-list-item > a img {
  transition: transform 0.35s ease;
}

.np-list-item > a:hover img {
  transform: scale(1.08);
}

.np-list-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.np-list-content h5 {
  display: -webkit-box;
  overflow: hidden;
  margin: 0 0 6px;
  color: var(--np-ink);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.75;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.np-list-content h5 a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.np-list-content h5 a:hover {
  color: var(--np-accent);
}

.np-list-meta {
  color: var(--np-text-faint);
  font-size: 0.68rem;
}

/* ================================
   Comments
================================ */
.np-comment-item {
  display: flex;
  gap: 12px;
}

.np-comment-avatar {
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  padding: 8px;
  border: 1px solid var(--np-line);
  border-radius: 50%;
  background: #fff;
  object-fit: contain;
}

.np-comment-box {
  position: relative;
  flex: 1;
  padding: 15px 16px;
  border: 1px solid var(--np-line);
  border-radius: 4px var(--np-radius-md) var(--np-radius-md) var(--np-radius-md);
  background: var(--np-paper);
}

.np-comment-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.np-comment-name {
  color: var(--np-ink);
  font-size: 0.8rem;
  font-weight: 800;
}

.np-comment-date {
  color: var(--np-text-faint);
  font-size: 0.68rem;
  white-space: nowrap;
}

.np-comment-text {
  margin: 0;
  color: var(--np-text-muted);
  font-size: 0.82rem;
  line-height: 1.9;
}

.np-empty-state {
  padding: 22px 15px;
  color: var(--np-text-muted);
  border: 1px dashed var(--np-line-strong);
  border-radius: var(--np-radius-md);
  background: var(--np-paper);
  font-size: 0.85rem;
  text-align: center;
}

/* ================================
   Forms
================================ */
.np-form-group {
  margin-bottom: 16px;
}

.np-form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.np-form-row .np-form-group {
  flex: 1 1 220px;
}

.np-form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--np-ink);
  font-size: 0.78rem;
  font-weight: 800;
}

.np-form-control {
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  color: var(--np-text);
  border: 1px solid var(--np-line);
  border-radius: 12px;
  outline: none;
  background: var(--np-paper);
  font-family: inherit;
  font-size: 0.84rem;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

textarea.np-form-control {
  min-height: 120px;
  line-height: 1.8;
  resize: vertical;
}

.np-form-control::placeholder {
  color: var(--np-text-faint);
}

.np-form-control:hover {
  border-color: var(--np-line-strong);
}

.np-form-control:focus {
  border-color: var(--np-accent);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(40, 122, 143, 0.15);
}

.np-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 21px;
  color: #fff;
  border: 1px solid var(--np-accent);
  border-radius: 12px;
  outline: none;
  background: var(--np-accent);
  box-shadow: 0 10px 22px rgba(40, 122, 143, 0.28);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 800;
  transition: 0.22s ease;
}

.np-btn:hover {
  border-color: var(--np-accent-hover);
  background: var(--np-accent-hover);
  box-shadow: 0 12px 25px rgba(40, 122, 143, 0.34);
  transform: translateY(-2px);
}

.np-btn:active {
  transform: translateY(0);
}

.np-search-form {
  position: relative;
}

.np-search-form .np-form-control {
  padding-right: 44px;
}

.np-search-btn {
  position: absolute;
  top: 50%;
  right: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 37px;
  height: 37px;
  color: var(--np-text-muted);
  border: 0;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  transform: translateY(-50%);
  transition: 0.2s ease;
}

.np-search-btn:hover {
  color: #fff;
  background: var(--np-ink);
}

/* ================================
   Admin comment actions
================================ */
.np-comment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.np-text-btn {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 800;
}

.np-text-btn.success {
  color: var(--np-success);
}

.np-text-btn.danger {
  color: var(--np-coral);
}

.text-danger {
  color: var(--np-coral);
}

/* ================================
   Responsive
================================ */
@media (max-width: 992px) {
  .np-container {
    margin-top: 38px;
  }

  .np-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .np-sidebar {
    position: static;
    max-height: none;
    overflow: visible;
    padding: 0;
  }
}

@media (max-width: 576px) {
  .np-blog-wrapper {
    padding: 24px 0 48px;
  }

  .np-container {
    padding: 0 13px;
    margin-top: 20px;
  }

  .np-grid {
    gap: 18px;
  }

  .np-main,
  .np-sidebar {
    gap: 18px;
  }

  .np-card-body,
  .np-article-card .np-card-body {
    padding: 18px;
  }

  .np-title {
    margin: 12px 0 16px;
    font-size: 1.5rem;
    line-height: 1.65;
  }

  .np-meta-list {
    gap: 10px 14px;
    padding-bottom: 16px;
  }

  .np-post-image {
    height: 220px;
    margin-bottom: 21px;
    border-radius: 12px;
  }

  .np-content,
  .np-content p {
    font-size: 0.96rem;
    line-height: 2.1;
    text-align: right;
  }

  .np-summary-card .np-card-body {
    align-items: flex-start;
    gap: 13px;
  }

  .np-summary-icon {
    flex-basis: 50px;
    width: 50px;
    height: 50px;
    font-size: 1rem;
  }

  .np-share-card .np-card-body {
    align-items: flex-start;
    flex-direction: column;
  }

  .np-comment-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .np-list-item > a,
  .np-list-item > a img,
  .np-list-item > img {
    width: 60px;
    height: 60px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .np-blog-wrapper *,
  .np-blog-wrapper *::before,
  .np-blog-wrapper *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

.np-mobile-input {
  direction: rtl;
  text-align: right;
}

.np-mobile-input:not(:placeholder-shown) {
  direction: ltr;
  text-align: right;
}

html, body {
  overflow-x: hidden !important;
  overflow-y: auto !important;
}
