/* ══════════════════════════════════════════════════════════════
   مطالعه (کاغذ) + آزمون + نتیجه
   ══════════════════════════════════════════════════════════════ */

.readerpage {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 18px 60px;
}

.readerhead {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 22px;
}

.readerhead .back {
  margin-bottom: 12px;
}

.readerhead h1 {
  font-size: clamp(1.6rem, 6.4vw, 2.3rem);
  line-height: 1.45;
}

.readerhead__summary {
  color: var(--muted);
  font-size: 0.9rem;
}

/* ───────── برگهٔ کاغذی درس ───────── */

.reader {
  position: relative;
  padding: clamp(22px, 5.2vw, 40px);
  border-radius: 20px;
  background: linear-gradient(180deg, var(--paper) 0%, var(--paper-2) 100%);
  color: var(--paper-ink);
  box-shadow: 0 30px 70px -34px rgba(0, 0, 0, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  overflow: hidden;
}

.reader::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(120% 70% at 100% 0%, rgba(120, 84, 40, 0.07), transparent 60%);
}

.reader p {
  font-size: clamp(0.96rem, 3.6vw, 1.04rem);
  line-height: 2.2;
  margin-bottom: 1.15em;
  text-align: justify;
}

.reader p:last-child {
  margin-bottom: 0;
}

.reader h2 {
  position: relative;
  font-size: clamp(1.02rem, 4.2vw, 1.16rem);
  color: #3a2716;
  margin: 1.9em 0 0.8em;
  padding-top: 1em;
  border-top: 1px solid rgba(36, 26, 18, 0.13);
}

.reader h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.reader h2::before {
  content: '';
  position: absolute;
  top: -2px;
  inset-inline-start: 0;
  width: 34px;
  height: 2px;
  background: #b08347;
  border-radius: 2px;
}

.reader ul {
  margin: 0 0 1.2em;
  display: flex;
  flex-direction: column;
  gap: 0.55em;
}

.reader li {
  position: relative;
  padding-inline-start: 1.5em;
  font-size: clamp(0.93rem, 3.4vw, 1rem);
  line-height: 2;
  color: #33261a;
}

.reader li::before {
  content: '◇';
  position: absolute;
  inset-inline-start: 0.1em;
  top: 0;
  color: #a97c43;
  font-size: 0.8em;
}

/* ───────── فراخوان آزمون ───────── */

.reader__quiz {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 20px;
  padding: 18px 20px;
  border-radius: 18px;
  border: 1px solid var(--stroke);
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, transparent), rgba(255, 255, 255, 0.03));
}

.reader__quiz-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1 1 200px;
}

.reader__quiz-text strong {
  font-size: 0.95rem;
}

.reader__quiz-text span {
  font-size: 0.76rem;
  color: var(--muted);
}

.reader__quiz .btn {
  flex: 0 0 auto;
}

.reader__nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 22px;
}

.reader__nav a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 13px 16px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: var(--surface);
  transition: background 0.25s, border-color 0.25s;
}

.reader__nav a:hover {
  background: var(--surface-2);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
}

.reader__nav a.next {
  text-align: end;
}

.reader__nav small {
  font-size: 0.7rem;
  color: var(--faint);
}

.reader__nav b {
  font-size: 0.84rem;
  font-weight: 600;
}

/* ───────── آزمون ───────── */

.quizpage {
  max-width: 700px;
  margin: 0 auto;
  padding: 24px 18px 70px;
}

.quizhead {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 24px;
}

.quiz__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--muted);
}

.quiz__count,
.quiz__score {
  font-variant-numeric: tabular-nums;
}

.quiz__bar {
  height: 4px;
  margin: 10px 0 24px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.quiz__bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent2), var(--accent));
  transition: width 0.45s var(--ease);
}

.quiz__q {
  font-size: clamp(1.14rem, 4.8vw, 1.5rem);
  line-height: 1.85;
  margin-bottom: 22px;
  animation: qIn 0.45s var(--ease) both;
}

@keyframes qIn {
  from { opacity: 0; translate: 0 8px; }
  to   { opacity: 1; translate: 0 0; }
}

.choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.choice {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 16px;
  text-align: start;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background: var(--surface);
  transition: background 0.25s, border-color 0.25s, transform 0.2s var(--ease), opacity 0.3s;
}

.choice:not(:disabled):hover {
  background: var(--surface-2);
  border-color: color-mix(in srgb, var(--accent) 38%, transparent);
  transform: translateX(-2px);
}

.choice:disabled {
  cursor: default;
}

.choice__key {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 9px;
  border: 1px solid var(--stroke);
  color: var(--muted);
  font-size: 0.74rem;
  transition: background 0.25s, color 0.25s, border-color 0.25s;
}

.choice__text {
  font-size: 0.92rem;
  line-height: 1.8;
}

.choice.is-correct {
  background: color-mix(in srgb, var(--ok) 14%, transparent);
  border-color: color-mix(in srgb, var(--ok) 52%, transparent);
}

.choice.is-correct .choice__key {
  background: var(--ok);
  border-color: transparent;
  color: #05281a;
  font-weight: 700;
}

