/*
 * 30-second lecture preview on the TOEFL 2026 task pages.
 * Markup is written into each page by scripts/add_toefl_course_preview.py;
 * behaviour (stop at 0:30, Premium popup) lives in course-preview.js.
 */
/* Compact card: small player on the left, lecture info on the right,
   transcript underneath across the full width. Stacks on phones. */
.cp-card {
  display: grid;
  grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
  gap: 12px 20px;
  align-items: center;
  padding: 14px;
  border: 1px solid #e6e3fb;
  border-radius: 14px;
  background: #faf9ff;
}

.cp-player {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  aspect-ratio: 16 / 9;
}

.cp-info {
  min-width: 0;
}

.cp-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #634bf6;
}

.cp-mins {
  padding: 1px 8px;
  border-radius: 999px;
  background: #ece9fe;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.cp-title {
  margin-bottom: 4px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  color: #1d1d3a;
}

.cp-pts {
  font-size: 13px;
  color: #6b6b80;
}

.cp-hint {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #5a68f5;
}

.cp-player video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

/* Above the app banner (1200) and the course promo (1000). */
.cp-gate {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(17, 17, 39, 0.7);
  backdrop-filter: blur(3px);
}

.cp-gate[hidden] {
  display: none;
}

.cp-gate-card {
  position: relative;
  max-width: 420px;
  width: 100%;
  padding: 28px 20px 24px;
  border-radius: 12px;
  background: #fff;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.cp-gate-title {
  margin-bottom: 8px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  color: #1d1d3a;
}

.cp-gate-text {
  margin-bottom: 18px;
  font-size: 14px;
  color: #6b6b80;
}

.cp-gate-cta {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 12px;
  background: linear-gradient(90deg, #634bf6, #4baef6 100%);
  color: #fff;
  font-weight: 700;
}

.cp-gate-cta:hover {
  opacity: 0.9;
}

.cp-gate-close {
  position: absolute;
  top: 6px;
  right: 10px;
  font-size: 26px;
  line-height: 1;
  color: #999;
  background: none;
  border: 0;
  cursor: pointer;
}

.cp-gate-close:hover {
  color: #000;
}

.cp-gate-replay {
  display: block;
  margin: 12px auto 0;
  font-size: 13px;
  color: #5a68f5;
  text-decoration: underline;
  background: none;
  border: 0;
  cursor: pointer;
}

.cp-transcript {
  grid-column: 1 / -1;
  padding: 10px 14px;
  border-radius: 10px;
  background: #fff;
}

.cp-transcript summary {
  font-size: 15px;
  cursor: pointer;
  font-weight: 600;
  color: #5a68f5;
}

/* Long lectures scroll inside the box instead of stretching the page. */
.cp-transcript[open] .cp-transcript-body {
  max-height: 360px;
  overflow-y: auto;
  margin-top: 8px;
  padding-right: 6px;
}

.cp-transcript h3 {
  margin: 10px 0 2px;
  font-size: 14px;
  font-weight: 700;
}

.cp-transcript h3:first-child {
  margin-top: 0;
}

.cp-transcript p {
  margin-bottom: 6px;
  font-size: 13px;
  line-height: 1.5;
}

/* Icons before the timing / strategy / practice card headings
   (scripts/add_toefl_card_icons.py). */
.ts-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ts-ico {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #ece9fe;
  color: #634bf6;
}

.ts-ico svg {
  width: 16px;
  height: 16px;
}

@media (max-width: 640px) {
  .cp-card {
    grid-template-columns: minmax(0, 1fr);
    padding: 10px;
  }

  .cp-title {
    font-size: 16px;
  }
}

@media (max-width: 500px) {
  .cp-gate-title {
    font-size: 18px;
  }
}
