/* ============================================================
   Подготовка к тренажёрной и лётной практике.
   Подключается ПОСЛЕ /lectures/style.css: наследует токены и
   базовую типографику, добавляет свои компоненты — глоссарий
   при наведении, видеоблоки, проверку знаний, прогресс.
   ============================================================ */

/* ============== ГЛОССАРИЙ ПРИ НАВЕДЕНИИ ============== */
.gl {
  border-bottom: 1px dotted var(--term);
  cursor: help;
  text-decoration: none;
  color: inherit;
}
.gl:hover { background: var(--term-soft); border-radius: 3px; }

#gl-tip {
  position: absolute;
  z-index: 500;
  max-width: 340px;
  background: var(--bg-card-2);
  border: 1px solid var(--term-line);
  border-radius: 12px;
  padding: 12px 15px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  box-shadow: 0 14px 40px rgba(0,0,0,0.5);
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .14s, transform .14s;
}
#gl-tip.on { opacity: 1; transform: translateY(0); }
#gl-tip .t {
  color: var(--term);
  font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; font-weight: 700;
  margin-bottom: 5px;
}

/* ============== МЕТКА БЛОКА ВНУТРИ УРОКА ============== */
h2 .section-num { color: var(--accent); font-weight: 600; }

/* ============== ВИДЕОБЛОК ============== */
.video {
  margin: 24px 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg-card);
}
.video .v-play {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  cursor: pointer;
  background: #000;
  aspect-ratio: 16 / 9;
}
.video .v-play img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  opacity: 0.85;
  transition: opacity .2s, transform .3s;
}
.video .v-play:hover img { opacity: 1; transform: scale(1.02); }
.video .v-play::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 64px; height: 64px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: rgba(14,17,23,0.78) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23e6edf3'><path d='M8 5.5v13l11-6.5z'/></svg>") center/26px no-repeat;
  border: 1.5px solid rgba(230,237,243,0.35);
  transition: transform .2s, background-color .2s;
}
.video .v-play:hover::after {
  transform: translate(-50%, -50%) scale(1.08);
  background-color: rgba(37,99,201,0.85);
}
.video iframe {
  width: 100%; aspect-ratio: 16 / 9;
  display: block; border: 0;
}
.video .v-meta {
  padding: 13px 17px 14px;
}
.video .v-title {
  font-weight: 600; font-size: 15.5px; line-height: 1.35;
  color: var(--text);
}
.video .v-sub {
  margin-top: 4px;
  font-size: 13px; color: var(--text-dim);
}
.video .v-why {
  margin-top: 8px;
  font-size: 14px; line-height: 1.55;
  color: var(--text-dim);
}
.video .v-why b { color: var(--text); }
.video .v-link {
  display: inline-block; margin-top: 8px;
  font-size: 12.5px;
}

/* ============== ДОПОЛНИТЕЛЬНО (сворачиваемое) ============== */
details.extra {
  margin: 40px 0 0;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: transparent;
}
details.extra > summary {
  cursor: pointer;
  list-style: none;
  padding: 16px 20px;
  font-weight: 600;
  color: var(--text-dim);
  font-size: 15px;
  display: flex; align-items: center; gap: 10px;
  user-select: none;
}
details.extra > summary::-webkit-details-marker { display: none; }
details.extra > summary::before {
  content: "+";
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--accent);
  font-size: 16px; font-weight: 500;
  transition: transform .2s;
  flex: 0 0 auto;
}
details.extra[open] > summary::before { content: "−"; }
details.extra > summary:hover { color: var(--text); }
details.extra .extra-body { padding: 0 20px 20px; }
details.extra .extra-body > :first-child { margin-top: 0; }

