/* Post — cover images on the article page and the index cards.
 * ---------------------------------------------------------------------- */

@layer modules {
  .post-cover {
    aspect-ratio: 16 / 9;
    border-radius: var(--border-radius-l);
    display: block;
    height: auto;
    object-fit: cover;
    width: 100%;
  }

  .post-card__cover {
    aspect-ratio: 16 / 9;
    border-radius: var(--border-radius-m);
    display: block;
    object-fit: cover;
    width: 100%;
  }

  .post-card__cover--default {
    background: var(--ps-ink, #0e1111);
    position: relative;
  }

  .post-card__cover-mark {
    height: 42%;
    inset: 0;
    margin: auto;
    position: absolute;
    width: auto;
  }
}

/* The article body, on the public page and in the admin (the editor and the
 * post page), so the admin shows a post the way it will be published. Unlayered so it beats
 * the `.trix-content *` reset in actiontext.css and Lexxy's own content
 * styles, both unlayered too. */

.post-editor .lexxy-editor__content,
.post-sheet {
  /* The public stage tokens a post reads, repeated here because the admin
   * does not sit under .pitch-site. */
  --font-sans: "Space Grotesk", -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --color-border: rgba(14, 17, 17, 0.55);
  --color-ink-dark: #3a3f3f;
  --border-radius-m: 9px;

  background: #f5f2ea;
  color: #0e1111;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5;
  margin-inline: auto;
  max-width: 56rem;
}

.post-editor lexxy-editor {
  background: #f5f2ea;
}

.post-editor .lexxy-editor__content > * {
  margin-block: 0;
}

.post-sheet {
  border-radius: var(--border-radius-m);
  padding: var(--space-xl);
}

.post-sheet .post-sheet__title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.post-sheet .post-sheet__meta {
  color: var(--color-ink-dark);
  font-size: var(--text-small);
}

:is(.post-editor .lexxy-editor__content, .post-sheet .post-body) :is(p, li, blockquote, td, th) {
  color: inherit;
  font-size: inherit;
}

:is(.post-body .trix-content, .post-editor .lexxy-editor__content) > * + * {
  margin-block-start: var(--space-s);
}

:is(.post-body .trix-content, .post-editor .lexxy-editor__content) > :is(h2, h3, h4) {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-block-start: var(--space-xl);
  text-wrap: balance;
}

:is(.post-body .trix-content, .post-editor .lexxy-editor__content) > h2 { font-size: var(--text-large); }
:is(.post-body .trix-content, .post-editor .lexxy-editor__content) > h3 { font-size: 1.1rem; }
:is(.post-body .trix-content, .post-editor .lexxy-editor__content) > h4 { font-size: var(--text-normal); }

:is(.post-body .trix-content, .post-editor .lexxy-editor__content) > :is(h2, h3, h4) + * {
  margin-block-start: var(--space-xs);
}

:is(.post-body, .post-editor .lexxy-editor__content) a {
  color: #e63329;
  text-decoration: none;
}

:is(.post-body, .post-editor .lexxy-editor__content) blockquote {
  border: 0;
  border-inline-start: 0.3em solid #ccc;
  font-style: normal;
  margin-inline: 0.3em 0;
  padding: 0 0 0 0.6em;
}

:is(.post-body, .post-editor .lexxy-editor__content) :is(ul, ol) {
  padding-inline-start: var(--space-l);
}

:is(.post-body, .post-editor .lexxy-editor__content) li + li {
  margin-block-start: var(--space-xxs);
}

:is(.post-body .trix-content, .post-editor .lexxy-editor__content) > hr {
  border: 0;
  border-block-start: 1px solid var(--color-border);
  margin-block: var(--space-xl);
}

:is(.post-body, .post-editor .lexxy-editor__content) :is(figure, action-text-attachment) {
  display: block;
  margin-block: var(--space-l);
}

:is(.post-body, .post-editor .lexxy-editor__content) img {
  border-radius: var(--border-radius-m);
}

:is(.post-body, .post-editor .lexxy-editor__content) .attachment__caption {
  color: var(--color-ink-dark);
  font-size: var(--text-small);
  margin-block-start: var(--space-xs);
}

:is(.post-body, .post-editor .lexxy-editor__content) table {
  border-collapse: collapse;
  display: block;
  font-size: var(--text-small);
  overflow-x: auto;
  width: 100%;
}

:is(.post-body, .post-editor .lexxy-editor__content) :is(th, td) {
  border-block-end: 1px solid var(--color-border);
  padding: var(--space-xxs) var(--space-xs);
  text-align: start;
}
