/* =============================================================
   assets/css/article.css
   AdNeutral — Article Page Styles
   Load order: variables.css → reset.css → components.css
               → layout.css → animations.css → article.css
   Only loaded on article pages via <link> in article templates.
   ============================================================= */


/* ─────────────────────────────────────────────────────────────
   ARTICLE COVER IMAGE
   ───────────────────────────────────────────────────────────── */

.article-cover-wrap {
  position: relative;
  margin-bottom: var(--space-6);
}

.article-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius-xl);
  background: var(--bg-tertiary);
  display: block;
}

.article-cover-caption {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-align: center;
  margin-top: var(--space-2);
  font-style: italic;
  line-height: 1.5;
}


/* ─────────────────────────────────────────────────────────────
   ARTICLE BODY — HEADING ANCHORS
   A link icon appears on hover beside each heading.
   The <a class="heading-anchor"> is injected by article.js.
   ───────────────────────────────────────────────────────────── */

.article-body h2,
.article-body h3,
.article-body h4 {
  position: relative;
}

.heading-anchor {
  position: absolute;
  left: calc(-1 * var(--space-4));
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  opacity: 0;
  text-decoration: none;
  transition: opacity var(--transition-fast), color var(--transition-fast);
  border-radius: var(--radius-sm);
}

.article-body h2:hover .heading-anchor,
.article-body h3:hover .heading-anchor,
.article-body h4:hover .heading-anchor,
.heading-anchor:focus {
  opacity: 1;
  color: var(--accent);
}

.heading-anchor:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* On mobile, always show anchor icons (no hover) */
@media (max-width: 767px) {
  .heading-anchor { display: none; }
}


/* ─────────────────────────────────────────────────────────────
   ARTICLE BODY — CODE BLOCKS
   Enhanced pre/code styling with optional copy button and
   language label. The wrapper div is injected by article.js.
   ───────────────────────────────────────────────────────────── */

.code-block-wrap {
  position: relative;
  margin: var(--space-5) 0;
}

.code-block-wrap pre {
  margin: 0;
  border-radius: var(--radius-lg);
}

/* Language label */
.code-lang-label {
  position: absolute;
  top: 0;
  left: 0;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-bottom: none;
  border-right: none;
  padding: 3px 10px;
  border-radius: var(--radius-lg) 0 var(--radius-md) 0;
  pointer-events: none;
  user-select: none;
  line-height: 1.5;
}

/* Copy button */
.code-copy-btn {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  height: 28px;
  padding: 0 var(--space-2);
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  opacity: 0;
  transition: opacity var(--transition-fast), color var(--transition-fast),
              background var(--transition-fast);
}

.code-block-wrap:hover .code-copy-btn,
.code-copy-btn:focus {
  opacity: 1;
}

.code-copy-btn:hover {
  color: var(--accent);
  background: var(--accent-glow);
  border-color: var(--border-accent);
}

.code-copy-btn.copied {
  color: var(--success);
  border-color: var(--success);
  background: var(--success-bg);
  opacity: 1;
}

/* Inline code — slightly larger tap target on mobile */
.article-body code {
  font-size: 0.875em;
  padding: 0.15em 0.45em;
}


/* ─────────────────────────────────────────────────────────────
   ARTICLE BODY — CALLOUT / NOTE BOXES
   Used for tips, warnings, important notes, info blocks.
   Author writes:  <div class="callout callout--tip"> ... </div>
   ───────────────────────────────────────────────────────────── */

.callout {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  border: 1px solid;
  margin: var(--space-5) 0;
  font-size: var(--text-base);
  line-height: var(--leading-loose);
}

.callout-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 2px;
}

.callout-body {
  flex: 1;
  min-width: 0;
}

.callout-title {
  font-weight: var(--weight-semibold);
  margin-bottom: 4px;
  font-size: var(--text-sm);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  font-family: var(--font-mono);
}

.callout-body p {
  color: var(--text-primary);
  max-width: none;
  margin: 0;
  font-size: var(--text-base);
}

/* Variants */
.callout--tip {
  background: var(--success-bg);
  border-color: var(--success);
}
.callout--tip .callout-icon,
.callout--tip .callout-title { color: var(--success); }

.callout--warning {
  background: var(--warning-bg);
  border-color: var(--warning);
}
.callout--warning .callout-icon,
.callout--warning .callout-title { color: var(--warning); }

