/* Article-specific styles */
.article-main {
  padding: 2rem 0;
  background-color: var(--bg-secondary);
}

/* Breadcrumb */
.breadcrumb {
  margin-bottom: 2rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.breadcrumb a {
  color: var(--accent-primary);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb-separator {
  margin: 0 0.5rem;
}

.breadcrumb-current {
  color: var(--text-muted) !important;
}

/* Article Layout */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 3rem;
  align-items: start;
}

/* Article Content */
.article-content {
  background-color: var(--bg-primary);
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: var(--shadow-md);
}

/* Article Header */
.article-header {
  margin-bottom: 2rem;
}

.article-category-tag {
  display: inline-block;
  background-color: var(--accent-primary);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.article-title {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.article-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 2rem;
}

.article-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.author-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.author-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}

.author-details {
  display: flex;
  flex-direction: column;
}

.author-name {
  font-weight: 600;
  color: var(--accent-primary);
  text-decoration: none;
}

.author-name:hover {
  text-decoration: underline;
}

.author-title {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.article-stats {
  display: flex;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.article-stats span {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Article Image */
.article-image {
  margin: 2rem 0;
  border-radius: 1rem;
  overflow: hidden;
}

.article-image img {
  width: 100%;
  height: 400px;
  object-fit: cover;
}

/* Article Body */
.article-body {
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--text-primary);
}

.article-body .lead {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  padding: 1rem;
  background-color: var(--bg-secondary);
  border-radius: 0.5rem;
  border-left: 4px solid var(--accent-primary);
}

[dir="rtl"] .article-body .lead {
  border-left: none;
  border-right: 4px solid var(--accent-primary);
}

.article-body h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 2rem 0 1rem;
  color: var(--text-primary);
}

.article-body h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 1.5rem 0 1rem;
  color: var(--text-primary);
}

.article-body p {
  margin-bottom: 1.5rem;
}

.article-quote {
  font-size: 1.25rem;
  font-style: italic;
  color: var(--text-secondary);
  margin: 2rem 0;
  padding: 1.5rem;
  background-color: var(--bg-secondary);
  border-radius: 0.5rem;
  border-left: 4px solid var(--accent-secondary);
  position: relative;
}

[dir="rtl"] .article-quote {
  border-left: none;
  border-right: 4px solid var(--accent-secondary);
}

.article-quote::before {
  content: '"';
  font-size: 3rem;
  color: var(--accent-secondary);
  position: absolute;
  top: 0;
  left: 1rem;
  line-height: 1;
  margin-top: 0.5rem;
}

[dir="rtl"] .article-quote::before {
  left: auto;
  right: 1rem;
}

.article-list {
  margin: 1.5rem 0;
  padding-left: 1.5rem;
}

[dir="rtl"] .article-list {
  padding-left: 0;
  padding-right: 1.5rem;
}

.article-list li {
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

.article-list li strong {
  color: var(--accent-primary);
}

/* Info Box */
.info-box {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  padding: 2rem;
  margin: 2rem 0;
  
}

.info-box h3 {
  margin-top: 0;
  margin-bottom: 1.5rem;
  color: var(--accent-primary);
}

.sectors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}
/* article.css */

/* TOC داخل الـ sidebar: يظهر فقط على الشاشات الكبيرة ≥ 992px */
@media (min-width: 992px) {
  .article-sidebar .toc {
    display: block; /* يظهر */
  }

  /* TOC فوق المقال (نسخة الموبايل) نخفيها */
  .article-main .toc {
    display: none;
  }
}

/* TOC فوق المقال: يظهر فقط على الشاشات المتوسطة والصغيرة < 992px */
@media (max-width: 991px) {
  .article-main .toclarge {
    display: block; /* يظهر */
  }

  /* TOC داخل الـ sidebar نخفيها */
  .article-sidebar .toclarge {
    display: none;
  }
}

.sector-item {
  background-color: var(--bg-primary);
  padding: 1rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border-color);
  text-decoration: none;
}

.sector-item h4 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.sector-item p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0;
}

/* Article Tags */
.article-tags {
  margin: 2rem 0;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border-color);
}

.article-tags h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  display: inline-block;
  background-color: var(--bg-secondary);
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  border-radius: 1rem;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

.tag:hover {
  background-color: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
}

/* Share Buttons */
.article-share {
  margin: 2rem 0;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border-color);
}

.article-share h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.share-buttons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.share-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 0.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  font-size: 0.875rem;
}

.share-btn.twitter {
  background-color: #1da1f2;
  color: white;
}

.share-btn.facebook {
  background-color: #1877f2;
  color: white;
}

.share-btn.linkedin {
  background-color: #0a66c2;
  color: white;
}

