/**
 * Shared tool card styles (tools.html + homepage Recent Tools carousel).
 */

.tool-card {
  --tool-card-cover-height: 260px;
  background: var(--haa-surface);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--haa-border-strong);
  border-radius: var(--haa-radius);
  padding: 0;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.28);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.tool-card:hover {
  transform: translateY(-3px);
  border-color: rgba(212, 175, 55, 0.28);
  box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.06), 0 20px 48px rgba(0, 0, 0, 0.45);
}

.tool-card .tool-link {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  width: 100%;
  padding: 0;
  color: inherit;
  text-decoration: none;
}

.tool-card__body,
.tool-link__body {
  padding: 28px 32px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.tool-link:focus-visible {
  outline: 2px solid var(--haa-accent);
  outline-offset: 2px;
}

/* Tool card cover images only (not avatars, logos, or inline icons) */
.tool-card .tool-card__image,
.tool-card .tool-image {
  width: 100%;
  max-width: none;
  height: var(--tool-card-cover-height);
  margin: 0;
  padding: 0;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
  display: block;
  background: #060608;
  border-bottom: 1px solid var(--haa-border);
  box-sizing: border-box;
}

.tool-card .tool-card__image picture,
.tool-card .tool-image picture {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
}

.tool-card .tool-card__image img,
.tool-card .tool-image img {
  display: block;
  width: 100%;
  min-width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
  object-fit: cover;
  object-position: center center;
  transition: transform 0.35s ease;
}

.tool-card .tool-image__placeholder {
  object-fit: cover;
}

.tool-card:hover .tool-image img,
.tool-card:hover .tool-card__image img {
  transform: scale(1.03);
}

/* Other collection surfaces that reuse these class names (not tool grid cards) */
.collection-card__image,
.collection-card__media {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  margin: 0;
  padding: 0;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
  display: block;
  background: #060608;
  box-sizing: border-box;
}

.collection-card__image picture,
.collection-card__media picture {
  display: block;
  width: 100%;
  height: 100%;
}

.collection-card__image img,
.collection-card__media img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: cover;
  object-position: center center;
  margin: 0;
  padding: 0;
}

.tool-card__title,
.tool-title {
  font-family: var(--haa-font-mono);
  font-size: clamp(17px, 2vw, 20px);
  font-weight: 700;
  letter-spacing: 0.04em;
  margin: 0;
  color: var(--haa-accent-soft);
  line-height: 1.25;
}

.tool-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
}

.badge {
  display: inline-block;
  border: 1px solid var(--haa-border-strong);
  border-radius: 999px;
  padding: 4px 10px;
  font-family: var(--haa-font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--haa-text-muted);
}

.tool-card__description,
.tool-copy {
  font-family: var(--haa-font-body);
  font-size: 14px;
  color: var(--haa-text-soft);
  line-height: 1.55;
  flex: 1;
  margin: 0;
  text-align: left;
}

.tool-action {
  display: inline-block;
  align-self: flex-start;
  margin-top: 0;
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 999px;
  padding: 7px 14px;
  font-family: var(--haa-font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--haa-link);
  margin-right: 0;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.tool-link:hover .tool-action {
  color: var(--haa-link-hover);
  border-color: rgba(212, 175, 55, 0.65);
  background: rgba(212, 175, 55, 0.08);
}

.tool-card__footer,
.tool-card__foot {
  margin-top: auto;
  padding: 12px 20px;
  min-height: 0;
  border-top: 1px solid var(--haa-border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.tool-card__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-left: auto;
}

.tool-featured-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  font-family: var(--haa-font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(244, 221, 92, 0.45);
  color: var(--haa-accent-soft);
  background: rgba(10, 10, 12, 0.82);
}

.tool-card--highlight {
  animation: tool-highlight-pulse 0.6s ease 2;
}

@keyframes tool-highlight-pulse {
  0%,
  100% {
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.28);
  }
  50% {
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.45), 0 20px 48px rgba(0, 0, 0, 0.45);
  }
}

@media (max-width: 768px) {
  .tool-card {
    --tool-card-cover-height: 220px;
  }

  .tool-card__body,
  .tool-link__body {
    padding: 22px 20px 20px;
  }
}

/* Homepage carousel: shorter cover so title + description stay visible */
.home-carousel-track .tool-card.home-carousel-slide {
  min-height: 0;
}

.home-carousel-track .tool-card.home-carousel-slide .tool-card__image,
.home-carousel-track .tool-card.home-carousel-slide .tool-image {
  --tool-card-cover-height: 148px;
  height: var(--tool-card-cover-height);
}
