/* ========================================================
   path-card.css - Home page learning-path card: image on
   top, text below, a soft wave in the bottom-right corner.

   Colour themes: .path-card--orange, .path-card--violet
   ======================================================== */

.path-card {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column-reverse;
  padding: clamp(10px, 1.1vw, 16px);
  border-radius: clamp(24px, 2.2vw, 32px);
  background: var(--color-surface);
  border: 1px solid #ebe6f4;
  box-shadow:
    0 0 0 6px rgba(255, 255, 255, 0.7),
    0 30px 60px -34px rgba(76, 29, 149, 0.3),
    0 4px 14px rgba(19, 36, 92, 0.05);
  overflow: hidden;
}

/* ---------- Colour themes ---------- */

.path-card--orange {
  --accent: #f26a1b;
  --button-bg: linear-gradient(90deg, #ff9426 0%, #f86a0c 100%);
  --button-shadow: rgba(248, 106, 12, 0.5);
  --wave-light: #ffe7d1;
  --wave-deep: #ffb470;
}

.path-card--violet {
  --accent: #7c3aed;
  --button-bg: linear-gradient(90deg, #9a3bff 0%, #6a1fe6 100%);
  --button-shadow: rgba(106, 31, 230, 0.5);
  --wave-light: #eee4ff;
  --wave-deep: #c6a3ff;
}

/* ---------- Image ---------- */

/* A little wider than the image itself; the crop keeps the title at the top. */
.path-card__media-frame {
  position: relative;
  z-index: 1;
  aspect-ratio: 9 / 4;
  border-radius: clamp(18px, 1.6vw, 24px);
  overflow: hidden;
}

.path-card__media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 25%;
}

/* ---------- Text ---------- */

.path-card__content {
  --badge-size: clamp(62px, 5.5vw, 80px);

  position: relative;
  z-index: 2;
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(4px, 0.45vw, 6px);
  padding: 0 clamp(10px, 1.5vw, 22px) clamp(6px, 0.6vw, 8px);
}

/* Mostly over the image, hanging a quarter below its bottom edge. */
.path-card__icon-badge {
  display: grid;
  place-items: center;
  width: var(--badge-size);
  height: var(--badge-size);
  margin: calc(var(--badge-size) * -0.74) 0 2px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffffff 0%, #fbf8ff 70%);
  border: 1px solid #f0ebf7;
  color: var(--accent);
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, 0.9),
    0 14px 28px -14px rgba(19, 36, 92, 0.35);
}

.path-card__icon-badge svg {
  width: 42%;
  height: 42%;
}

.path-card__title {
  font-size: clamp(1.3rem, 2.2vw, 1.95rem);
  font-weight: 700;
  line-height: 1.3;
  color: #141b55;
}

.path-card__description {
  margin-bottom: clamp(4px, 0.45vw, 6px);
  font-size: clamp(0.9rem, 1.2vw, 1.06rem);
  line-height: 1.4;
  color: #2c3140;
}

/* Pushed to the bottom so the Explore buttons line up in cards of equal height. */
.path-card__explore {
  display: inline-flex;
  align-items: center;
  gap: clamp(12px, 1.1vw, 16px);
  margin-top: auto;
  padding: clamp(10px, 0.9vw, 13px) clamp(24px, 2.4vw, 35px);
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--button-bg);
  color: #fff;
  font-size: clamp(1rem, 1.4vw, 1.25rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.01em;
  box-shadow: 0 14px 26px -12px var(--button-shadow);
  transition:
    transform 0.3s var(--ease-out),
    box-shadow 0.3s ease;
}

.path-card__explore-arrow {
  width: 1.15em;
  height: 1.15em;
  transition: transform 0.4s var(--ease-out);
}

@media (hover: hover) {
  .path-card__explore:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 32px -12px var(--button-shadow);
  }

  .path-card__explore:hover .path-card__explore-arrow {
    transform: translateX(3px);
  }
}

/* Points down to the section showing this card's content */
.path-card__explore[aria-expanded='true'] .path-card__explore-arrow {
  transform: rotate(90deg);
}

/* ---------- Corner wave ---------- */

/* Fades in from the left so it reads as a soft gradient. */
.path-card__wave {
  position: absolute;
  z-index: 0;
  right: 0;
  bottom: 0;
  width: 58%;
  height: 21%;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 50%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 50%);
  pointer-events: none;
}
