/**
 * Featured Content Panels.
 *
 * The component is rendered inside Course Home in the current release. All
 * selectors remain scoped so its broadly enqueued stylesheet is inert elsewhere.
 */

.cpa-featured-content {
  width: min(
    calc(100% - var(--cpa-course-home-gutter, clamp(20px, 4.2vw, 64px)) - var(--cpa-course-home-gutter, clamp(20px, 4.2vw, 64px))),
    var(--cpa-course-home-content-max, 1280px)
  );
  margin-inline: auto;
  padding-top: clamp(42px, 5.2vw, 66px);
  color: var(--cpa-ink, #1E1B18);
  font-family: var(--cpa-font-body, "DM Sans", system-ui, sans-serif);
}

.cpa-featured-content__header {
  width: min(100%, 1120px);
  margin: 0 auto clamp(26px, 3.4vw, 40px);
  text-align: center;
}

.cpa-featured-content__headline {
  width: 100%;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 2vw, 26px);
  color: var(--cpa-ink, #1E1B18);
  font-family: var(--cpa-font-ui, "Sora", system-ui, sans-serif);
  font-size: clamp(22px, 2.2vw, 30px);
  line-height: 1.18;
  font-weight: 650;
  letter-spacing: -0.04em;
  text-align: center;
  text-wrap: balance;
  text-transform: none;
}

.cpa-featured-content__headline:not(.cpa-featured-content__screen-reader-title)::before,
.cpa-featured-content__headline:not(.cpa-featured-content__screen-reader-title)::after {
  content: "";
  min-width: 24px;
  max-width: 240px;
  height: 2px;
  border-radius: var(--cpa-radius-pill, 999px);
  flex: 1 1 80px;
  background: var(--cpa-course-theme-line, #CBDDE5);
}

.cpa-featured-content__subheadline {
  max-width: 640px;
  margin: 11px auto 0;
  color: var(--cpa-muted, #6F675F);
  font-size: 14.5px;
  line-height: 1.6;
  font-weight: 500;
  text-align: center;
}

.cpa-featured-content__screen-reader-title {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.cpa-featured-content__grid {
  width: min(100%, 1120px);
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: clamp(20px, 2.4vw, 28px);
}

.cpa-featured-content--count-1 .cpa-featured-content__grid {
  max-width: 360px;
}

.cpa-featured-content--count-2 .cpa-featured-content__grid,
.cpa-featured-content--count-4 .cpa-featured-content__grid {
  max-width: 752px;
}

.cpa-featured-content__card {
  width: 100%;
  max-width: 360px;
  min-width: 0;
  border: 1px solid var(--cpa-course-theme-line, #CBDDE5);
  border-radius: 18px;
  flex: 1 1 300px;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: var(--cpa-bg-card, #FFFFFF);
  box-shadow: 0 10px 26px rgba(30, 27, 24, 0.045);
  transform: translateY(0);
  transition:
    border-color 0.2s ease,
    transform 0.24s var(--cpa-layout-ease, ease),
    box-shadow 0.24s ease;
}

.cpa-featured-content__card:hover {
  border-color: rgba(var(--cpa-course-theme-rgb, 111, 159, 181), 0.38);
  transform: translateY(-3px);
  box-shadow: 0 15px 34px rgba(30, 27, 24, 0.08);
}

.cpa-featured-content__media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  display: block;
  background:
    linear-gradient(145deg, rgba(var(--cpa-course-theme-rgb, 111, 159, 181), 0.12), rgba(var(--cpa-course-theme-rgb, 111, 159, 181), 0.28)),
    var(--cpa-course-theme-mist, #F3F7F9);
}

.cpa-featured-content__image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transform: scale(1.005);
  transition:
    filter var(--cpa-motion-medium, 0.28s) ease,
    transform 0.4s var(--cpa-layout-ease, ease);
}

.cpa-featured-content__card:hover .cpa-featured-content__image {
  transform: scale(1.035);
}

.cpa-featured-content__placeholder {
  position: absolute;
  inset: 0;
  display: block;
  background:
    radial-gradient(circle at 72% 28%, rgba(255, 255, 255, 0.72), transparent 30%),
    linear-gradient(135deg, transparent 35%, rgba(255, 255, 255, 0.42));
}

.cpa-featured-content__card--purchasable .cpa-featured-content__image {
  filter: saturate(0.62) brightness(0.72);
}

.cpa-featured-content__access-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(16, 38, 43, 0.28), rgba(var(--cpa-course-theme-rgb, 111, 159, 181), 0.38));
  pointer-events: none;
}

.cpa-featured-content__access-mark {
  position: relative;
  width: 38px;
  height: 32px;
  margin-top: 8px;
  border: 2px solid rgba(255, 255, 255, 0.94);
  border-radius: 7px;
  display: block;
  background: rgba(16, 38, 43, 0.18);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.cpa-featured-content__access-mark::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% - 2px);
  width: 21px;
  height: 17px;
  border: 2px solid rgba(255, 255, 255, 0.94);
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  transform: translateX(-50%);
}

.cpa-featured-content__access-mark::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  transform: translate(-50%, -45%);
}

.cpa-featured-content__card-body {
  min-width: 0;
  min-height: 0;
  padding: 19px 20px 21px;
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  background: linear-gradient(180deg, #FFFFFF 0%, var(--cpa-course-theme-mist, #F3F7F9) 190%);
  text-align: center;
}

.cpa-featured-content__label {
  margin: 0 0 8px;
  color: var(--cpa-course-theme-deep, #537280);
  font-family: var(--cpa-font-ui, "Sora", system-ui, sans-serif);
  font-size: 10px;
  line-height: 1.25;
  font-weight: 750;
  letter-spacing: 0.09em;
  text-align: center;
  text-transform: uppercase;
}

.cpa-featured-content__title {
  width: 100%;
  margin: 0;
  color: var(--cpa-ink, #1E1B18);
  font-family: var(--cpa-font-ui, "Sora", system-ui, sans-serif);
  font-size: 19px;
  line-height: 1.23;
  font-weight: 650;
  letter-spacing: -0.035em;
  text-align: center;
  text-wrap: balance;
  text-transform: none;
}

.cpa-featured-content__description {
  width: 100%;
  margin: 10px 0 0;
  display: -webkit-box;
  overflow: hidden;
  color: var(--cpa-muted, #6F675F);
  font-size: 13.5px;
  line-height: 1.54;
  font-weight: 500;
  text-align: center;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.cpa-featured-content__status {
  width: max-content;
  max-width: 100%;
  margin: 16px auto 0;
  padding: 5px 10px;
  border-radius: var(--cpa-radius-pill, 999px);
  font-family: var(--cpa-font-ui, "Sora", system-ui, sans-serif);
  font-size: 10.5px;
  line-height: 1.2;
  font-weight: 700;
  text-align: center;
}

.cpa-featured-content__status--available {
  color: var(--cpa-course-theme-deep, #537280);
  background: rgba(var(--cpa-course-theme-rgb, 111, 159, 181), 0.12);
}

.cpa-featured-content__status--purchasable {
  color: var(--cpa-accent-readable, #B8533A);
  background: var(--cpa-accent-wash, #FFF3EE);
}

.cpa-featured-content__action,
.cpa-featured-content__action:visited {
  width: max-content;
  max-width: 100%;
  min-height: 38px;
  margin: 18px auto 0;
  padding: 0 18px;
  border: 1px solid var(--cpa-accent-readable, #B8533A);
  border-radius: var(--cpa-radius-pill, 999px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: #FFFFFF;
  background: var(--cpa-accent-readable, #B8533A);
  font-family: var(--cpa-font-ui, "Sora", system-ui, sans-serif);
  font-size: 12px;
  line-height: 1;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 7px 18px rgba(184, 83, 58, 0.14);
  transition:
    background-color var(--cpa-motion-fast, 0.18s) ease,
    border-color var(--cpa-motion-fast, 0.18s) ease,
    box-shadow var(--cpa-motion-fast, 0.18s) ease,
    transform var(--cpa-motion-fast, 0.18s) var(--cpa-layout-ease, ease);
}

.cpa-featured-content__action:hover,
.cpa-featured-content__action:focus-visible {
  border-color: var(--cpa-bg-dark, #10262B);
  color: #FFFFFF;
  background: var(--cpa-bg-dark, #10262B);
  box-shadow: 0 9px 20px rgba(16, 38, 43, 0.18);
  text-decoration: none;
  transform: translateX(2px);
}

.cpa-featured-content__action:focus-visible {
  outline: 3px solid var(--cpa-course-theme-deep, #537280);
  outline-offset: 3px;
}

.cpa-featured-content__action-icon,
.cpa-featured-content__action-icon svg {
  width: 15px;
  height: 15px;
  display: block;
}

@media (max-width: 640px) {
  .cpa-featured-content {
    padding-top: clamp(38px, 11vw, 52px);
  }

  .cpa-featured-content__header {
    margin-bottom: 26px;
  }

  .cpa-featured-content__headline {
    gap: 10px;
    font-size: 22px;
  }

  .cpa-featured-content__headline:not(.cpa-featured-content__screen-reader-title)::before,
  .cpa-featured-content__headline:not(.cpa-featured-content__screen-reader-title)::after {
    min-width: 18px;
    height: 1px;
  }

  .cpa-featured-content__subheadline {
    margin-top: 9px;
    font-size: 14px;
  }

  .cpa-featured-content__grid {
    width: min(100%, 360px);
    gap: 18px;
  }

  .cpa-featured-content__card-body {
    padding: 18px;
  }

  .cpa-featured-content__title {
    font-size: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cpa-featured-content__card,
  .cpa-featured-content__image,
  .cpa-featured-content__action {
    transition: none;
  }

  .cpa-featured-content__card:hover,
  .cpa-featured-content__action:hover,
  .cpa-featured-content__action:focus-visible {
    transform: none;
  }
}
