/**
 * رهنمود - استایل عمومی
 * شامل: شورت‌کدها، صفحه آرشیو و صفحه تکی
 *
 * @package Rahnamoud
 * @since   1.0.0
 */

/* ============================================
   ۱. متغیرهای مشترک CSS
   ============================================ */
:root {
  --dwr-primary-color: #0073aa;
  --dwr-primary-hover: #005a87;
  --dwr-bg-light: #ffffff;
  --dwr-bg-dark: #1e1e1e;
  --dwr-text-light: #333333;
  --dwr-text-dark: #e0e0e0;
  --dwr-border: #e0e0e0;
  --dwr-radius: 8px;
  --dwr-radius-lg: 16px;
  --dwr-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  --dwr-shadow-lg: 0 4px 24px rgba(0, 0, 0, 0.08);
  --dwr-shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.15);
  --dwr-transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --dwr-hub-hero-bg: #0a0a1a;
  --dwr-hub-hero-text: #ffffff;
  --dwr-hub-hero-muted: #8892b0;
  --dwr-hub-accent: #6366f1;
  --dwr-hub-accent2: #a855f7;
  --dwr-hub-bg: #ffffff;
  --dwr-hub-bg-secondary: #f8fafc;
  --dwr-hub-text: #1e293b;
  --dwr-hub-text-secondary: #64748b;
  --dwr-hub-border: #e2e8f0;
}

/* ============================================
   ۲. استایل‌های عمومی
   ============================================ */
.dwr-error {
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  color: #856404;
  padding: 1rem;
  border-radius: 4px;
  margin: 1rem 0;
}

.dwr-btn {
  display: inline-block;
  padding: 10px 20px;
  background: var(--dwr-primary-color);
  color: #fff;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 500;
  transition: var(--dwr-transition);
  border: none;
  cursor: pointer;
}

.dwr-btn:hover {
  background: var(--dwr-primary-hover);
  color: #fff;
  text-decoration: none;
}

/* ============================================
   ۳. شورت‌کدها
   ============================================ */
.dwr-docs-container {
  max-width: 900px;
  margin: 2rem auto;
  padding: 2rem;
  background: var(--dwr-bg-light);
  border-radius: var(--dwr-radius);
  box-shadow: var(--dwr-shadow);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--dwr-text-light);
}

.dwr-search-box {
  position: relative;
  margin-bottom: 2rem;
}

.dwr-search-input {
  width: 100%;
  padding: 12px 16px 12px 44px;
  border: 2px solid var(--dwr-border);
  border-radius: var(--dwr-radius);
  font-size: 1rem;
  transition: var(--dwr-transition);
  box-sizing: border-box;
}

.dwr-search-input:focus {
  border-color: var(--dwr-primary-color);
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.dwr-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #999;
  font-size: 20px;
}

.dwr-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--dwr-bg-light);
  border: 1px solid var(--dwr-border);
  border-radius: var(--dwr-radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  max-height: 300px;
  overflow-y: auto;
  z-index: 100;
  margin-top: 4px;
}

.dwr-view-all {
  text-align: center;
  margin-top: 2rem;
}

.dwr-template-list .dwr-section {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--dwr-border);
}

.dwr-template-list .dwr-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.dwr-section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 1rem;
  color: var(--dwr-primary-color);
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.dwr-section-number {
  color: #999;
  font-size: 1.2rem;
  font-weight: 600;
  min-width: 2rem;
}

.dwr-section-content {
  line-height: 1.8;
  color: var(--dwr-text-light);
}

.dwr-section-content p {
  margin-bottom: 1rem;
}
.dwr-section-content img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

.dwr-accordion-item {
  border: 1px solid var(--dwr-border);
  border-radius: var(--dwr-radius);
  margin-bottom: 0.75rem;
  overflow: hidden;
  transition: var(--dwr-transition);
}

.dwr-accordion-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.dwr-accordion-header {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 1rem 1.25rem;
  background: #f9f9f9;
  border: none;
  cursor: pointer;
  text-align: right;
  font-size: 1.05rem;
  font-weight: 600;
  gap: 10px;
  transition: var(--dwr-transition);
  color: var(--dwr-text-light);
}

.dwr-accordion-header:hover {
  background: #f0f0f0;
}
.dwr-accordion-number {
  color: var(--dwr-primary-color);
  font-weight: 700;
}

.dwr-accordion-icon {
  margin-right: auto;
  transition: transform 0.3s ease;
  color: #666;
}

.dwr-accordion-header[aria-expanded="true"] .dwr-accordion-icon {
  transform: rotate(180deg);
}

.dwr-accordion-body {
  padding: 0 1.25rem 1.25rem;
  background: var(--dwr-bg-light);
}

.dwr-accordion-content {
  line-height: 1.8;
  padding-top: 1rem;
}

.dwr-tabs-nav {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--dwr-border);
  margin-bottom: 1.5rem;
  overflow-x: auto;
}

.dwr-tab-btn {
  padding: 12px 20px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  white-space: nowrap;
  transition: var(--dwr-transition);
  color: #666;
}