.callout--info {
  background: var(--info-bg);
  border-color: var(--info);
}
.callout--info .callout-icon,
.callout--info .callout-title { color: var(--info); }

.callout--danger {
  background: var(--error-bg);
  border-color: var(--error);
}
.callout--danger .callout-icon,
.callout--danger .callout-title { color: var(--error); }

.callout--neutral {
  background: var(--bg-tertiary);
  border-color: var(--border);
}
.callout--neutral .callout-icon,
.callout--neutral .callout-title { color: var(--text-secondary); }


/* ─────────────────────────────────────────────────────────────
   ARTICLE BODY — KEY TAKEAWAYS BOX
   A structured summary box placed near the top of longer articles.
   ───────────────────────────────────────────────────────────── */

.key-takeaways {
  background: var(--bg-secondary);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-xl);
  padding: var(--space-4) var(--space-5);
  margin: var(--space-5) 0;
}

.key-takeaways-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.key-takeaways-title {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--accent);
}

.key-takeaways-icon {
  color: var(--accent);
  width: 16px;
  height: 16px;
}

.key-takeaways ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: 0;
  margin: 0;
}

.key-takeaways li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  font-size: var(--text-base);
  color: var(--text-primary);
  line-height: var(--leading-loose);
}

.key-takeaways li::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--accent);
  flex-shrink: 0;
  margin-top: 8px;
}


/* ─────────────────────────────────────────────────────────────
   ARTICLE BODY — IMAGES
   Full-width images with optional caption support.
   Article.js wraps standalone <img> tags in <figure>.
   ───────────────────────────────────────────────────────────── */

.article-body figure {
  margin: var(--space-6) 0;
}

.article-body figure img {
  width: 100%;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  margin: 0;
}

.article-body figcaption {
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-align: center;
  margin-top: var(--space-2);
  line-height: 1.5;
  font-style: italic;
}

/* Inline images (float, used inside paragraphs) */
.article-body .img-float-right {
  float: right;
  margin: 0 0 var(--space-3) var(--space-4);
  max-width: 300px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.article-body .img-float-left {
  float: left;
  margin: 0 var(--space-4) var(--space-3) 0;
  max-width: 300px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.article-body .clearfix::after {
  content: '';
  display: table;
  clear: both;
}

@media (max-width: 767px) {
  .article-body .img-float-right,
  .article-body .img-float-left {
    float: none;
    max-width: 100%;
    margin: 0 0 var(--space-3) 0;
  }
}


/* ─────────────────────────────────────────────────────────────
   ARTICLE BODY — ENHANCED BLOCKQUOTES
   Pull-quotes or attributed quotes in article content.
   ───────────────────────────────────────────────────────────── */

.article-body blockquote {
  position: relative;
  border-left: 3px solid var(--accent);
  background: linear-gradient(90deg, var(--accent-glow) 0%, transparent 100%);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  padding: var(--space-4) var(--space-5);
  margin: var(--space-6) 0;
}

.article-body blockquote::before {
  content: '\201C'; /* left double quotation mark */
  position: absolute;
  top: -8px;
  left: var(--space-4);
  font-family: var(--font-display);
  font-size: 4rem;
  color: var(--accent);
  opacity: 0.3;
  line-height: 1;
  pointer-events: none;
}

.article-body blockquote p {
  font-size: var(--text-lg);
  font-style: italic;
  color: var(--text-primary);
  line-height: var(--leading-prose);
  margin: 0 0 var(--space-2);
  max-width: none;
}

.article-body blockquote cite {
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-style: normal;
  display: flex;
  align-items: center;
  gap: 6px;
}

.article-body blockquote cite::before {
  content: '—';
  color: var(--accent);
}


/* ─────────────────────────────────────────────────────────────
   ARTICLE BODY — TABLES
   Styled for article content, responsive via scroll wrapper.
   ───────────────────────────────────────────────────────────── */

.article-body .table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: var(--space-5) 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.article-body table {
  width: 100%;
  font-size: var(--text-sm);
  margin: 0;
}

.article-body thead {
  background: var(--bg-tertiary);
}

.article-body th {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--text-muted);
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
  font-weight: var(--weight-medium);
}

.article-body td {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  vertical-align: top;
  line-height: var(--leading-loose);
}

.article-body tr:last-child td {
  border-bottom: none;
}

.article-body tbody tr:hover td {
  background: var(--bg-hover);
}


/* ─────────────────────────────────────────────────────────────
   ARTICLE BODY — FAQ SECTION
   Structured Q&A section with schema-ready markup.
   Uses native <details>/<summary> for keyboard accessibility.
   ───────────────────────────────────────────────────────────── */

.faq-section {
  margin: var(--space-8) 0;
}

.faq-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-5);
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.faq-item {
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--transition-fast);
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-item[open] {
  background: var(--accent-glow);
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4);
  cursor: pointer;
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  user-select: none;
  list-style: none;
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-question-text {
  flex: 1;
}