.share-btn.copy {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.share-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
/* Article Rating */
.article-rating {
  margin-top: 2rem;
  text-align: center;
  padding: 1rem;
  background: #f9fafb;
  border-radius: 0.75rem;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.article-rating h3 {
  margin-bottom: 1rem;
  font-size: 1.2rem;
  color: var(--text-primary, #333);
}

.stars {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  font-size: 2rem;
  cursor: pointer;
}

.stars i {
  color: #ccc;
  transition: color 0.3s;
}

.stars i.active {
  color: #fbbf24; /* لون ذهبي */
}

.rating-message {
  margin-top: 0.5rem;
  font-size: 1rem;
  color: var(--accent-primary, #007bff);
}
/* تصميم زر اقتراح التعديل */
.suggest-edit {
    margin-top: 20px;
    text-align: center; /* الزر بالمنتصف */
}

.btn-suggest-edit {
    display: inline-block;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: bold;
    color: #0d6efd; /* أزرق فاتح متناسق مع ألوان المقال */
    background-color: #e7f1ff; /* خلفية فاتحة للزر */
    border: 2px solid #0d6efd;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-suggest-edit:hover {
    background-color: #0d6efd; /* يصبح أزرق عند المرور */
    color: #fff; /* لون النص أبيض */
    transform: translateY(-2px); /* حركة صغيرة عند المرور */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Sidebar */
.article-sidebar {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  order: 1;
}

.sidebar-card {
  background-color: var(--bg-primary);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
}

.sidebar-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--acc);
}

/* Author Card */
.author-card {
  text-align: center;
}

.author-image {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 1rem;
}

.author-card .author-name {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.author-bio {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.author-link {
  display: inline-block;
  background-color: var(--accent-primary);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  text-decoration: none;
  font-weight: 600;
  transition: background-color 0.3s ease;
}

.author-link:hover {
  background-color: var(--accent-hover);
}

/* Related Articles */
.related-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.related-item {
  display: flex;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.related-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.related-item img {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border-radius: 0.5rem;
  flex-shrink: 0;
}

.related-content h4 {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 0.25rem;
}

.related-content a {
  color: var(--text-primary);
  text-decoration: none;
}

.related-content a:hover {
  color: var(--accent-primary);
}

.related-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Table of Contents */
.toc-list {
  list-style: none;
  padding: 0;
}

.toc-list li {
  margin-bottom: 0.5rem;
}

.toc-list a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.3s ease;
}

.toc-list a:hover {
  color: var(--accent-primary);
}

/* Comments Section */
.comments-section {
  background-color: var(--bg-primary);
  padding: 3rem 0;
}

.comments-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 2rem;
  color: var(--text-primary);
}

/* Comment Form */
.comment-form {
  background-color: var(--bg-secondary);
  padding: 2rem;
  border-radius: 1rem;
  margin-bottom: 2rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

/* Comments List */
.comments-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.comment {
  display: flex;
  gap: 1rem;
  padding: 1.5rem;
  background-color: var(--bg-secondary);
  border-radius: 1rem;
}

.comment-avatar img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.comment-content {
  flex: 1;
}

.comment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.comment-author {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.comment-date {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.comment-text {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.comment-reply {
  background: none;
  border: none;
  color: var(--accent-primary);
  font-weight: 600;
  cursor: pointer;
  font-size: 0.875rem;
}
/* بشكل افتراضي: نخفي النسخة الثانية */
.author-card-outside {
  display: none;
  text-align: center;

}

/* على الشاشات المتوسطة والصغيرة: نعرض النسخة الثانية ونخفي اللي بالـ sidebar */
@media (max-width: 992px) {
  .author-card-outside {
    display: block;
    margin-bottom: 0.5rem;
  }

  .article-sidebar .author-card {
    display: none;
  }
}

.comment-reply:hover {
  text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .article-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
    
  }

}

@media (max-width: 768px) {
  .article-main {
    padding: 1rem 0;
  }

  .article-content {
    padding: 1.5rem;
  }

  .article-title {
    font-size: 2rem;
  }

  .article-subtitle {
    font-size: 1.125rem;
  }

  .article-meta {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }

  .article-stats {
    flex-direction: column;
    gap: 0.5rem;
  }

  .article-body {
    font-size: 1rem;
  }

  .article-body h2 {
    font-size: 1.5rem;
  }

  .sectors-grid {
    grid-template-columns: 1fr;
  }

  .share-buttons {
    justify-content: center;
  }

  .comment {
    padding: 1rem;
  }

  .comment-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
}

@media (max-width: 480px) {
  .article-content {
    padding: 1rem;
  }

  .article-title {
    font-size: 1.75rem;
  }

  .article-image img {
    height: 250px;
  }

  .share-buttons {
    flex-direction: column;
  }

  .share-btn {
    justify-content: center;
  }
}
