/*
 * Apex — Tools index (/tools/) and the shared tool detail page (/tools/{slug}/).
 * Loaded on top of case-study.css (reuses .apex-cs-hero* and .apex-cs-info*).
 * Modelled on the Figma "Wireframe - Tools" and "Wireframe - Tool - *" frames.
 */

/* =================================================== Tools index (/tools/) */

/* Soft dark glow behind the head (from the Figma head background): two wide top
   glows (brighter toward the sides, dimmer centre) fading to black. Shared by
   the Tools index and the tool detail pages. */
.apex-tools-index,
.apex-tool {
  background:
    radial-gradient(65vw 560px at 18% -60px, #1d232e 0%, rgba(0, 0, 0, 0) 68%),
    radial-gradient(65vw 560px at 82% -60px, #1b212b 0%, rgba(0, 0, 0, 0) 68%),
    #000;
  background-repeat: no-repeat;
}

.apex-tools-index {
  margin-bottom: clamp(4.5rem, 8vw, 10rem); /* roomy gap before the contact section */
}

.apex-tools__intro {
  text-align: center;
  padding-block: clamp(6.5rem, 9vw, 9rem) clamp(2.5rem, 5vw, 4.5rem);
  padding-inline: clamp(1.5rem, 5vw, 6rem);
}

.apex-tools__title {
  font-size: clamp(2.25rem, 3.35vw, 4.1875rem); /* ~67px at 1999, measured in Figma */
  line-height: 1;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--apex-text);
}

.apex-tools__subtitle {
  max-width: 46rem;
  margin: clamp(0.75rem, 1.4vw, 1.25rem) auto 0;
  font-size: 0.9375rem;
  line-height: 1.5;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #a0a0a0;
}

.apex-tools__list {
  display: flex;
  flex-direction: column;
  gap: clamp(0.5rem, 0.7vw, 0.875rem);
}

.apex-tools__card {
  display: flex;
  text-decoration: none;
  color: inherit;
  min-height: max(28rem, 40vw);
  padding-block: clamp(3rem, 5vw, 5rem) clamp(2.5rem, 4.5vw, 5.5rem);
  border-bottom: 0;
}

.apex-tools__card .apex-cs-hero__media img {
  transition: transform 0.6s var(--apex-ease);
}

.apex-tools__card:hover .apex-cs-hero__media img {
  transform: scale(1.04);
}

/* Tool card meta: Year / Description / Category, centred as a group. */
.apex-tools__meta {
  display: grid;
  grid-template-columns: 8rem minmax(0, 1fr) 15rem;
  gap: clamp(1.5rem, 3vw, 3.5rem);
  align-items: start;
  width: 100%;
  max-width: 68rem;
  margin-inline: auto;
  text-align: center;
}

.apex-tools__meta .apex-cs-hero__meta-value {
  white-space: normal; /* the description column wraps */
}

/* =============================================== Tool detail (/tools/{slug}/) */

.apex-tool__hero {
  text-align: center;
  /* Top pad clears the fixed header (5rem). */
  padding-block: clamp(6.5rem, 9vw, 9rem) clamp(2.5rem, 4vw, 4rem);
  padding-inline: clamp(1.5rem, 5vw, 6rem);
}

.apex-tool__title {
  font-size: clamp(2.25rem, 3.35vw, 4.1875rem); /* ~67px at 1999, matches the Tools index title */
  line-height: 1;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--apex-text);
}

/* Full-bleed media band (single image, ~2.3:1 — pixel-measured in the frame). */
.apex-tool__media {
  margin-block: clamp(2rem, 4vw, 4.5rem);
  aspect-ratio: 1999 / 869;
  background: #151515;
  overflow: hidden;
}

.apex-tool__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* "You may be interested" related-tool card reuses the home work-card layout
   (.apex-work__item); give it a little breathing room and a gap before contact. */
.apex-tool__related {
  padding-bottom: clamp(5rem, 10vw, 13rem);
}

/* Even 30% black scrim over the related-card image (better text contrast). */
.apex-tool__related .apex-work__media::after {
  background: rgba(0, 0, 0, 0.3);
}

/* ----------------------------------------------------------------- Responsive */

@media (max-width: 960px) {
  .apex-tools__card {
    min-height: max(24rem, 60vw);
  }

  .apex-tools__meta {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    max-width: 32rem;
  }
}
