/**
 * Article Components - Typography + rich content elements
 * Tuned to cyclingapparelfactory.com brand (navy #0B3D5C / orange #E8541E / amber #ffc107)
 */

/* ========== Headings ========== */
.article-content h2,
.article-content h3,
.article-content h4 {
  color: #16222C;
  font-weight: 700;
  line-height: 1.3;
  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, #0B3D5C);
}

.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: #16222C;
}

.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;
}

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

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

/* ========== 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(11, 61, 92, 0.08);
  border: 1px solid #DDE3E8;
}

.article-content thead th {
  background: var(--brand-color, #0B3D5C);
  color: #fff;
  font-weight: 600;
  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 #DDE3E8;
  font-size: 0.9375rem;
  color: #16222C;
}

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

.article-content tbody tr:hover td {
  background: rgba(11, 61, 92, 0.06);
}

/* ========== Blockquote ========== */
.article-content blockquote {
  margin: 1.75rem 0;
  padding: 1rem 1.5rem;
  border-left: 4px solid var(--brand-color, #0B3D5C);
  background: #F3F5F6;
  color: #54626F;
  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(11, 61, 92, 0.08);
  color: #0B3D5C;
  border-radius: 4px;
}

.article-content pre {
  margin: 1.5rem 0;
  padding: 1.25rem;
  background: #16222C;
  color: #e6e6e6;
  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, #DDE3E8, 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, #0B3D5C 0%, #082C42 100%);
  border-radius: 10px;
  text-align: center;
  color: #fff;
  box-shadow: 0 12px 30px rgba(11, 61, 92, 0.22);
}

.cta-banner h2,
.cta-banner-section h2 {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.3;
  color: #fff;
  margin: 0 0 0.75rem;
  border-bottom: none;
  padding-bottom: 0;
}

.cta-banner p {
  font-size: 1rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.92);
  margin: 0 auto 1.5rem;
  max-width: 620px;
}

.cta-banner .cta-button,
a.cta-button {
  display: inline-block;
  padding: 0.85rem 2rem;
  background: #ffc107;
  color: #16222C;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  border-radius: 6px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

.cta-banner .cta-button:hover,
a.cta-button:hover {
  background: #e6ae06;
  color: #16222C;
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.24);
  text-decoration: none;
}

.cta-banner-title {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.3;
  color: #fff;
  margin: 0 0 0.75rem;
}

.cta-banner-body {
  font-size: 1rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.92);
  margin: 0 auto 1.5rem;
  max-width: 620px;
}

.cta-banner-button {
  display: inline-block;
  padding: 0.85rem 2rem;
  background: #ffc107;
  color: #16222C;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  border-radius: 6px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

.cta-banner-button:hover {
  background: #e6ae06;
  color: #16222C;
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.24);
  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 #DDE3E8;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
}

.faq-item summary {
  font-weight: 700;
  color: #0B3D5C;
  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: #E8541E;
  transition: transform 0.2s ease;
}

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

.faq-answer {
  margin-top: 0.75rem;
  color: #54626F;
}

.faq-answer p {
  margin: 0;
}