.dwr-tab-btn:hover {
  color: var(--dwr-primary-color);
  background: rgba(0, 115, 170, 0.03);
}

.dwr-tab-btn.active {
  color: var(--dwr-primary-color);
  border-bottom-color: var(--dwr-primary-color);
  font-weight: 700;
}

.dwr-tab-number {
  font-size: 0.8rem;
  opacity: 0.7;
}
.dwr-tab-panel {
  display: none;
}
.dwr-tab-panel.active {
  display: block;
  animation: dwrFadeIn 0.3s ease;
}
.dwr-tab-heading {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--dwr-primary-color);
}
.dwr-tab-body {
  line-height: 1.8;
}

@keyframes dwrFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes dwrFadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes dwrFloat {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(5deg);
  }
}

/* ============================================
   ۴. Documentation Hub (Hero + Archive)
   ============================================ */
.dwr-hub-hero {
  position: relative;
  background: var(--dwr-hub-hero-bg);
  padding: 6rem 0 4rem;
  min-height: 60vh;
  display: flex;
  align-items: center;
}

.dwr-hub-hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.dwr-hub-hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
}

.dwr-hub-hero-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.15;
}

.dwr-hub-glow-1 {
  width: 600px;
  height: 600px;
  background: var(--dwr-hub-accent);
  top: -200px;
  left: -100px;
}

.dwr-hub-glow-2 {
  width: 500px;
  height: 500px;
  background: var(--dwr-hub-accent2);
  bottom: -200px;
  right: -100px;
}

.dwr-hub-hero-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
  position: relative;
  z-index: 2;
}

.dwr-hub-hero-content {
  text-align: center;
  max-width: 700px;
  margin: 0 auto;
}

.dwr-hub-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: var(--dwr-hub-accent);
  padding: 8px 18px;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 2rem;
}

.dwr-hub-title {
  font-size: 3.5rem;
  font-weight: 900;
  color: var(--dwr-hub-hero-text);
  line-height: 1.15;
  margin: 0 0 1.5rem;
  letter-spacing: -1px;
}

.dwr-hub-title-accent {
  color: var(--dwr-hub-accent);
}

.dwr-hub-description {
  font-size: 1.2rem;
  color: var(--dwr-hub-hero-muted);
  line-height: 1.8;
  margin: 0 auto 2.5rem;
  max-width: 550px;
}

.dwr-hub-stats {
  display: grid;
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.dwr-hub-hero .dwr-hub-stats {
  grid-template-columns: repeat(2, 1fr);
  max-width: 450px;
  margin-left: auto;
  margin-right: auto;
}

.dwr-product-stats {
  grid-template-columns: repeat(3, 1fr);
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
  justify-content: flex-start;
  margin-bottom: 0;
}

.dwr-hub-stat {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 14px 20px;
  border-radius: var(--dwr-radius);
  transition: var(--dwr-transition);
}

.dwr-hub-stat:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.dwr-hub-stat-icon {
  color: var(--dwr-hub-accent);
  display: flex;
  align-items: center;
}

.dwr-hub-stat-info {
  text-align: right;
}

.dwr-hub-stat-number {
  display: block;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--dwr-hub-hero-text);
}

.dwr-hub-stat-label {
  display: block;
  font-size: 0.8rem;
  color: var(--dwr-hub-hero-muted);
  margin-top: 2px;
}

.dwr-hero-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 2rem;
  transition: var(--dwr-transition);
}

.dwr-hero-back:hover {
  color: #f8fafc;
}

.dwr-hero-stat svg {
  opacity: 0.7;
}

.dwr-hub-search-wrapper {
  max-width: 520px;
  margin: 0 auto;
  position: relative;
}

.dwr-hub-search-group {
  position: relative;
  display: flex;
  align-items: center;
}

.dwr-hub-search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--dwr-hub-hero-muted);
  pointer-events: none;
  z-index: 2;
}

.dwr-hub-search-input {
  width: 100%;
  padding: 16px 120px 16px 120px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--dwr-radius);
  color: var(--dwr-hub-hero-text);
  font-size: 1rem;
  transition: var(--dwr-transition);
}

.dwr-hub-search-input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--dwr-hub-accent);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

.dwr-hub-search-input::placeholder {
  color: var(--dwr-hub-hero-muted);
}

.dwr-hub-search-kbd {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.08);
  color: var(--dwr-hub-hero-muted);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-family: monospace;
  border: 1px solid rgba(255, 255, 255, 0.1);
  pointer-events: none;
}

.dwr-hub-search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #1a1a2e;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--dwr-radius);
  max-height: 350px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: var(--dwr-shadow-xl);
}

.dwr-hub-search-item {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: background 0.2s ease;
}

.dwr-hub-search-item:last-child {
  border-bottom: none;
}
.dwr-hub-search-item:hover {
  background: rgba(255, 255, 255, 0.06);
}
.dwr-hub-search-item-title {
  font-weight: 600;
  color: white;
  margin-bottom: 4px;
}
.dwr-hub-search-item-product {
  font-size: 0.85rem;
  color: var(--dwr-hub-hero-muted);
}

