/* ===================================================================
   AllUpdate247 — Article Page Styles
   =================================================================== */

/* --- Article Page Layout --- */
.article-page {
  padding: var(--space-8) 0 var(--space-16);
}

.article-layout {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-width);
  gap: var(--space-10);
  align-items: start;
}

/* --- Article Sidebar --- */
.article-sidebar {
  position: sticky;
  top: calc(var(--header-height) + var(--space-4));
  max-height: calc(100vh - var(--header-height) - var(--space-8));
  overflow-y: auto;
}

/* --- Article Header --- */
.article-header {
  margin-bottom: var(--space-6);
}

.article-cat-badge {
  margin-bottom: var(--space-3);
}

.article-title {
  font-size: var(--text-4xl);
  font-weight: var(--fw-extrabold);
  line-height: var(--lh-tight);
  color: var(--text);
  margin-bottom: var(--space-4);
}

.article-excerpt {
  font-size: var(--text-lg);
  color: var(--muted);
  line-height: var(--lh-relaxed);
  margin-bottom: var(--space-5);
  font-weight: var(--fw-normal);
}

/* --- Article Meta --- */
.article-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
  padding: var(--space-4) 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-6);
}

.article-author {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.article-author-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-weight: var(--fw-bold);
  font-size: var(--text-sm);
  flex-shrink: 0;
}

.article-author-name {
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  color: var(--text);
}

.article-author-role {
  font-size: var(--text-xs);
  color: var(--muted);
}

.article-dates {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-left: 1px solid var(--border);
  padding-left: var(--space-4);
}

.article-date-item {
  font-size: var(--text-xs);
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.article-date-label {
  font-weight: var(--fw-semibold);
}

.article-read-time {
  font-size: var(--text-xs);
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: var(--space-1);
  border-left: 1px solid var(--border);
  padding-left: var(--space-4);
}

.article-verified-badge {
  margin-left: auto;
}

/* --- Featured Image --- */
.article-featured-image-wrap {
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-bottom: var(--space-6);
  aspect-ratio: 16/9;
  background: var(--surface-2);
}

.article-featured-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-image-caption {
  text-align: center;
  font-size: var(--text-xs);
  color: var(--muted);
  margin-top: var(--space-2);
  font-style: italic;
}

/* --- Article Content --- */
.article-content {
  font-size: var(--text-lg);
  line-height: var(--lh-relaxed);
  color: var(--text-secondary);
  margin-bottom: var(--space-8);
}

.article-content h2 {
  font-size: var(--text-2xl);
  font-weight: var(--fw-bold);
  color: var(--text);
  margin: var(--space-8) 0 var(--space-4);
  padding-bottom: var(--space-2);
  border-bottom: 2px solid var(--primary-light);
}

.article-content h3 {
  font-size: var(--text-xl);
  font-weight: var(--fw-bold);
  color: var(--text);
  margin: var(--space-6) 0 var(--space-3);
}

.article-content h4 {
  font-size: var(--text-lg);
  font-weight: var(--fw-semibold);
  color: var(--text);
  margin: var(--space-5) 0 var(--space-2);
}

.article-content p {
  margin-bottom: var(--space-4);
}

.article-content ul, .article-content ol {
  margin: var(--space-4) 0;
  padding-left: var(--space-6);
}

.article-content ul { list-style: disc; }
.article-content ol { list-style: decimal; }

.article-content li {
  margin-bottom: var(--space-2);
  line-height: var(--lh-relaxed);
}

.article-content a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--transition-fast);
}

.article-content a:hover {
  color: var(--primary-dark);
}

.article-content blockquote {
  border-left: 4px solid var(--primary);
  padding: var(--space-4) var(--space-5);
  margin: var(--space-6) 0;
  background: var(--primary-light);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--text-secondary);
}

.article-content img {
  border-radius: var(--radius-lg);
  margin: var(--space-6) 0;
  box-shadow: var(--shadow-sm);
}

.article-content table {
  width: 100%;
  font-size: var(--text-sm);
  margin: var(--space-6) 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.article-content th, .article-content td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.article-content th {
  background: var(--surface-2);
  font-weight: var(--fw-semibold);
  color: var(--text);
}

.article-content tr:last-child td {
  border-bottom: none;
}

.article-content strong {
  font-weight: var(--fw-bold);
  color: var(--text);
}

.article-content code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--surface-2);
  padding: 0.1em 0.4em;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

