/* Articles and blog category pages (content/_layouts/article.html).
   Tokens come from app.css; numbers are measured from the live smartpath.school pages. */

:root {
  --article-width: 50.75rem;          /* 812px article column */
  --article-header-width: 59.625rem;  /* 954px header block */
  --article-text: var(--color-text);
  --article-body-size: var(--font-size-sm);   /* 14px */
  --article-heading-size: var(--font-size-xl); /* 24px */
  --article-link: inherit;
  --post-text: var(--color-ink);
}

/* ---- Article header ---- */
.article-header {
  max-width: var(--article-header-width);
  margin-inline: auto;
  padding: 2.8125rem 1.875rem;
  color: #000000;
  text-align: center;
}
.article-header h1 {
  margin: 0 0 0.75rem;
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  line-height: 1.3;
}
.article-subtitle,
.article-author,
.article-date {
  margin: 0;
  font-size: var(--font-size-base);
  line-height: 1.3;
}
.article-subtitle { margin-bottom: 0.75rem; }
.article-categories { margin-bottom: 0.75rem; }
.article-header.visually-hidden + .article-image { margin-top: 1.5rem; }

/* ---- Cover image: cropped to the live page's box ---- */
.article-image {
  max-width: var(--article-width);
  margin: 2.5rem auto 3.5rem;
  aspect-ratio: calc(var(--crop-w, 812) / var(--crop-h, 344));
  overflow: hidden;
}
.article-image img { width: 100%; height: 100%; object-fit: cover; }

/* ---- Article text ---- */
.article-body {
  max-width: var(--article-width);
  margin-inline: auto;
  padding-bottom: 1rem;
  color: var(--article-text);
  font-size: var(--article-body-size);
  line-height: 1.5;
}
.article-body p { margin: 0 0 1.5rem; }
.article-body h2,
.article-body h3 {
  margin: 0 0 1.5rem;
  color: #000000;
  font-size: var(--article-heading-size);
  font-weight: var(--font-weight-medium);
  line-height: 1.3;
}
.article-body h3 { font-size: var(--font-size-lg); }
.article-body-large { font-size: var(--font-size-base); }
.article-body ul,
.article-body ol { margin: 0 0 1rem; padding-left: 2.5rem; }
.article-body li { margin-bottom: 0.5rem; line-height: 2; }
.article-body li > p { margin: 0; }
.article-body a { color: var(--article-link); text-decoration: underline; }
.article-body a:hover { color: var(--color-primary); }
.article-body .text-accent,
.article-cta .text-accent { color: var(--color-accent); }

/* ---- CTA band under an article ---- */
.article-cta { padding: 4.375rem var(--spacing-lg) 3.5rem; text-align: center; }
.article-cta-actions { display: flex; justify-content: center; gap: 4rem; }
.article-cta-button {
  min-width: 16.1875rem;
  min-height: 3.125rem;
  background: var(--color-accent);
  border-color: var(--color-accent);
  font-weight: var(--font-weight-regular);
}
.article-cta-button:hover { background: var(--color-ink); border-color: var(--color-ink); }
.article-cta-tagline { margin: 1.875rem 0 0; color: #000000; font-size: var(--font-size-base); line-height: 1.3; }

/* ---- Related posts (same cards as the home page's "The Latest from SmartPath") ---- */
.article-related { padding-block: 0 3.75rem; }
.article-related .post-cards { gap: 2rem; max-width: var(--container-width); margin-top: 3.75rem; }
.article-related .card-pager,
.category-list .card-pager { margin-top: var(--spacing-lg); }

/* ---- Category pages ---- */
.category-hero {
  padding: 4.8125rem var(--spacing-lg) 6.625rem;
  background: var(--color-bg-blue);
  color: var(--post-text);
  text-align: center;
}
.category-hero h1 { margin: 0 0 0.3125rem; font-size: 3rem; font-weight: var(--font-weight-medium); line-height: 1.3; }
.category-hero p { max-width: 45.6875rem; margin: 0 auto; font-size: var(--font-size-lead); line-height: 1.5; }

.category-list { max-width: var(--container-width); margin-inline: auto; padding: 3.75rem var(--spacing-lg); }
.post-cards-wide { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem; max-width: none; margin: 0; }
.post-card-full { display: flex; flex-direction: column; color: var(--post-text); }
.post-card-full .post-card-image { margin-bottom: 1.25rem; }
.post-card-full .post-card-image img { aspect-ratio: 5 / 3; object-fit: cover; }
.post-card-categories { margin: 0 0 1rem; font-size: var(--font-size-base); line-height: 1.3; text-transform: uppercase; }
.post-card-categories span { opacity: 0.8; white-space: nowrap; }
.post-card-categories span:not(:last-child)::after { content: "·"; margin: 0 1rem; }
.post-card-title { margin: 0 0 0.75rem; font-size: var(--font-size-xl); font-weight: var(--font-weight-bold); line-height: 1.3; }
.post-card-title a { color: var(--post-text); text-decoration: none; }
.post-card-title a:hover { color: var(--color-primary); }
.post-card-description,
.post-card-author,
.post-card-meta { margin: 0 0 0.75rem; font-size: var(--font-size-base); line-height: 1.3; opacity: 0.8; }
.post-card-author { margin-bottom: 0.25rem; }
.post-card-meta { margin-bottom: 0; }
.post-card-meta span::before { content: " · "; }

@media (max-width: 57.5rem) {
  .article-header { padding: var(--spacing-lg); }
  .article-image {
    margin: 2.5rem var(--spacing-lg) 2rem;
    aspect-ratio: calc(var(--crop-mw, 328) / var(--crop-mh, 184));
  }
  .article-body { padding-inline: var(--spacing-lg); }
  .article-body ul,
  .article-body ol { padding-left: 1.75rem; }
  .article-cta { padding: 1.5rem var(--spacing-lg) 2.5rem; }
  .article-cta-actions { gap: 0.75rem; }
  .article-cta-button { flex: 1 1 0; min-width: 0; max-width: 16.1875rem; min-height: var(--tap-target); padding-inline: var(--spacing-sm); font-size: var(--font-size-xs); }
  .article-cta-tagline { margin-top: 1rem; font-size: var(--font-size-sm); }

  .category-hero { padding: 2.5rem 1.9375rem 1.5rem; }
  .category-hero h1 { margin-bottom: 1rem; font-size: 2.5rem; }
  .category-hero-compact { padding: 4rem var(--spacing-lg); }
  .category-hero-compact h1 { margin-bottom: 1.25rem; font-size: 1.875rem; }
  .category-hero-compact-intro p { font-size: var(--font-size-base); line-height: 1.3; }
  .category-list { padding: 3.75rem var(--spacing-lg) 3rem; }
  .post-cards-wide { grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
  /* 7-14 page buttons at 44px tap size do not fit 390px: wrap instead of overflowing */
  .article-related .card-pager,
  .category-list .card-pager { flex-wrap: wrap; gap: 0; }
}
