/* PHASE:5A:START — articles.css — Article listing and article page styles */
/* =================================================================
   FILE: /src/css/articles.css
   Injected by build.js for every PAGE_TYPE: article.
   Mirrors tools.css structure exactly — same padding scale, same
   max-width child-constraint pattern, same breakpoints.

   Mobile-first. Base = 375px.
   Breakpoints: 600px (tablet), 768px (small desktop), 1140px (wide)
   ================================================================= */


/* ─── OUTER PAGE WRAPPER — mirrors .tool-page exactly ──────────────────── */
/*
   .tool-page uses:
     padding: 0 16px  (mobile)
     padding: 0 24px  (600px+)
     padding: 0 40px  (1140px+)
   Children constrained to max-width: 1100px via .tool-page > *
   We do the same here.
*/

.article-page {
  padding: 0 16px;
  box-sizing: border-box;
}

/* Constrain all direct children to same max-width as tool pages */
.article-page > * {
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

/* Article body (individual article pages) — narrower reading width */
.article-page > article.article-body {
  max-width: 740px;
}

@media (min-width: 600px) {
  .article-page { padding: 0 24px; }
}

@media (min-width: 1140px) {
  .article-page { padding: 0 40px; }
}


/* ─── LISTING PAGE HEADER ───────────────────────────────────────────────── */

.articles-page-header {
  padding: 24px 0 16px;   /* matches .tool-hero padding */
  margin-bottom: 0;
}

.articles-page-header h1 {
  font-size: 1.5rem;       /* matches tool-hero h1 mobile */
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 8px;
  line-height: 1.25;
}

.articles-intro {
  font-size: 1rem;
  color: var(--color-text-light);
  line-height: 1.6;
  margin: 0 0 20px;
}

@media (min-width: 600px) {
  .articles-page-header h1 { font-size: 1.75rem; }
}

@media (min-width: 768px) {
  .articles-page-header { padding: 32px 0 20px; } /* matches .tool-hero desktop */
  .articles-page-header h1 { font-size: 2rem; }
}


/* ─── FILTER BUTTONS ────────────────────────────────────────────────────── */

.articles-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.filter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 16px;
  border: 2px solid var(--color-primary);
  border-radius: 999px;
  background: transparent;
  color: var(--color-primary);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  min-height: 44px;
  line-height: 1;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--color-primary);
  color: #fff;
}


/* ─── ARTICLE LISTING GRID ──────────────────────────────────────────────── */

.articles-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 32px;
}

@media (min-width: 600px) {
  .articles-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .articles-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Article card — matches .tool-card feel from global.css */
.article-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 20px 16px;
  background: var(--color-bg);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.article-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.article-card[style*="display:none"] {
  display: none !important;
}

.article-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.article-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
  line-height: 1.3;
  flex: 1;
}

.article-card p {
  font-size: 0.9rem;
  color: var(--color-text-light);
  line-height: 1.5;
  margin: 0;
  flex: 1;
}

.article-card-footer {
  margin-top: auto;
  padding-top: 8px;
}

.article-card-link {
  color: var(--color-primary);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
}

.article-card-link:hover {
  text-decoration: underline;
}

/* Empty state */
.articles-empty {
  text-align: center;
  padding: 48px 16px;
  color: var(--color-text-light);
  font-size: 1rem;
}


/* ─── TYPE BADGES ───────────────────────────────────────────────────────── */

.article-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  flex-shrink: 0;
}

