/* Homepage ready quiz cover/card fix
   Isolated to homepage section only. */

.homepage-ready-quizzes {
  overflow: hidden;
}

.homepage-ready-quizzes .ready-quiz-inner {
  position: relative;
}

.homepage-ready-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  align-items: stretch;
}

.homepage-ready-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border-radius: 30px;
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(91,46,229,.10);
  box-shadow: 0 22px 60px rgba(61,35,138,.08);
  display: flex;
  flex-direction: column;
  isolation: isolate;
}

.homepage-ready-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 6px;
  z-index: 3;
  background: linear-gradient(90deg, #5b2ee5, #41d2ff, #ffda6b);
}

.homepage-ready-cover {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(91,46,229,.22), transparent 42%),
    linear-gradient(135deg, #f0ebff, #ffffff);
  color: #5b2ee5;
  text-decoration: none;
  font-size: clamp(44px, 6vw, 72px);
  font-weight: 1000;
}

.homepage-ready-cover img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center center;
}

.homepage-ready-cover span {
  width: 92px;
  height: 92px;
  border-radius: 32px;
  display: grid;
  place-items: center;
  background: rgba(91,46,229,.10);
  color: #5b2ee5;
  box-shadow: inset 0 0 0 1px rgba(91,46,229,.10);
}

.homepage-ready-content {
  flex: 1;
  min-width: 0;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.homepage-ready-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.homepage-ready-icon {
  width: 54px;
  height: 54px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: #f0ebff;
  color: #5b2ee5;
  font-size: 25px;
  font-weight: 1000;
  flex: 0 0 auto;
}

.homepage-ready-badge {
  border-radius: 999px;
  padding: 8px 10px;
  background: #fff8dc;
  color: #8b6511;
  font-size: 12px;
  font-weight: 1000;
  white-space: nowrap;
}

.homepage-ready-text {
  min-width: 0;
}

.homepage-ready-text h3 {
  margin: 0 0 8px;
  color: #24194d;
  font-size: 24px;
  line-height: 1.05;
  letter-spacing: -.035em;
}

.homepage-ready-text p {
  margin: 0;
  color: #665d81;
  line-height: 1.5;
  font-weight: 750;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 4.5em;
}

.homepage-ready-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.homepage-ready-meta span {
  border-radius: 999px;
  padding: 8px 10px;
  background: #f3f0ff;
  color: #4a34a1;
  font-size: 12px;
  font-weight: 1000;
}

.homepage-ready-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.homepage-ready-actions a {
  min-height: 46px;
}

/* Neutralize old shared card styles inside the homepage section if they exist */
.homepage-ready-quizzes .ready-quiz-card,
.homepage-ready-quizzes .template-card,
.homepage-ready-quizzes .template-cover,
.homepage-ready-quizzes .template-card-top {
  all: unset;
}

@media (max-width: 1040px) {
  .homepage-ready-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .homepage-ready-grid {
    grid-template-columns: 1fr;
  }

  .homepage-ready-card {
    border-radius: 26px;
  }

  .homepage-ready-content {
    padding: 16px;
  }

  .homepage-ready-actions {
    grid-template-columns: 1fr;
  }

  .homepage-ready-text p {
    min-height: 0;
  }
}