.faq-chevron {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform var(--transition-base), color var(--transition-fast);
}

.faq-item[open] .faq-chevron {
  transform: rotate(180deg);
  color: var(--accent);
}

.faq-answer {
  padding: 0 var(--space-4) var(--space-4);
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: var(--leading-loose);
}

.faq-answer p {
  max-width: none;
  margin: 0 0 var(--space-2);
}

.faq-answer p:last-child {
  margin-bottom: 0;
}


/* ─────────────────────────────────────────────────────────────
   ARTICLE BODY — COMPARISON SNIPPET
   Inline mini-comparison used mid-article.
   ───────────────────────────────────────────────────────────── */

.article-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  margin: var(--space-5) 0;
}

.article-comparison-col {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
}

.article-comparison-col--yes {
  border-color: var(--border-accent);
  background: var(--accent-glow);
}

.article-comparison-col--no {
  border-color: var(--error);
  background: var(--error-bg);
  opacity: 0.8;
}

.article-comparison-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  margin-bottom: var(--space-2);
}

.article-comparison-col--yes .article-comparison-label { color: var(--accent); }
.article-comparison-col--no  .article-comparison-label { color: var(--error);  }

.article-comparison ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.article-comparison li {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  display: flex;
  align-items: flex-start;
  gap: 6px;
  line-height: 1.5;
}

.article-comparison-col--yes li::before {
  content: '✓';
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
}

.article-comparison-col--no li::before {
  content: '✕';
  color: var(--error);
  font-weight: 700;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .article-comparison {
    grid-template-columns: 1fr;
  }
}


/* ─────────────────────────────────────────────────────────────
   ARTICLE BODY — NUMBERED STEPS
   Styled step-by-step instructions within article body.
   ───────────────────────────────────────────────────────────── */

.article-steps {
  list-style: none;
  counter-reset: step-counter;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin: var(--space-5) 0;
  padding: 0;
}

.article-step {
  counter-increment: step-counter;
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
}

.article-step::before {
  content: counter(step-counter);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: var(--radius-full);
  background: var(--accent-glow);
  border: 1px solid var(--border-accent);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--accent);
  line-height: 1;
  margin-top: 2px;
}

.article-step-content {
  flex: 1;
}

.article-step-title {
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin-bottom: 4px;
  font-size: var(--text-base);
}

.article-step-body {
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: var(--leading-loose);
}

.article-step-body p {
  max-width: none;
  margin: 0 0 var(--space-2);
}


/* ─────────────────────────────────────────────────────────────
   ARTICLE FOOTER — TAGS, AUTHOR BIO, SHARE
   ───────────────────────────────────────────────────────────── */

.article-footer {
  margin-top: var(--space-10);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border-subtle);
}

/* Tags row */
.article-tags {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-6);
}

.article-tags-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Article share bar */
.article-share-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}

.article-share-prompt {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}

.article-share-prompt span {
  display: block;
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: var(--weight-regular);
  margin-top: 2px;
}

/* Author bio card */
.author-bio {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-5);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  margin-bottom: var(--space-6);
}

.author-bio-avatar {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  border: 2px solid var(--border-accent);
  flex-shrink: 0;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--accent);
  overflow: hidden;
}

.author-bio-body {
  flex: 1;
  min-width: 0;
}

.author-bio-name {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin-bottom: 4px;
}

.author-bio-role {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-2);
}

.author-bio-description {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-loose);
  margin: 0;
  max-width: none;
}

@media (max-width: 640px) {
  .author-bio {
    flex-direction: column;
    align-items: flex-start;
  }
}


/* ─────────────────────────────────────────────────────────────
   ARTICLE — NEWSLETTER CTA (mid-article, between sections)
   ───────────────────────────────────────────────────────────── */