.dwr-hub-search-hint {
  color: var(--dwr-hub-hero-muted);
  font-size: 0.85rem;
  margin-top: 12px;
  opacity: 0.7;
}

.dwr-hub-floating {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.dwr-hub-float {
  position: absolute;
  color: rgba(255, 255, 255, 0.5);
  animation: dwrFloat 6s ease-in-out infinite;
}

.dwr-float-1 {
  top: 15%;
  left: 8%;
  animation-delay: 0s;
}
.dwr-float-2 {
  top: 60%;
  right: 5%;
  animation-delay: 2s;
}
.dwr-float-3 {
  bottom: 20%;
  left: 15%;
  animation-delay: 4s;
}

/* ============================================
   ۵. صفحه اصلی Hub (بخش‌های جدید)
   ============================================ */
.dwr-hub-main {
  background: var(--dwr-hub-bg);
  padding: 4rem 0;
}

.dwr-hub-main-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.dwr-hub-layout {
  display: flex;
  gap: 3rem;
}

.dwr-hub-content-area {
  flex: 1;
  min-width: 0;
}

.dwr-hub-sidebar {
  width: 280px;
  flex-shrink: 0;
}

.dwr-hub-section {
  margin-bottom: 4rem;
}

.dwr-hub-section:last-child {
  margin-bottom: 0;
}

.dwr-hub-section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 3rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.dwr-hub-section-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--dwr-hub-text);
  margin: 0 0 0.5rem;
}

.dwr-hub-section-subtitle {
  color: var(--dwr-hub-text-secondary);
  margin: 0;
  font-size: 1.05rem;
}

.dwr-hub-count-badge {
  display: inline-block;
  background: var(--dwr-hub-bg-secondary);
  color: var(--dwr-hub-text-secondary);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid var(--dwr-hub-border);
}

/* --- کارت‌های دسته‌بندی --- */
.dwr-categories-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.dwr-category-card {
  background: var(--dwr-hub-bg);
  border: 1px solid var(--dwr-hub-border);
  border-radius: var(--dwr-radius-lg);
  overflow: hidden;
  transition: var(--dwr-transition);
}

.dwr-category-card:hover {
  box-shadow: var(--dwr-shadow-lg);
  border-color: #d0d5dd;
  transform: translateY(-2px);
}

.dwr-category-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--dwr-hub-border);
  background: var(--dwr-hub-bg-secondary);
}

.dwr-category-card-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
}

.dwr-category-card-info {
  flex: 1;
  min-width: 0;
}

.dwr-category-card-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 2px;
}

.dwr-category-card-title a {
  color: var(--dwr-hub-text);
  text-decoration: none;
  transition: var(--dwr-transition);
}

.dwr-category-card-title a:hover {
  color: var(--dwr-hub-accent);
}

.dwr-category-card-count {
  font-size: 0.8rem;
  color: var(--dwr-hub-text-secondary);
}

.dwr-category-card-list {
  list-style: none;
  padding: 0.5rem 0;
  margin: 0;
}

.dwr-category-card-item {
  border-bottom: 1px solid #f5f5f5;
}

.dwr-category-card-item:last-child {
  border-bottom: none;
}

.dwr-category-card-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 1.5rem;
  text-decoration: none;
  transition: var(--dwr-transition);
}

.dwr-category-card-link:hover {
  background: rgba(99, 102, 241, 0.04);
}

.dwr-category-card-item-title {
  font-size: 0.9rem;
  color: var(--dwr-hub-text);
  font-weight: 500;
}

.dwr-category-card-item-meta {
  font-size: 0.75rem;
  color: var(--dwr-hub-text-secondary);
  flex-shrink: 0;
  margin-right: 12px;
}

.dwr-category-card-empty {
  text-align: center;
  padding: 14px;
  color: var(--dwr-hub-text-secondary);
  font-size: 0.85rem;
}

.dwr-category-card-more {
  display: block;
  text-align: center;
  padding: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--dwr-hub-accent);
  text-decoration: none;
  border-top: 1px solid var(--dwr-hub-border);
  transition: var(--dwr-transition);
}

.dwr-category-card-more:hover {
  background: rgba(99, 102, 241, 0.05);
}

/* --- آخرین مستندات --- */
.dwr-latest-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.dwr-latest-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 1rem;
  background: var(--dwr-hub-bg);
  border: 1px solid var(--dwr-hub-border);
  border-radius: var(--dwr-radius);
  text-decoration: none;
  transition: var(--dwr-transition);
}

.dwr-latest-card:hover {
  border-color: var(--dwr-hub-accent);
  box-shadow: var(--dwr-shadow-lg);
  transform: translateY(-2px);
}

.dwr-latest-card-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  overflow: hidden;
}

.dwr-latest-card-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dwr-latest-card-content {
  flex: 1;
  min-width: 0;
}

.dwr-latest-card-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--dwr-hub-text);
  margin: 0 0 4px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dwr-latest-card-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--dwr-hub-text-secondary);
}

