/* ============================================================
 * NisitSornGraph Course Platform styles — courses.html, course.html,
 * classroom.html. Same dark / gold visual language as the rest of
 * Finisit; light-mode overrides at the bottom.
 * ============================================================ */

/* ── Hero shared between courses + course-detail ───────────────── */
.courses-hero {
  position: relative;
  padding: calc(var(--nav-h, 72px) + var(--sp-9, 4rem)) 0 var(--sp-7, 2.5rem);
  background:
    radial-gradient(700px 400px at 80% 0%, rgba(212, 184, 135, 0.08), transparent 60%),
    radial-gradient(500px 300px at 5% 90%, rgba(212, 184, 135, 0.04), transparent 60%);
  border-bottom: 1px solid var(--border-soft);
}
.courses-hero .breadcrumb {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ivory-dim);
  margin-bottom: var(--sp-4, 1.25rem);
}
.courses-hero .breadcrumb a {
  color: var(--ivory-muted);
  text-decoration: none;
}
.courses-hero .breadcrumb .sep { margin: 0 6px; opacity: 0.6; }
.courses-hero .eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--gold);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: var(--sp-3, 1rem);
}
.courses-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 300;
  margin: 0 0 var(--sp-3, 1rem);
}
.courses-hero h1 em {
  font-style: italic;
  color: var(--gold);
}
.courses-hero__lead {
  color: var(--ivory-muted);
  font-size: var(--text-md, 1rem);
  line-height: 1.7;
  max-width: 56ch;
  margin: 0 0 var(--sp-5, 1.5rem);
}

/* ── Catalogue page ────────────────────────────────────────────── */
.courses-page {
  padding: var(--sp-7, 2.5rem) 0 var(--sp-9, 4rem);
}
.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--sp-5, 1.5rem);
}
.courses-skel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--sp-5, 1.5rem);
  margin-top: var(--sp-4);
}
.course-card {
  display: block;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, transform 0.15s, background 0.15s;
}
.course-card:hover {
  border-color: var(--gold);
  background: rgba(212, 184, 135, 0.04);
  transform: translateY(-2px);
}
.course-card__thumb {
  aspect-ratio: 16 / 9;
  background: var(--ink-graphite);
  overflow: hidden;
}
.course-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.course-card__body {
  padding: 18px 20px 20px;
}
.course-card__title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--ivory);
  margin: 0 0 8px;
  line-height: 1.3;
}
.course-card__desc {
  font-size: 13px;
  color: var(--ivory-muted);
  line-height: 1.6;
  margin: 0 0 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.course-card__foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-top: 10px;
  border-top: 1px solid var(--border-soft);
}
.course-card__price {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--gold);
  font-weight: 500;
}
.course-card__cta {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--ivory-muted);
}
.course-card--skel {
  height: 260px;
  background: linear-gradient(110deg, rgba(255,255,255,0.025) 30%, rgba(255,255,255,0.05) 50%, rgba(255,255,255,0.025) 70%);
  background-size: 200% 100%;
  animation: course-shimmer 1.6s linear infinite;
}
@keyframes course-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.courses-empty {
  text-align: center;
  padding: var(--sp-9, 4rem) var(--gutter);
  color: var(--ivory-muted);
}
.courses-empty h3 {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--ivory);
  margin: 0 0 12px;
}

/* ── Course detail ─────────────────────────────────────────────── */
.course-detail { background: var(--ink-void); }
.course-hero {
  padding: calc(var(--nav-h, 72px) + var(--sp-7, 2.5rem)) 0 var(--sp-8, 3rem);
  border-bottom: 1px solid var(--border-soft);
}
.course-hero__grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: var(--sp-7, 2.5rem);
  align-items: start;
}
@media (max-width: 880px) {
  .course-hero__grid { grid-template-columns: 1fr; }
}
.course-hero__copy h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 300;
  margin: 0 0 var(--sp-4, 1.25rem);
}
.course-hero__lead {
  color: var(--ivory-muted);
  line-height: 1.7;
  margin: 0 0 var(--sp-5, 1.5rem);
}
.course-hero__price {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 var(--sp-5, 1.5rem);
}
.course-hero__price-num {
  font-family: var(--font-display);
  font-size: 2.4rem;
  color: var(--gold);
}
.course-hero__price-suffix {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ivory-dim);
}
.course-hero__cover img {
  width: 100%;
  border-radius: 14px;
  display: block;
}
.course-hero__actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.course-hero__status { font-family: var(--font-mono); font-size: 11px; color: var(--ivory-muted); }

/* ── Curriculum list ───────────────────────────────────────────── */
.course-curriculum {
  padding: var(--sp-8, 3rem) 0;
}
.course-curriculum h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 300;
  margin: 0 0 var(--sp-5, 1.5rem);
}
.lesson-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  overflow: hidden;
}
.lesson-row {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-soft);
}
.lesson-row:last-child { border-bottom: 0; }
.lesson-row__num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ivory-dim);
}
.lesson-row__title { color: var(--ivory); font-weight: 500; }
.lesson-row__meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ivory-dim);
}
.lesson-row__pill {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(212,184,135,0.12);
  color: var(--gold);
  margin-right: 8px;
  font-size: 10px;
  letter-spacing: 0.06em;
}
.lesson-row.is-preview .lesson-row__title::after {
  content: '🎬';
  margin-left: 8px;
  font-size: 11px;
}

