:root {
  --tm-red: #C90404;
  --tm-red-dark: #9f0303;
  --tm-text: #1d1717;
  --tm-muted: #6f6565;
  --tm-bg: #fff7f3;
  --tm-card: #ffffff;
  --tm-border: rgba(29, 23, 23, 0.12);
  --tm-shadow: 0 24px 70px rgba(29, 23, 23, 0.10);
}

.tm-course-page {
  color: var(--tm-text);
  background: #fff;
}

.tm-course-container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.tm-course-hero,
.tm-course-archive-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(48px, 6vw, 92px) 0;
  background: radial-gradient(circle at top right, rgba(201,4,4,.12), transparent 34%), linear-gradient(135deg, #fff7f3, #fff);
}

.tm-course-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr);
  gap: clamp(28px, 4vw, 56px);
  align-items: center;
}

.tm-course-breadcrumbs {
  margin-bottom: 18px;
  font-size: 14px;
  color: var(--tm-muted);
}

.tm-course-kicker {
  margin: 0 0 14px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--tm-red);
}

.tm-course-page h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 68px);
  line-height: .98;
  letter-spacing: -0.04em;
  color: var(--tm-text);
}

.tm-course-lead {
  max-width: 760px;
  margin: 24px 0 0;
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.55;
  color: var(--tm-muted);
}

.tm-course-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.tm-course-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 14px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 800;
  text-decoration: none !important;
  transition: transform .18s ease, background .18s ease, color .18s ease, border-color .18s ease;
}

.tm-course-btn:hover {
  transform: translateY(-1px);
}

.tm-course-btn--primary {
  background: var(--tm-red);
  color: #fff !important;
}

.tm-course-btn--primary:hover {
  background: var(--tm-red-dark);
}

.tm-course-btn--outline {
  background: #fff;
  color: var(--tm-red) !important;
  border-color: rgba(201,4,4,.28);
}

.tm-course-btn--outline:hover {
  border-color: var(--tm-red);
}

.tm-course-btn--wide {
  width: 100%;
}

.tm-course-card {
  background: var(--tm-card);
  border: 1px solid var(--tm-border);
  border-radius: 28px;
  box-shadow: var(--tm-shadow);
}

.tm-course-hero__card {
  padding: 28px;
}

.tm-course-price {
  margin-bottom: 22px;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1;
  font-weight: 900;
  color: var(--tm-red);
}

.tm-course-facts {
  list-style: none;
  padding: 0;
  margin: 0;
}

.tm-course-facts li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 0;
  border-top: 1px solid var(--tm-border);
}

.tm-course-facts span {
  color: var(--tm-muted);
}

.tm-course-facts strong {
  text-align: right;
}

.tm-course-section {
  padding: clamp(48px, 6vw, 88px) 0;
}

.tm-course-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 42px;
  align-items: start;
}

.tm-course-content {
  min-width: 0;
}

.tm-course-video,
.tm-course-image {
  overflow: hidden;
  margin: 0 0 36px;
  border-radius: 30px;
  background: #111;
  box-shadow: var(--tm-shadow);
}

.tm-course-video video,
.tm-course-image img {
  display: block;
  width: 100%;
  height: auto;
}

.tm-course-text,
.tm-course-block {
  margin-bottom: 36px;
}

.tm-course-block {
  padding: clamp(24px, 3vw, 36px);
  border: 1px solid var(--tm-border);
  border-radius: 28px;
  background: #fff;
}

.tm-course-text h2,
.tm-course-block h2 {
  margin: 0 0 20px;
  font-size: clamp(26px, 3vw, 40px);
  line-height: 1.1;
  color: var(--tm-text);
}

.tm-course-text p,
.tm-course-block p,
.tm-course-list,
.tm-course-steps {
  font-size: 17px;
  line-height: 1.65;
}

.tm-course-list,
.tm-course-steps {
  margin: 0;
  padding-left: 22px;
}

.tm-course-list li,
.tm-course-steps li {
  margin-bottom: 10px;
}

.tm-course-list--check {
  list-style: none;
  padding-left: 0;
}

.tm-course-list--check li {
  position: relative;
  padding-left: 34px;
}

.tm-course-list--check li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(201,4,4,.1);
  color: var(--tm-red);
  font-weight: 900;
}

.tm-course-faq-block details {
  padding: 18px 0;
  border-top: 1px solid var(--tm-border);
}

.tm-course-faq-block summary {
  cursor: pointer;
  font-weight: 800;
}

.tm-course-sidebar {
  min-width: 0;
}

.tm-course-sticky {
  position: sticky;
  top: 24px;
  padding: 26px;
}

.tm-course-sticky h2 {
  margin: 0 0 14px;
  font-size: 26px;
}

.tm-course-sidebar__price {
  margin: 0 0 18px;
  font-size: 32px;
  font-weight: 900;
  color: var(--tm-red);
}

.tm-course-note {
  margin: 16px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--tm-muted);
}