.article-newsletter-cta {
  background: linear-gradient(
    135deg,
    var(--bg-secondary) 0%,
    color-mix(in srgb, var(--color-accent) 4%, transparent) 100%
  );
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  margin: var(--space-8) 0;
  text-align: center;
}

.article-newsletter-cta-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.article-newsletter-cta-subtitle {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
  line-height: 1.6;
  max-width: none;
}

.article-newsletter-form {
  display: flex;
  gap: var(--space-2);
  max-width: 440px;
  margin: 0 auto;
}

.article-newsletter-form .input {
  flex: 1;
  height: 44px;
  font-size: var(--text-sm);
}

@media (max-width: 640px) {
  .article-newsletter-form {
    flex-direction: column;
  }

  .article-newsletter-form .btn-primary {
    width: 100%;
  }
}

.article-newsletter-legal {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-2);
  line-height: 1.4;
}


/* ─────────────────────────────────────────────────────────────
   ARTICLE — INSTALL CTA BLOCK (mid-article)
   A contextual nudge to install AdNeutral, placed after the
   first major section of an article about AI ad frustrations.
   ───────────────────────────────────────────────────────────── */

.article-install-cta {
  background: var(--bg-secondary);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-xl);
  padding: var(--space-5) var(--space-6);
  margin: var(--space-8) 0;
  display: flex;
  align-items: center;
  gap: var(--space-5);
  box-shadow: var(--shadow-glow);
}

.article-install-cta-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-lg);
  background: var(--accent-glow);
  border: 1px solid var(--border-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}

.article-install-cta-body {
  flex: 1;
}

.article-install-cta-title {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin-bottom: 4px;
}

.article-install-cta-subtitle {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
  max-width: none;
}

.article-install-cta-btn {
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .article-install-cta {
    flex-direction: column;
    text-align: center;
    padding: var(--space-4);
  }

  .article-install-cta-btn {
    width: 100%;
  }
}


/* ─────────────────────────────────────────────────────────────
   ARTICLE — PREV / NEXT NAVIGATION
   Links to the previous and next article in the series.
   ───────────────────────────────────────────────────────────── */

.article-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin: var(--space-8) 0;
}

.article-nav-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--space-4);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: border-color var(--transition-base), box-shadow var(--transition-base),
              transform var(--transition-base);
}

.article-nav-link:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

.article-nav-link--next {
  text-align: right;
}

.article-nav-direction {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

.article-nav-link--next .article-nav-direction {
  justify-content: flex-end;
}

.article-nav-title {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 640px) {
  .article-nav {
    grid-template-columns: 1fr;
  }

  .article-nav-link--next .article-nav-direction {
    justify-content: flex-start;
  }

  .article-nav-link--next {
    text-align: left;
  }
}


/* ─────────────────────────────────────────────────────────────
   ARTICLE — RELATED ARTICLES SECTION
   Three-card grid below article footer. Inherits from
   .related-articles in layout.css; this file adds card details.
   ───────────────────────────────────────────────────────────── */

.related-section-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-5);
}


/* ─────────────────────────────────────────────────────────────
   ARTICLE — READING PROGRESS BAR
   3px teal bar fixed at top of viewport. Width is set by
   article.js on scroll events. Position and color defined in
   components.css; this file only adds the start-of-page state.
   ───────────────────────────────────────────────────────────── */

#progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: var(--progress-height);
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-hover) 100%);
  z-index: calc(var(--z-sticky) + 1);
  box-shadow: 0 0 10px color-mix(in srgb, var(--color-accent) 50%, transparent);
  transition: width 0.1s linear;
  border-radius: 0 var(--radius-full) var(--radius-full) 0;
}


/* ─────────────────────────────────────────────────────────────
   ARTICLE — SYNTAX HIGHLIGHT TOKENS
   Minimal token colours compatible with Prism.js or manual
   class application. Designed for the dark theme.
   ───────────────────────────────────────────────────────────── */

.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
  color: var(--text-muted);
  font-style: italic;
}