/* --- گرید همه مستندات --- */
.dwr-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.dwr-hub-card {
  background: var(--dwr-hub-bg);
  border: 1px solid var(--dwr-hub-border);
  border-radius: var(--dwr-radius-lg);
  overflow: hidden;
  transition: var(--dwr-transition);
  position: relative;
}

.dwr-hub-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--dwr-radius-lg);
  opacity: 0;
  transition: opacity 0.3s ease;
  box-shadow: 0 0 0 2px var(--dwr-hub-accent);
  pointer-events: none;
}

.dwr-hub-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--dwr-shadow-lg);
  border-color: transparent;
}

.dwr-hub-card:hover::before {
  opacity: 1;
}

.dwr-hub-card-link {
  display: flex;
  padding: 2rem;
  text-decoration: none;
  gap: 1.5rem;
  align-items: flex-start;
}

.dwr-hub-card-icon {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  overflow: hidden;
}

.dwr-hub-card-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dwr-hub-card-content {
  flex: 1;
  min-width: 0;
}

.dwr-hub-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--dwr-hub-text);
  margin: 0 0 0.5rem;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--dwr-transition);
}

.dwr-hub-card-arrow {
  opacity: 0;
  transform: translateX(-8px);
  transition: var(--dwr-transition);
  color: var(--dwr-hub-accent);
  flex-shrink: 0;
}

.dwr-hub-card:hover .dwr-hub-card-arrow {
  opacity: 1;
  transform: translateX(0);
  transform: rotate(45deg);
}

.dwr-hub-card-desc {
  color: var(--dwr-hub-text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0 0 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dwr-hub-card-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.dwr-hub-card-chapters {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  color: var(--dwr-hub-text-secondary);
  background: var(--dwr-hub-bg-secondary);
  padding: 4px 10px;
  border-radius: 15px;
}

.dwr-hub-card-date {
  font-size: 0.8rem;
  color: var(--dwr-hub-text-secondary);
}

.dwr-hub-card-categories {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 10px 0;
}

.dwr-hub-card-cat {
  display: inline-block;
  padding: 3px 10px;
  background: var(--dwr-hub-bg-secondary);
  color: var(--dwr-hub-accent);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid rgba(99, 102, 241, 0.2);
}

/* --- سایدبار Hub --- */
.dwr-hub-sidebar-widget {
  margin-bottom: 2rem;
}

.dwr-hub-sidebar-widget:last-child {
  margin-bottom: 0;
}

.dwr-hub-sidebar-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--dwr-hub-text-secondary);
  margin: 0 0 12px;
}

.dwr-hub-sidebar-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.dwr-hub-sidebar-list li {
  margin-bottom: 2px;
}

.dwr-hub-sidebar-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  text-decoration: none;
  color: var(--dwr-hub-text-secondary);
  border-radius: 6px;
  font-size: 0.9rem;
  transition: var(--dwr-transition);
}

.dwr-hub-sidebar-link:hover {
  background: rgba(99, 102, 241, 0.05);
  color: var(--dwr-hub-text);
}

.dwr-hub-sidebar-link.active {
  background: rgba(99, 102, 241, 0.1);
  color: var(--dwr-hub-accent);
  font-weight: 600;
}

.dwr-hub-sidebar-count {
  background: var(--dwr-hub-bg-secondary);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
}

.dwr-hub-filters {
  display: block;
  background: var(--dwr-hub-bg);
  border-bottom: 1px solid var(--dwr-hub-border);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  margin-bottom: 1rem;
}
.dwr-filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.dwr-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--dwr-hub-bg);
  color: var(--dwr-hub-text-secondary);
  border: 1px solid var(--dwr-hub-border);
  border-radius: 12px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.25s ease;
  white-space: nowrap;
  position: relative;
}

.dwr-filter-btn::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 13px;
  opacity: 0;
  transition: opacity 0.25s ease;
  background: linear-gradient(
    135deg,
    var(--dwr-hub-accent),
    var(--dwr-hub-accent2)
  );
  z-index: -1;
}

.dwr-filter-btn:hover {
  background: var(--dwr-hub-bg);
  border-color: var(--dwr-hub-accent);
  color: var(--dwr-hub-accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

.dwr-filter-btn:hover::before {
  opacity: 0.05;
}

.dwr-filter-btn.active {
  background: linear-gradient(
    135deg,
    var(--dwr-hub-accent),
    var(--dwr-hub-accent2)
  );
  border-color: transparent;
  color: white;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}

.dwr-filter-btn.active:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
  color: white;
}

.dwr-filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 22px;
  padding: 0 8px;
  background: rgba(99, 102, 241, 0.1);
  color: var(--dwr-hub-accent);
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  transition: all 0.25s ease;
}

.dwr-filter-btn.active .dwr-filter-count {
  background: rgba(255, 255, 255, 0.25);
  color: white;
}

.dwr-filter-btn:hover .dwr-filter-count {
  background: rgba(99, 102, 241, 0.2);
}