.tm-course-direction-grid,
.tm-course-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.tm-course-direction-grid {
  margin-bottom: 34px;
}

.tm-course-direction-card,
.tm-course-card-listing__link {
  display: block;
  height: 100%;
  padding: 26px;
  color: inherit !important;
  text-decoration: none !important;
  border: 1px solid var(--tm-border);
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(29, 23, 23, 0.07);
}

.tm-course-direction-card h2,
.tm-course-card-listing h2 {
  margin: 0 0 12px;
  font-size: 24px;
  line-height: 1.2;
}

.tm-course-card-listing__image {
  overflow: hidden;
  margin: -26px -26px 20px;
  border-radius: 28px 28px 0 0;
  aspect-ratio: 16 / 10;
  background: var(--tm-bg);
}

.tm-course-card-listing__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tm-course-card-listing__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.tm-course-card-listing__meta span {
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--tm-bg);
  color: var(--tm-text);
  font-size: 13px;
  font-weight: 800;
}

@media (max-width: 980px) {
  .tm-course-hero__grid,
  .tm-course-layout,
  .tm-course-direction-grid,
  .tm-course-grid {
    grid-template-columns: 1fr;
  }

  .tm-course-sidebar {
    order: -1;
  }

  .tm-course-sticky {
    position: static;
  }
}

@media (max-width: 640px) {
  .tm-course-container {
    width: min(100% - 24px, 1180px);
  }

  .tm-course-hero,
  .tm-course-archive-hero {
    padding: 38px 0;
  }

  .tm-course-page h1 {
    font-size: 34px;
    line-height: 1.06;
  }

  .tm-course-lead {
    font-size: 17px;
  }

  .tm-course-hero__actions,
  .tm-course-btn {
    width: 100%;
  }

  .tm-course-hero__card,
  .tm-course-block,
  .tm-course-sticky,
  .tm-course-direction-card,
  .tm-course-card-listing__link {
    border-radius: 22px;
    padding: 20px;
  }

  .tm-course-facts li {
    display: block;
  }

  .tm-course-facts strong {
    display: block;
    margin-top: 4px;
    text-align: left;
  }
}

/* v1.1 fixes */
.tm-course-breadcrumbs a {
  color: inherit !important;
  text-decoration: none !important;
}

.tm-course-breadcrumbs a:hover {
  color: var(--tm-red) !important;
}

.tm-course-inline-intro {
  margin: 0 0 14px;
  font-weight: 700;
  color: var(--tm-text);
}

.tm-course-program h3 {
  margin: 28px 0 12px;
  font-size: clamp(21px, 2vw, 28px);
  line-height: 1.2;
  color: var(--tm-text);
}

.tm-course-program h3:first-of-type {
  margin-top: 0;
}

.tm-course-text h2:first-child {
  margin-top: 0;
}

.tm-course-card-listing__meta span {
  line-height: 1.2;
}

/* v1.3 payment iframe + sticky sidebar */
@media (min-width: 981px) {
  .tm-course-sidebar {
    align-self: stretch;
  }

  .tm-course-sticky {
    position: sticky;
    top: 112px;
    z-index: 2;
    max-height: calc(100vh - 132px);
    overflow: auto;
    scrollbar-width: thin;
  }
}

.tm-course-payment-frame {
  overflow: hidden;
  width: 100%;
  margin: 12px 0 12px;
  border: 1px solid var(--tm-border);
  border-radius: 22px;
  background: #fff;
}

.tm-course-payment-frame iframe {
  display: block;
  width: 100%;
  min-height: 520px;
  border: 0;
  background: #fff;
}

.tm-course-payment-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  margin-top: 10px;
  color: var(--tm-red) !important;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none !important;
}

.tm-course-payment-open:hover {
  text-decoration: underline !important;
}

@media (max-width: 980px) {
  .tm-course-payment-frame iframe {
    min-height: 560px;
  }
}

@media (max-width: 640px) {
  .tm-course-payment-frame {
    border-radius: 18px;
  }

  .tm-course-payment-frame iframe {
    min-height: 620px;
  }
}

/* v1.4 payment block UX fixes */
@media (min-width: 981px) {
  .tm-course-layout {
    grid-template-columns: minmax(0, 1fr) minmax(380px, 420px);
    gap: clamp(36px, 4vw, 52px);
  }

  .tm-course-sticky {
    max-height: none;
    overflow: visible;
  }
}

.tm-course-sticky h2 {
  margin-bottom: 18px;
}

.tm-course-payment-frame {
  margin-top: 0;
}

.tm-course-payment-open {
  min-height: 42px;
  padding: 0 10px;
  line-height: 1.35;
  text-align: center;
}

@media (min-width: 981px) and (max-height: 800px) {
  .tm-course-sticky {
    padding: 22px;
  }

  .tm-course-payment-frame iframe {
    min-height: 470px;
  }

  .tm-course-note {
    margin-top: 12px;
    font-size: 13px;
  }
}
