/* The case lesson (2026-10-08): the trainee's reading page and the downloadable file share this
   sheet, so the two look alike. Everything sits under .lx-lesson and carries its own tokens — the
   file has no other stylesheet. Answers fold with <details>, the contents are anchors; the only
   script is the print button's one line. */

.lx-lesson {
  --lx-paper: #FFFDF5;
  --lx-canvas: #F7ECDA;
  --lx-card: #FCF3E1;
  --lx-line: #E6D5B8;
  --lx-ink: #14181E;
  --lx-ink-2: #3A4150;
  --lx-ink-3: #6B7180;
  --lx-indigo: #1A2150;
  --lx-indigo-2: #283068;
  --lx-indigo-soft: #EEF0F8;
  --lx-copper: #AC4A0F;
  --lx-copper-2: #C96312;
  --lx-copper-soft: #FAE9C9;
  --lx-saffron: #E2A32C;
  --lx-olive: #4F6318;
  --lx-olive-soft: #E9EDD4;
  --lx-red: #9B2C1F;
  --lx-red-soft: #F8E1DA;
  --lx-amber: #7C520B;
  --lx-amber-soft: #F7E4BA;
  --lx-blue: #1F4E79;
  --lx-blue-soft: #E2ECF6;
  --lx-radius: 18px;
  /* How far below the window's top the contents stay put and a jumped-to section lands: the file
     has nothing above it, the site's pages have their own sticky header. */
  --lx-stick: 18px;

  direction: rtl;
  font-family: "Vazirmatn", Tahoma, sans-serif;
  color: var(--lx-ink);
  line-height: 2.05;
  font-size: 16px;
  max-width: 1180px;
  margin: 0 auto;
}
.lx-lesson *, .lx-lesson *::before, .lx-lesson *::after { box-sizing: border-box; }
/* A lesson's text cannot be selected or copied (owner, 2026-10-13) — a deterrent, not a lock. */
.lx-lesson { -webkit-user-select: none; user-select: none; }
/* On the site's pages the global heading rules (their colour, tight tracking, balanced wrapping)
   would reach in; the lesson's headings take their own. Tracking stays normal for Persian. */
.lx-lesson h1, .lx-lesson h2, .lx-lesson h3 { font-family: inherit; letter-spacing: normal; text-wrap: wrap; color: inherit; }

