/**
 * article-components.css — typography + rich content elements for SmartMowBot articles
 *
 * Tokens (from index.html <style id="smb-home"> / assets/css/global.css):
 *   #16A34A turf · #15803D deep green · #1F2937 ground/ink · #111827 · #374151
 *   #FACC15 CTA yellow · #EAB308 hover · #E2E5DE line · #F5F7F4 wash · #6B7280 muted
 *   Archivo (headings) + Inter (body)
 *
 * Contrast note: #FACC15 is used only as a filled button background with #1F2937 text
 * on it (12.2:1), never as text on white.
 */

/* ========== Headings ========== */
.article-content h2,
.article-content h3,
.article-content h4 {
  font-family: 'Archivo', 'Inter', system-ui, sans-serif;
  color: #1F2937;
  font-weight: 800;
  line-height: 1.28;
  letter-spacing: -0.012em;
  scroll-margin-top: 110px;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

.article-content h2 {
  font-size: 1.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--brand-color, #16A34A);
}

.article-content h3 {
  font-size: 1.375rem;
}

.article-content h4 {
  font-size: 1.125rem;
}

/* ========== Paragraphs and lists ========== */
.article-content p {
  margin: 0 0 1.25rem;
  color: #374151;
}

.article-content ul,
.article-content ol {
  margin: 0 0 1.5rem;
  padding-left: 1.5rem;
}

.article-content li {
  margin-bottom: 0.5rem;
  line-height: 1.7;
  color: #374151;
}

.article-content li + li {
  margin-top: 0.25rem;
}

.article-content ul li::marker {
  color: var(--brand-color, #16A34A);
}

/* ========== Tables ========== */
.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.75rem 0;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(31, 41, 55, 0.08);
  border: 1px solid #E2E5DE;
}

.article-content thead th {
  background: #1F2937;
  color: #fff;
  font-family: 'Archivo', 'Inter', system-ui, sans-serif;
  font-weight: 700;
  text-align: left;
  padding: 0.875rem 1rem;
  font-size: 0.9375rem;
  letter-spacing: 0.02em;
}

.article-content tbody td {
  padding: 0.75rem 1rem;
  border-top: 1px solid #E2E5DE;
  font-size: 0.9375rem;
  color: #374151;
  font-variant-numeric: tabular-nums;
}

.article-content tbody tr:nth-child(even) td {
  background: #FAFBF9;
}

.article-content tbody tr:hover td {
  background: rgba(22, 163, 74, 0.07);
}

/* ========== Blockquote ========== */
.article-content blockquote {
  margin: 1.75rem 0;
  padding: 1rem 1.5rem;
  border-left: 4px solid var(--brand-color, #16A34A);
  background: #F5F7F4;
  color: #4B5563;
  font-style: italic;
  border-radius: 0 10px 10px 0;
}

.article-content blockquote p:last-child {
  margin-bottom: 0;
}

/* ========== Inline code + code blocks ========== */
.article-content code {
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.9em;
  padding: 0.15em 0.4em;
  background: rgba(22, 163, 74, 0.10);
  color: #15803D;
  border-radius: 4px;
}

.article-content pre {
  margin: 1.5rem 0;
  padding: 1.25rem;
  background: #1F2937;
  color: #E5E7EB;
  border-radius: 10px;
  overflow-x: auto;
  font-size: 0.9375rem;
  line-height: 1.6;
}

.article-content pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  border-radius: 0;
}

/* ========== Horizontal rule ========== */
.article-content hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, #E2E5DE, transparent);
  margin: 2.5rem 0;
}

/* ========== CTA banner ==========
   render_article.py's _render_cta_banner() emits bare <h2>/<p>/<a class="cta-button">
   inside .cta-banner (no -title/-body/-banner-button suffixes) — style those directly
   so they don't fall through to .article-content h2/p's dark-on-light defaults. */
.cta-banner {
  margin: 2.5rem 0;
  padding: 2.25rem 1.75rem;
  background: linear-gradient(135deg, #1F2937 0%, #111827 100%);
  border-radius: 10px;
  text-align: center;
  color: #fff;
  box-shadow: 0 12px 30px rgba(31, 41, 55, 0.22);
}

.cta-banner h2,
.cta-banner-section h2 {
  font-family: 'Archivo', 'Inter', system-ui, sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.3;
  color: #F9FAFB;
  margin: 0 0 0.75rem;
  border-bottom: none;
  padding-bottom: 0;
}

.cta-banner p {
  font-size: 1rem;
  line-height: 1.65;
  color: #E5E7EB;
  margin: 0 auto 1.5rem;
  max-width: 620px;
}

.cta-banner .cta-button,
a.cta-button {
  display: inline-block;
  padding: 0.85rem 2rem;
  background: #FACC15;
  color: #1F2937;
  font-family: 'Archivo', 'Inter', system-ui, sans-serif;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  border-radius: 8px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
  box-shadow: 0 8px 20px rgba(250, 204, 21, 0.28);
}

.cta-banner .cta-button:hover,
a.cta-button:hover {
  background: #EAB308;
  color: #1F2937;
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(250, 204, 21, 0.34);
  text-decoration: none;
}

.cta-banner-title {
  font-family: 'Archivo', 'Inter', system-ui, sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.3;
  color: #F9FAFB;
  margin: 0 0 0.75rem;
}

.cta-banner-body {
  font-size: 1rem;
  line-height: 1.65;
  color: #E5E7EB;
  margin: 0 auto 1.5rem;
  max-width: 620px;
}

.cta-banner-button {
  display: inline-block;
  padding: 0.85rem 2rem;
  background: #FACC15;
  color: #1F2937;
  font-family: 'Archivo', 'Inter', system-ui, sans-serif;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  border-radius: 8px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
  box-shadow: 0 8px 20px rgba(250, 204, 21, 0.28);
}

.cta-banner-button:hover {
  background: #EAB308;
  color: #1F2937;
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(250, 204, 21, 0.34);
  text-decoration: none;
}

/* ========== Responsive ========== */
@media (max-width: 767.98px) {
  .article-content h2 { font-size: 1.5rem; }
  .article-content h3 { font-size: 1.2rem; }
  .article-content h4 { font-size: 1.05rem; }

  .article-content table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .cta-banner {
    padding: 1.75rem 1.25rem;
  }
  .cta-banner-title {
    font-size: 1.25rem;
  }
}

/* ========== FAQ (render_article.py's _render_faq() literal markup) ==========
   <section class="faq-section"><h2>FAQ</h2><div class="faq-list">
     <details class="faq-item"><summary>{q}</summary>
       <div class="faq-answer"><p>{a}</p></div></details>
   </div></section> */
.faq-section {
  margin: 2.5rem 0;
}

.faq-section > h2 {
  border-bottom: none;
  padding-bottom: 0;
}

.faq-item {
  background: #fff;
  border: 1px solid #E2E5DE;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
}

.faq-item summary {
  font-family: 'Archivo', 'Inter', system-ui, sans-serif;
  font-weight: 700;
  color: #1F2937;
  cursor: pointer;
  list-style: none;
}

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

.faq-item summary::after {
  content: '\f282';
  font-family: 'bootstrap-icons';
  float: right;
  color: #16A34A;
  transition: transform 0.2s ease;
}

.faq-item[open] summary::after {
  transform: rotate(180deg);
}

.faq-answer {
  margin-top: 0.75rem;
  color: #4B5563;
}

.faq-answer p {
  margin: 0;
}
