/*
  result-card.css
  ---------------------------------------------------------------------
  A horizontal result row: a fixed-size thumbnail, a flexible title/
  meta/description/tags column, and an actions column pinned to the
  end. Compare with card.css (a generic box) and pricing-card.css (a
  vertical plan card) - this is specifically a list-item layout for
  search/browse results.

  Requires: css/reset.css, css/core.css

  HTML STRUCTURE:
    <article class="result-card">
      <div class="result-card__thumb"></div>
      <div>
        <div class="result-card__title">Modern CSS - From Zero to Framework</div>
        <div class="result-card__meta">Instructor: Maya Chen · 8.5 hours · 4.9 ★</div>
        <div class="result-card__desc">Master the modern CSS toolkit.</div>
        <div class="result-card__tags">
          <span class="badge badge--accent">Web Dev</span>
        </div>
      </div>
      <div class="result-card__actions">
        <a class="btn btn--primary btn--sm" href="#">Enrol free</a>
      </div>
    </article>
  ---------------------------------------------------------------------
*/

@layer components {
  .result-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: var(--space-4);
    align-items: start;
    padding: var(--space-6);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    transition: border-color var(--transition-fast);
  }

  .result-card:hover { border-color: var(--color-border-strong); }

  .result-card__thumb {
    width: 4rem;
    height: 4rem;
    border-radius: var(--radius);
    background: var(--color-elevated);
    border: 1px solid var(--color-border);
    object-fit: cover;
    flex-shrink: 0;
  }

  .result-card__title { font-weight: 700; font-size: 0.9rem; }
  .result-card__meta  { font-size: 0.9rem; color: var(--color-muted); margin-block-start: 0.2rem; }
  .result-card__desc  { font-size: 0.9rem; color: var(--color-muted); margin-block-start: var(--space-2); }

  /* The badge row under a result's title/meta/description. A .cluster
     with its own margin baked in, the same way __meta and __desc each
     own their spacing above - so a page using this pattern never needs
     to set that spacing itself. */
  .result-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-block-start: var(--space-4);
  }

  .result-card__actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    align-items: flex-end;
    /* Grid items get an implicit min-width: auto floor sized off their
       content - a number input's own intrinsic minimum can be far
       wider than any width set on it, which silently overrides that
       width and pushes the whole row past the card's edge. min-width: 0
       removes that floor so the explicit width actually holds. */
    min-width: 0;
  }
}