/* ---------------------------------------------------------------- hero */
.lx-hero {
  position: relative; overflow: hidden;
  background: radial-gradient(120% 140% at 100% 0%, var(--lx-indigo-2) 0%, var(--lx-indigo) 48%, #0E1430 100%);
  color: #F7ECDA; border-radius: 26px; padding: 34px 36px 30px;
  box-shadow: 0 18px 40px -22px rgba(14, 20, 48, .6);
}
.lx-hero::after {
  content: ""; position: absolute; inset: auto -60px -90px auto; width: 260px; height: 260px;
  border-radius: 50%; background: radial-gradient(circle, rgba(226, 163, 44, .35), rgba(226, 163, 44, 0) 70%);
}
.lx-hero-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; position: relative; z-index: 1; }
.lx-pill {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600;
  padding: 3px 12px; border-radius: 999px; background: rgba(247, 236, 218, .12); color: #F7ECDA;
  border: 1px solid rgba(247, 236, 218, .22);
}
.lx-pill--gold { background: var(--lx-saffron); color: #2A1A02; border-color: transparent; }
.lx-brand { margin-inline-start: auto; font-weight: 700; letter-spacing: .02em; opacity: .9; }
.lx-brand i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--lx-saffron); margin-inline-start: 5px; vertical-align: middle; }
.lx-kicker { margin: 22px 0 2px; font-size: 14px; color: #EBC27A; font-weight: 600; position: relative; z-index: 1; }
.lx-title { margin: 0; font-size: 30px; line-height: 1.6; font-weight: 800; position: relative; z-index: 1; }
.lx-sub { margin: 6px 0 0; color: #BFC2CB; font-size: 14.5px; position: relative; z-index: 1; }
.lx-mentor {
  position: relative; z-index: 1; display: flex; gap: 14px; align-items: flex-start;
  margin-top: 22px; padding: 14px 16px; border-radius: 16px;
  background: rgba(247, 236, 218, .08); border: 1px solid rgba(247, 236, 218, .16);
}
.lx-mentor svg { flex: 0 0 auto; width: 40px; height: 40px; }
.lx-mentor b { display: block; font-size: 15px; color: #fff; }
.lx-mentor span { display: block; font-size: 13.5px; line-height: 1.95; color: #D9DCE4; }

/* ---------------------------------------------------------------- stats & legend */
.lx-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 18px 0 0; }
.lx-stat {
  background: var(--lx-paper); border: 1px solid var(--lx-line); border-radius: 16px; padding: 12px 14px;
  display: flex; flex-direction: column;
}
.lx-stat b { font-size: 24px; line-height: 1.4; color: var(--lx-indigo); font-weight: 800; }
.lx-stat span { font-size: 13px; color: var(--lx-ink-3); }
.lx-legend {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 14px 0 0;
  font-size: 13px; color: var(--lx-ink-2);
}
.lx-legend b { font-weight: 700; color: var(--lx-ink); }

/* ---------------------------------------------------------------- layout */
/* minmax(0, …): the contents row scrolls sideways on a phone, and a plain 1fr would take its full
   unwrapped width as the column's minimum and push the whole lesson off the screen. */
.lx-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; margin-top: 22px; align-items: start; }
.lx-layout > * { min-width: 0; }
@media (min-width: 1040px) {
  .lx-layout { grid-template-columns: 250px minmax(0, 1fr); }
  .lx-toc { position: sticky; top: var(--lx-stick); max-height: calc(100vh - var(--lx-stick) - 18px); overflow-y: auto; }
}
.lx-toc {
  background: var(--lx-paper); border: 1px solid var(--lx-line); border-radius: var(--lx-radius);
  padding: 16px 14px;
}
.lx-toc h2 { margin: 0 0 8px; font-size: 14px; line-height: 2; color: var(--lx-ink-3); font-weight: 700; }
.lx-toc ol { list-style: none; margin: 0; padding: 0; }
.lx-toc a {
  display: flex; gap: 10px; align-items: center; padding: 5px 8px; border-radius: 10px;
  color: var(--lx-ink-2); text-decoration: none; font-size: 14px; line-height: 1.7;
}
.lx-toc a:hover { background: var(--lx-card); color: var(--lx-indigo); }
.lx-toc .n {
  flex: 0 0 26px; height: 26px; border-radius: 8px; display: grid; place-items: center;
  background: var(--lx-indigo-soft); color: var(--lx-indigo); font-size: 12.5px; font-weight: 700;
}
.lx-toc .lx-toc-key .n { background: var(--lx-copper-soft); color: var(--lx-copper); }
@media (max-width: 1039px) {
  .lx-toc ol { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
  .lx-toc a { white-space: nowrap; background: var(--lx-card); }
}

/* ---------------------------------------------------------------- sections */
.lx-body { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.lx-sec {
  background: var(--lx-paper); border: 1px solid var(--lx-line); border-radius: var(--lx-radius);
  padding: 24px 28px 20px; scroll-margin-top: var(--lx-stick);
}
.lx-sec > h2 { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; font-size: 21px; line-height: 1.6; color: var(--lx-indigo); }
.lx-num {
  flex: 0 0 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(140deg, var(--lx-copper-2), var(--lx-copper)); color: #FFF7EA;
  font-size: 16px; font-weight: 800; box-shadow: 0 6px 14px -8px rgba(172, 74, 15, .8);
}
.lx-sec p { margin: 0 0 12px; }
.lx-sec p:last-child { margin-bottom: 0; }
.lx-sec h3 {
  margin: 20px 0 8px; font-size: 16.5px; font-weight: 700; color: var(--lx-ink); line-height: 1.8;
  padding-inline-start: 12px; border-inline-start: 4px solid var(--lx-saffron);
}
.lx-sec h3:first-of-type { margin-top: 4px; }
.lx-lead { font-weight: 700; color: var(--lx-ink); }
.lx-list { margin: 4px 0 14px; padding: 0; list-style: none; }
.lx-list li { position: relative; padding-inline-start: 22px; margin: 4px 0; }
.lx-list li::before {
  content: ""; position: absolute; inset-inline-start: 4px; top: .95em; width: 8px; height: 8px;
  border-radius: 3px; background: var(--lx-copper-2); transform: rotate(45deg);
}
.lx-term { color: var(--lx-indigo-2); font-weight: 600; }

/* The case's own anatomy reads wider, the guild note and the self-test stand apart. */
.lx-sec--anatomy { border-color: #D9C49E; box-shadow: 0 16px 34px -28px rgba(112, 48, 11, .55); }
.lx-sec--anatomy > h2 .lx-num { background: linear-gradient(140deg, var(--lx-indigo-2), var(--lx-indigo)); box-shadow: none; }
.lx-sec--guild { background: linear-gradient(180deg, var(--lx-olive-soft), var(--lx-paper) 80%); border-color: #C9D3A0; }
.lx-sec--guild > h2 { color: var(--lx-olive); }
.lx-sec--guild > h2 .lx-num { background: var(--lx-olive); box-shadow: none; }
.lx-sec--selftest { background: linear-gradient(180deg, var(--lx-indigo-soft), var(--lx-paper) 70%); border-color: #CDD2E6; }

/* ---------------------------------------------------------------- the document's own words */
.lx-quote {
  position: relative; margin: 10px 0 14px; padding: 14px 18px 12px 18px;
  background: linear-gradient(180deg, #FFFEFA, #FBF5E8);
  border: 1px solid #E8D9BC; border-inline-start: 5px solid var(--lx-copper);
  border-radius: 6px 14px 14px 6px; box-shadow: 0 10px 24px -20px rgba(20, 24, 30, .6);
}
.lx-quote figcaption {
  font-size: 12px; font-weight: 700; color: var(--lx-copper); margin-bottom: 4px; letter-spacing: .02em;
}
.lx-quote blockquote { margin: 0; }
.lx-quote blockquote p { margin: 0 0 6px; font-size: 15.5px; color: #2A2418; }
.lx-quote blockquote p::before { content: "«"; color: var(--lx-copper-2); font-weight: 700; margin-inline-end: 2px; }
.lx-quote blockquote p::after { content: "»"; color: var(--lx-copper-2); font-weight: 700; margin-inline-start: 2px; }

/* ---------------------------------------------------------------- the mentor's labelled notes */
.lx-note {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; align-items: start;
  margin: 8px 0 10px; padding: 10px 14px; border-radius: 14px; background: var(--lx-card);
  border: 1px solid var(--lx-line);
}
.lx-note-label {
  font-size: 12.5px; font-weight: 800; padding: 2px 10px; border-radius: 999px; white-space: nowrap;
  background: var(--lx-indigo-soft); color: var(--lx-indigo); margin-top: 5px;
}
.lx-note p { margin: 0; }
.lx-note--what .lx-note-label { background: var(--lx-indigo-soft); color: var(--lx-indigo); }
.lx-note--why { background: #F4F6EA; border-color: #D6DEAF; }
.lx-note--why .lx-note-label { background: var(--lx-olive-soft); color: var(--lx-olive); }
.lx-note--alt .lx-note-label { background: #ECE7DE; color: #5A4B32; }
.lx-note--trap { background: var(--lx-red-soft); border-color: #EDBFB2; }
.lx-note--trap .lx-note-label { background: var(--lx-red); color: #FFF4F0; }
.lx-note--trap .lx-note-label::before { content: "⚠ "; }
.lx-note--answer { background: #EEF6EA; border-color: #CFE0C2; }
.lx-note--answer .lx-note-label { background: #DDEBD3; color: #2F5A1B; }
.lx-note--prep { background: var(--lx-copper-soft); border-color: #EEC488; }
.lx-note--prep .lx-note-label { background: var(--lx-copper); color: #FFF7EA; }
@media (max-width: 620px) { .lx-note { grid-template-columns: 1fr; } .lx-note-label { justify-self: start; } }

/* ---------------------------------------------------------------- where a source comes from */
.lx-src {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700;
  line-height: 1.6; padding: 1px 9px; border-radius: 999px; vertical-align: 1px; white-space: nowrap;
}
.lx-src::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.lx-src--bank { background: var(--lx-olive-soft); color: var(--lx-olive); }
.lx-src--law { background: var(--lx-blue-soft); color: var(--lx-blue); }
.lx-src--check { background: var(--lx-amber-soft); color: var(--lx-amber); }

/* ---------------------------------------------------------------- self-test */
.lx-qs { display: grid; gap: 12px; }
.lx-q {
  background: #FFFFFF; border: 1px solid #D5D9EA; border-radius: 16px; padding: 14px 16px 12px;
  box-shadow: 0 10px 22px -20px rgba(26, 33, 80, .7);
}
.lx-q-tag {
  display: inline-block; font-size: 12.5px; font-weight: 800; color: #fff; background: var(--lx-indigo);
  padding: 1px 12px; border-radius: 999px; margin-bottom: 6px;
}
.lx-q--exercise .lx-q-tag { background: var(--lx-copper); }
.lx-q > p { margin: 0 0 6px; font-weight: 600; }
.lx-q details { margin-top: 6px; border-top: 1px dashed #D5D9EA; padding-top: 6px; }
.lx-q summary {
  cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 8px;
  font-size: 13.5px; font-weight: 700; color: var(--lx-indigo-2);
}
.lx-q summary::-webkit-details-marker { display: none; }
.lx-q summary::before {
  content: "＋"; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px;
  background: var(--lx-indigo-soft); font-size: 13px;
}
.lx-q details[open] summary::before { content: "－"; }
.lx-answer { margin-top: 8px; padding: 10px 14px; border-radius: 12px; background: #F3F8EF; }
.lx-answer p { margin: 0 0 8px; }
.lx-answer p:last-child { margin: 0; }
.lx-print-only { display: none; }

/* ---------------------------------------------------------------- foot */
.lx-foot {
  margin-top: 22px; padding: 16px 20px; border-radius: var(--lx-radius); background: var(--lx-card);
  border: 1px dashed #D9C49E; font-size: 13px; color: var(--lx-ink-3); line-height: 2;
}
.lx-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; position: relative; z-index: 1; }
.lx-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 12px;
  font: inherit; font-size: 14px; font-weight: 700; text-decoration: none; cursor: pointer;
  background: var(--lx-saffron); color: #2A1A02; border: none;
}
.lx-btn--ghost { background: rgba(247, 236, 218, .12); color: #F7ECDA; border: 1px solid rgba(247, 236, 218, .3); }

/* ---------------------------------------------------------------- the file on its own */
body.lx-standalone { margin: 0; background: var(--lx-canvas, #F7ECDA); padding: 28px 18px 48px; }
@media (max-width: 720px) {
  .lx-hero { padding: 24px 20px 22px; border-radius: 20px; }
  .lx-title { font-size: 23px; }
  .lx-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lx-sec { padding: 18px 16px 16px; }
  .lx-sec > h2 { font-size: 18.5px; }
  body.lx-standalone { padding: 14px 10px 30px; }
}

/* ---------------------------------------------------------------- on the site */
.app-main .lx-lesson { --lx-stick: 82px; }                                          /* customer header: 64px */
[data-lesson-preview-article] .lx-lesson { --lx-stick: calc(var(--adm-top-h, 58px) + 18px); } /* admin header */
/* The strip above the article on the reading page: back to the case, and the other versions. */
.lx-crumbs {
  max-width: 1180px; margin: 0 auto 14px; display: flex; flex-wrap: wrap; align-items: center;
  gap: 8px 18px; font-size: 14px; color: #6B7180; direction: rtl;
}
.lx-crumbs a { color: #AC4A0F; text-decoration: none; }
.lx-crumbs a:hover { text-decoration: underline; }
.lx-crumbs-versions { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.lx-crumbs-versions a, .lx-crumbs-versions b {
  display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 8px;
  border-radius: 999px; border: 1px solid #E6D5B8; background: #FFFDF5; font-weight: 700;
}
.lx-crumbs-versions b { background: #1A2150; border-color: #1A2150; color: #fff; }

/* ---------------------------------------------------------------- the intro page (/trainees) */
/* «بخشِ کارآموزان»: the public page about the trainee edition. Its excerpt is a real .lx-lesson;
   the rest sits on the site's own sheet, with these few additions. */
.lx-intro-block { margin-top: 44px; }
.lx-intro-block > h2 { margin-bottom: 14px; }
.lx-intro-parts {
  list-style: none; margin: 0; padding: 0; display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.lx-intro-parts li {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px;
  background: #FFFDF5; border: 1px solid #E6D5B8; font-weight: 600; line-height: 1.7;
}
.lx-intro-parts .n {
  flex: none; display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px;
  background: #1A2150; color: #F7ECDA; font-size: 14px; font-weight: 800;
}
.lx-intro-parts li:nth-child(7) { border-color: #AC4A0F; background: #FAE9C9; }
.lx-intro-parts li:nth-child(7) .n { background: #AC4A0F; }
.lx-excerpt { max-width: 900px; margin: 14px 0 0; }
.lx-intro-prices { width: 100%; border-collapse: collapse; margin: 6px 0 10px; }
.lx-intro-prices td { padding: 8px 0; border-bottom: 1px dashed #E6D5B8; }
.lx-intro-prices td:last-child { text-align: left; font-weight: 700; color: #AC4A0F; white-space: nowrap; }
.lx-intro-notes { margin: 8px 0 0; padding-inline-start: 20px; line-height: 2.1; }
.lx-intro-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }

/* ---------------------------------------------------------------- paper */
@media print {
  /* On the reading page the site's own header and the strip above the article stay off paper. */
  .app-top, .app-backdrop, .lx-crumbs { display: none !important; }
  .app-main { max-width: none; padding: 0; }
  body.lx-standalone { background: #fff; padding: 0; }
  .lx-lesson { max-width: none; font-size: 12pt; line-height: 1.9; }
  .lx-hero { background: #1A2150 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; box-shadow: none; }
  .lx-actions, .lx-toc { display: none; }
  .lx-layout { display: block; }
  .lx-sec { break-inside: auto; border-color: #ddd; box-shadow: none; margin-bottom: 12px; }
  .lx-sec > h2 { break-after: avoid; }
  .lx-quote, .lx-note, .lx-q { break-inside: avoid; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .lx-q details { display: none; }
  .lx-print-only { display: block !important; }
}
