/* Shared styles for courses.html + course-details.html (+ landing rail cards) */
:root {
  --gold-400: #F0C040;
  --gold-500: #D4AF37;
  --grad-primary: linear-gradient(135deg, #D4AF37 0%, #F0C040 100%);
  --gold-glow: 0 8px 28px rgba(212, 175, 55, .34);
  --ink-900: #0f0e0c;
  --s-text: #F8FAFC;
  --s-muted: #A8A29E;
  --s-muted-2: #78716C;
  --page: #0b0a08;
  --surface: #1c1812;
}

* { box-sizing: border-box; }

body.course-pages {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--s-text);
  background: linear-gradient(170deg, #111008 0%, #16130d 40%, #0f0e0a 100%);
}

.cp-wrap { max-width: 1400px; margin: 0 auto; padding: 0 20px 48px; }
@media (min-width: 768px) {
  .cp-wrap { padding-left: 40px; padding-right: 40px; }
}

/* Nav — matches index.html sticky header */
.cp-nav {
  position: sticky;
  top: 0;
  z-index: 1030;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: linear-gradient(135deg, rgba(0, 0, 0, .95) 0%, rgba(33, 33, 33, .95) 100%);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .3);
  border-bottom: 1px solid rgba(255, 193, 7, .3);
}
.cp-nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
}
@media (min-width: 768px) {
  .cp-nav-inner { padding: 12px 40px; }
}
.cp-logo {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-decoration: none;
  flex: none;
}
.cp-logo img {
  height: 50px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
  display: block;
}
.cp-navlinks {
  display: none;
  gap: 24px;
  margin-left: 22px;
  align-items: center;
}
@media (min-width: 768px) {
  .cp-navlinks { display: flex; }
}
.cp-navlinks a {
  color: var(--s-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}
.cp-navlinks a:hover,
.cp-navlinks a[aria-current="page"] { color: var(--gold-400); }
.cp-navacts {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
}
.cp-login {
  display: none;
  color: var(--s-text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}
.cp-login:hover { color: var(--gold-400); }
@media (min-width: 768px) {
  .cp-login { display: inline; }
}
.cp-pill {
  background: var(--grad-primary);
  color: var(--ink-900);
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  padding: 11px 20px;
  border-radius: 999px;
  box-shadow: var(--gold-glow);
  white-space: nowrap;
}
.cp-pill:hover {
  color: var(--ink-900);
  box-shadow: 0 10px 34px rgba(240, 192, 64, .5);
}
@media (max-width: 767px) {
  .cp-nav-inner { justify-content: center; position: relative; }
  .cp-logo { margin: 0 auto; }
  .cp-navacts {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 0;
  }
  .cp-pill { padding: 9px 14px; font-size: 13px; }
}

/* Page header */
.cp-hero {
  padding: 36px 0 8px;
  background: radial-gradient(120% 80% at 22% 0%, rgba(212, 175, 55, .12) 0%, rgba(212, 175, 55, 0) 55%);
}
.cp-crumb {
  font-size: 13px;
  color: var(--s-muted-2);
  margin-bottom: 14px;
}
.cp-crumb a { color: var(--gold-400); text-decoration: none; }
.cp-crumb a:hover { text-decoration: underline; }
.cp-hero h1 {
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 800;
  letter-spacing: -.03em;
  margin: 0 0 10px;
  line-height: 1.15;
}
.cp-hero h1 em { font-style: normal; color: var(--gold-400); }
.cp-hero p { color: var(--s-muted); margin: 0; max-width: 62ch; }

/* Search */
.cp-search {
  display: flex;
  gap: 10px;
  margin: 22px 0 8px;
  flex-wrap: wrap;
}
.cp-search input {
  flex: 1;
  min-width: 200px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 12px;
  color: var(--s-text);
  font-family: inherit;
  font-size: 15px;
  padding: 0 16px;
  min-height: 50px;
}
.cp-search input:focus {
  outline: 2px solid var(--gold-400);
  outline-offset: 1px;
}
.cp-search button {
  background: var(--grad-primary);
  color: var(--ink-900);
  border: 0;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 700;
  padding: 0 22px;
  border-radius: 12px;
  min-height: 50px;
  cursor: pointer;
  box-shadow: var(--gold-glow);
}

/* Chips */
.s-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 16px 0 22px;
}
.s-chips button {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--s-muted);
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .09);
  cursor: pointer;
  background: transparent;
  font-family: inherit;
}
.s-chips button.on {
  background: var(--grad-primary);
  color: var(--ink-900);
  border-color: transparent;
  font-weight: 700;
}
.s-chips button:disabled { opacity: .55; cursor: wait; }

.cp-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  font-size: 13.5px;
  color: var(--s-muted);
}
.cp-meta-row strong { color: var(--gold-400); }