.dwr-filter-btn.active:hover .dwr-filter-count {
  background: rgba(255, 255, 255, 0.35);
}
.tax-dwr_category .dwr-hub-filters {
  display: block;
}

/* --- صفحه‌بندی --- */
.dwr-hub-pagination {
  margin-top: 3rem;
  text-align: center;
}

.dwr-hub-pagination-links {
  display: inline-flex;
  gap: 6px;
  list-style: none;
  padding: 0;
}

.dwr-hub-pagination-links .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--dwr-hub-border);
  border-radius: 10px;
  color: var(--dwr-hub-text);
  text-decoration: none;
  font-weight: 600;
  transition: var(--dwr-transition);
}

.dwr-hub-pagination-links .page-numbers.current {
  background: var(--dwr-hub-accent);
  border-color: var(--dwr-hub-accent);
  color: white;
}

.dwr-hub-pagination-links .page-numbers:hover:not(.current) {
  border-color: var(--dwr-hub-accent);
  color: var(--dwr-hub-accent);
}

/* --- حالت خالی --- */
.dwr-hub-empty {
  text-align: center;
  padding: 5rem 2rem;
}

.dwr-hub-empty-icon {
  color: var(--dwr-hub-border);
  margin-bottom: 1.5rem;
}

.dwr-hub-empty-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--dwr-hub-text);
  margin: 0 0 0.5rem;
}

.dwr-hub-empty-desc {
  color: var(--dwr-hub-text-secondary);
  margin: 0 0 2rem;
}

.dwr-hub-empty-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--dwr-hub-accent);
  color: white;
  padding: 12px 24px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  transition: var(--dwr-transition);
}

.dwr-hub-empty-btn:hover {
  background: #4f46e5;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

/* --- فوتر Hub --- */
.dwr-hub-footer {
  background: var(--dwr-hub-bg-secondary);
  border-top: 1px solid var(--dwr-hub-border);
  padding: 4rem 0 2rem;
}

.dwr-hub-footer-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
}

.dwr-hub-footer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3rem;
  margin-bottom: 3rem;
}

.dwr-hub-footer-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--dwr-hub-text);
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dwr-hub-footer-text {
  color: var(--dwr-hub-text-secondary);
  font-size: 0.9rem;
  line-height: 1.7;
  margin: 0 0 12px;
}

.dwr-hub-footer-link {
  color: var(--dwr-hub-accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}

.dwr-hub-footer-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.dwr-hub-footer-list li {
  margin-bottom: 8px;
}

.dwr-hub-footer-list a {
  color: var(--dwr-hub-text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: var(--dwr-transition);
}

.dwr-hub-footer-list a:hover {
  color: var(--dwr-hub-accent);
}

.dwr-hub-footer-bottom {
  border-top: 1px solid var(--dwr-hub-border);
  padding-top: 2rem;
  text-align: center;
}

.dwr-hub-footer-bottom p {
  color: var(--dwr-hub-text-secondary);
  font-size: 0.85rem;
  margin: 0;
}

/* ============================================
   ۶. صفحه آرشیو دسته‌بندی
   ============================================ */
.dwr-category-header {
  text-align: center;
  padding: 3rem 0 2rem;
}

.dwr-category-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--dwr-hub-text);
  margin: 0 0 0.5rem;
}

.dwr-category-description {
  color: var(--dwr-hub-text-secondary);
  font-size: 1.05rem;
  max-width: 600px;
  margin: 0 auto;
}

/* ============================================
   ۷. صفحه تکی محصول (Single Product)
   ============================================ */
.dwr-hero-product {
  background: var(--dwr-hub-hero-bg);
  padding: 5rem 0 4rem;
  position: relative;
  overflow: hidden;
}

.dwr-hero-product .dwr-hub-hero-container {
  max-width: 1200px;
}

.dwr-hero-product .dwr-hub-hero-content {
  text-align: right;
  max-width: 100%;
}

.dwr-product-hero-row {
  display: flex;
  align-items: center;
  gap: 3rem;
  flex-wrap: wrap;
}

.dwr-product-hero-text {
  flex: 1;
  min-width: 300px;
}

.dwr-product-badge {
  display: inline-flex;
  margin-bottom: 1.5rem;
}

.dwr-product-title {
  font-size: 2.8rem;
  margin-bottom: 1rem;
  text-align: right;
}

.dwr-product-description {
  margin: 0 0 1.5rem;
  text-align: right;
}

