/* ============================================================
   Course Curriculum Delight Pass — F1 (RAM-533)
   Editorial enhancements that make the three REI curriculum
   pages (REI 101, Canada REI, USA REI) feel premium without
   touching the existing license-gate / progress-dashboard /
   gamification flow. CSS only (the JS enhancer is shared with
   chapter-delight.js — already deferred and reduced-motion safe).
   ============================================================ */

/* ---- 1. Course header rhythm ---- */

.course-header {
  position: relative;
  isolation: isolate;
}
.course-header::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(232,160,32,0.45), transparent);
  pointer-events: none;
}

/* Animate the course meta numbers */
.course-meta-item strong {
  font-family: 'Outfit', system-ui, sans-serif;
  font-weight: 900;
  letter-spacing: -0.025em;
  font-size: clamp(20px, 1.8vw, 26px);
  color: rgba(255, 255, 255, 0.95);
  display: inline-block;
  margin-right: 4px;
}
.course-meta-item {
  position: relative;
  padding-left: 14px;
}
.course-meta-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 22px;
  background: var(--primary, #E8A020);
  border-radius: 2px;
}

/* ---- 2. Modules grid — staggered reveal + editorial card ---- */

@media (prefers-reduced-motion: no-preference) {
  .modules-grid > .module-card {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity .7s ease, transform .7s ease;
    transition-delay: var(--reveal-delay, 0ms);
  }
  .modules-grid > .module-card.is-visible {
    opacity: 1;
    transform: translateY(0);
  }
}
.modules-grid > .module-card:nth-child(1)  { --reveal-delay: 0ms; }
.modules-grid > .module-card:nth-child(2)  { --reveal-delay: 60ms; }
.modules-grid > .module-card:nth-child(3)  { --reveal-delay: 120ms; }
.modules-grid > .module-card:nth-child(4)  { --reveal-delay: 180ms; }
.modules-grid > .module-card:nth-child(5)  { --reveal-delay: 240ms; }
.modules-grid > .module-card:nth-child(6)  { --reveal-delay: 300ms; }
.modules-grid > .module-card:nth-child(7)  { --reveal-delay: 360ms; }
.modules-grid > .module-card:nth-child(8)  { --reveal-delay: 420ms; }
.modules-grid > .module-card:nth-child(9)  { --reveal-delay: 480ms; }
.modules-grid > .module-card:nth-child(10) { --reveal-delay: 540ms; }
.modules-grid > .module-card:nth-child(11) { --reveal-delay: 600ms; }
.modules-grid > .module-card:nth-child(12) { --reveal-delay: 660ms; }

/* Module card — refined editorial hover */
.module-card {
  position: relative;
  overflow: hidden;
}
.module-card::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 0;
  background: var(--primary, #E8A020);
  transition: width .35s ease;
}
@media (hover: hover) {
  .module-card:hover::after { width: 100%; }
}

/* Editorial mc-num badge — editorial display numeral */
.mc-num {
  font-family: 'Outfit', system-ui, sans-serif !important;
  font-weight: 800 !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase;
}

/* For image-card variants (REI 101, Canada): refine the badge */
.mc-img-wrap .mc-num {
  background: rgba(15, 15, 15, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 6px 12px;
  font-size: 11px;
  letter-spacing: 0.16em !important;
  border: 1px solid rgba(232, 160, 32, 0.28);
}
@media (hover: hover) {
  .module-card:hover .mc-img-wrap .mc-num {
    background: rgba(232, 160, 32, 0.95);
    color: #1A1208;
    border-color: rgba(255, 255, 255, 0.5);
  }
  .mc-img-wrap img {
    transition: transform .5s ease;
  }
  .module-card:hover .mc-img-wrap img {
    transform: scale(1.06);
  }
}

/* For text-card variants (USA): mc-top top row */
.mc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px dashed rgba(26, 18, 8, 0.12);
}
.mc-top .mc-num {
  color: var(--primary, #E8A020);
  font-size: 12px;
  letter-spacing: 0.2em !important;
}
.mc-top .mc-time {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(26, 18, 8, 0.55);
}
[data-theme="dark"] .mc-top {
  border-bottom-color: rgba(255, 255, 255, 0.12);
}
[data-theme="dark"] .mc-top .mc-time {
  color: rgba(255, 255, 255, 0.55);
}

/* Module card heading — editorial leading + balance */
.module-card h3 {
  text-wrap: balance;
  letter-spacing: -0.012em;
}

/* Arrow — animated underline + slide */
.mc-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: gap .25s ease;
}
@media (hover: hover) {
  .module-card:hover .mc-arrow { gap: 10px; }
}

/* ---- 3. Modules section title — editorial eyebrow ---- */

.modules-section > h2 {
  position: relative;
  padding-top: 18px;
}
.modules-section > h2::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 56px;
  height: 3px;
  background: var(--primary, #E8A020);
}

/* ---- 4. Welcome card (USA course) — editorial polish ---- */

.welcome-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-top: 24px;
}
.wf-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-left: 14px;
  border-left: 3px solid var(--primary, #E8A020);
}
.wf-item strong {
  font-family: 'Outfit', system-ui, sans-serif;
  font-weight: 900;
  letter-spacing: -0.025em;
  font-size: clamp(16px, 1.5vw, 19px);
  color: var(--text-h, #1A1208);
}
.wf-item span {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-b, rgba(26,18,8,0.65));
}
[data-theme="dark"] .wf-item strong { color: rgba(255, 255, 255, 0.95); }
[data-theme="dark"] .wf-item span { color: rgba(255, 255, 255, 0.65); }

/* ---- 5. Progress section — editorial divider ---- */

.progress-section {
  position: relative;
}
.progress-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 56px;
  height: 3px;
  background: var(--primary, #E8A020);
  margin-top: -1.5px;
}
.progress-section h2 {
  position: relative;
  padding-top: 18px;
  text-align: center;
}

/* ---- 6. Back-link refinement ---- */

.back-link {
  position: relative;
  transition: color .2s ease;
}
.back-link::before {
  display: inline-block;
  transition: transform .25s ease;
}
@media (hover: hover) {
  .back-link:hover::before {
    transform: translateX(-3px);
  }
}