/* --- Quick Info Box --- */
.quick-info-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin: var(--space-6) 0;
  box-shadow: var(--shadow-sm);
}

.quick-info-header {
  background: var(--primary);
  padding: var(--space-3) var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.quick-info-header h3 {
  font-size: var(--text-base);
  font-weight: var(--fw-bold);
  color: #fff;
  margin: 0;
}

.quick-info-table {
  width: 100%;
}

.quick-info-table tr:nth-child(even) td {
  background: var(--surface-2);
}

.quick-info-table th,
.quick-info-table td {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  text-align: left;
}

.quick-info-table th {
  background: var(--surface-3);
  color: var(--text);
  font-weight: var(--fw-bold);
  border-bottom: 2px solid var(--border);
}

.quick-info-table td:first-child {
  font-weight: var(--fw-semibold);
  color: var(--text);
  width: 40%;
  white-space: nowrap;
}

.quick-info-table td:last-child {
  color: var(--text-secondary);
}

.quick-info-table tr:last-child td {
  border-bottom: none;
}

/* --- Important Links Box --- */
.important-links-box {
  background: var(--surface);
  border: 2px solid var(--primary-light);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  margin: var(--space-6) 0;
}

.important-links-title {
  font-size: var(--text-lg);
  font-weight: var(--fw-bold);
  color: var(--text);
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.important-links-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-2);
}

.important-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  text-decoration: none;
  transition: all var(--transition-fast);
  border: 1.5px solid transparent;
}

.important-link-btn--primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.important-link-btn--primary:hover {
  background: var(--primary-dark);
  box-shadow: var(--shadow-primary);
}

.important-link-btn--outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

.important-link-btn--outline:hover {
  background: var(--primary-light);
}

/* --- Source Block --- */
.source-block {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 4px solid var(--success);
  border-radius: var(--radius);
  padding: var(--space-4);
  margin: var(--space-6) 0;
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.source-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  color: var(--success);
  margin-top: 1px;
}

.source-content p {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin: 0;
}

.source-content a {
  color: var(--primary);
  font-weight: var(--fw-medium);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* --- FAQ Section --- */
.faq-list {
  margin: var(--space-6) 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4);
  cursor: pointer;
  font-weight: var(--fw-semibold);
  font-size: var(--text-base);
  color: var(--text);
  transition: background var(--transition-fast);
  gap: var(--space-3);
  list-style: none;
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-question:hover {
  background: var(--surface-2);
}

.faq-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}

details[open] .faq-icon {
  transform: rotate(45deg);
}

.faq-answer {
  padding: 0 var(--space-4) var(--space-4);
  font-size: var(--text-base);
  color: var(--muted);
  line-height: var(--lh-relaxed);
  border-top: 1px solid var(--border);
}

/* --- Article Tags --- */
.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: var(--space-6) 0;
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}

.article-tag-label {
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  color: var(--text);
  margin-right: var(--space-2);
}

/* --- Social Share Block --- */
.article-share {
  background: var(--surface-2);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin: var(--space-6) 0;
  border: 1px solid var(--border);
}

.article-share-title {
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  color: var(--text);
  margin-bottom: var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* --- Related Articles --- */
.related-section {
  margin-top: var(--space-10);
  padding-top: var(--space-8);
  border-top: 2px solid var(--border);
}

.related-title {
  font-size: var(--text-xl);
  font-weight: var(--fw-bold);
  color: var(--text);
  margin-bottom: var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}

/* --- Table of Contents --- */
.toc-widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-5);
}

.toc-title {
  font-size: var(--text-sm);
  font-weight: var(--fw-bold);
  color: var(--text);
  margin-bottom: var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.toc-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.toc-item {
  font-size: var(--text-sm);
  color: var(--muted);
  text-decoration: none;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  border-left: 2px solid transparent;
  line-height: var(--lh-snug);
}

.toc-item:hover, .toc-item.active {
  color: var(--primary);
  background: var(--primary-light);
  border-left-color: var(--primary);
}

.toc-item--h3 {
  padding-left: var(--space-5);
  font-size: var(--text-xs);
}
