/* ==========================================================================
   Article pages — centralized styles (shared by all /article/*.html)
   Load after style.css: <link rel="stylesheet" href="/assets/article.css">
   ========================================================================== */

html { scroll-behavior: smooth; }

/* Article-specific tokens (don’t override global --visa-*) */
.article-page {
  --article-ink: #0E2A47;
  --article-ink-2: #163a5f;
  --article-line: #E6E9F2;
  --article-soft: #F6F8FC;
  --article-brand: #14205A;
}

/* ----- Hero ----- */
.article-hero {
  position: relative;
  padding: 56px 0 40px;
  background: linear-gradient(135deg, #0E163F 0%, #14205A 50%, #1a2871 100%);
  color: #fff;
}

.article-hero .container {
  position: relative;
  z-index: 1;
}

.article-hero .breadcrumb {
  font-size: 0.875rem;
  opacity: 0.92;
  margin-bottom: 12px;
}

.article-hero .breadcrumb a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  transition: color 0.2s;
}

.article-hero .breadcrumb a:hover {
  color: #fff;
}

.article-hero .breadcrumb span {
  color: rgba(255,255,255,0.7);
}

.article-hero h1 {
  margin: 0 0 14px 0;
  font-size: clamp(1.5rem, 4vw, 2rem);
  line-height: 1.25;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 20px;
  font-size: 0.9rem;
  opacity: 0.95;
}

.article-meta time {
  font-weight: 500;
}

.kw-badge {
  display: inline-block;
  font-size: 0.75rem;
  padding: 5px 12px;
  background: rgba(255,255,255,0.15);
  color: #fff;
  border-radius: 999px;
  font-weight: 600;
}

/* ----- Featured image ----- */
.article-featured-wrap {
  margin: 0 0 32px 0;
}

.featured-image {
  margin: 0;
  border: 1px solid var(--article-line, #E6E9F2);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

.featured-image img {
  width: 100%;
  height: auto;
  display: block;
}

.featured-image figcaption {
  font-size: 0.85rem;
  color: #5E6A85;
  padding: 14px 18px;
  background: var(--article-soft, #F6F8FC);
  border-top: 1px solid var(--article-line, #E6E9F2);
}

/* ----- Article body ----- */
.article-section {
  padding: 48px 0 56px;
}

.article-body {
  max-width: 720px;
  margin: 0 auto;
  font-size: 1.0625rem;
  line-height: 1.7;
}

.article-body h2 {
  margin: 2.2rem 0 0.75rem;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--article-ink, #0E2A47);
  letter-spacing: -0.02em;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--article-line, #E6E9F2);
}

.article-body h3 {
  margin: 1.75rem 0 0.5rem;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--article-ink-2, #163a5f);
}

.article-body p {
  margin: 0.85rem 0;
  color: #374151;
}

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

.article-body li {
  margin: 0.35rem 0;
}

.article-body a {
  color: var(--article-brand, #14205A);
  font-weight: 600;
  text-decoration: none;
}

.article-body a:hover {
  text-decoration: underline;
}

.content-body {
  margin: 0;
}

/* Callout / tip box */
.callout-tip {
  border-left: 4px solid var(--article-brand, #14205A);
  background: #EFF6FF;
  padding: 16px 20px;
  border-radius: 10px;
  margin: 1.25rem 0;
  font-size: 0.95rem;
  color: #1E40AF;
}

.callout-tip strong {
  color: #1E3A8A;
}

.callout-warning {
  border-left: 4px solid #d9534f;
  background: #fff5f5;
  padding: 16px 20px;
  border-radius: 10px;
  margin: 1.25rem 0;
  font-size: 0.95rem;
  color: #721c24;
}

.callout-warning strong {
  color: #721c24;
}

/* ----- TOC ----- */
.toc-card {
  border: 1px solid var(--article-line, #E6E9F2);
  border-radius: 14px;
  background: #fff;
  padding: 20px 22px;
  margin: 0 0 32px 0;
  box-shadow: 0 4px 16px rgba(0,0,0,0.04);
}

.toc-card .toc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.toc-card h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--article-ink, #0E2A47);
}

.toc-toggle {
  display: none;
  border: 1px solid var(--article-line, #E6E9F2);
  background: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  color: #4B5563;
}

.toc-list {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: toc;
}

.toc-list li {
  margin: 6px 0;
}

.toc-list a {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--article-ink, #0E2A47);
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: background 0.2s, border-color 0.2s;
}

.toc-list a::before {
  counter-increment: toc;
  content: counter(toc);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #EFF6FF;
  color: var(--article-brand, #14205A);
  font-weight: 700;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.toc-list a:hover {
  background: #F8FAFC;
  border-color: #E2E8F0;
}

.toc-list a.is-active {
  background: #EEF2FF;
  border-color: #C7D2FE;
  color: var(--article-brand, #14205A);
}

/* Anchor offset for fixed header */
.article-body h2[id],
.article-body h3[id],
#what-you-need, #steps, #faq, #summary {
  scroll-margin-top: 100px;
}

/* ----- Related ----- */
.related {
  padding: 48px 0 64px;
  background: var(--article-soft, #F6F8FC);
  border-top: 1px solid var(--article-line, #E6E9F2);
}

.related .container {
  max-width: 1100px;
  margin: 0 auto;
  width: min(92%, 1100px);
}

.related-title,
.related h2.section-header {
  margin: 0 0 24px 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--article-ink, #0E2A47);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.related-grid a {
  display: block;
  border: 1px solid var(--article-line, #E6E9F2);
  background: #fff;
  padding: 20px 22px;
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
}

.related-grid a:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  transform: translateY(-2px);
  border-color: #C7D2FE;
}

.related-grid a h3 {
  margin: 0 0 8px 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--article-ink, #0E2A47);
  line-height: 1.35;
}

.related-grid a p {
  margin: 0;
  font-size: 0.9rem;
  color: #6B7280;
  line-height: 1.5;
}

/* ----- Mobile ----- */
@media (max-width: 768px) {
  .article-hero {
    padding: 40px 0 32px;
  }

  .article-hero h1 {
    font-size: 1.5rem;
  }

  .article-meta {
    font-size: 0.85rem;
    gap: 10px 16px;
  }

  .article-section {
    padding: 36px 0 44px;
  }

  .article-body {
    font-size: 1rem;
  }

  .article-body h2 {
    font-size: 1.2rem;
    margin-top: 1.75rem;
  }

  .article-body h3 {
    font-size: 1.05rem;
  }

  .toc-toggle {
    display: inline-block;
  }

  .toc-list[data-collapsed="true"] {
    display: none;
  }

  .related {
    padding: 36px 0 48px;
  }

  .related-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .article-hero h1 {
    font-size: 1.35rem;
  }

  .article-meta {
    gap: 8px 12px;
  }

  .toc-card {
    padding: 16px 18px;
  }

  .toc-card h3 {
    font-size: 0.95rem;
  }
}
