/* courses.css — course cards, category filters, course detail pages */

/* ── COURSES SECTION BACKGROUND ── */
.courses-bg {
  background: var(--light);
}

/* ── CATEGORY FILTER BUTTONS ── */
.course-categories {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}

.cat-btn {
  padding: 8px 18px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: white;
  color: var(--slate);
  transition: all 0.2s;
}

.cat-btn:hover,
.cat-btn.active {
  background: var(--navy);
  color: white;
  border-color: var(--navy);
}

/* ── COURSE GRID ── */
.courses-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* ── COURSE CARD ── */
.course-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
}

.course-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}

.course-card-banner {
  height: 8px;
  background: var(--teal);
  border-radius: 7px 7px 0 0;
}

.course-card-banner.orange {
  background: #e8821a;
}

.course-card-banner.slate {
  background: #5a6a8a;
}

.course-card-banner.green {
  background: #2d8a4e;
}

.course-card-banner.purple {
  background: #805ad5;
}

.course-card-banner.indigo {
  background: #4c51bf;
}

.course-card-banner.rose {
  background: #e53e3e;
}

.course-card-banner.dark {
  background: #111827;
  height: 6px;
}

.course-card-body {
  padding: 24px;
  flex: 1;
}

.course-cat-tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 10px;
}

.course-cat-tag.orange {
  color: #c96b0a;
}

.course-cat-tag.slate {
  color: #4a5568;
}

.course-cat-tag.green {
  color: #22703d;
}

.course-cat-tag.purple {
  color: #805ad5;
}

.course-cat-tag.indigo {
  color: #4c51bf;
}

.course-cat-tag.rose {
  color: #c53030;
}

.course-card h3 {
  font-size: 17px;
  color: var(--navy);
  margin-bottom: 10px;
  line-height: 1.25;
}

.course-card p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 18px;
}

.course-meta {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.course-meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--slate);
  font-weight: 500;
}

/* ── COURSE CARD FOOTER — TWO-TIER PRICING ── */
.course-card-footer {
  padding: 14px 20px 16px;
  border-top: 1px solid var(--border);
  background: var(--light);
  border-radius: 0 0 7px 7px;
}

/* Row 1: per-person open price + savings badge */
.course-pp-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}

.course-pp-price {
  font-family: 'Syne', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
}

.course-pp-price small {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
  display: block;
  margin-top: 3px;
}

/* ── SAVING BADGE & TOOLTIP ── */
.course-saving-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #22703d;
  background: rgba(45, 138, 78, 0.1);
  border: 1px solid rgba(45, 138, 78, 0.2);
  padding: 3px 7px;
  border-radius: 100px;
  white-space: nowrap;
  align-self: center;
  position: relative;
  cursor: help;
}

/* Tooltip container */
.course-saving-badge::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  right: -10px;
  left: auto;
  transform: none;
  width: 220px;
  background: var(--navy);
  color: white;
  text-align: center;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  line-height: 1.5;
  white-space: normal;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
  z-index: 10;
  box-shadow: var(--shadow-lg);
  pointer-events: none;
}

/* Tooltip arrow */
.course-saving-badge::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: var(--navy) transparent transparent transparent;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
  z-index: 10;
  pointer-events: none;
}

/* Show tooltip on hover */
.course-saving-badge:hover::after,
.course-saving-badge:hover::before {
  opacity: 1;
  visibility: visible;
}

/* Divider between tiers */
.course-tier-divider {
  border: none;
  border-top: 1px dashed var(--border);
  margin: 10px 0;
}

/* ── COURSE CARD BUTTON (SINGLE LINE) ── */
.course-group-cta {
  display: block;
  background: var(--accent);
  color: var(--navy);
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 13px;
  text-align: center;
  padding: 12px 14px;
  border-radius: var(--radius);
  transition: background 0.2s;
  line-height: 1.3;
}

.course-group-cta:hover {
  background: #e8971a;
}

/* ── GROUP-ONLY CARD (no pp price row) ── */
.course-group-only .course-pp-row,
.course-group-only .course-tier-divider {
  display: none;
}

/* ── LEGACY single-row .course-price (index.html preview cards) ── */
.course-price {
  font-family: 'Syne', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
}

.course-price small {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
  display: block;
  margin-top: 1px;
}

.course-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--teal);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── WEALTHY HOUSEHOLD CARD (premium footer) ── */
.course-card-footer.wh-premium {
  background: #111827;
  border-top: none;
  padding: 16px 20px;
  border-radius: 0 0 7px 7px;
}

.wh-premium-price {
  font-family: 'Syne', sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: white;
  margin-bottom: 2px;
}

.wh-premium-note {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 10px;
}

.course-wh-cta {
  display: block;
  background: transparent;
  color: rgba(180, 160, 120, 0.85);
  border: 1px solid rgba(180, 160, 120, 0.35);
  font-family: 'Syne', sans-serif;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  text-align: center;
  padding: 9px 14px;
  border-radius: 4px;
  transition: all 0.2s;
}

.course-wh-cta:hover {
  background: rgba(180, 160, 120, 0.08);
  border-color: rgba(180, 160, 120, 0.6);
}

/* ── COURSE DETAIL HERO ── */
.course-hero {
  background: var(--navy);
  padding: 60px 5vw;
}

.course-hero-inner {
  max-width: 1160px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px;
  align-items: start;
}