.dwr-product-hero-image {
  flex: 0 0 280px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.dwr-product-hero-image-wrapper {
  position: relative;
  border-radius: var(--dwr-radius-lg);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.dwr-product-hero-glow {
  position: absolute;
  inset: -4px;
  background: linear-gradient(
    135deg,
    var(--dwr-hub-accent),
    var(--dwr-hub-accent2)
  );
  border-radius: calc(var(--dwr-radius-lg) + 2px);
  filter: blur(25px);
  opacity: 0.3;
  z-index: -1;
}

.dwr-product-hero-img {
  width: 260px;
  height: auto;
  display: block;
  border-radius: var(--dwr-radius-lg);
}

.dwr-product-hero-placeholder {
  width: 260px;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.3);
}

/* جستجوی صفحه تکی */
.dwr-search-section {
  background: var(--dwr-hub-bg);
  border-bottom: 1px solid var(--dwr-hub-border);
  padding: 1.5rem 0;
}

.dwr-search-section-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.dwr-search-wrapper-lg {
  max-width: 600px;
  margin: 0 auto;
  position: relative;
}

.dwr-search-input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.dwr-search-icon-lg {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--dwr-hub-text-secondary);
  pointer-events: none;
  z-index: 2;
}

.dwr-search-input-lg {
  width: 100%;
  padding: 14px 110px 14px 48px;
  border: 2px solid var(--dwr-hub-border);
  border-radius: var(--dwr-radius-lg);
  font-size: 1rem;
  background: var(--dwr-hub-bg-secondary);
  color: var(--dwr-hub-text);
  transition: var(--dwr-transition);
}

.dwr-search-input-lg:focus {
  outline: none;
  border-color: var(--dwr-hub-accent);
  background: var(--dwr-hub-bg);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.dwr-search-input-lg::placeholder {
  color: var(--dwr-hub-text-secondary);
}

.dwr-search-results-lg {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--dwr-hub-bg);
  border: 1px solid var(--dwr-hub-border);
  border-radius: var(--dwr-radius-lg);
  box-shadow: var(--dwr-shadow-lg);
  max-height: 400px;
  overflow-y: auto;
  z-index: 100;
}

/* لایه اصلی سایدبار + محتوا */
.dwr-main-layout {
  background: var(--dwr-hub-bg);
  min-height: 60vh;
}

.dwr-main-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  gap: 2rem;
  position: relative;
}

.dwr-sidebar {
  width: 280px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 2rem 1.5rem 2rem 2rem;
  border-left: 1px solid var(--dwr-hub-border);
  background: var(--dwr-hub-bg-secondary);
}

.dwr-sidebar-heading {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--dwr-hub-text-secondary);
  margin: 0 0 1rem;
  font-weight: 700;
}

.dwr-sidebar-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.dwr-sidebar-item {
  margin-bottom: 2px;
}

.dwr-sidebar-link {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 12px;
  text-decoration: none;
  color: var(--dwr-hub-text-secondary);
  border-radius: 6px;
  font-size: 0.9rem;
  transition: var(--dwr-transition);
  border-right: 2px solid transparent;
}

.dwr-sidebar-link:hover {
  background: rgba(37, 99, 235, 0.05);
  color: var(--dwr-hub-text);
}

.dwr-sidebar-link.active {
  background: #dbeafe;
  color: #2563eb;
  border-right-color: #2563eb;
  font-weight: 600;
}

.dwr-sidebar-number {
  font-size: 0.75rem;
  font-weight: 700;
  color: #2563eb;
  min-width: 20px;
  opacity: 0.7;
}

.dwr-sidebar-toggle {
  display: none;
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 48px;
  height: 48px;
  background: var(--dwr-hub-accent);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: var(--dwr-shadow-lg);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.dwr-content {
  flex: 1;
  min-width: 0;
  padding: 2rem 2rem 2rem 0;
}

.dwr-content-inner {
  max-width: 780px;
}

.dwr-content-section {
  margin-bottom: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--dwr-hub-border);
}

.dwr-content-section:last-child {
  border-bottom: none;
}

.dwr-section-header-modern {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 1.5rem;
  position: relative;
}

.dwr-section-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: #2563eb;
  color: white;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
}

.dwr-section-heading {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--dwr-hub-text);
  margin: 0;
  line-height: 1.4;
}

.dwr-section-permalink {
  color: var(--dwr-hub-text-secondary);
  text-decoration: none;
  opacity: 0;
  transition: var(--dwr-transition);
  padding: 4px;
  border-radius: 4px;
}

.dwr-section-permalink:hover {
  background: var(--dwr-hub-bg-secondary);
  color: var(--dwr-hub-accent);
}
.dwr-content-section:hover .dwr-section-permalink {
  opacity: 1;
}

.dwr-section-body-modern {
  color: var(--dwr-hub-text);
  line-height: 1.9;
  font-size: 1.02rem;
}

.dwr-section-body-modern h2 {
  font-size: 1.35rem;
  margin: 2rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--dwr-hub-border);
}

.dwr-section-body-modern h3 {
  font-size: 1.15rem;
  margin: 1.5rem 0 0.75rem;
}
.dwr-section-body-modern p {
  margin-bottom: 1.25rem;
}
.dwr-section-body-modern ul,
.dwr-section-body-modern ol {
  margin-bottom: 1.25rem;
  padding-right: 1.5rem;
}
.dwr-section-body-modern li {
  margin-bottom: 0.5rem;
}

.dwr-section-body-modern code {
  background: var(--dwr-hub-bg-secondary);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.9em;
  color: #2563eb;
  border: 1px solid var(--dwr-hub-border);
}