.badge-chart      { background: #dbeafe; color: #1d4ed8; }
.badge-how-to     { background: #dcfce7; color: #15803d; }
.badge-guide      { background: #ede9fe; color: #7c3aed; }
.badge-comparison { background: #ffedd5; color: #c2410c; }
.badge-standard   { background: #f3f4f6; color: #374151; }
.badge-brand      { background: #fce7f3; color: #9d174d; }


/* ─── ARTICLE PAGE — HEADER ─────────────────────────────────────────────── */
/* Individual article pages: <main class="article-page"><article class="article-body"> */

.article-body {
  padding-top: 0;
}

.article-body > header {
  padding: 24px 0 0;      /* matches .tool-hero top padding */
}

.article-body h1 {
  font-size: 1.5rem;      /* matches .tool-hero h1 — mobile */
  font-weight: 700;
  line-height: 1.25;
  color: var(--color-text);
  margin: 0 0 12px;
}

@media (min-width: 600px) {
  .article-body h1 { font-size: 1.75rem; }
}

@media (min-width: 768px) {
  .article-body > header { padding: 32px 0 0; }  /* matches .tool-hero desktop */
  .article-body h1 { font-size: 2rem; }
}


/* ─── ARTICLE META (badge + date line) ─────────────────────────────────── */

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
  font-size: 0.85rem;
  color: var(--color-text-light);
}


/* ─── ANSWER PARAGRAPH (AEO critical) ──────────────────────────────────── */

.answer-paragraph {
  font-size: 1rem;
  line-height: 1.7;
  background: #fff7f2;
  border-left: 4px solid var(--color-primary);
  padding: 14px 16px;
  border-radius: 0 6px 6px 0;
  margin-bottom: 20px;
  color: var(--color-text);
}


/* ─── ARTICLE BODY TYPOGRAPHY ───────────────────────────────────────────── */

.article-body h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
  margin-top: 32px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--color-border);
  line-height: 1.3;
}

.article-body h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  margin-top: 20px;
  margin-bottom: 8px;
}

.article-body p {
  font-size: 1rem;
  line-height: 1.75;
  margin-bottom: 16px;
  color: var(--color-text);
}

.article-body ul,
.article-body ol {
  margin: 8px 0 16px;
}

.article-body li {
  margin-bottom: 6px;
  line-height: 1.6;
  font-size: 1rem;
}

.article-body a {
  color: var(--color-primary);
  text-decoration: underline;
}

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

@media (min-width: 768px) {
  .article-body h2 { font-size: 1.35rem; }
}


/* ─── QUICK REFERENCE BOX ───────────────────────────────────────────────── */

.quick-reference-box {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-primary);
  border-radius: 0 8px 8px 0;
  padding: 14px 16px;
  margin: 20px 0;
}

.quick-reference-box h3 {
  margin: 0 0 8px;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-primary);
}

.quick-reference-box ul {
  margin: 0;
  padding-left: 1.25rem;
}

.quick-reference-box li {
  font-size: 0.95rem;
  margin-bottom: 4px;
}


/* ─── DATA TABLE ────────────────────────────────────────────────────────── */
/* Uses same .table-scroll and .data-table from global.css / tools.css pattern */

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table caption {
  font-size: 0.82rem;
  color: var(--color-text-light);
  text-align: left;
  padding-bottom: 8px;
}

.data-table th {
  background: var(--color-primary);
  color: #fff;
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
  font-size: 0.85rem;
}

.data-table th:not(:first-child),
.data-table td:not(:first-child) {
  text-align: right;
}

.data-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
  font-size: 0.9rem;
}

.data-table tbody tr:nth-child(even) td {
  background: #fafafa;
}

.data-table tbody tr:hover td {
  background: #fff3ee;
}

.data-table tbody tr.row-highlight td {
  background: #fff0e8;
  font-weight: 600;
}


/* ─── FAQ SECTION ───────────────────────────────────────────────────────── */
/* Matches tools.css .faq-item/.faq-question/.faq-answer exactly */

.faq-section {
  margin-top: 40px;
}

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

.faq-item {
  border-bottom: 1px solid var(--color-border);
  padding: 16px 0;
}

.faq-item:first-of-type {
  padding-top: 0;
}

.faq-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.faq-question {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 8px;
  line-height: 1.4;
  color: var(--color-text);
}

.faq-answer,
.faq-answer p {
  font-size: 0.95rem;
  color: var(--color-text);
  line-height: 1.6;
  margin: 0;
}


/* ─── RELATED TOOL CTA ──────────────────────────────────────────────────── */

.tool-cta {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 20px 16px;
  margin: 32px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tool-cta h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
}

.tool-cta p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--color-text-light);
  line-height: 1.5;
}

.tool-cta .btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  background: var(--color-primary);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  min-height: 48px;
  transition: background 0.15s ease;
  align-self: flex-start;
}

.tool-cta .btn-primary:hover {
  background: var(--color-primary-dark);
  text-decoration: none;
}

@media (min-width: 768px) {
  .tool-cta {
    flex-direction: row;
    align-items: center;
  }

  .tool-cta > div {
    flex: 1;
  }

  .tool-cta .btn-primary {
    align-self: center;
    flex-shrink: 0;
    margin-left: 16px;
  }
}


/* ─── RELATED ARTICLES GRID ─────────────────────────────────────────────── */

.related-articles {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 2px solid var(--color-border);
}

.related-articles h2 {
  border-bottom: none;
  margin-top: 0;
}

.related-articles-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.related-article-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 14px;
  text-decoration: none;
  color: var(--color-text);
  display: block;
  transition: border-color 0.15s ease, background 0.15s ease;
  font-size: 0.9rem;
  font-weight: 600;
}

.related-article-card:hover {
  border-color: var(--color-primary);
  background: #fff8f5;
  color: var(--color-primary);
  text-decoration: none;
}

.related-article-card strong {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.related-article-card span {
  display: block;
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--color-text-light);
  margin-top: 2px;
}

.related-article-card:hover span {
  color: inherit;
}

@media (min-width: 600px) {
  .related-articles-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .related-articles-grid { grid-template-columns: repeat(3, 1fr); }
}

/* PHASE:5A:END */