/* Course cards (Flutter CourseCard layout) */
.s-covers {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 768px) {
  .s-covers { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1100px) {
  .s-covers { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.cov {
  text-decoration: none;
  color: var(--s-text);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .08);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .28), 0 2px 4px rgba(0, 0, 0, .18);
  transition: transform .16s, border-color .16s, box-shadow .16s;
}
.cov:hover {
  transform: translateY(-3px);
  border-color: rgba(212, 175, 55, .45);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .4), 0 0 0 1px rgba(212, 175, 55, .12);
}
.cov-art {
  display: block;
  position: relative;
  flex: none;
  background: rgba(255, 255, 255, .05);
  overflow: hidden;
  width: 100%;
}
.cov-art img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}
.cov-art .cov-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  font-size: 28px;
  opacity: .45;
}
.cov-diff {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  line-height: 1.2;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .18);
  max-width: 46%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cov-diff.beginner { background: rgba(34, 197, 94, .9); }
.cov-diff.intermediate { background: rgba(249, 115, 22, .9); }
.cov-diff.advanced { background: rgba(239, 68, 68, .9); }
.cov-diff.default { background: rgba(59, 130, 246, .9); }
.cov-body { display: flex; flex-direction: column; gap: 8px; padding: 12px; flex: 1; }
.cov-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
  color: var(--s-text);
}
.cov-rating { display: flex; align-items: center; gap: 4px; min-width: 0; }
.cov-stars {
  display: inline-flex;
  gap: 0;
  flex: none;
  color: #f59e0b;
  font-size: 13px;
  letter-spacing: -1px;
  line-height: 1;
}
.cov-stars .off { color: rgba(255, 255, 255, .22); }
.cov-score { font-size: 12px; font-weight: 600; color: var(--s-text); flex: none; }
.cov-reviews {
  font-size: 11px;
  color: var(--s-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cov-tags { display: flex; gap: 6px; margin-top: 4px; }
.cov-tag {
  flex: 1;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 6px;
  border-radius: 6px;
  font-size: 9px;
  font-weight: 600;
  line-height: 1.2;
}
.cov-tag span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cov-tag.duration {
  background: rgba(59, 130, 246, .12);
  border: 1px solid rgba(59, 130, 246, .22);
  color: #60a5fa;
}
.cov-tag.language {
  background: rgba(249, 115, 22, .12);
  border: 1px solid rgba(249, 115, 22, .22);
  color: #fb923c;
}
.cov-skel {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .06);
  background: linear-gradient(90deg, rgba(255,255,255,.04) 25%, rgba(255,255,255,.09) 50%, rgba(255,255,255,.04) 75%);
  background-size: 200% 100%;
  animation: cov-shimmer 1.2s ease-in-out infinite;
  height: 230px;
}
@keyframes cov-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.s-rail-empty, .s-rail-error {
  grid-column: 1 / -1;
  padding: 28px 16px;
  text-align: center;
  color: var(--s-muted);
  font-size: 14px;
  border: 1px dashed rgba(255, 255, 255, .12);
  border-radius: 14px;
}
.s-rail-error a { color: var(--gold-400); }

/* Infinite scroll status */
.cp-scroll-status {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  margin: 24px 0 8px;
  color: var(--s-muted);
  font-size: 13.5px;
  font-weight: 600;
}
.cp-scroll-status.is-loading { color: var(--gold-400); }
.cp-scroll-spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(212, 175, 55, .25);
  border-top-color: var(--gold-400);
  animation: cp-spin .7s linear infinite;
}
@keyframes cp-spin {
  to { transform: rotate(360deg); }
}
.cp-scroll-retry {
  margin-left: 6px;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid rgba(212, 175, 55, .45);
  background: rgba(212, 175, 55, .1);
  color: var(--gold-400);
  font: inherit;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}
.cp-scroll-retry:hover {
  background: rgba(212, 175, 55, .18);
}
.cp-scroll-sentinel {
  height: 1px;
  width: 100%;
  pointer-events: none;
}

/* Course details */
.cd-layout {
  display: grid;
  gap: 28px;
  padding: 28px 0 40px;
}
@media (min-width: 900px) {
  .cd-layout { grid-template-columns: 1.1fr .9fr; align-items: start; }
}
.cd-cover {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .08);
  background: var(--surface);
}
.cd-cover img {
  display: block;
  width: 100%;
  height: auto;
}
.cd-panel {
  background: linear-gradient(160deg, #1d1913, #16130e);
  border: 1px solid rgba(212, 175, 55, .18);
  border-radius: 18px;
  padding: 22px;
}
.cd-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: var(--gold-400);
  border: 1px solid rgba(212, 175, 55, .34);
  border-radius: 999px;
  padding: 6px 12px;
  margin-bottom: 14px;
}
.cd-panel h1 {
  font-size: clamp(24px, 3.4vw, 34px);
  font-weight: 800;
  letter-spacing: -.02em;
  margin: 0 0 8px;
  line-height: 1.15;
}
.cd-sub { color: var(--s-muted); margin: 0 0 16px; font-size: 15px; }
.cd-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}
.cd-stat {
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 10px;
  padding: 10px 12px;
  min-width: 110px;
}
.cd-stat b { display: block; color: var(--gold-400); font-size: 15px; }
.cd-stat span { font-size: 12px; color: var(--s-muted); }
.cd-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.cd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 22px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  border: 1px solid transparent;
}
.cd-btn-primary {
  background: var(--grad-primary);
  color: var(--ink-900);
  box-shadow: var(--gold-glow);
}
.cd-btn-ghost {
  background: rgba(212, 175, 55, .06);
  color: var(--gold-400);
  border-color: rgba(212, 175, 55, .55);
}
.cd-desc {
  margin-top: 28px;
  background: rgba(255, 255, 255, .03);
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 16px;
  padding: 22px;
}
.cd-desc h2 {
  font-size: 20px;
  font-weight: 800;
  margin: 0 0 14px;
}
.cd-desc-body {
  color: #EDEAE4;
  font-size: 14.5px;
  line-height: 1.7;
}
.cd-desc-body h2,
.cd-desc-body h3 {
  color: var(--gold-400);
  margin-top: 1.4em;
}
.cd-desc-body p { margin: 0 0 1em; }
.cd-desc-body a { color: var(--gold-400); }
.cd-loading, .cd-error {
  padding: 48px 16px;
  text-align: center;
  color: var(--s-muted);
}

