---
interface Props {
  class?: string;
}

const { class: className } = Astro.props;
---

<div class:list={["card", "scroll-animate", className]}>
  <slot />
</div>

<style>
  .card {
    background: var(--color-bg-light);
    border-radius: 12px;
    padding: var(--space-lg);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(212, 165, 116, 0.1);
    transition: box-shadow 0.3s ease;
  }

  .card:hover {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
  }

  .card :global(h2) {
    font-size: 2rem;
    margin-bottom: var(--space-md);
  }

  .card :global(p) {
    margin-bottom: var(--space-md);
    color: var(--color-text);
  }

  .card :global(p:last-child) {
    margin-bottom: 0;
  }

  /* Scroll animation states */
  .scroll-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
  }

  .scroll-animate.visible {
    opacity: 1;
    transform: translateY(0);
  }

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

    .card:hover {
      box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    }

    .scroll-animate {
      opacity: 1;
      transform: none;
      transition: none;
    }
  }

  @media (max-width: 768px) {
    .card :global(h2) {
      font-size: 1.5rem;
    }
  }
</style>