.token.punctuation          { color: var(--text-secondary); }
.token.property,
.token.tag,
.token.constant,
.token.symbol,
.token.deleted              { color: #FF6B6B; }
.token.boolean,
.token.number               { color: #F4A261; }
.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted             { color: var(--success); }
.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string        { color: var(--accent); }
.token.atrule,
.token.attr-value,
.token.keyword              { color: #A78BFA; }
.token.function,
.token.class-name           { color: #60A5FA; }
.token.regex,
.token.important,
.token.variable             { color: var(--warning); }

/* Light mode token adjustments */
[data-theme="light"] .token.comment   { color: #6B7280; }
[data-theme="light"] .token.keyword   { color: #7C3AED; }
[data-theme="light"] .token.function  { color: #2563EB; }
[data-theme="light"] .token.string    { color: #059669; }
[data-theme="light"] .token.number    { color: #D97706; }


/* ─────────────────────────────────────────────────────────────
   ARTICLE — INLINE STAT HIGHLIGHT
   Pull a key statistic out of body text as a display number.
   ───────────────────────────────────────────────────────────── */

.article-stat-pull {
  text-align: center;
  margin: var(--space-8) 0;
  padding: var(--space-6);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-xl);
  background: var(--accent-glow);
}

.article-stat-number {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: var(--weight-bold);
  color: var(--accent);
  letter-spacing: var(--tracking-tight);
  line-height: 1;
  display: block;
  margin-bottom: var(--space-2);
}

.article-stat-label {
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: none;
  margin: 0;
}

.article-stat-source {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-2);
  display: block;
}


/* ─────────────────────────────────────────────────────────────
   ARTICLE — AFFILIATE / DISCLOSURE NOTICE
   Required legal disclosure above sponsored/affiliated content.
   ───────────────────────────────────────────────────────────── */

.article-disclosure {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: var(--space-5);
}


/* ─────────────────────────────────────────────────────────────
   ARTICLE — TABLE OF CONTENTS (sidebar, sticky)
   Extended styles on top of the .toc component in components.css
   ───────────────────────────────────────────────────────────── */

/* Progress indicator on active TOC link */
.toc-link.active {
  position: relative;
}

.toc-link.active::before {
  content: '';
  position: absolute;
  left: -1px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--accent);
  border-radius: var(--radius-full);
}


/* ─────────────────────────────────────────────────────────────
   ARTICLE — AD SLOT LABELS
   Override the global .ad-label size within article context
   to match AdSense "ADVERTISEMENT" labelling requirements.
   ───────────────────────────────────────────────────────────── */

.article-body .ad-slot {
  margin: var(--space-6) 0;
  clear: both; /* clear any floating images */
}

.article-body .ad-label {
  font-family: var(--font-mono);
  font-size: var(--ad-label-size);
  font-weight: var(--weight-medium);
  letter-spacing: var(--ad-label-tracking);
  text-transform: uppercase;
  color: var(--ad-label-color);
  text-align: center;
  display: block;
  margin-bottom: 6px;
}


/* ─────────────────────────────────────────────────────────────
   RESPONSIVE ADJUSTMENTS — ARTICLE
   ───────────────────────────────────────────────────────────── */

@media (max-width: 1023px) {
  .article-share-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
  }
}

@media (max-width: 767px) {
  .article-body h2 { font-size: var(--text-xl);  }
  .article-body h3 { font-size: var(--text-lg);  }
  .article-body h4 { font-size: var(--text-base); }

  .article-body blockquote p {
    font-size: var(--text-base);
  }

  .article-body pre {
    font-size: 12px;
  }

  .faq-question {
    padding: var(--space-3);
    font-size: var(--text-sm);
  }

  .faq-answer {
    padding: 0 var(--space-3) var(--space-3);
  }

  .key-takeaways {
    padding: var(--space-3);
  }
}


/* ─────────────────────────────────────────────────────────────
   ARTICLE — PRINT OVERRIDES
   Supplement the global print rules in reset.css with
   article-specific print layout.
   ───────────────────────────────────────────────────────────── */

@media print {
  #progress-bar,
  .article-sidebar,
  .article-share-bar,
  .article-install-cta,
  .article-newsletter-cta,
  .article-nav,
  .related-articles,
  .toc,
  .code-copy-btn,
  .code-lang-label,
  .heading-anchor {
    display: none !important;
  }

  .article-layout {
    display: block;
  }

  .article-main {
    max-width: 100%;
  }

  .article-body {
    font-size: 11pt;
    color: #000;
    max-width: 100%;
  }

  .article-body h2,
  .article-body h3 {
    color: #000;
    page-break-after: avoid;
  }

  .callout,
  .key-takeaways,
  .faq-list {
    border: 1px solid #ccc;
    background: #f9f9f9 !important;
    box-shadow: none;
  }

  .callout-body p,
  .faq-answer p {
    color: #333;
  }
}
