/* Shared styles for ArchRails Academy lesson pages.
   Mounted by each lesson's index.html after dashboard.css so design
   tokens (--bg, --text, --r-md, etc.) are already defined. */

.ls-wrap { max-width: 760px; margin: 0 auto; padding: 48px 32px 96px; }

/* Meta strip above the title — "Lesson N of 6 · 8 min · Foundations". */
.ls-meta {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text-3); margin-bottom: 14px;
}
.ls-meta-chip {
  background: rgba(99,102,241,0.14); color: #818cf8;
  padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.04em;
}
.ls-meta-dot { opacity: 0.5; }

.ls-title {
  font-family: var(--font-disp);
  font-size: 36px; font-weight: 600; line-height: 1.2;
  margin: 0 0 16px; color: var(--text);
}
.ls-lead {
  font-size: 16px; line-height: 1.65; color: var(--text-2);
  margin: 0 0 36px;
}

/* Sticky-ish table of contents block at the top of each lesson. */
.ls-toc {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 18px 22px; margin: 0 0 40px;
}
.ls-toc-lbl {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.13em; color: var(--text-3); margin-bottom: 10px;
}
.ls-toc-list {
  margin: 0; padding-left: 20px;
  font-size: 13.5px; line-height: 1.85; color: var(--text-2);
}
.ls-toc-list a {
  color: var(--text-2); text-decoration: none;
  border-bottom: 1px dotted transparent;
}
.ls-toc-list a:hover { color: #93c5fd; border-bottom-color: rgba(147,197,253,0.4); }

/* Body typography. */
.ls-wrap h2.ls-h2 {
  font-family: var(--font-disp);
  font-size: 22px; font-weight: 600;
  color: var(--text);
  margin: 44px 0 14px;
  scroll-margin-top: 80px; /* leave room under the fixed header on jumps */
}
.ls-wrap p, .ls-wrap li {
  font-size: 14.5px; line-height: 1.7; color: var(--text);
}
.ls-wrap p { margin: 0 0 16px; }
.ls-ul { margin: 0 0 18px; padding-left: 22px; }
.ls-ul li { margin-bottom: 8px; }
.ls-ul li::marker { color: var(--text-3); }

.ls-wrap a {
  color: #93c5fd; text-decoration: none;
  border-bottom: 1px dotted rgba(147,197,253,0.4);
}
.ls-wrap a:hover { color: #bfdbfe; }

/* Inline code — used freely throughout lesson prose. */
.ls-wrap code {
  font-family: var(--font-mono);
  font-size: 12.5px; color: #93c5fd;
  background: rgba(0,0,0,0.35);
  padding: 1px 6px; border-radius: 4px;
}

/* The orange placeholder tag we render inside REVIEW REQUIRED prose. */
.ls-tag-warn {
  color: #fbbf24 !important;
  background: rgba(251,191,36,0.10) !important;
  border: 1px solid rgba(251,191,36,0.25);
  padding: 1px 7px; border-radius: 4px;
  font-size: 11.5px; font-weight: 600;
  letter-spacing: 0.02em;
}

/* Code blocks with a copy button. */
.ls-code {
  position: relative;
  background: #0a0a0f; border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 14px 16px;
  margin: 12px 0 22px;
}
.ls-code pre {
  margin: 0; font-family: var(--font-mono);
  font-size: 12.5px; line-height: 1.65; color: #d1d5db;
  white-space: pre-wrap; word-break: break-word;
  padding-right: 64px;
}
.ls-code .ls-copy {
  position: absolute; top: 8px; right: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--text-2);
  padding: 3px 10px; border-radius: 6px;
  font-size: 11px; font-family: var(--font);
  cursor: pointer; transition: var(--ease, 120ms);
}
.ls-code .ls-copy:hover { color: var(--text); background: rgba(255,255,255,0.08); }

/* Inline syntax highlighting we paint by hand inside <pre>. Keep it
   minimal — full Prism/Highlight.js is overkill for the small amount
   of code we render here. */
.ls-code .hl-key { color: #c4b5fd; }
.ls-code .hl-val { color: #fcd34d; }
.ls-code .hl-warn { color: #fbbf24; background: rgba(251,191,36,0.08); padding: 0 4px; border-radius: 3px; }
.ls-code .hl-comment { color: var(--text-3); font-style: italic; }
.ls-code .hl-str { color: #86efac; }

/* Callouts — info (blue), ok (green), warn (amber). */
.ls-callout {
  border-radius: var(--r-md); padding: 14px 18px;
  margin: 20px 0 28px;
  font-size: 13.5px; line-height: 1.6;
}
.ls-callout strong { font-weight: 600; }
.ls-callout-info {
  background: rgba(14,165,233,0.06);
  border: 1px solid rgba(14,165,233,0.25);
  color: #bae6fd;
}
.ls-callout-ok {
  background: rgba(34,197,94,0.07);
  border: 1px solid rgba(34,197,94,0.3);
  color: #bbf7d0;
}
.ls-callout-warn {
  background: rgba(251,191,36,0.07);
  border: 1px solid rgba(251,191,36,0.3);
  color: #fde68a;
}

/* Native <details> styled to match. */
.ls-faq details {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 14px 18px;
  margin-bottom: 10px;
}
.ls-faq details[open] { background: rgba(255,255,255,0.02); }
.ls-faq summary {
  cursor: pointer; list-style: none;
  font-size: 14px; font-weight: 500; color: var(--text);
  display: flex; align-items: center; gap: 10px;
}
.ls-faq summary::-webkit-details-marker { display: none; }
.ls-faq summary::before {
  content: '+'; color: var(--text-3); font-size: 18px; line-height: 1;
  width: 14px; transition: transform 150ms ease;
}
.ls-faq details[open] summary::before { content: '\2212'; }
.ls-faq details > p,
.ls-faq details > ul { margin-top: 12px; }

/* Prev / next strip at the bottom of every lesson. */
.ls-nav {
  display: flex; justify-content: space-between; gap: 16px;
  margin-top: 60px; padding-top: 24px;
  border-top: 1px solid var(--border);
}
.ls-nav a {
  font-size: 13px; color: var(--text-2);
  text-decoration: none; border-bottom: none;
  padding: 10px 16px; border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: var(--ease, 120ms);
}
.ls-nav a:hover { color: var(--text); border-color: var(--border-hi); }
.ls-nav-next { margin-left: auto; }

/* Scaffold "Coming soon" block used by lessons 2-6 in their placeholder state. */
.ls-scaffold {
  background: var(--bg-card); border: 1px dashed var(--border-hi);
  border-radius: var(--r-md); padding: 32px;
  text-align: center; color: var(--text-2);
  margin: 28px 0;
}
.ls-scaffold-icon {
  font-size: 28px; margin-bottom: 10px;
  filter: grayscale(40%);
}
.ls-scaffold h3 { font-size: 16px; color: var(--text); margin: 0 0 8px; }
.ls-scaffold p { font-size: 13.5px; margin: 0; }
.ls-scaffold-list {
  text-align: left; max-width: 480px; margin: 18px auto 0;
  font-size: 13px; line-height: 1.85; color: var(--text-2);
}
.ls-scaffold-list li { padding-left: 4px; }


/* ── Control-template catalog ──────────────────────────────────────────── */

.ls-catalog {
  list-style: none;
  padding: 0;
  margin: 1rem 0 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.ls-catalog-card {
  border: 1px solid var(--border-subtle, #2a2c30);
  border-radius: 10px;
  background: var(--surface-2, #16181b);
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.ls-catalog-card:hover {
  border-color: var(--accent, #ff7a59);
  transform: translateY(-1px);
}

.ls-catalog-link {
  display: block;
  padding: 1rem 1.2rem 1.1rem;
  color: inherit;
  text-decoration: none;
}

.ls-catalog-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

.ls-catalog-name {
  font-weight: 600;
  font-size: 1.02rem;
}

.ls-catalog-summary {
  margin: 0 0 0.6rem;
  color: var(--text-muted, #aab0b6);
  line-height: 1.4;
  font-size: 0.93rem;
}

.ls-catalog-version {
  font-size: 0.78rem;
  color: var(--text-muted, #8b9097);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 4px;
  padding: 1px 6px;
}

/* Catalog-doc reuses base lesson styles but wraps the rendered markdown
   so we can tweak vertical rhythm without colliding with .ls-h2 etc. */
.ls-catalog-doc h1 { display: none; }   /* page title already in breadcrumb */
.ls-catalog-doc h2 {
  font-family: var(--font-display, "Playfair Display", serif);
  font-size: 1.55rem;
  margin: 2rem 0 0.6rem;
  letter-spacing: -0.01em;
}
.ls-catalog-doc h3 {
  font-size: 1.18rem;
  margin: 1.3rem 0 0.5rem;
}
.ls-catalog-doc pre {
  background: #0d0f12;
  border: 1px solid #20242a;
  border-radius: 8px;
  padding: 0.85rem 1rem;
  overflow-x: auto;
  font-size: 0.84rem;
  line-height: 1.45;
}
.ls-catalog-doc code {
  font-size: 0.88em;
}
.ls-catalog-doc blockquote {
  border-left: 3px solid #ff7a59;
  padding: 0.4rem 0.95rem;
  margin: 1rem 0;
  color: var(--text-muted, #aab0b6);
  background: rgba(255, 122, 89, 0.04);
  border-radius: 4px;
}
.ls-catalog-doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.9rem;
}
.ls-catalog-doc th,
.ls-catalog-doc td {
  border-bottom: 1px solid #20242a;
  padding: 0.5rem 0.75rem;
  text-align: left;
  vertical-align: top;
}
.ls-catalog-doc th {
  font-weight: 600;
  color: var(--text-muted, #aab0b6);
}

/* ── Ordered lists in lesson prose (numbered how-to steps) ─────────────── */
.ls-ol {
  margin: 0 0 20px;
  padding-left: 24px;
  counter-reset: ls-step;
  list-style: none;
}
.ls-ol > li {
  position: relative;
  margin-bottom: 14px;
  padding-left: 8px;
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--text);
}
.ls-ol > li::before {
  counter-increment: ls-step;
  content: counter(ls-step) ".";
  position: absolute;
  left: -24px;
  width: 22px;
  text-align: right;
  color: var(--text-3);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ── Lesson prose tables ───────────────────────────────────────────────── */
.ls-table-wrap {
  /* Horizontal scroll on narrow viewports — keeps table readable on phones
     without breaking layout. */
  overflow-x: auto;
  margin: 14px 0 22px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--bg-card);
}
.ls-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.ls-table th,
.ls-table td {
  text-align: left;
  vertical-align: top;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  line-height: 1.55;
  color: var(--text);
}
.ls-table thead th {
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-3);
  background: rgba(255,255,255,0.02);
}
.ls-table tbody tr:last-child td { border-bottom: none; }

/* ── Mobile ───────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .ls-wrap {
    padding: 28px 18px 64px;
  }
  .ls-title { font-size: 28px; }
  .ls-lead { font-size: 15px; }
  .ls-catalog {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  .ls-catalog-link { padding: 0.9rem 1rem 1rem; }
  .ls-callout { padding: 12px 14px; font-size: 13px; }
  .ls-table th, .ls-table td { padding: 8px 10px; font-size: 13px; }
}