.dwr-section-body-modern pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 1.25rem;
  border-radius: var(--dwr-radius-lg);
  overflow-x: auto;
  margin: 1.5rem 0;
  line-height: 1.6;
}

.dwr-section-body-modern pre code {
  background: none;
  padding: 0;
  color: inherit;
  border: none;
  font-size: 0.9rem;
}

.dwr-section-body-modern blockquote {
  border-right: 4px solid #2563eb;
  background: #dbeafe;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  border-radius: 0 8px 8px 0;
  color: #1e40af;
}

.dwr-section-body-modern blockquote p:last-child {
  margin-bottom: 0;
}
.dwr-section-body-modern img {
  max-width: 100%;
  height: auto;
  border-radius: var(--dwr-radius-lg);
  box-shadow: var(--dwr-shadow);
}

.dwr-section-body-modern table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

.dwr-section-body-modern th,
.dwr-section-body-modern td {
  padding: 10px 14px;
  border: 1px solid var(--dwr-hub-border);
  text-align: right;
}

.dwr-section-body-modern th {
  background: var(--dwr-hub-bg-secondary);
  font-weight: 700;
}

/* ============================================
   ۸. فوتر بازخورد
   ============================================ */
.dwr-content-footer {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--dwr-hub-border);
}

.dwr-feedback-card {
  background: var(--dwr-hub-bg-secondary);
  border: 1px solid var(--dwr-hub-border);
  border-radius: var(--dwr-radius-lg);
  padding: 2rem;
  text-align: center;
  transition: var(--dwr-transition);
}

.dwr-feedback-card:hover {
  box-shadow: var(--dwr-shadow-lg);
  border-color: #d0d5dd;
}

.dwr-feedback-emoji {
  color: var(--dwr-hub-accent);
  margin-bottom: 0.75rem;
  display: flex;
  justify-content: center;
}

.dwr-feedback-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--dwr-hub-text);
  margin: 0 0 0.5rem;
}

.dwr-feedback-subtitle {
  color: var(--dwr-hub-text-secondary);
  font-size: 0.9rem;
  margin: 0 0 1.5rem;
  line-height: 1.6;
}

.dwr-feedback-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.dwr-feedback-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: 1px solid var(--dwr-hub-border);
  border-radius: 10px;
  background: var(--dwr-hub-bg);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--dwr-hub-text);
  transition: all 0.25s ease;
}

.dwr-feedback-btn svg {
  flex-shrink: 0;
}
.dwr-feedback-btn:hover {
  transform: translateY(-1px);
}

.dwr-feedback-yes:hover {
  background: #ecfdf5;
  border-color: #10b981;
  color: #059669;
}

.dwr-feedback-yes.selected {
  background: #ecfdf5;
  border-color: #10b981;
  color: #059669;
  font-weight: 600;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.dwr-feedback-no:hover {
  background: #fef2f2;
  border-color: #ef4444;
  color: #dc2626;
}

.dwr-feedback-no.selected {
  background: #fef2f2;
  border-color: #ef4444;
  color: #dc2626;
  font-weight: 600;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.dwr-feedback-btn:disabled {
  opacity: 0.6;
  pointer-events: none;
}

.dwr-feedback-thanks {
  animation: dwrFadeInUp 0.4s ease;
}

.dwr-feedback-thanks-icon {
  color: #10b981;
  margin-bottom: 0.75rem;
  display: flex;
  justify-content: center;
}

.dwr-footer-meta {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.dwr-footer-updated,
.dwr-footer-readtime {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--dwr-hub-text-secondary);
  font-size: 0.85rem;
}

.dwr-footer-updated svg,
.dwr-footer-readtime svg {
  opacity: 0.6;
  flex-shrink: 0;
}

/* ============================================
   ۹. Progress Bar + Scroll to Top
   ============================================ */
.dwr-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: transparent;
  z-index: 9999;
  pointer-events: none;
}

.dwr-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(
    90deg,
    var(--dwr-hub-accent),
    var(--dwr-hub-accent2)
  );
  transition: width 0.1s ease;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

.dwr-scroll-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 48px;
  height: 48px;
  background: var(--dwr-hub-accent);
  color: white;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
}

.dwr-scroll-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dwr-scroll-top:hover {
  background: #4f46e5;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.6);
}

.dwr-scroll-top:active {
  transform: translateY(0);
}

/* ============================================
   ۱۰. Toast
   ============================================ */
.dwr-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #1e293b;
  color: white;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 0.9rem;
  z-index: 9999;
  transition: transform 0.3s ease;
  pointer-events: none;
}

.dwr-toast.show {
  transform: translateX(-50%) translateY(0);
}

/* ============================================
   ۱۱. حالت تاریک
   ============================================ */
body.dwr-dark-mode {
  --dwr-hub-bg: #111111;
  --dwr-hub-bg-secondary: #1a1a1a;
  --dwr-hub-text: #e0e0e0;
  --dwr-hub-text-secondary: #888;
  --dwr-hub-border: #2a2a2a;
}

