@layer components {
  /* ============================================
     Post Card — horizontal news-style cards
     ============================================
     Structure:
       .post-card
         .post-card__image
         .post-card__content
           .post-card__top
             .post-card__title
             .post-card__badge
           .post-card__meta
           .post-card__preview
           .post-card__category  (TODO: wire up tags)
     ============================================ */

  .post-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 2px;
  }

  /* ── Base card ── */
  .post-card {
    display: flex;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 1px 2px var(--color-shadow);
    transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s;
    cursor: pointer;
  }

  /* card hover */

  .post-card:hover {
    box-shadow: 0 4px 12px var(--color-shadow);
    border-color: var(--color-text-semimuted);
  }

  .post-card--admin {
    outline: 2px solid var(--color-primary);
    border: 0;
  }

  /* ── Image (left side) ── */
  .post-card__image {
    width: 240px;
    min-width: 240px;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
  }

  .post-card__image img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
  }

  .post-card__image .post-image {
    width: 100%;
    height: 100%;
    background: var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    font-size: var(--text-sm);
  }

  /* ── Content area ── */
  .post-card__content {
    flex: 1;
    min-width: 0;
    padding: var(--block-space);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  /* ── Title row + badge ── */
  .post-card__top {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
  }

  .post-card__title {
    font-size: var(--text-md);
    font-weight: var(--weight-bold);
    line-height: 1.35;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
  }

  .post-card__badge {
    flex-shrink: 0;
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-on-primary);
    background-color: var(--color-primary);
    padding: 0.15em 0.45em;
    border-radius: 3px;
  }

  /* ── Meta line ── */
  .post-card__meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: var(--text-xs);
    font-weight: var(--weight-bold);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    flex-shrink: 0;
  }

  .post-card__meta-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--color-text-muted);
    flex-shrink: 0;
  }

  .post-card__author {
    font-weight: var(--weight-bold);
  }

  /* ── Preview text ── */
  .post-card__preview {
    font-size: var(--text-base);
    line-height: 1.5;
    color: var(--color-text);
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
  }

  /* ── Category tag (TODO: wire up in view) ── */
  .post-card__category {
    margin-top: auto;
    padding-top: 0.4rem;
  }

  .post-card__category span {
    font-size: var(--text-xs);
    font-weight: var(--weight-bold);
    color: var(--color-primary);
    background: color-mix(in oklch, var(--color-primary), transparent 90%);
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
  }

  /* ── Empty state ── */
  .posts-preview__empty {
    padding: 0.625rem 0.75rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    font-size: var(--text-sm);
    color: var(--color-text-muted);
  }

  /* ── Posts preview ── */
  .posts-preview__footer {
    display: flex;
    justify-content: center;
    padding-top: 1rem;
  }

  /* ── Responsive ── */
  @media (max-width: 600px) {
    .post-card {
      height: auto;
    }

    .post-card__image {
      width: 120px;
      min-width: 120px;
    }

    .post-card__content {
      padding: 0.625rem 0.75rem;
    }
  }
}
