/* emod theme — the Blog: listings (Blog, Topic) and the Article page.
   Built on tokens.css and the card, prose and mono-label patterns in theme.css. */

/* ---------- Listings ---------- */
.blog-listing .lede {
  margin-bottom: var(--space-6);
}

.topic-filter {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-7);
}
.topic-filter__item {
  font: 500 14px/1 var(--font-sans);
  padding: 8px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-primary);
  text-decoration: none;
  transition: border-color var(--duration-fast) var(--ease-out);
}
a.topic-filter__item:hover {
  border-color: var(--gray-500);
}
a.topic-filter__item:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}
.topic-filter__item.is-active {
  background: var(--bg-inverse);
  border-color: var(--bg-inverse);
  color: var(--text-inverse);
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}
@media (max-width: 960px) {
  .article-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 640px) {
  .article-grid {
    grid-template-columns: 1fr;
  }
}

.article-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition:
    transform var(--duration-base) var(--ease-out),
    box-shadow var(--duration-base) var(--ease-out);
}
.article-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}
.article-card__cover img {
  display: block;
  width: 100%;
  aspect-ratio: 1200 / 630;
  object-fit: cover;
}
.article-card__body {
  padding: var(--space-5) var(--space-5) var(--space-6);
}
.article-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-3);
  margin-bottom: var(--space-3);
}
/* Topic links sit above the card's stretched title link. */
.article-card__topic {
  position: relative;
  z-index: 1;
  color: var(--text-accent);
  text-decoration: none;
}
.article-card__topic:hover {
  text-decoration: underline;
}
.article-card__title {
  font: var(--text-h3);
  margin-bottom: var(--space-3);
}
.article-card__title a {
  color: inherit;
  text-decoration: none;
}
/* The whole card is the title's link. */
.article-card__title a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
}
.article-card__title a:focus-visible {
  outline: none;
}
.article-card__title a:focus-visible::after {
  box-shadow: var(--focus-ring);
}
.article-card__summary {
  color: var(--text-secondary);
  font-size: 15px;
  margin: 0;
}

.blog-listing .nav-links {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-7);
}
.blog-listing .page-numbers {
  padding: 8px 14px;
  border-radius: var(--radius-full);
  text-decoration: none;
}
.blog-listing .page-numbers.current {
  background: var(--bg-inverse);
  color: var(--text-inverse);
}

/* ---------- Article ---------- */
/* One column width for the whole Article, in px: `ch` would differ between the
   header's and the body's font sizes and the edges would not line up. */
.article__header,
.article__body,
.author-box,
.article-cta__inner {
  max-width: 720px;
  margin-inline: auto;
}
.article__back {
  text-decoration: none;
}
.article__back::before {
  content: "\2190\00a0";
}
.article__topics {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.article__topic {
  font: var(--text-label);
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
  color: var(--text-accent);
  text-decoration: none;
}
.article__topic:hover {
  text-decoration: underline;
}
.article__title {
  font: var(--text-display);
  letter-spacing: var(--tracking-display);
  margin-bottom: var(--space-4);
}
@media (max-width: 720px) {
  .article__title {
    font: var(--text-h1);
  }
}
.article__dates {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-5);
  color: var(--text-secondary);
  font: var(--text-body-sm);
  margin-bottom: var(--space-3);
}
.article__translation {
  display: inline-block;
  font: 600 14px/1.4 var(--font-sans);
  color: var(--text-accent);
  text-decoration: none;
}
.article__translation::after {
  content: "\00a0\2192";
}
.article__translation:hover {
  text-decoration: underline;
}
.article__cover {
  max-width: 900px;
  margin: var(--space-7) auto 0;
}
.article__cover img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
}
.article__body {
  margin-top: var(--space-7);
  font: var(--text-body-lg);
}
.article__body h2 {
  margin-top: var(--space-7);
}
.article__body p,
.article__body li {
  color: var(--text-primary);
}

.author-box {
  margin-top: var(--space-8);
  padding: var(--space-5) var(--space-6);
  background: var(--bg-sunken);
  border-radius: var(--radius-lg);
}
.author-box__name {
  font: var(--text-h4);
  margin: var(--space-2) 0 var(--space-2);
}
.author-box__bio {
  color: var(--text-secondary);
  margin-bottom: var(--space-3);
}
.author-box__link {
  font-weight: 600;
  color: var(--text-accent);
  text-decoration: none;
}
.author-box__link:hover {
  text-decoration: underline;
}

/* ---------- End of an Article: the call to action, then what to read next ---------- */
/* The call to action sits in the Article's own bottom padding, so it adds space
   below itself only; the related listing below is a section of its own. */
.article-cta {
  padding-bottom: var(--space-8);
}
/* Width comes from the Article column group above, so the card lines up with
   the body and the Author box. */
.article-cta__inner {
  padding: var(--space-7) var(--space-6);
  text-align: center;
  background: var(--bg-inverse);
  color: var(--text-inverse);
  border-radius: var(--radius-lg);
}
.article-cta__title {
  font: var(--text-h2);
  color: var(--text-inverse);
  margin-bottom: var(--space-3);
}
.article-cta p {
  color: var(--text-inverse-secondary);
  margin: 0 auto var(--space-6);
}

.related {
  border-top: 1px solid var(--border-subtle);
}
.related .mono-label {
  display: block;
  margin-bottom: var(--space-2);
}
.related__title {
  font: var(--text-h2);
  margin-bottom: var(--space-6);
}