.course-hero-breadcrumb {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.course-hero-breadcrumb a {
  cursor: pointer;
  color: rgba(255, 255, 255, 0.7);
  transition: color 0.2s;
}

.course-hero-breadcrumb a:hover {
  color: var(--teal-light);
}

.course-hero h1 {
  font-size: clamp(28px, 4vw, 44px);
  color: white;
  margin-bottom: 14px;
}

.course-hero-sub {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.65);
  font-weight: 300;
  margin-bottom: 24px;
  line-height: 1.6;
}

.course-hero-tags {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.course-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.8);
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
}

.course-quote-box {
  background: var(--teal);
  border-radius: 10px;
  padding: 28px 32px;
  text-align: center;
  min-width: 220px;
}

.course-quote-box .price-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.course-quote-box .price {
  font-family: 'Syne', sans-serif;
  font-size: 36px;
  font-weight: 800;
  color: white;
  margin-bottom: 4px;
}

.course-quote-box .price-note {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 20px;
}

.course-quote-box .price-divider {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  margin: 20px 0;
}

.course-quote-box .group-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 12px;
}

.course-quote-box .btn-quote {
  display: block;
  background: var(--accent);
  color: var(--navy);
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 14px;
  padding: 12px 16px;
  border-radius: var(--radius);
  transition: background 0.2s;
  line-height: 1.3;
  text-align: center;
}

.course-quote-box .btn-quote:hover {
  background: #e8971a;
}

.course-quote-box .btn-quote span {
  display: block;
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  font-size: 11px;
  opacity: 0.75;
  margin-top: 3px;
}

/* ── GROUP-ONLY QUOTE BOX (no open pp price) ── */
.course-quote-box.group-only .open-price-block {
  display: none;
}

.course-quote-box.group-only .price-divider {
  display: none;
}

/* ── COURSE DETAIL CONTENT ── */
.course-content {
  padding: 48px 5vw;
  max-width: 1160px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 52px;
  align-items: start;
}

.course-section {
  margin-bottom: 24px;
  padding: 0; /* override the global section padding in base.css */
}

.course-section h2 {
  font-size: 22px;
  color: var(--navy);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}

.course-section p {
  color: var(--slate);
  line-height: 1.75;
  margin-bottom: 12px;
  font-size: 15px;
}

.learning-outcomes {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.learning-outcomes li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--slate);
  line-height: 1.5;
}

.learning-outcomes li::before {
  content: '✓';
  color: var(--teal);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── COURSE SIDEBAR ── */
/* The whole aside is sticky — making each card sticky made them overlap while scrolling */
.course-aside {
  position: sticky;
  top: 90px;
}

.side-card {
  background: var(--light);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 20px;
}

.side-card--cta {
  background: var(--navy);
  border-color: var(--navy);
}

.side-card.side-card--cta h3 {
  color: white;
  margin-bottom: 12px;
}

.side-card--cta p {
  color: rgba(255, 255, 255, 0.75);
  font-size: 14px;
  margin-bottom: 20px;
}

.side-card--cta .btn {
  display: block;
  width: 100%;
  text-align: center;
}

.side-detail-row .value-note {
  display: block;
  font-size: 11px;
  color: var(--muted);
  font-weight: normal;
  margin-top: 2px;
}

.course-back-link {
  margin-top: 24px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
  text-decoration: underline;
  display: inline-block;
}

.course-error {
  text-align: center;
  padding: 120px 5vw;
  min-height: 60vh;
}

.course-error p {
  color: var(--muted);
  margin-bottom: 24px;
}

/* ── COURSES PAGE: LOADING SKELETON & MESSAGES ── */
.card-skeleton {
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card-skel-banner {
  height: 8px;
  background: #e2e8f0;
}

.card-skel-body {
  padding: 24px;
  flex: 1;
}

.card-skel-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  background: var(--light);
}

.skel-line {
  background: linear-gradient(90deg, #e2e8f0 25%, #edf2f7 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 4px;
  margin-bottom: 10px;
}

.skel-line.w30 { width: 30%; height: 10px; }
.skel-line.w70 { width: 70%; height: 16px; }
.skel-line.w90 { width: 90%; height: 12px; }
.skel-line.w50 { width: 50%; height: 12px; }
.skel-line.w40 { width: 40%; height: 28px; }
.skel-line.w60 { width: 60%; height: 32px; }

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.load-error {
  grid-column: 1/-1;
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
  font-size: 14px;
}

.load-error strong {
  display: block;
  color: var(--navy);
  font-size: 16px;
  margin-bottom: 8px;
}

.load-error a {
  color: var(--teal);
  text-decoration: underline;
}

.side-card h3 {
  font-size: 16px;
  color: var(--navy);
  margin-bottom: 16px;
}

/* UPDATED spacing and alignment for sidebar text */
.side-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.side-detail-row:last-child {
  border-bottom: none;
}

.side-detail-row .label {
  color: var(--muted);
  flex-shrink: 0;
  padding-right: 16px;
}

.side-detail-row .value {
  font-weight: 600;
  color: var(--navy);
  text-align: right;
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .courses-grid {
    grid-template-columns: 1fr 1fr;
  }

  .course-content {
    grid-template-columns: 1fr;
  }

  .course-aside {
    position: static;
  }

  .course-hero-inner {
    grid-template-columns: 1fr;
  }

  .course-quote-box {
    min-width: unset;
  }

  .learning-outcomes {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .courses-grid {
    grid-template-columns: 1fr;
  }
}