/* ==========================================================================
   ARTICLE.CSS
   Styles specific to article.html only.
   Auto-split from the original style.css — no CSS rules were modified.
   Load AFTER common.css
   ========================================================================== */


/* =========================================================================
   ARTICLE PAGE (article.html)
   ========================================================================= */

.reading-progress {
  position: fixed; top: 0; left: 0;
  height: 3px; width: 0%;
  background: var(--gradient-brand);
  z-index: 1001;
  transition: width 0.08s linear;
}

.article-hero { padding-block: 22px 4px; }

.article-hero .badge { margin-bottom: 18px; }

.article-title {
  font-size: clamp(28px, 4.2vw, 46px);
  margin-bottom: 18px;
  max-width: 880px;
}

.article-excerpt {
  font-size: 17.5px;
  color: var(--text-secondary);
  line-height: 1.65;
  max-width: 740px;
  margin-bottom: 26px;
}

.article-hero-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 14px;
  font-size: 13.5px; color: var(--text-muted);
  padding-block: 20px;
  border-block: 1px solid var(--border);
  margin-bottom: 32px;
}

.article-hero-meta .divider { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: 0.5; }

.article-hero-meta .author-name { color: var(--text-primary); font-weight: 600; }

.article-cover {
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin-bottom: 44px;
  aspect-ratio: 16 / 8 !important;
  width: 100%;
}

.article-cover img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  aspect-ratio: 16 / 8 !important;
  object-fit: cover !important;
  object-position: center !important;
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 48px;
  align-items: start;
  padding-block: 0 clamp(56px, 7vw, 90px);
}

/* article typography ("prose") ---------------------------------------------*/

.prose { font-size: 17px; line-height: 1.8; color: var(--text-primary); max-width: 720px; }

.prose > * + * { margin-top: 22px; }

.prose h2 { font-size: 26px; margin-top: 46px; scroll-margin-top: 100px; }

.prose h3 { font-size: 20px; margin-top: 34px; scroll-margin-top: 100px; }

.prose p { color: var(--text-secondary); }

.prose strong { color: var(--text-primary); }

.prose a { color: var(--signal); text-decoration: underline; text-underline-offset: 3px; }

.prose blockquote {
  border-left: 3px solid var(--signal);
  padding-left: 20px;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  color: var(--text-primary);
}

.prose ul,
.prose ol { padding-left: 22px; color: var(--text-secondary); display: flex; flex-direction: column; gap: 9px; }

.prose li::marker { color: var(--signal); font-weight: 700; }

.prose figure { margin: 0; }

.prose figure img { border-radius: var(--r-md); width: 100%; }

.prose figcaption { font-size: 13px; color: var(--text-muted); margin-top: 10px; text-align: center; }

.prose code { font-family: var(--font-mono); font-size: 0.88em; background: var(--border); padding: 2px 6px; border-radius: 6px; }

.prose pre {
  background: #0B0E17; color: #E7E9F5;
  border-radius: var(--r-md);
  padding: 20px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.7;
}

.prose pre code { background: none; padding: 0; }

/* share bar -------------------------------------------------------------------*/

.share-bar {
  display: flex; align-items: center; gap: 10px;
  margin-top: 44px; padding-top: 28px;
  border-top: 1px solid var(--border);
}

.share-bar .share-label { font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); margin-right: 6px; }

.share-btn {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
  transition: all var(--dur-fast) var(--ease);
}

.share-btn svg { width: 16px; height: 16px; }

.share-btn:hover { color: #fff; background: var(--gradient-brand); border-color: transparent; transform: translateY(-2px); }

/* author card -------------------------------------------------------------------*/

.author-card {
  display: flex; gap: 18px; align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 26px;
  margin-top: 40px;
  box-shadow: var(--shadow-sm);
}

.author-card .avatar { width: 56px; height: 56px; font-size: 18px; }

.author-card h4 { font-family: var(--font-display); font-size: 17px; margin-bottom: 6px; }

.author-card p { font-size: 14px; color: var(--text-secondary); line-height: 1.6; }

.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 36px; }

