/* News: the list, the cards and the article. Loaded after site.css on every public page and in
   the panel, whose post form and social preview render an article the same way. */

.post-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

.post-card__media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: var(--surface-3);
}

.post-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}

.post-card:hover .post-card__media img {
  transform: scale(1.04);
}

.post-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  padding: 22px 24px 24px;
}

.post-card__body h3 {
  margin: 0;
  font-size: 1.2rem;
}

.post-card__body p {
  flex: 1;
  margin: 0;
  font-size: 0.97rem;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  font-size: 0.82rem;
  color: var(--fg-faint);
}

.post-meta .chip {
  font-size: 0.74rem;
}

.post-card--lead {
  display: grid;
}

@media (min-width: 900px) {
  .post-card--lead {
    grid-column: 1 / -1;
    grid-template-columns: 1.3fr 1fr;
  }

  .post-card--lead .post-card__media {
    aspect-ratio: auto;
    min-height: 320px;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .post-card--lead .post-card__body {
    justify-content: center;
    padding: 36px;
  }

  .post-card--lead h3 {
    font-size: 1.8rem;
  }
}

.news-art {
  --tint: var(--accent, var(--white));
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    url('/img/texture/relief.webp') left -260px top -180px / 900px auto no-repeat,
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--tint) 10%, var(--black)),
      color-mix(in srgb, var(--tint) 22%, var(--coal-2))
    );
}

.news-art .icon {
  width: 34px;
  height: 34px;
  color: color-mix(in srgb, var(--tint) 60%, var(--white));
  stroke-width: 1.25;
}

.article {
  max-width: 760px;
  margin-inline: auto;
}

.article__cover {
  margin: 32px 0 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.article__cover img {
  width: 100%;
  height: auto;
}

.article-body {
  font-size: 1.1rem;
  line-height: 1.75;
  color: var(--fg);
}

.article-body h2 {
  margin-top: 1.8em;
  font-size: 1.6rem;
}

.article-body h3 {
  margin-top: 1.5em;
  font-size: 1.25rem;
}

.article-body a {
  color: var(--accent-text);
}

.article-body ul,
.article-body ol {
  padding-left: 1.3em;
}

.article-body li {
  margin-bottom: 0.4em;
}

.article-body blockquote {
  margin: 1.5em 0;
  padding: 4px 0 4px 20px;
  border-left: 3px solid var(--mark);
  color: var(--fg-muted);
}

.article-body code {
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--surface-2);
  font-size: 0.92em;
}

.article-body pre {
  overflow-x: auto;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.article-body pre code {
  padding: 0;
  background: none;
}

.article-body img {
  height: auto;
  border-radius: var(--radius);
}

.article-body hr {
  margin: 2.5em 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.article-body th,
.article-body td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.pagination-public {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 40px;
  color: var(--fg-faint);
  font-size: 0.92rem;
}

.empty-state {
  padding: 48px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  text-align: center;
  color: var(--fg-muted);
}

.empty-state h2,
.empty-state h3 {
  font-size: 1.3rem;
}
