/* ==========================================================================
   CYBERPUNK × CORSAIR — COLLECTION PANELS (Edgerunners / Arasaka)
   Pairs with collections.html
   ========================================================================== */

:root {
  --cpa-yellow: #ece81a;
  --cpa-light-grey: #c1c6c8;
  --cpa-cta-h: 44px; /* CTA row height — collections.js reads this for the frame */
}

@media screen and (min-width: 860px) {
  :root {
    --cpa-cta-h: 40px;
  }
}

/* ---------- Section ---------- */
/* ---------- Wrapper: one merged background (4096 × 4053) behind both panels ----------
   Height is driven by the content; the artwork is a repeating pattern, so `cover`
   cropping the sides (or top/bottom) is fine. */
.cpa-collections {
  background-color: #000;
  background-image: url("https://assets.corsair.com/image/upload/f_auto,q_auto/v1790953731/content/landing-pages/cyberpunk-arasaka/PLP_BG.jpg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  color: #fff;
}

.cpa-collection {
  position: relative;
  padding: 3.5rem 1rem;
  background: transparent;
}

@media screen and (min-width: 860px) {
  .cpa-collection {
    padding: 4.5rem 1rem;
  }
}

.cpa-collection-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1280px;   /* matches the PWA --panel-max-content-width at ≥1024px */
  margin: 0 auto;
  text-align: center;
}

.cpa-collection-logo {
  display: block;
  width: auto;
  height: 46px;
  margin: 0 auto 0.875rem;
}

/* Header 3 — mirrors corsair-pwa `.text-header-3` (styles/utilities.css):
   Saira Expanded 300; 24px/1.166 → 44px/1.09 @768 (+1px tracking) → 48px/1.08 @1024.
   The PWA class also pads 0.5rem top / 1rem bottom; replicated here as margin. */
.cpa-collection-title {
  margin: 0;
  padding: 0.5rem 0 1rem;
  font-family: "Saira Expanded", sans-serif;
  font-weight: 300;
  font-size: 1.5rem;
  line-height: 1.166;
  text-transform: uppercase;
  color: #fff;
}

/* Arasaka has no intro paragraph, so give the title its own space above the cards */
.cpa-collection--arasaka .cpa-collection-title {
  margin-bottom: 2rem;
}

@media screen and (min-width: 768px) {
  .cpa-collection-title {
    font-size: 2.75rem;
    line-height: 1.09;
    letter-spacing: 1px;
  }
}

@media screen and (min-width: 1024px) {
  .cpa-collection-title {
    font-size: 3rem;
    line-height: 1.08;
  }
}

/* Body Copy 2 — Desktop (Figma spec). Token names match the PWA's variables. */
.cpa-collection-copy {
  max-width: 640px;
  margin: 0 auto 2rem;
  font-family: var(--font-family-body, "Saira", sans-serif);
  font-size: var(--font-size-body-copy-2, 16px);
  font-style: normal;
  font-weight: 400;
  line-height: var(--font-line-height-body-copy-2, 22px); /* 137.5% */
  text-align: center;
  color: var(--text-strong, #fff);
}

.cpa-collection-copy strong {
  font-weight: 600;
}

/* ---------- Grid ---------- */
.cpa-cards {
  display: grid;
  /* minmax(0, …) so mobile Safari can't grow the track to the card's min-content width */
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  min-width: 0;
  gap: 0.75rem;
  text-align: left;
}

@media screen and (min-width: 460px) {
  .cpa-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media screen and (min-width: 860px) {
  .cpa-cards {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.25rem;
  }
}

/* ---------- Card ---------- */
.cpa-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 228px;
  color: #fff;
  text-decoration: none;
  /* soft radial glow behind the product */
  background:
    radial-gradient(ellipse 70% 60% at 50% 42%, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.05) 45%, rgba(0, 0, 0, 0) 75%),
    #141414;
}

.cpa-card:hover,
.cpa-card:focus-visible {
  color: #fff;
  text-decoration: none;
  outline: none;
}

/* SVG frame (injected by collections.html script) */
.cpa-card-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.cpa-card-frame path {
  fill: none;
  stroke: var(--cpa-yellow);
  stroke-width: 1;
  stroke-linejoin: miter;
}

/* CTA tab fill: dark by default, Bright Yellow on hover */
.cpa-card-frame .cpa-card-tab {
  fill: #0b0b0b;
  stroke: none;
  transition: fill 0.25s ease;
}

.cpa-card:hover .cpa-card-frame .cpa-card-tab {
  fill: var(--cpa-yellow);
}

/* Product image: default + hover stacked, hover fades in */
.cpa-card-media {
  position: relative;
  aspect-ratio: 4 / 3;          /* image area scales with card width at every size */
  min-width: 0;
  margin: 1.5rem 1.5rem 0.75rem;
}

.cpa-card-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: opacity 0.35s ease;
}

.cpa-card-img--hover {
  opacity: 0;
  transform: translateX(-6px); /* optical alignment with the default render */
}

.cpa-card:hover .cpa-card-img--hover {
  opacity: 1;
}

.cpa-card:hover .cpa-card-img:not(.cpa-card-img--hover) {
  opacity: 0;
}

/* Copy */
.cpa-card-body {
  flex: 1;
  padding: 0.5rem 1.25rem 1.25rem;
}

.cpa-card-name {
  margin: 0 0 0.375rem;
  font-family: "Saira Expanded", "Saira", sans-serif;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.25;
  letter-spacing: 0;
  text-transform: uppercase;
  overflow-wrap: anywhere;
  color: #fff;
}

.cpa-card-type {
  margin: 0;
  overflow-wrap: anywhere;
  font-family: "Saira", sans-serif;
  font-size: 0.8125rem;
  line-height: 1.3;
  color: var(--cpa-light-grey);
}

/* CTA row (sits on top of the filled tab) */
.cpa-card-cta {
  position: relative;
  height: var(--cpa-cta-h);
  display: flex;
  align-items: center;
  justify-content: center;
  /* mirrors corsair-pwa .text-cta-copy: Saira 600, 1px tracking */
  font-family: "Saira", sans-serif;
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1.4;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #fff;
  transition: color 0.25s ease;
}

@media screen and (min-width: 860px) {
  .cpa-card-body {
    padding: 0.5rem 1.25rem 1.25rem;
  }

  .cpa-card-name {
    font-size: clamp(0.875rem, 1.25vw, 1.125rem);
  }

  .cpa-card-type {
    font-size: clamp(0.75rem, 1vw, 0.875rem);
  }

  .cpa-card-cta {
    font-size: 0.875rem;
  }
}

@media screen and (min-width: 1024px) {
  .cpa-card-cta {
    font-size: 1rem;
  }
}

.cpa-card:hover .cpa-card-cta {
  color: #000;
}

.cpa-card-arrow {
  display: inline-block;
  width: 6px;
  height: auto;
  margin-left: 0.5rem;
  flex-shrink: 0;
  transition: transform 0.25s ease;
}

.cpa-card:hover .cpa-card-arrow {
  transform: translateX(2px);
}

@media screen and (min-width: 860px) {
  .cpa-card-arrow {
    width: 7px;
  }
}
