/* Стили раздела «Курс» — самостоятельные, не зависят от оформления основного сайта vi007.ru */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body.course-body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #f6f7f9;
  color: #24292f;
  line-height: 1.65;
}
.course-header { background: #1f2a44; color: #fff; }
.course-header-inner {
  max-width: 1200px; margin: 0 auto; padding: 18px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
}
.course-brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 1.05rem; line-height: 1.25; }
.course-brand span { display: block; font-weight: 400; font-size: .8rem; opacity: .75; }
.course-nav a, .course-home {
  color: #cdd6ee; text-decoration: none; margin-left: 14px; font-size: .95rem;
}
.course-nav a:hover, .course-home:hover { color: #fff; text-decoration: underline; }
.course-home { margin-left: auto; }
.course-last {
  color: #fff; text-decoration: none; margin-left: 14px; font-size: .9rem;
  background: rgba(255,255,255,.14); border-radius: 8px; padding: 5px 12px; max-width: 260px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.course-last:hover { background: rgba(255,255,255,.24); }
.course-last[hidden] { display: none; }

/* Двухколоночный layout: слева содержание, справа текст */
.course-wrap {
  max-width: 1200px; margin: 0 auto; padding: 26px 20px 56px;
  display: flex; gap: 28px; align-items: flex-start;
}
.course-sidebar { width: 280px; flex-shrink: 0; position: sticky; top: 16px; }
.course-sidebar-empty { width: 280px; flex-shrink: 0; }
.ctree-title { font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; color: #5a6270; margin: 0 0 .55rem; font-weight: 700; }
.ctree, .ctree ul { list-style: none; margin: 0; padding: 0; font-size: .95rem; }
.ctree ul { padding-left: 14px; border-left: 1px solid #e3e6ee; margin-left: 9px; }
.ctree li { margin: 1px 0; }
.ctree a { display: block; padding: 6px 10px; border-radius: 8px; color: #24292f; text-decoration: none; }
.ctree a:hover { background: #eceff7; }
.ctree a.active { background: #e8efff; color: #1f2a44; font-weight: 600; }
.ctree details { margin: 2px 0; }
.ctree summary {
  cursor: pointer; padding: 6px 10px; border-radius: 8px; user-select: none;
  font-weight: 600; color: #1f2a44;
}
.ctree summary::-webkit-details-marker { display: none; }
.ctree summary::before { content: '\25B8'; display: inline-block; width: 1em; transition: transform .15s; color: #7a8296; }
.ctree details[open] > summary::before { transform: rotate(90deg); }
.ctree summary:hover { background: #eceff7; }
.ctree a.ctree-current-folder { font-weight: 600; }

.course-content { flex: 1; min-width: 0; }
.course-crumbs { font-size: .85rem; color: #5a6270; margin-bottom: .4rem; }
.course-crumbs a { color: #2451b3; text-decoration: none; }
.course-crumbs a:hover { text-decoration: underline; }
.course-crumbs .sep { margin: 0 .35rem; color: #9aa2b2; }

.course-main h1 { font-size: 1.7rem; margin: 0 0 1rem; color: #1f2a44; }
.course-main h2 { font-size: 1.25rem; margin: 1.8rem 0 .6rem; color: #1f2a44; }
.course-main h3 { font-size: 1.05rem; margin: 1.4rem 0 .5rem; }
.course-main p, .course-main li { font-size: 1rem; }
.course-main a { color: #2451b3; }
.course-main ol, .course-main ul { padding-left: 1.4rem; }
.course-main ol li { margin-bottom: .35rem; }
.course-main table { border-collapse: collapse; width: 100%; }
.course-main td, .course-main th { border: 1px solid #d9dee8; padding: .5rem .7rem; text-align: left; }
.course-main img { max-width: 100%; height: auto; }
.lesson-meta {
  display: inline-block; background: #eef1f8; border: 1px solid #e3e6ee; border-radius: 8px;
  padding: 6px 12px; font-size: .88rem; color: #5a6270; margin-bottom: 1.2rem;
}
.course-card {
  background: #fff; border: 1px solid #e3e6ee; border-radius: 12px;
  padding: 22px 24px; margin: 1rem 0; box-shadow: 0 1px 3px rgba(20,28,50,.06);
}
.course-note { color: #5a6270; font-size: .9rem; }
.course-footer {
  border-top: 1px solid #e3e6ee; color: #5a6270; font-size: .85rem;
  max-width: 1200px; margin: 0 auto; padding: 18px 20px 28px;
}
@media (max-width: 880px) {
  .course-header-inner { flex-direction: column; align-items: flex-start; }
  .course-home, .course-last { margin-left: 0; }
  .course-wrap { flex-direction: column; gap: 20px; padding-top: 18px; }
  .course-sidebar, .course-sidebar-empty { width: 100%; position: static; }
}
.ctree summary.ctree-current-folder { color: #1f2a44; font-weight: 700; background: #e8efff; }


/* Закладка в шапке — первый элемент слева */
.course-header-inner { padding-left: 16px; }
.course-last { order: -1; margin-left: 0; max-width: 280px; }
.course-brand { margin-left: 6px; }

/* Полоса над контентом: крошки слева, закладка-чекбокс справа */
.course-topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: .4rem; flex-wrap: wrap;
}
.course-bookmark {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  font-size: .88rem; color: #5a6270; user-select: none; white-space: nowrap;
  background: #fff; border: 1px solid #e3e6ee; border-radius: 999px; padding: 5px 14px 5px 11px;
  transition: border-color .15s, color .15s;
}
.course-bookmark:hover { border-color: #c6d2f2; color: #1f2a44; }
.course-bookmark input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.course-bookmark svg { width: 16px; height: 16px; fill: none; stroke: #7a8296; stroke-width: 1.8; transition: stroke .15s, fill .15s; }
.course-bookmark input:checked ~ svg { fill: #2451b3; stroke: #2451b3; }
.course-bookmark input:checked ~ .bm-text { color: #1f2a44; font-weight: 600; }

/* Линия между деревом (меню) и текстом */
.course-content { border-left: 1px solid #e3e6ee; padding-left: 28px; }
@media (max-width: 880px) {
  .course-content { border-left: none; border-top: 1px solid #e3e6ee; padding-left: 0; padding-top: 18px; }
}

/* Примеры-раскладки (details) */
.course-ex { margin: 1.1rem 0 1.4rem; background: #fff; border: 1px solid #e3e6ee; border-radius: 10px; overflow: hidden; }
.course-ex summary { cursor: pointer; padding: 10px 14px; font-size: .92rem; font-weight: 600; color: #2451b3; list-style: none; user-select: none; display: flex; align-items: center; gap: 8px; }
.course-ex summary::-webkit-details-marker { display: none; }
.course-ex summary .ex-arrow { transition: transform .15s; color: #7a8296; font-size: .85em; }
.course-ex[open] summary .ex-arrow { transform: rotate(90deg); }
.course-ex .course-ex-body { padding: 6px 16px 14px; border-top: 1px solid #eef0f5; }
.course-ex-body p { font-size: .95rem; margin: .5rem 0; }
.course-ex-body ul, .course-ex-body ol { margin: .4rem 0 .6rem; }
.course-ex-body pre { background: #1f2a44; color: #e8ecf7; padding: 12px 14px; border-radius: 8px; overflow-x: auto; font-size: .85rem; line-height: 1.5; margin: .5rem 0; }
.course-ex-body code { font-family: "SF Mono", Consolas, Menlo, monospace; }
.course-ex-body p code, .course-ex-body li code { background: #eef1f8; border-radius: 4px; padding: 1px 5px; font-size: .88em; }

/* Заметка учителю — отдельный блок, другой шрифт */
.course-note-box { background: #faf7f2; border: 1px solid #ece4d4; border-left: 3px solid #d8c9a5; border-radius: 10px; padding: 14px 18px; margin-top: 2.2rem; }
.course-note-box h2 { font-family: Georgia, "Times New Roman", serif; font-style: italic; font-weight: 600; font-size: 1.02rem; color: #8a7a5c; margin: 0 0 .45rem; }
.course-note-box p { font-family: Georgia, "Times New Roman", serif; font-size: .93rem; color: #857b6b; margin: 0; }
