/* ==========================================================================
   Negareh Single Article Dedicated Stylesheet (single-article.css)
   Scoped strictly under .negareh-single-article
   Source of Truth: article-detail.html
   ========================================================================== */

/* Page Root Wrapper & Design System Tokens Fallback */
.negareh-single-article {
  --brand-cyan: #00CDD3;
  --brand-cyan-dark: #00ADB2;
  --brand-cyan-light: #E6FAFA;
  --brand-cyan-glow: rgba(0, 205, 211, 0.35);

  --brand-teal: #006872;
  --brand-teal-dark: #004D54;
  --brand-teal-deep: #00363B;
  --brand-teal-light: #E6F0F1;
  --brand-teal-glow: rgba(0, 104, 114, 0.28);

  --brand-yellow: #FFB400;
  --brand-yellow-dark: #E09E00;
  --brand-yellow-light: #FFF8E6;

  --brand-red: #CA0A0A;
  --brand-red-dark: #A80808;

  --bg-primary: #FFFFFF;
  --bg-surface: #FFFFFF;
  --bg-elevated: #F6FAFA;
  --bg-subtle: #EDF5F5;
  --bg-dark: #011E22;
  --bg-dark-card: #03363D;
  --bg-glass: rgba(255, 255, 255, 0.92);

  --text-primary: #0A191D;
  --text-secondary: #3D5A60;
  --text-muted: #6B888E;
  --text-inverse: #FFFFFF;

  --border-subtle: rgba(0, 104, 114, 0.1);
  --border-medium: rgba(0, 104, 114, 0.18);
  --border-focus: var(--brand-cyan);

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 22px;
  --radius-2xl: 28px;
  --radius-pill: 999px;

  --shadow-sm: 0 4px 14px rgba(0, 54, 59, 0.05);
  --shadow-md: 0 10px 30px -6px rgba(0, 54, 59, 0.09), 0 3px 10px rgba(0, 54, 59, 0.03);
  --shadow-lg: 0 20px 48px -10px rgba(0, 54, 59, 0.15);

  --transition-fast: 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  --container-max: 1240px;

  margin-top: 10px;
  margin-bottom: 60px;
}

[data-theme="dark"] .negareh-single-article {
  --bg-primary: #021215;
  --bg-surface: #052026;
  --bg-elevated: #082930;
  --bg-subtle: #0B353E;
  --bg-dark: #010C0E;
  --bg-dark-card: #041B1F;
  --bg-glass: rgba(5, 32, 38, 0.92);

  --text-primary: #F2FCFC;
  --text-secondary: #A0CBD1;
  --text-muted: #64969E;

  --border-subtle: rgba(0, 205, 211, 0.12);
  --border-medium: rgba(0, 205, 211, 0.24);

  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 30px -6px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 20px 48px -10px rgba(0, 0, 0, 0.75);
}

.negareh-single-article .gradient-title {
  background: linear-gradient(135deg, var(--brand-teal-deep) 0%, var(--brand-teal) 65%, #008794 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="dark"] .negareh-single-article .gradient-title {
  background: linear-gradient(135deg, #FFFFFF 20%, var(--brand-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ==================== ۱. هدر جزئیات مقاله ==================== */
.negareh-single-article .article-header-card {
  background: linear-gradient(135deg, var(--bg-surface) 0%, var(--bg-elevated) 100%);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-2xl, 28px);
  padding: 34px 38px;
  margin-top: 10px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.negareh-single-article .breadcrumb-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.negareh-single-article .breadcrumb-nav a {
  color: var(--brand-teal);
  text-decoration: none;
  font-weight: 700;
  transition: color var(--transition-fast);
}

[data-theme="dark"] .negareh-single-article .breadcrumb-nav a { color: var(--brand-cyan); }
.negareh-single-article .breadcrumb-nav a:hover { text-decoration: underline; }

.negareh-single-article .breadcrumb-separator {
  color: var(--text-muted);
  opacity: 0.6;
}

.negareh-single-article .article-meta-badges-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.negareh-single-article .badge-cat-pill {
  background: var(--brand-teal-light);
  color: var(--brand-teal);
  padding: 4px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 800;
  border: 1px solid rgba(0, 104, 114, 0.2);
  text-decoration: none;
  display: inline-block;
}

[data-theme="dark"] .negareh-single-article .badge-cat-pill {
  background: rgba(0, 205, 211, 0.18);
  color: var(--brand-cyan);
  border-color: rgba(0, 205, 211, 0.35);
}

.negareh-single-article .article-full-title {
  font-size: clamp(1.4rem, 2.6vw, 2.15rem);
  font-weight: 900;
  line-height: 1.4;
  margin-bottom: 16px;
}

.negareh-single-article .article-author-bar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.84rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.negareh-single-article .author-detail-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* تصویر / بنر شاخص مقاله */
.negareh-single-article .article-featured-media-box {
  background: linear-gradient(135deg, var(--brand-teal-deep) 0%, var(--brand-teal) 100%);
  border-radius: var(--radius-2xl, 28px);
  min-height: 240px;
  max-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 34px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-medium);
}

.negareh-single-article .article-featured-img {
  width: 100%;
  height: 100%;
  max-height: 420px;
  object-fit: cover;
  display: block;
  border-radius: var(--radius-2xl, 28px);
}

.negareh-single-article .media-emoji-hero {
  font-size: 5.5rem;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.35));
}

