/* SHY-21 — the welcome-from-Relish landing page.

   A signed-out, marketing-shell first impression for a migrated Relish
   customer (see internal/app/welcome_relish.go + pages/welcome_relish.html).
   Warm cream hero with the tomato mascot + a Fraunces greeting, then the
   person's own recipe grid, the SHY-26 picks row, and one tomato CTA.

   Design-bible alignment: tomato (--md-primary) is the only accent (1.1);
   the warm hero uses the brand's --md-primary-container cream, not a
   decorative gradient. One generous move = the Fraunces greeting (0.3.2).
   1px borders at rest, shadows only in motion (1.6); one radius
   vocabulary (1.8). Mascot is the static brand mark (1.10).

   Cascade-layer note: lives in `components` so reset/layout never
   overrides it and utility classes always do — same as welcome.css. */

@layer components {

  .welcome-relish {
    width: 100%;
    max-width: 56rem;
    margin-inline: auto;
    padding-block: var(--space-6) var(--space-12);
    padding-inline: var(--space-4);
  }

  /* ==============================================
     HERO — mascot + eyebrow + Fraunces greeting + reassurance, on a
     warm cream panel. The generous typographic move of the page.
     ============================================== */
  .welcome-relish__hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--space-3);
    padding: var(--space-10) var(--space-6) var(--space-8);
    margin-block-end: var(--space-10);
    background: var(--md-primary-container);
    border: 1px solid var(--md-border-muted);
    border-radius: var(--radius-xl);
  }

  /* Static mascot — reuses the auth_mascot SVG (.signin__mascot class).
     No cursor tracking here (no auth-mascot.js on this page), so it rests
     as the brand mark per 1.10. */
  .welcome-relish__hero .signin__mascot {
    width: 72px;
    height: 72px;
    margin-block-end: var(--space-2);
  }

  .welcome-relish__eyebrow {
    margin: 0;
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--md-on-primary-container);
  }

  .welcome-relish__heading {
    margin: 0;
    font-family: var(--font-heading);
    font-weight: var(--weight-semibold);
    font-size: clamp(var(--text-3xl), 5vw, var(--text-5xl));
    line-height: var(--leading-tight);
    letter-spacing: -0.02em;
    color: var(--md-on-surface);
    text-wrap: balance;
  }

  .welcome-relish__lede {
    margin: var(--space-2) auto 0;
    max-width: 34rem;
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: var(--leading-relaxed);
    color: var(--md-on-surface-variant);
  }

  .welcome-relish__lede strong {
    color: var(--md-on-surface);
    font-weight: var(--weight-semibold);
  }

  /* ==============================================
     LIBRARY — "Your recipes" + count, then a card grid of their own
     migrated recipes. Read-only (signed-out): no save heart, no menu.
     ============================================== */
  .welcome-relish__library {
    margin-block-end: var(--space-10);
  }

  .welcome-relish__library-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-3);
    margin-block-end: var(--space-4);
  }

  .welcome-relish__library-heading {
    margin: 0;
    font-family: var(--font-heading);
    font-weight: var(--weight-semibold);
    font-size: var(--text-xl);
    letter-spacing: -0.01em;
    color: var(--md-on-surface);
  }

  .welcome-relish__library-count {
    flex: 0 0 auto;
    font-family: var(--font-body);
    font-size: var(--text-sm);
    color: var(--md-on-surface-variant);
  }

  .welcome-relish__grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-4);
  }

  .welcome-relish__cell {
    min-width: 0;
  }

  .welcome-relish__card {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--md-border);
    border-radius: var(--radius-lg);
    background: var(--md-surface-container-low);
    overflow: hidden;
    transition:
      transform var(--motion-spring-fast-effects-duration) var(--motion-spring-fast-effects),
      box-shadow var(--motion-spring-fast-effects-duration) var(--motion-spring-fast-effects);
  }

  .welcome-relish__card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
  }

  .welcome-relish__card:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
  }

  .welcome-relish__media {
    position: relative;
    aspect-ratio: var(--ratio, 4 / 3);
    background: var(--md-surface-container);
    overflow: hidden;
  }

  .welcome-relish__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  /* Typography/skeleton fallback only (non-negotiable #3). */
  .welcome-relish__fallback {
    position: absolute;
    inset: 0;
    background: var(--md-surface-container-high);
  }

  .welcome-relish__card-body {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    padding: var(--space-3);
  }

  .welcome-relish__card-meta {
    margin: 0;
    font-family: var(--font-body);
    font-size: var(--text-xs);
    letter-spacing: 0.04em;
    color: var(--md-on-surface-variant);
  }

  .welcome-relish__card-title {
    margin: 0;
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: var(--weight-semibold);
    line-height: var(--leading-snug);
    color: var(--md-on-surface);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* ==============================================
     CTA — the one tomato button + a quiet reassurance note. Closes the
     page (bible 1.5: the page ends with something real).
     ============================================== */
  .welcome-relish__cta {
    margin-block-start: var(--space-12);
    text-align: center;
  }

  .welcome-relish__cta-button {
    display: block;
    width: 100%;
    max-width: 30rem;
    margin-inline: auto;
    padding: var(--space-4) var(--space-6);
    border-radius: var(--radius-md);
    background: var(--md-primary);
    color: var(--md-on-primary);
    font-family: var(--font-body);
    font-size: var(--text-lg);
    font-weight: var(--weight-semibold);
    text-decoration: none;
    transition: background-color var(--motion-spring-fast-effects-duration) var(--motion-spring-fast-effects);
  }

  /* state-layer overlay reads as a darken on the tomato surface (same
     treatment the signin + paste submits use). */
  .welcome-relish__cta-button.state-layer::after {
    background: var(--md-on-surface);
  }

  .welcome-relish__cta-button:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
  }

  .welcome-relish__cta-note {
    margin: var(--space-3) 0 0;
    font-family: var(--font-body);
    font-size: var(--text-sm);
    color: var(--md-on-surface-variant);
  }

  @media (prefers-reduced-motion: reduce) {
    .welcome-relish__card {
      transition: box-shadow 0.01ms;
    }

    .welcome-relish__card:hover {
      transform: none;
    }
  }

  @media (max-width: 640px) {
    .welcome-relish__hero {
      padding: var(--space-8) var(--space-4) var(--space-6);
    }

    .welcome-relish__grid {
      grid-template-columns: 1fr;
    }
  }
}
