/* Lock the cascade order before our own `@layer components` block, since this
   file loads before application.css alphabetically. Keep in sync with it. */
@layer tokens, base, components;

@layer components {
  /* Post show — mirrors the activity show page: title first, then the cover
     photo for the romance, then the lead and the article itself. */

  .postShow__header {
    margin-block: var(--space-lg) var(--content-margin);
  }

  .postShow__title {
    margin: 0;
  }

  .postShow__byline {
    margin: var(--space-sm) 0 0;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.9rem;
    letter-spacing: 0.01em;
  }

  .postShow__cover {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    margin-block: var(--content-margin) var(--space-lg);
  }

  .postLead {
    margin-block: var(--content-margin) var(--space-lg);
    font-size: 1.125rem;
    line-height: 1.6;
    text-align: center;
    text-wrap: pretty;
  }

  /* The affiliate disclosure has to be seen, but it's housekeeping, not
     content: the caption voice, above the article. */
  .postDisclosure {
    margin-block: var(--space-lg);
    color: var(--color-caption);
    font-size: 0.85rem;
    line-height: 1.4;
    font-style: italic;
  }

  .postShow__content {
    margin-block: var(--space-lg) var(--space-xl);
  }

  /* Drafts and scheduled posts, seen only by admins: muted, never indigo. */
  .postStatus {
    display: inline-block;
    padding: 0 var(--space-md);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text-muted);
    font-size: 0.85rem;
  }

  /* The closing invitation: one quiet line and the site's one action. */
  .postCta {
    margin-block: var(--space-xl) 0;
    padding-block: var(--space-xl);
    border-block-start: 1px solid var(--color-border);
    text-align: center;
  }

  .postCta__text {
    margin: 0 0 var(--space-lg);
    font-size: 1.125rem;
  }

  /* ===== Blog index ===== */

  .postList {
    margin: var(--space-xl) 0 0;
    padding: 0;
    list-style: none;
  }

  .postList__item {
    border-block-end: 1px solid color-mix(in srgb, var(--color-border) 50%, transparent);
  }
  .postList__item:last-child {
    border-block-end: 0;
  }

  .postList__link {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    padding: var(--space-lg) var(--space-md);
    color: var(--color-text);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: background-color 200ms cubic-bezier(0.22, 1, 0.36, 1);
  }
  .postList__link:hover {
    background-color: color-mix(in srgb, var(--color-link) 4%, transparent);
  }
  .postList__link:hover .postList__title {
    text-decoration: underline;
  }

  .postList__title {
    color: var(--color-link);
    font-size: 1.25rem;
    line-height: 1.2;
  }

  .postList__description {
    line-height: 1.4;
  }

  .postList__date {
    color: var(--color-text-muted);
    font-size: 0.85rem;
  }

  .postList__empty {
    color: var(--color-text-muted);
    text-align: center;
  }

  @media (prefers-reduced-motion: reduce) {
    .postList__link {
      transition: none;
    }
  }
}