.choice.is-wrong {
  background: color-mix(in srgb, var(--no) 12%, transparent);
  border-color: color-mix(in srgb, var(--no) 48%, transparent);
}

.choice.is-wrong .choice__key {
  background: var(--no);
  border-color: transparent;
  color: #2b0a08;
  font-weight: 700;
}

.choice.is-dim {
  opacity: 0.42;
}

.feedback {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 78px;
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: var(--surface);
  font-size: 0.82rem;
  line-height: 1.85;
  opacity: 0;
  transition: opacity 0.3s var(--ease), background 0.3s, border-color 0.3s;
}

.feedback.is-on {
  opacity: 1;
}

.feedback strong {
  font-size: 0.88rem;
}

.feedback span {
  color: var(--muted);
}

.feedback.ok {
  background: color-mix(in srgb, var(--ok) 9%, transparent);
  border-color: color-mix(in srgb, var(--ok) 34%, transparent);
}

.feedback.ok strong {
  color: color-mix(in srgb, var(--ok) 88%, white);
}

.feedback.no {
  background: color-mix(in srgb, var(--no) 8%, transparent);
  border-color: color-mix(in srgb, var(--no) 30%, transparent);
}

.feedback.no strong {
  color: color-mix(in srgb, var(--no) 88%, white);
}

.quizfoot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

/* ───────── نتیجه ───────── */

.result {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 8px 0 28px;
  animation: qIn 0.5s var(--ease) both;
}

.result__ring {
  position: relative;
  display: grid;
  place-items: center;
}

.result__ring .ring span {
  font-size: 1.75rem;
  font-weight: 700;
}

.result__badge {
  position: absolute;
  bottom: -10px;
  padding: 3px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 88%, white);
  color: #1a1206;
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
}

.result h1 {
  margin-top: 24px;
  font-size: clamp(1.3rem, 5.4vw, 1.7rem);
}

.result__verdict {
  max-width: 40ch;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

.result__saved {
  margin-top: 10px;
  font-size: 0.74rem;
  color: var(--faint);
}

.review {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}

.review__item {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background: var(--surface);
  font-size: 0.85rem;
}

.review__item.ok {
  border-color: color-mix(in srgb, var(--ok) 28%, transparent);
}

.review__item.no {
  border-color: color-mix(in srgb, var(--no) 26%, transparent);
}

.review__q {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-weight: 600;
  line-height: 1.8;
}

.review__mark {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 21px;
  height: 21px;
  margin-top: 2px;
  border-radius: 50%;
  font-size: 0.68rem;
  font-weight: 700;
}

.review__item.ok .review__mark {
  background: color-mix(in srgb, var(--ok) 22%, transparent);
  color: var(--ok);
}

.review__item.no .review__mark {
  background: color-mix(in srgb, var(--no) 20%, transparent);
  color: var(--no);
}

.review__a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.79rem;
}

.review__a b {
  color: color-mix(in srgb, var(--ink) 85%, transparent);
  font-weight: 600;
}

.review__why {
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
  color: color-mix(in srgb, var(--ink) 50%, transparent);
  font-size: 0.78rem;
  line-height: 1.9;
}

@media (max-width: 430px) {
  .reader__nav {
    grid-template-columns: 1fr;
  }
  .reader__nav a.next {
    text-align: start;
  }
  .quizfoot .btn {
    flex: 1;
  }
}

.reader__basis {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  font-size: 0.74rem;
  line-height: 1.9;
  color: var(--faint);
}

.reader__basis b {
  color: color-mix(in srgb, var(--accent) 70%, white);
  font-weight: 600;
  margin-inline-end: 4px;
}

/* ───────── ویدئوی جلسه ───────── */

.video {
  margin: 0 0 18px;
}

.video__frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #05080e;
  box-shadow: var(--shadow);
}

.video__frame iframe,
.video__frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: contain;
  background: #05080e;
}

.video figcaption {
  margin-top: 7px;
  font-size: 0.72rem;
  color: var(--faint);
}

/* ───────── اسلایدها ───────── */

.slides {
  margin-top: 18px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.03);
  outline: none;
}

.slides:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.slides__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.slides__head h2 {
  font-size: 0.92rem;
}

.slides__count {
  font-size: 0.72rem;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.slides__stage {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #05080e;
}

.slides__img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.slides__arrow {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(6, 10, 16, 0.6);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 1.1rem;
  line-height: 1;
  transition: background 0.2s, opacity 0.2s;
}

.slides__arrow:hover {
  background: rgba(6, 10, 16, 0.85);
}

.slides__arrow.prev {
  inset-inline-start: 10px;
}

.slides__arrow.next {
  inset-inline-end: 10px;
}

.slides__caption {
  margin-top: 9px;
  font-size: 0.8rem;
  line-height: 1.85;
  color: var(--muted);
  min-height: 1.6em;
}

.slides__dots {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.slides__dots button {
  width: 8px;
  height: 8px;
  padding: 0;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.2);
  transition: background 0.2s, width 0.2s;
}

.slides__dots button.is-on {
  width: 20px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--accent) 85%, white);
}
