/* styles/featured-tools.css */

/* ===============================
   PERFORMANCE TOOL DIRECTORY
================================= */

.featured-tool-section {
  padding: clamp(56px, 7vw, 88px) var(--page-gutter);
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.015),
      transparent
    );
}

.featured-tool-container {
  width: min(var(--page-max-width), 100%);
  margin-inline: auto;
}

.featured-tool-heading {
  max-width: 760px;
  margin: 0 auto clamp(28px, 4vw, 42px);
  text-align: center;
}

.featured-tool-eyebrow {
  margin: 0 0 10px;
  color: var(--color-gold-light);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.featured-tool-heading h2 {
  margin: 0 0 14px;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.08;
  letter-spacing: 0;
  text-wrap: balance;
}

.featured-tool-intro {
  max-width: 64ch;
  margin: 0 auto;
  color: var(--color-text-muted);
  line-height: 1.7;
}

/* ===============================
   TWO-BY-TWO DIRECTORY
================================= */

.featured-tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(14px, 2vw, 22px);
  align-items: stretch;
}

.featured-tool-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: 1fr;
  gap: clamp(20px, 3vw, 36px);
  align-items: end;
  min-width: 0;
  min-height: 230px;
  padding: clamp(24px, 3vw, 34px);
  overflow: hidden;
  isolation: isolate;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.055),
      rgba(255, 255, 255, 0.015)
    ),
    var(--color-surface);
  box-shadow: var(--shadow-card);
  transition:
    transform 220ms ease,
    border-color 220ms ease,
    background 220ms ease,
    box-shadow 220ms ease;
}

.featured-tool-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: clamp(24px, 3vw, 34px);
  width: 46px;
  height: 2px;
  z-index: 0;
  background: var(--color-gold);
  transition: width 220ms ease;
}

.featured-tool-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(
      circle at 100% 0,
      rgba(212, 175, 55, 0.09),
      transparent 34%
    );
}

.featured-tool-card:hover,
.featured-tool-card:focus-within {
  transform: translateY(-3px);
  border-color: rgba(212, 175, 55, 0.42);
  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.07),
      rgba(255, 255, 255, 0.02)
    ),
    var(--color-surface);
  box-shadow:
    0 24px 56px rgba(0, 0, 0, 0.36),
    0 0 20px rgba(212, 175, 55, 0.07);
}

.featured-tool-card:hover::before,
.featured-tool-card:focus-within::before {
  width: 92px;
}

.featured-tool-card-content,
.featured-tool-actions {
  position: relative;
  z-index: 1;
}

.featured-tool-card-content {
  align-self: center;
  min-width: 0;
}

.featured-tool-card h3 {
  max-width: 18ch;
  margin: 0 0 12px;
  color: var(--color-text);
  font-size: clamp(1.25rem, 2vw, 1.65rem);
  line-height: 1.18;
  letter-spacing: 0;
  text-wrap: balance;
}

.featured-tool-card p {
  max-width: 50ch;
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.96rem;
  line-height: 1.68;
}

/* ===============================
   FULL-CARD LINK
================================= */

.featured-tool-actions {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  margin: 0;
}

.featured-tool-actions .primary-cta {
  position: static;
  width: 46px;
  min-width: 46px;
  height: 46px;
  min-height: 46px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(212, 175, 55, 0.38);
  border-radius: 50%;
  background: rgba(212, 175, 55, 0.08);
  box-shadow: none;
  color: transparent;
  font-size: 0;
  letter-spacing: 0;
  white-space: nowrap;
}

.featured-tool-actions .primary-cta::before {
  content: "\2192";
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: var(--color-gold-light);
  font-size: 1.2rem;
  line-height: 1;
  transition:
    transform 220ms ease,
    color 220ms ease;
}

.featured-tool-actions .primary-cta::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
}

.featured-tool-card:hover
  .featured-tool-actions
  .primary-cta,
.featured-tool-card:focus-within
  .featured-tool-actions
  .primary-cta {
  border-color: var(--color-gold);
  background: var(--color-gold);
  box-shadow: none;
  transform: none;
}

.featured-tool-card:hover
  .featured-tool-actions
  .primary-cta::before,
.featured-tool-card:focus-within
  .featured-tool-actions
  .primary-cta::before {
  color: #080808;
  transform: translateX(2px);
}

.featured-tool-actions .primary-cta:focus-visible {
  outline: 2px solid var(--color-gold-light);
  outline-offset: 4px;
}

/* Keep every tool visually equal. */
.featured-tool-card-reference {
  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.055),
      rgba(255, 255, 255, 0.015)
    ),
    var(--color-surface);
}

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

@media (max-width: 900px) {
  .featured-tool-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .featured-tool-card {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
    min-height: 260px;
  }

  .featured-tool-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .featured-tool-section {
    padding: 52px var(--mobile-page-gutter);
  }

  .featured-tool-heading {
    margin-bottom: 26px;
  }

  .featured-tool-heading h2 {
    font-size: 1.85rem;
  }

  .featured-tool-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .featured-tool-card {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: 1fr;
    align-items: end;
    min-height: 0;
    padding: 22px 20px;
  }

  .featured-tool-card::before {
    left: 20px;
  }

  .featured-tool-card h3 {
    max-width: none;
    font-size: 1.25rem;
  }

  .featured-tool-card p {
    font-size: 0.94rem;
    line-height: 1.62;
  }

  .featured-tool-actions {
    justify-content: flex-end;
  }

  .featured-tool-actions .primary-cta {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .featured-tool-card,
  .featured-tool-card::before,
  .featured-tool-actions .primary-cta,
  .featured-tool-actions .primary-cta::before {
    transition: none;
  }

  .featured-tool-card:hover,
  .featured-tool-card:focus-within {
    transform: none;
  }
}
