/* Blog home, cards, article layout */

/* Hero */
.hero {
  padding: 3.5rem 0 2.5rem;
}

.hero__inner {
  max-width: 40rem;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0 0 1.25rem;
}

.hero__lead {
  font-size: 1.125rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin: 0;
  max-width: 36rem;
}

/* Category filter */
.category-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.category-filter a {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.category-filter a:hover,
.category-filter a.is-active {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-dim);
  text-decoration: none;
}

/* Section */
.section {
  padding: 2rem 0 3rem;
}

.section__head {
  margin-bottom: 1.75rem;
}

.section__head h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 0;
}

/* Post grid */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.post-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
}

.post-card:hover {
  border-color: rgba(62, 207, 126, 0.3);
  transform: translateY(-2px);
}

.post-card--featured {
  grid-column: 1 / -1;
  flex-direction: row;
}

@media (max-width: 767px) {
  .post-card--featured {
    flex-direction: column;
  }
}

.post-card__image {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-elevated);
  flex-shrink: 0;
}

.post-card--featured .post-card__image {
  width: 45%;
  aspect-ratio: auto;
  min-height: 220px;
}

@media (max-width: 767px) {
  .post-card--featured .post-card__image {
    width: 100%;
    aspect-ratio: 16 / 9;
    min-height: auto;
  }
}

.post-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-card__body {
  padding: 1.25rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.post-card__meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  font-size: 0.8125rem;
}

.post-card__category {
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.post-card__time {
  color: var(--text-muted);
}

.post-card__title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.3;
  margin: 0 0 0.75rem;
  letter-spacing: -0.02em;
}

.post-card--featured .post-card__title {
  font-size: 1.5rem;
}

.post-card__title a {
  color: var(--text);
  text-decoration: none;
}

.post-card__title a:hover {
  color: var(--accent);
}

.post-card__excerpt {
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.6;
  margin: 0 0 1rem;
  flex: 1;
}

.post-card__link {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  margin-top: auto;
}

.post-card__link:hover {
  text-decoration: underline;
}

.empty-state {
  padding: 3rem;
  text-align: center;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

/* Article page */
.article {
  padding: 2.5rem 0 4rem;
}

.article__header {
  max-width: 42rem;
  margin: 0 auto 2rem;
}

.article__back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  text-decoration: none;
}

.article__back:hover {
  color: var(--accent);
}

.article__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.article__category {
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.8125rem;
}

.article h1 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4.5vw, 2.75rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin: 0 0 1rem;
}

.article__excerpt {
  font-size: 1.125rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin: 0;
}

.article__hero-image {
  max-width: 56rem;
  margin: 0 auto 2.5rem;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.article__hero-image img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.article__layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  max-width: 56rem;
  margin: 0 auto;
}

@media (min-width: 900px) {
  .article__layout--toc {
    grid-template-columns: 200px 1fr;
    align-items: start;
  }
}

.article__toc {
  display: none;
  position: sticky;
  top: calc(var(--header-h) + 1rem);
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

@media (min-width: 900px) {
  .article__layout--toc .article__toc {
    display: block;
  }
}

.article__toc h2 {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
}

.article__toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.article__toc li + li {
  margin-top: 0.5rem;
}

.article__toc a {
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-decoration: none;
  line-height: 1.4;
  display: block;
}

.article__toc a:hover {
  color: var(--accent);
}

.article__content {
  max-width: 42rem;
}

.article__content h2 {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 2.5rem 0 1rem;
  line-height: 1.3;
  scroll-margin-top: calc(var(--header-h) + 1rem);
}

.article__content h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem;
  line-height: 1.35;
}

.article__content p {
  font-size: 1.125rem;
  line-height: 1.75;
  color: var(--text-muted);
  margin: 0 0 1.25rem;
}

.article__content ul,
.article__content ol {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--text-muted);
  margin: 0 0 1.25rem;
  padding-left: 1.5rem;
}

.article__content li + li {
  margin-top: 0.5rem;
}

.article__content a {
  color: var(--accent);
}

.article__content img {
  border-radius: var(--radius-sm);
  margin: 1.5rem 0;
}

.article__content blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border-left: 3px solid var(--accent);
  background: var(--accent-dim);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text);
  font-style: italic;
}

/* CTA card — inline and footer */
.article-cta-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem 1.5rem;
  margin: 2.5rem 0;
  padding: 1.5rem 1.75rem;
  background: linear-gradient(135deg, var(--accent-dim), rgba(80, 100, 140, 0.12));
  border: 1px solid rgba(62, 207, 126, 0.25);
  border-radius: var(--radius);
}

.article-cta-card--footer {
  max-width: 42rem;
  margin: 3rem auto 0;
}

.article-cta-card__copy {
  flex: 1 1 200px;
  min-width: 0;
}

.article-cta-card__headline {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.02em;
  color: var(--text);
}

.article-cta-card__btn {
  flex-shrink: 0;
  font-size: 0.9375rem;
  padding: 0.875rem 1.5rem;
  text-decoration: none;
}

.article-cta-card__btn:hover {
  text-decoration: none;
}

@media (max-width: 540px) {
  .article-cta-card {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .article-cta-card__btn {
    width: 100%;
  }
}

.article__content .article-cta-card a.article-cta-card__btn {
  color: var(--bg);
}

.article__content .article-cta-card a.article-cta-card__btn:hover {
  color: var(--bg);
}

/* Related posts */
.related-posts {
  max-width: 56rem;
  margin: 4rem auto 0;
  padding-top: 2.5rem;
  border-top: 1px solid var(--border);
}

.related-posts h2 {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 500;
  margin: 0 0 1.5rem;
}

.related-posts .post-grid {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
