/* Course pages — requires global.css */

/* ── Page header (courses index) ── */
.page-header {
  width: 100%;
  padding: 5rem 0 4rem;
  border-bottom: 1px solid var(--border);
}
.page-header h1 {
  font-family: "Crimson Pro", serif;
  font-size: clamp(2.4rem, 4vw, 3.4rem);
  font-weight: 500;
  line-height: 1.1;
  margin-bottom: 1rem;
}
.page-header p {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 560px;
  line-height: 1.75;
}

/* ── Hero (course detail) ── */
.hero {
  width: 100%;
  padding: 5rem 0 4rem;
  border-bottom: 1px solid var(--border);
}
.hero .inner {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 5rem;
  align-items: start;
}
.hero-eyebrow {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary);
  display: block;
  margin-bottom: 1.25rem;
}
h1 {
  font-family: "Crimson Pro", serif;
  font-size: clamp(2.4rem, 4vw, 3.6rem);
  font-weight: 500;
  line-height: 1.1;
  margin-bottom: 1.25rem;
}
.hero-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 560px;
  line-height: 1.75;
  margin-bottom: 2rem;
}
.hero-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2.5rem;
}
.author-photo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.author-name {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.author-name strong {
  color: var(--text);
  font-weight: 500;
}

/* ── Stats bar ── */
.stats-bar {
  display: flex;
  gap: 2rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.5rem;
}
.stat {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.stat-value {
  font-family: "Crimson Pro", serif;
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1;
}
.stat-label {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ── CTA card ── */
.cta-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2rem;
  position: sticky;
  top: 2rem;
}
.cta-card .cta-price {
  font-family: "Crimson Pro", serif;
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}
.cta-card .cta-price strong {
  font-size: 1.5rem;
  color: var(--text);
  font-family: "Sora", sans-serif;
}
.cta-btn {
  display: block;
  width: 100%;
  padding: 0.9rem 1.5rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-family: "Sora", sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s;
  margin-bottom: 1rem;
}
.cta-btn:hover {
  background: var(--primary-d);
}
.cta-btn.outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.cta-btn.outline:hover {
  border-color: var(--primary);
  color: var(--text);
}
.cta-includes {
  margin-top: 1.5rem;
  list-style: none;
  display: grid;
  gap: 0.6rem;
}
.cta-includes li {
  font-size: 0.82rem;
  color: var(--text-muted);
  padding-left: 1.25rem;
  position: relative;
  line-height: 1.5;
}
.cta-includes li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--primary);
}
.prereq-badge {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1.5rem;
  padding: 0.75rem 1rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.prereq-badge a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}
.prereq-badge a:hover {
  text-decoration: underline;
}

/* ── What you will learn ── */
.learn {
  width: 100%;
  padding: 5rem 0;
  border-bottom: 1px solid var(--border);
}
.learn h2 {
  font-family: "Crimson Pro", serif;
  font-size: clamp(1.6rem, 2.5vw, 2.2rem);
  font-weight: 500;
  margin-bottom: 2rem;
}
.learn-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 3rem;
}
.learn-grid li {
  font-size: 0.9rem;
  color: var(--text-muted);
  padding-left: 1.25rem;
  position: relative;
  line-height: 1.6;
  list-style: none;
}
.learn-grid li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--primary);
}
.learn-grid li strong {
  color: var(--text);
}

/* ── Prerequisites ── */
.prereqs {
  width: 100%;
  padding: 4rem 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
}
.prereqs h2 {
  font-family: "Crimson Pro", serif;
  font-size: 1.4rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
}
.prereqs p {
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 640px;
  line-height: 1.7;
}
.prereqs .tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
}
.tag {
  font-size: 0.75rem;
  font-family: "JetBrains Mono", monospace;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.3rem 0.7rem;
}
.tag.highlight {
  color: var(--primary);
  border-color: var(--primary-d);
}

/* ── Chapter list ── */
.chapters {
  width: 100%;
  padding: 5rem 0;
  border-bottom: 1px solid var(--border);
}
.chapters h2 {
  font-family: "Crimson Pro", serif;
  font-size: clamp(1.6rem, 2.5vw, 2.2rem);
  font-weight: 500;
  margin-bottom: 0.5rem;
}
.chapters-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
}
.chapter-list {
  width: 100%;
  border-collapse: collapse;
}
.chapter-list tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.chapter-list tr:first-child {
  border-top: 1px solid var(--border);
}
.chapter-list tr:hover {
  background: var(--bg-card);
}
.chapter-row-link {
  display: block;
  text-decoration: none;
  color: inherit;
}
.chapter-list td {
  padding: 1.25rem 1rem;
  vertical-align: top;
}
.chapter-number {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
  width: 2.5rem;
  padding-top: 1.4rem;
  white-space: nowrap;
}
.chapter-list td strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.25rem;
}
.chapter-list td p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.55;
}
.chapter-tag {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 3px;
  padding: 0.15rem 0.5rem;
  margin-left: 0.5rem;
  vertical-align: middle;
}
.tag-project {
  background: var(--tag-project-bg);
  color: var(--depth-intermediate);
}
.tag-quiz {
  background: rgba(74, 157, 124, 0.1);
  color: var(--emerald);
}
.tag-capstone {
  background: rgba(212, 168, 83, 0.1);
  color: var(--gold);
}