/* table of contents widget ------------------------------------------------------*/

.toc-list { display: flex; flex-direction: column; gap: 2px; }

.toc-list a {
  display: block; padding: 9px 12px; border-radius: var(--r-sm);
  font-size: 13.5px; color: var(--text-secondary);
  border-left: 2px solid transparent;
  transition: all var(--dur-fast) var(--ease);
}

.toc-list a:hover { color: var(--text-primary); background: var(--border); }

/* comments ------------------------------------------------------------------------*/

.comments { margin-top: 56px; }

.comments .section-head { margin-bottom: 26px; }

.comment-list { display: flex; flex-direction: column; gap: 22px; margin-bottom: 36px; }

.comment-form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 26px; box-shadow: var(--shadow-sm); }

.comment-form h3 { font-size: 17px; margin-bottom: 16px; }

.comment-form textarea,
.comment-form input {
  width: 100%; padding: 13px 16px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg);
  font-size: 14.5px;
  margin-bottom: 14px;
  resize: vertical;
  min-height: 100px;
  font-family: var(--font-body);
}

.comment-form input { min-height: unset; }

.comment-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.comment-note { font-size: 13px; margin-top: 4px; color: var(--text-muted); }

@media (max-width: 980px) {
  .article-layout { grid-template-columns: 1fr; }

  .sidebar-article { order: 2; }

  .comment-form .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .article-cover,
  .article-cover img { aspect-ratio: 4 / 3 !important; }
}

/* ==========================================================================
   FINAL CLS & ACCESSIBILITY FIX
   ========================================================================== */

/* 1. ہیرو سیکشن کی اونچائی پہلے سے فکس رکھیں تاکہ جھٹکا (0.265) صفر ہو جائے */

.article-hero {
  min-height: 480px !important;
  display: block;
  contain: layout style;
}

/* 3. مدھم لنکس اور فرنٹ کلر کا کنٹراسٹ درست کرنا (Accessibility 100 Fix) */

.share-label,
#articleDate,
#articleReadTime,
#articleCrumbCat {
  color: #a1a1aa !important; /* واضح اور روشن کلر */
}
.hero-feature-img {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 16 / 9 !important; /* جگہ پہلے سے ریزرو ہو جائے گی */
  object-fit: cover !important;
}
/* ---- Responsive & Fixed Image Layout ---- */
#editor-container .ql-editor img,
#articleContent img,
.article-img-container img,
.editor-responsive-img {
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: 480px !important;
  display: block !important;
  margin: 1.5rem auto !important;
  border-radius: 10px;
  object-fit: cover !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* ---- Modern Table Styling for Scorecards ---- */
#editor-container .ql-editor table,
#articleContent table {
  width: 100% !important;
  border-collapse: collapse !important;
  margin: 1.8rem 0 !important;
  font-size: 0.95rem;
  background-color: #ffffff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  border: 1px solid #e2e8f0;
}

#editor-container .ql-editor th,
#editor-container .ql-editor td,
#articleContent th,
#articleContent td {
  padding: 12px 16px !important;
  border-bottom: 1px solid #edf2f7 !important;
  text-align: left;
}

/* Header Row / First Row Style */
#editor-container .ql-editor tr:first-child,
#articleContent tr:first-child {
  background-color: #1e293b !important;
  color: #ffffff !important;
  font-weight: 600;
}

#editor-container .ql-editor tr:first-child td,
#articleContent tr:first-child td {
  color: #ffffff !important;
  border-bottom: none !important;
}

/* Zebra Striping for alternate rows */
#editor-container .ql-editor tr:nth-child(even),
#articleContent tr:nth-child(even) {
  background-color: #f8fafc;
}

/* Table Hover Effect */
#editor-container .ql-editor tr:hover,
#articleContent tr:hover {
  background-color: #f1f5f9;
}