---
/**
 * MOREMINIMORE - SERVICE CARD COMPONENT (LIGHT THEME)
 */

interface Props {
  title: string;
  subtitle?: string;
  image?: string;
  link: string;
}

const { title, subtitle, image, link } = Astro.props;
---

<a href={link} class="service-card">
  <div class="card-inner">
    <!-- Image -->
    <div class="card-image">
      <img src={image || "/images/services/default.jpg"} alt={title} loading="lazy" />
    </div>

    <!-- Content -->
    <div class="card-content">
      <h3 class="card-title">{title}</h3>
      {subtitle && <p class="card-subtitle">{subtitle}</p>}
    </div>

    <!-- Arrow -->
    <div class="card-arrow">
      <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
        <path d="M5 12h14M12 5l7 7-7 7"/>
      </svg>
    </div>
  </div>
</a>

<style>
  /* ============================================
     SERVICE CARD (LIGHT THEME)
     ============================================ */

  .service-card {
    display: block;
  }

  .card-inner {
    position: relative;
    background: var(--color-white);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.4s var(--ease-out-expo);
    border: 1px solid var(--color-gray-200);
  }

  .card-inner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--color-primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s var(--ease-out-expo);
    z-index: 2;
  }

  .service-card:hover .card-inner::before {
    transform: scaleX(1);
  }

  .service-card:hover .card-inner {
    box-shadow: var(--shadow-md);
    transform: translateY(-8px);
    border-color: var(--color-primary);
  }

  .service-card:hover .card-arrow {
    transform: translateX(8px);
    opacity: 1;
  }

  /* ============================================
     IMAGE
     ============================================ */

  .card-image {
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
  }

  .card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
  }

  .service-card:hover .card-image img {
    transform: scale(1.08);
  }

  /* ============================================
     CONTENT
     ============================================ */

  .card-content {
    padding: 28px 24px;
  }

  .card-title {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 800;
    color: var(--color-black);
    margin-bottom: 8px;
    transition: color 0.3s ease;
  }

  .card-subtitle {
    font-size: 14px;
    line-height: 1.6;
    color: var(--color-gray-600);
  }

  /* ============================================
     ARROW (yellow, visible on hover)
     ============================================ */

  .card-arrow {
    position: absolute;
    bottom: 24px;
    right: 24px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary);
    border-radius: 50%;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s var(--ease-out-expo);
    z-index: 2;
  }

  .card-arrow svg {
    width: 20px;
    height: 20px;
    stroke: var(--color-black);
    transition: stroke 0.3s ease;
  }

  /* ============================================
     RESPONSIVE
     ============================================ */

  @media (max-width: 640px) {
    .card-content {
      padding: 24px 20px;
    }

    .card-title {
      font-size: 18px;
    }
  }
</style>
