/**
 * Tool card component. Used on the homepage, category and "All Tools"
 * pages. A card must always contain an icon, a title AND a description —
 * never icon+title alone (product requirement).
 */

.calcoryn-tool-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  background-color: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--motion-duration-base) var(--motion-easing),
    border-color var(--motion-duration-base) var(--motion-easing);
  height: 100%;
}

.calcoryn-tool-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary-blue);
}

.calcoryn-tool-card__icon {
  width: 40px;
  height: 40px;
  color: var(--color-primary-blue);
  flex-shrink: 0;
}

.calcoryn-tool-card__title {
  font-size: var(--text-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  margin: 0;
}

.calcoryn-tool-card__description {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: var(--line-height-relaxed);
  margin: 0;
}

/* The whole card is clickable, but stays a real, accessible link — not a
   div with a click handler. The stretched-link technique keeps the visible
   title link as the accessible name while expanding the hit target. */
.calcoryn-tool-card__link {
  color: inherit;
  text-decoration: none;
}

.calcoryn-tool-card__link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.calcoryn-tool-card__link:focus-visible::after {
  box-shadow: var(--color-focus-ring);
}

.calcoryn-tool-card__title .calcoryn-tool-card__link:hover {
  color: var(--color-primary-blue);
}

.calcoryn-tool-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-5);
}