/* Footer */
.cp-foot {
  margin-top: 56px;
  padding: 48px 0 0;
  border-top: 1px solid rgba(255, 255, 255, .08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .02) 0%, transparent 40%),
    #100e0b;
  color: var(--s-muted);
  font-size: 14px;
}
.cp-foot a { color: var(--s-muted); text-decoration: none; transition: color .2s ease; }
.cp-foot a:hover { color: var(--gold-400); }
.cp-foot-grid {
  display: grid;
  gap: 36px;
  padding-bottom: 36px;
}
@media (min-width: 720px) {
  .cp-foot-grid { grid-template-columns: 1.4fr 1fr; gap: 32px; }
}
@media (min-width: 1000px) {
  .cp-foot-grid { grid-template-columns: 1.5fr .85fr .95fr 1.15fr; }
}
.cp-foot-brand {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--gold-400);
  letter-spacing: -.02em;
  margin: 0 0 6px;
}
.cp-foot-brand a { color: inherit; }
.cp-foot-brand a:hover { color: var(--gold-300, #F0C040); }
.cp-foot-product {
  margin: 0 0 12px;
  font-size: 12.5px;
  font-style: italic;
  color: var(--s-muted-2);
}
.cp-foot-blurb {
  margin: 0 0 18px;
  line-height: 1.65;
  max-width: 36ch;
  color: var(--s-muted);
}
.cp-foot-company {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(212, 175, 55, .06);
  border-left: 3px solid var(--gold-400);
  margin-bottom: 20px;
}
.cp-foot-company strong {
  display: block;
  color: var(--s-text);
  font-size: 13.5px;
  margin-bottom: 4px;
}
.cp-foot-company a { color: var(--gold-400); font-size: 13px; }
.cp-foot h6 {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--s-text);
}
.cp-foot-social {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.cp-foot-social a {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .04);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--s-muted);
}
.cp-foot-social a:hover {
  border-color: rgba(212, 175, 55, .55);
  color: var(--gold-400);
  transform: translateY(-2px);
  background: rgba(212, 175, 55, .1);
}
.cp-foot-social svg { width: 15px; height: 15px; fill: currentColor; }
.cp-foot-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.cp-foot-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--s-muted);
}
.cp-foot-links a::before {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(212, 175, 55, .55);
  flex: none;
}
.cp-foot-links a:hover { color: var(--gold-400); padding-left: 2px; }
.cp-foot-stores {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 22px;
}
.cp-foot-store {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: linear-gradient(135deg, #1a1712 0%, #242018 100%);
  border: 1px solid rgba(255, 255, 255, .08);
  color: var(--s-text) !important;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.cp-foot-store:hover {
  transform: translateY(-2px);
  border-color: rgba(212, 175, 55, .4);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
  color: var(--s-text) !important;
}
.cp-foot-store svg { width: 22px; height: 22px; flex: none; fill: currentColor; }
.cp-foot-store small {
  display: block;
  font-size: 10px;
  color: var(--s-muted-2);
  letter-spacing: .04em;
  line-height: 1.2;
}
.cp-foot-store b {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--s-text);
}
.cp-foot-contact {
  display: grid;
  gap: 10px;
  font-size: 13.5px;
}
.cp-foot-contact a { color: var(--gold-400); }
.cp-foot-contact span { color: var(--s-muted-2); font-size: 12px; display: block; margin-top: 2px; }
.cp-foot-bottom {
  border-top: 1px solid rgba(255, 255, 255, .07);
  padding: 18px 0 28px;
}
.cp-foot-bottom-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}
.cp-foot-bottom p {
  margin: 0;
  font-size: 12.5px;
  color: var(--s-muted-2);
  line-height: 1.5;
}
.cp-foot-bottom strong { color: var(--s-muted); }
.cp-foot-bottom .brand { color: var(--gold-400); }
.cp-foot-legal {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
}
.cp-foot-legal span { color: rgba(255, 255, 255, .2); }