/* ============== ПРОВЕРКА ЗНАНИЙ ============== */
.quiz {
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg-card);
  padding: 24px;
}
.quiz .q-progress {
  font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-muted); font-weight: 600;
  margin-bottom: 14px;
  display: flex; justify-content: space-between; align-items: center;
}
.quiz .q-bar {
  height: 3px; border-radius: 3px;
  background: var(--line-soft);
  margin-bottom: 20px; overflow: hidden;
}
.quiz .q-bar i {
  display: block; height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width .3s;
}
.quiz .q-text {
  font-size: 17px; font-weight: 600; line-height: 1.5;
  margin-bottom: 18px;
}
.quiz .q-opt {
  display: block; width: 100%;
  text-align: left;
  background: var(--bg-card-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 15.5px; line-height: 1.5;
  padding: 13px 16px;
  margin: 8px 0;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.quiz .q-opt:hover:not(:disabled) { border-color: var(--accent-line); }
.quiz .q-opt:disabled { cursor: default; }
.quiz .q-opt.ok {
  border-color: rgba(94,217,154,0.6);
  background: rgba(94,217,154,0.10);
}
.quiz .q-opt.bad {
  border-color: var(--danger-line);
  background: var(--danger-soft);
  opacity: 0.9;
}
.quiz .q-opt.dim { opacity: 0.45; }
.quiz .q-why {
  margin-top: 16px;
  padding: 14px 17px;
  border-radius: 12px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  font-size: 14.5px; line-height: 1.6;
  color: var(--text);
}
.quiz .q-why .w-verdict { font-weight: 700; margin-bottom: 6px; }
.quiz .q-why.miss { background: var(--warn-soft); border-color: var(--warn-line); }
.quiz .q-next {
  margin-top: 18px;
  appearance: none;
  background: var(--accent);
  border: 0; border-radius: 10px;
  color: #0e1117;
  font-family: inherit; font-weight: 700; font-size: 15px;
  padding: 11px 22px;
  cursor: pointer;
  transition: opacity .15s, transform .15s;
}
.quiz .q-next:hover { opacity: 0.9; transform: translateY(-1px); }

.quiz .q-result { text-align: center; padding: 12px 0 4px; }
.quiz .q-result .r-score {
  font-family: var(--serif);
  font-size: 52px; font-weight: 700;
  color: var(--accent);
  line-height: 1.1;
}
.quiz .q-result .r-note {
  color: var(--text-dim);
  font-size: 15px; margin-top: 10px;
  max-width: 46ch; margin-left: auto; margin-right: auto;
  line-height: 1.6;
}
.quiz .q-result .q-next { margin-top: 22px; }

/* ============== ИНДЕКС: КАРТОЧКИ УРОКОВ ============== */
.prep-progress {
  display: flex; align-items: center; gap: 16px;
  margin: 28px 0 8px;
}
.prep-progress .pp-bar {
  flex: 1;
  height: 6px; border-radius: 6px;
  background: var(--line-soft);
  overflow: hidden;
}
.prep-progress .pp-bar i {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--accent), #5ed99a);
  border-radius: 6px;
  transition: width .5s;
}
.prep-progress .pp-label {
  font-size: 13px; color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.plesson {
  display: flex; align-items: center; gap: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-card);
  padding: 16px 20px;
  margin: 10px 0;
  text-decoration: none;
  color: var(--text);
  transition: border-color .2s, background .2s, transform .2s;
}
.plesson:hover {
  border-color: var(--accent-line);
  background: var(--bg-card-2);
  transform: translateY(-1px);
}
.plesson .pl-num {
  flex: 0 0 auto;
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif);
  font-size: 17px; font-weight: 700;
  color: var(--text-dim);
}
.plesson .pl-body { flex: 1 1 auto; min-width: 0; }
.plesson .pl-date {
  font-size: 11.5px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-muted); font-weight: 600;
  margin-bottom: 3px;
  display: flex; gap: 8px; align-items: center;
}
.plesson .pl-title {
  font-weight: 600; font-size: 16.5px; line-height: 1.35;
}
.plesson .pl-sub {
  font-size: 13.5px; color: var(--text-dim);
  margin-top: 3px; line-height: 1.5;
}
.plesson .pl-state {
  flex: 0 0 auto;
  font-size: 12.5px;
  color: var(--text-muted);
  text-align: right;
  white-space: nowrap;
}
.plesson .pl-state .s-done { color: #5ed99a; font-weight: 700; }
.plesson.is-today { border-color: var(--accent-line); background: var(--accent-soft); }
.plesson.is-today .pl-num { border-color: var(--accent); color: var(--accent); }
.plesson.is-done .pl-num {
  border-color: rgba(94,217,154,0.55);
  color: #5ed99a;
}
.pl-badge {
  display: inline-block;
  background: var(--accent);
  color: #0e1117;
  font-size: 10px; font-weight: 800;
  letter-spacing: 0.1em;
  border-radius: 100px;
  padding: 2px 8px;
}

@media (max-width: 560px) {
  .plesson { gap: 13px; padding: 14px 15px; }
  .plesson .pl-state { display: none; }
  #gl-tip { max-width: calc(100vw - 32px); }
}

/* печать: раскрыть всё */
@media print {
  details.extra { border: 0; }
  details.extra .extra-body { display: block; }
  .video .v-play::after { display: none; }
}