/* ── Checkout modal ────────────────────────────────────────────── */
.checkout-modal {
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  background: var(--ink-obsidian);
  color: var(--ivory);
  padding: 0;
  max-width: 420px;
  width: 90vw;
}
.checkout-modal::backdrop { background: rgba(0,0,0,0.7); }
.checkout-modal__inner { padding: 28px 26px 26px; position: relative; }
.checkout-modal__close {
  position: absolute;
  top: 12px; right: 14px;
  background: none;
  border: 0;
  color: var(--ivory-muted);
  font-size: 24px;
  cursor: pointer;
}
.checkout-modal h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  margin: 0 0 4px;
  color: var(--ivory);
}
.checkout-modal__sub {
  color: var(--ivory-muted);
  font-size: 12.5px;
  margin: 0 0 var(--sp-4, 1.25rem);
}
.checkout-modal__methods {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: var(--sp-4, 1.25rem);
}
.checkout-method {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 10px;
  row-gap: 2px;
  padding: 12px 14px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.12s;
}
.checkout-method:hover { border-color: var(--gold); }
.checkout-method input { grid-row: span 2; }
.checkout-method__title { font-weight: 500; color: var(--ivory); font-size: 13.5px; }
.checkout-method__sub   { color: var(--ivory-muted); font-size: 11.5px; }
.checkout-modal #card-fields { display: flex; flex-direction: column; gap: 8px; margin-bottom: var(--sp-4); }
.checkout-modal #card-fields input,
.checkout-modal #card-fields .checkout-row input {
  width: 100%;
  padding: 9px 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  color: var(--ivory);
  font-family: var(--font-body);
  font-size: 13px;
}
.checkout-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.checkout-modal__pay {
  width: 100%;
  margin-top: 4px;
  padding: 12px;
}
.checkout-modal__status { margin: 12px 0 0; font-size: 12px; color: var(--ivory-muted); min-height: 1em; }
.checkout-modal__status.is-error { color: #E05555; }
.checkout-modal #qr-box { margin-top: 16px; text-align: center; }
.checkout-modal #qr-box img { width: 220px; height: 220px; background: white; padding: 8px; border-radius: 8px; }

/* ── Classroom — sidebar + player ──────────────────────────────── */
.nav--classroom {
  background: rgba(11, 13, 18, 0.92);
  border-bottom: 1px solid var(--border-soft);
}
.classroom { min-height: 100vh; padding-top: var(--nav-h, 72px); background: var(--ink-void); }
.classroom-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 0;
  min-height: calc(100vh - var(--nav-h, 72px));
}
@media (max-width: 880px) { .classroom-grid { grid-template-columns: 1fr; } }
.classroom-side {
  background: rgba(255,255,255,0.02);
  border-right: 1px solid var(--border-soft);
  padding: var(--sp-5);
  overflow-y: auto;
  max-height: calc(100vh - var(--nav-h, 72px));
}
.classroom-side__h {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--ivory);
  margin: 0 0 var(--sp-4, 1.25rem);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--border-soft);
}
.classroom-lessons {
  list-style: none;
  margin: 0;
  padding: 0;
}
.cl-lesson {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s;
}
.cl-lesson:hover { background: rgba(212,184,135,0.05); }
.cl-lesson.is-active {
  background: rgba(212,184,135,0.10);
  border-left: 2px solid var(--gold);
  padding-left: 8px;
}
.cl-lesson__num { font-family: var(--font-mono); font-size: 10.5px; color: var(--ivory-dim); }
.cl-lesson__title { font-size: 13px; color: var(--ivory); line-height: 1.35; }
.cl-lesson__dur { font-family: var(--font-mono); font-size: 10.5px; color: var(--ivory-dim); }

.classroom-main {
  padding: var(--sp-5);
}
.classroom-player {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: var(--sp-4);
}
.classroom-player iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0;
}
.classroom-meta h3 {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--ivory);
  margin: 0 0 4px;
  font-size: 1.2rem;
}
.classroom-meta__progress {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ivory-dim);
  margin: 0;
}

/* ── Light mode polish ─────────────────────────────────────────── */
[data-theme="light"] .course-card { background: #FFFFFF; border-color: rgba(60, 45, 20, 0.16); }
[data-theme="light"] .course-card:hover { background: #FFFFFF; border-color: #6B501C; }
[data-theme="light"] .course-card__price { color: #6B501C; }
[data-theme="light"] .course-curriculum h2 em,
[data-theme="light"] .courses-hero h1 em,
[data-theme="light"] .course-hero__price-num { color: #6B501C; }