/* ── Capstone ── */
.capstone {
  width: 100%;
  padding: 5rem 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
}
.capstone h2 {
  font-family: "Crimson Pro", serif;
  font-size: clamp(1.6rem, 2.5vw, 2.2rem);
  font-weight: 500;
  margin-bottom: 1rem;
}
.capstone p {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 680px;
  line-height: 1.75;
  margin-bottom: 1rem;
}
.capstone-requirements {
  margin-top: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2rem;
  max-width: 680px;
}
.capstone-requirements h3 {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}
.capstone-requirements ul {
  list-style: none;
  display: grid;
  gap: 0.7rem;
}
.capstone-requirements li {
  font-size: 0.875rem;
  color: var(--text-muted);
  padding-left: 1.25rem;
  position: relative;
  line-height: 1.55;
}
.capstone-requirements li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--primary);
}
.capstone-requirements li strong {
  color: var(--text);
}

/* ── Course group (courses index) ── */
.course-group {
  width: 100%;
  padding: 4rem 0;
  border-bottom: 1px solid var(--border);
}
.course-group:last-child {
  border-bottom: none;
}
.group-header {
  margin-bottom: 2rem;
}
.group-header h2 {
  font-family: "Crimson Pro", serif;
  font-size: 1.5rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
}
.group-header p {
  font-size: 0.875rem;
  color: var(--text-muted);
  max-width: 580px;
  line-height: 1.65;
}
.course-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}
.course-grid.single {
  grid-template-columns: repeat(3, 1fr);
}
.course-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.75rem 2rem;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  transition:
    border-color 0.2s,
    background 0.2s;
}
.course-card:hover {
  border-color: var(--primary);
  background: var(--card-hover-bg);
}
.course-card.coming-soon {
  opacity: 0.5;
  pointer-events: none;
  cursor: default;
}
.card-eyebrow {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
  display: block;
}
.course-card h3 {
  font-family: "Crimson Pro", serif;
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.5rem;
  line-height: 1.25;
}
.course-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
  flex: 1;
  margin-bottom: 1.25rem;
}
.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: auto;
}
.card-tag {
  font-size: 0.7rem;
  font-family: "JetBrains Mono", monospace;
  color: var(--text-muted);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.2rem 0.5rem;
  white-space: nowrap;
}
.card-tag.available {
  color: var(--emerald);
  border-color: var(--tag-available-border);
  background: var(--tag-available-bg);
}

/* ── Bottom CTA ── */
.bottom-cta {
  width: 100%;
  padding: 5rem 0;
  text-align: center;
}
.bottom-cta h2 {
  font-family: "Crimson Pro", serif;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 500;
  margin-bottom: 1rem;
}
.bottom-cta p {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto 2.5rem;
  line-height: 1.7;
}
.bottom-cta-btns {
  display: flex;
  gap: 1rem;
  justify-content: center;
}
.btn-primary {
  display: inline-block;
  padding: 0.9rem 2rem;
  background: var(--primary);
  color: #fff;
  border-radius: 6px;
  font-family: "Sora", sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s;
}
.btn-primary:hover {
  background: var(--primary-d);
}
.btn-ghost {
  display: inline-block;
  padding: 0.9rem 2rem;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 6px;
  font-family: "Sora", sans-serif;
  font-size: 0.95rem;
  text-decoration: none;
  transition:
    border-color 0.2s,
    color 0.2s;
}
.btn-ghost:hover {
  border-color: var(--primary);
  color: var(--text);
}

/* ── Lesson hero ── */
.lesson-hero {
  width: 100%;
  padding: 4rem 0;
  border-bottom: 1px solid var(--border);
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
}
.breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
}
.breadcrumb a:hover {
  color: var(--primary);
}
.breadcrumb span {
  color: var(--border);
}
.lesson-hero-inner {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 5rem;
  align-items: start;
}
.lesson-hero-left h1 {
  margin-bottom: 1.25rem;
}
.lesson-hero-left .hero-desc {
  margin-bottom: 2rem;
}
.lesson-hero-left .btn-primary {
  margin-top: 0.5rem;
}

/* ── Lesson prev/next nav ── */
.lesson-nav-section {
  width: 100%;
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--border);
}
.lesson-pagination {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1.5rem;
}
.lesson-nav-btn {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  text-decoration: none;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  transition:
    border-color 0.2s,
    background 0.2s;
}
.lesson-nav-btn:hover {
  border-color: var(--primary);
  background: var(--bg-card);
}
.lesson-nav-btn.right {
  text-align: right;
}
.lesson-nav-label {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.lesson-nav-title {
  font-size: 0.9rem;
  color: var(--text);
  font-weight: 500;
}
.lesson-nav-course {
  text-align: center;
  font-size: 0.82rem;
  color: var(--primary);
  text-decoration: none;
  white-space: nowrap;
}
.lesson-nav-course:hover {
  text-decoration: underline;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .hero .inner {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  .cta-card {
    position: static;
  }
  .learn-grid {
    grid-template-columns: 1fr;
  }
  .stats-bar {
    flex-wrap: wrap;
    gap: 1.5rem;
  }
  .bottom-cta-btns {
    flex-direction: column;
    align-items: center;
  }
  .course-grid,
  .course-grid.single {
    grid-template-columns: 1fr;
  }
  .lesson-hero-inner {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  .lesson-pagination {
    grid-template-columns: 1fr;
  }
  .lesson-nav-btn.right {
    text-align: left;
  }
  .lesson-nav-course {
    order: -1;
  }
}