/* ==================== ۲. چیدمان ۲ ستونه مقاله ==================== */
.negareh-single-article .article-content-layout {
  display: grid;
  grid-template-columns: 1fr 310px;
  gap: 36px;
  margin-bottom: 60px;
  align-items: start;
}

/* ستون متن مقاله (حداکثر ۷۲۰-۷۵۰px برای خوانایی ایده‌آل) */
.negareh-single-article .article-reading-column {
  max-width: 740px;
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-2xl, 28px);
  padding: 38px 42px;
  box-shadow: var(--shadow-sm);
}

.negareh-single-article .article-prose {
  font-size: 1.02rem;
  line-height: 1.88;
  color: var(--text-primary);
}

.negareh-single-article .article-prose p {
  margin-bottom: 20px;
}

.negareh-single-article .article-prose h2 {
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--brand-teal);
  margin-top: 36px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border-subtle);
  position: relative;
  scroll-margin-top: 100px;
}

[data-theme="dark"] .negareh-single-article .article-prose h2 {
  color: var(--brand-cyan);
}

.negareh-single-article .article-prose h2::after {
  content: '';
  position: absolute;
  bottom: -2px;
  right: 0;
  width: 50px;
  height: 2px;
  background: var(--brand-cyan);
  border-radius: 2px;
}

.negareh-single-article .article-prose h3 {
  font-size: 1.12rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-top: 24px;
  margin-bottom: 12px;
  scroll-margin-top: 100px;
}

.negareh-single-article .article-prose strong {
  color: var(--text-primary);
  font-weight: 800;
}

.negareh-single-article .article-prose img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  margin: 18px 0;
  box-shadow: var(--shadow-sm);
}

.negareh-single-article .article-prose blockquote {
  background: var(--bg-elevated);
  border-right: 4px solid var(--brand-cyan);
  padding: 16px 20px;
  margin: 24px 0;
  border-radius: var(--radius-sm);
  font-style: italic;
  color: var(--text-secondary);
}

.negareh-single-article .article-prose ul,
.negareh-single-article .article-prose ol {
  margin-bottom: 20px;
  padding-right: 24px;
}

.negareh-single-article .article-prose li {
  margin-bottom: 8px;
}

.negareh-single-article .article-prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 0.92rem;
}

.negareh-single-article .article-prose table th,
.negareh-single-article .article-prose table td {
  border: 1px solid var(--border-medium);
  padding: 10px 14px;
  text-align: right;
}

.negareh-single-article .article-prose table th {
  background: var(--bg-elevated);
  color: var(--brand-teal);
  font-weight: 800;
}

/* ==================== ۳. جعبه CTA میان‌مقاله (.inline-article-cta) ==================== */
.negareh-single-article .inline-article-cta {
  background: linear-gradient(135deg, var(--bg-elevated) 0%, var(--brand-cyan-light) 100%);
  border: 2px solid var(--brand-cyan);
  border-radius: var(--radius-xl, 22px);
  padding: 24px 26px;
  margin: 34px 0;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

[data-theme="dark"] .negareh-single-article .inline-article-cta {
  background: linear-gradient(135deg, var(--bg-elevated) 0%, rgba(0, 205, 211, 0.12) 100%);
  border-color: rgba(0, 205, 211, 0.5);
}

.negareh-single-article .inline-cta-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--brand-teal);
  color: #ffffff;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 3px 12px;
  border-radius: var(--radius-pill);
  align-self: flex-start;
}

[data-theme="dark"] .negareh-single-article .inline-cta-tag {
  background: var(--brand-cyan-dark);
  color: #002227;
}

.negareh-single-article .inline-cta-title {
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--brand-teal-deep);
  margin: 0;
  line-height: 1.45;
}

[data-theme="dark"] .negareh-single-article .inline-cta-title {
  color: #ffffff;
}

.negareh-single-article .inline-cta-text {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.75;
  margin: 0;
}

.negareh-single-article .inline-cta-btn {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--brand-teal) 0%, var(--brand-teal-deep) 100%);
  color: #ffffff;
  padding: 9px 22px;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 4px 14px var(--brand-teal-glow);
  transition: all var(--transition-fast);
  margin-top: 6px;
}