body.dwr-dark-mode .dwr-docs-container,
body.dwr-dark-mode .dwr-accordion-body {
  background: var(--dwr-bg-dark);
  color: var(--dwr-text-dark);
}

body.dwr-dark-mode .dwr-section-content,
body.dwr-dark-mode .dwr-accordion-content,
body.dwr-dark-mode .dwr-tab-body {
  color: var(--dwr-text-dark);
}

body.dwr-dark-mode .dwr-accordion-header {
  background: #2a2a2a;
  color: var(--dwr-text-dark);
}
body.dwr-dark-mode .dwr-accordion-header:hover {
  background: #333;
}
body.dwr-dark-mode .dwr-accordion-item {
  border-color: #444;
}

body.dwr-dark-mode .dwr-search-input-lg {
  background: #1a1a1a;
  color: var(--dwr-text-dark);
}
body.dwr-dark-mode .dwr-section-body-modern code {
  background: #1a1a1a;
  border-color: #333;
}
body.dwr-dark-mode .dwr-section-body-modern blockquote {
  background: #1e293b;
  color: #93c5fd;
}

body.dwr-dark-mode .dwr-btn-feedback {
  background: #1a1a1a;
  border-color: #333;
  color: #ccc;
}
body.dwr-dark-mode .dwr-hub-card {
  background: #1a1a1a;
}
body.dwr-dark-mode .dwr-hub-card-chapters {
  background: #222;
}
body.dwr-dark-mode .dwr-tab-btn {
  color: #aaa;
}

/* ============================================
   ۱۲. واکنش‌گرایی نهایی
   ============================================ */
@media (max-width: 1024px) {
  .dwr-product-title {
    font-size: 2.2rem;
  }
  .dwr-product-hero-image {
    flex: 0 0 220px;
  }
  .dwr-product-hero-img {
    width: 200px;
  }
  .dwr-hub-title {
    font-size: 2.8rem;
  }
  .dwr-categories-grid {
    grid-template-columns: 1fr 1fr;
  }
  .dwr-latest-grid {
    grid-template-columns: 1fr 1fr;
  }
  .dwr-hub-sidebar {
    display: none;
  }
}

@media (max-width: 768px) {
  .dwr-docs-container {
    margin: 1rem;
    padding: 1rem;
  }

  .dwr-hero-product {
    padding: 3rem 0 2rem;
  }
  .dwr-product-hero-row {
    flex-direction: column;
    text-align: center;
  }
  .dwr-product-hero-text {
    text-align: center;
  }
  .dwr-product-title {
    font-size: 1.8rem;
    text-align: center;
  }
  .dwr-product-description {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
  }
  .dwr-product-stats {
    justify-content: center;
    grid-template-columns: repeat(3, 1fr);
  }
  .dwr-product-hero-image {
    order: -1;
    flex: 0 0 auto;
    margin-bottom: 1rem;
  }
  .dwr-product-hero-img {
    width: 160px;
  }

  .dwr-hub-hero {
    padding: 4rem 0 3rem;
    min-height: auto;
  }
  .dwr-hub-title {
    font-size: 2rem;
  }
  .dwr-hub-description {
    font-size: 1rem;
  }
  .dwr-hub-stats {
    gap: 1rem;
  }
  .dwr-hub-stat {
    padding: 10px 16px;
  }
  .dwr-hub-grid {
    grid-template-columns: 1fr;
  }

  .dwr-hub-section-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .dwr-hub-footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .dwr-hub-card-link {
    padding: 1.5rem;
  }
  .dwr-hub-floating {
    display: none;
  }
  .dwr-hub-layout {
    flex-direction: column;
    gap: 2rem;
  }
  .dwr-categories-grid {
    grid-template-columns: 1fr;
  }
  .dwr-latest-grid {
    grid-template-columns: 1fr;
  }
  .dwr-hub-main {
    padding: 2rem 0;
  }
  .dwr-hub-section {
    margin-bottom: 2.5rem;
  }

  .dwr-main-container {
    flex-direction: column;
  }
  .dwr-sidebar {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    z-index: 999;
    transition: right 0.3s ease;
    box-shadow: var(--dwr-shadow-lg);
  }
  .dwr-sidebar.open {
    right: 0;
  }
  .dwr-sidebar-toggle {
    display: flex;
  }
  .dwr-content {
    padding: 1.5rem;
  }
  .dwr-section-heading {
    font-size: 1.3rem;
  }
  .dwr-tabs-nav {
    flex-wrap: nowrap;
  }

  .dwr-feedback-card {
    padding: 1.5rem;
  }
  .dwr-feedback-title {
    font-size: 1.1rem;
  }
  .dwr-feedback-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .dwr-feedback-btn {
    justify-content: center;
  }
  .dwr-footer-meta {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }

  .dwr-scroll-top {
    bottom: 20px;
    right: 20px;
    width: 42px;
    height: 42px;
    border-radius: 12px;
  }
  .dwr-progress-bar {
    height: 3px;
  }
}

@media (max-width: 480px) {
  .dwr-product-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}