.negareh-single-article .inline-cta-btn:hover {
  background: linear-gradient(135deg, var(--brand-cyan-dark) 0%, var(--brand-teal) 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px var(--brand-teal-glow);
}

/* بنر پایانی مقاله */
.negareh-single-article .article-end-cta {
  background: linear-gradient(135deg, var(--brand-teal-deep) 0%, var(--brand-teal) 100%);
  color: #ffffff;
  border-radius: var(--radius-xl);
  padding: 26px 28px;
  margin-top: 36px;
  text-align: center;
}

.negareh-single-article .end-cta-title {
  font-size: 1.15rem;
  font-weight: 900;
  margin-bottom: 8px;
}

.negareh-single-article .end-cta-desc {
  font-size: 0.86rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 16px;
  line-height: 1.7;
}

/* ==================== ۴. سایدبار چسبان: فهرست مطالب (Sticky TOC) ==================== */
.negareh-single-article .sticky-toc-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-2xl, 28px);
  padding: 24px 22px;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 90px;
}

.negareh-single-article .toc-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border-subtle);
  margin-bottom: 14px;
  position: relative;
}

.negareh-single-article .toc-header::after {
  content: '';
  position: absolute;
  bottom: -2px;
  right: 0;
  width: 45px;
  height: 2px;
  background: var(--brand-cyan);
  border-radius: 2px;
}

.negareh-single-article .toc-title {
  font-size: 1rem;
  font-weight: 900;
  color: var(--text-primary);
  margin: 0;
}

.negareh-single-article .toc-links-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.negareh-single-article .toc-link-item a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.45;
  transition: all var(--transition-fast);
  border-right: 3px solid transparent;
}

.negareh-single-article .toc-link-item a:hover,
.negareh-single-article .toc-link-item.active a {
  background: var(--brand-cyan-light);
  color: var(--brand-teal);
  border-right-color: var(--brand-cyan);
  transform: translateX(-3px);
}

[data-theme="dark"] .negareh-single-article .toc-link-item a:hover,
[data-theme="dark"] .negareh-single-article .toc-link-item.active a {
  background: rgba(0, 205, 211, 0.14);
  color: var(--brand-cyan);
}

/* آکاردئون موبایل فهرست مطالب */
.negareh-single-article .mobile-toc-accordion {
  display: none;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  padding: 14px 18px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.negareh-single-article .mobile-toc-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-primary);
}

.negareh-single-article .mobile-toc-content {
  display: none;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
  margin-top: 10px;
}

.negareh-single-article .mobile-toc-accordion.open .mobile-toc-content {
  display: block;
}

.negareh-single-article .mobile-toc-accordion.open .mobile-toc-chevron {
  transform: rotate(180deg);
}

/* ==================== ۵. مقالات مرتبط ==================== */
.negareh-single-article .related-articles-wrap {
  margin-top: 40px;
  margin-bottom: 60px;
}

.negareh-single-article .related-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border-subtle);
  position: relative;
}

.negareh-single-article .related-section-header::after {
  content: '';
  position: absolute;
  bottom: -2px;
  right: 0;
  width: 60px;
  height: 2px;
  background: var(--brand-cyan);
  border-radius: 2px;
}

.negareh-single-article .related-grid-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* کارت مقاله مشابه blog.html */
.negareh-single-article .article-post-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl, 22px);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-normal);
  text-decoration: none;
  color: inherit;
  position: relative;
}

.negareh-single-article .article-post-card:hover {
  border-color: var(--brand-cyan);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.negareh-single-article .card-cover-wrap {
  height: 125px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.negareh-single-article .card-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.negareh-single-article .card-cover-emoji {
  font-size: 3rem;
  transition: transform 0.35s ease;
}

.negareh-single-article .article-post-card:hover .card-cover-emoji {
  transform: scale(1.15) rotate(4deg);
}

.negareh-single-article .card-cat-badge-top {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 54, 59, 0.85);
  color: #ffffff;
  backdrop-filter: blur(6px);
  border: 1px solid rgba(0, 205, 211, 0.4);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  font-weight: 800;
  z-index: 2;
}

.negareh-single-article .card-body-box {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  gap: 8px;
}

.negareh-single-article .card-post-title {
  font-size: 0.96rem;
  font-weight: 900;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 3em;
}

.negareh-single-article .card-post-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
  margin-top: auto;
  font-size: 0.74rem;
  color: var(--text-muted);
}

/* ==================== ۶. واکنش‌گرایی موبایل و تبلت ==================== */
@media (max-width: 960px) {
  .negareh-single-article .article-content-layout {
    grid-template-columns: 1fr;
  }

  .negareh-single-article .sticky-toc-box {
    display: none;
  }

  .negareh-single-article .mobile-toc-accordion {
    display: block;
  }

  .negareh-single-article .related-grid-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .negareh-single-article .related-grid-cards {
    grid-template-columns: 1fr;
  }

  .negareh-single-article .article-reading-column {
    padding: 24px 20px;
  }

  .negareh-single-article .article-header-card {
    padding: 22px 18px;
  }

  .negareh-single-article .article-featured-media-box {
    min-height: 180px;
    max-height: 260px;
  }

  .negareh-single-article .media-emoji-hero {
    font-size: 4rem;
  }
}
