/* ═══════════════════════════════════════════════════════════════
   Дайджест школы YouTube - что сделано и что изменилось
   Стиль и переменные - как у Карты-старта (start-map.css),
   чтобы страницы в кабинете выглядели одной семьей.
   ═══════════════════════════════════════════════════════════════ */

.yt-lesson {
  --fh: 'Unbounded', 'Inter', sans-serif;
  --fb: 'Involve', 'Inter', sans-serif;
  --fm: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --bg: #0a0a0a;
  --bg-2: #141414;
  --card: #1a1a1a;
  --card-2: #1e1e1e;
  --line: #272727;
  --line-2: #353535;
  --ink: #f0f0f0;
  --ink-mute: #b0b0b0;
  --ink-faint: #6a6a6a;

  --accent: #e53935;
  --accent-2: #ff5252;
  --accent-soft: rgba(229, 57, 53, .10);
  --accent-line: rgba(229, 57, 53, .30);

  --green: #43a047;
  --green-soft: rgba(67, 160, 71, .12);
  --warn: #ffc107;
  --warn-soft: rgba(255, 193, 7, .12);
  --blue: #42a5f5;
  --blue-soft: rgba(66, 165, 245, .12);
  --violet: #ab47bc;
  --violet-soft: rgba(171, 71, 188, .12);

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 18px;
  --gap-block: 28px;
  --t-fast: .15s;
  --t-mid: .25s;
  --spring: cubic-bezier(.2, .9, .3, 1.3);

  font-family: var(--fb);
  color: var(--ink);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
}

.yt-lesson.light {
  --bg: #f4f0e8;
  --bg-2: #ebe6dc;
  --card: #ffffff;
  --card-2: #faf7f0;
  --line: #d8d2c5;
  --line-2: #c8c2b5;
  --ink: #1a1408;
  --ink-mute: #6b6456;
  --ink-faint: #9e9385;
  --accent-soft: rgba(229, 57, 53, .08);
}

/* Tilda: блок не режет контент по высоте */
.t-rec:has(.yt-lesson),
.t-rec:has(.yt-lesson) > div,
.t123:has(.yt-lesson),
.t123:has(.yt-lesson) > div {
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
}
.t-rec:has(.yt-lesson.light),
.t-rec:has(.yt-lesson.light) > div { background: var(--bg-2) !important; }

.yt-lesson::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg);
  z-index: -1;
  pointer-events: none;
}
body:has(.yt-lesson.light) { background: var(--bg); }
body:has(.yt-lesson:not(.light)) { background: #0a0a0a; }

.yt-lesson * { box-sizing: border-box; }
.yt-lesson p, .yt-lesson ul, .yt-lesson ol,
.yt-lesson h1, .yt-lesson h2, .yt-lesson h3, .yt-lesson h4 { margin: 0; }
.yt-lesson a { color: var(--accent); text-decoration: none; transition: opacity var(--t-fast); }
.yt-lesson a:hover { opacity: .8; }
.yt-lesson strong { color: var(--ink); font-weight: 600; }
.yt-lesson code {
  font-family: var(--fm); font-size: .88em;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 4px; padding: 1px 6px; color: var(--ink);
  white-space: nowrap;
}

/* ---------- Layout ---------- */
.yt-lesson .container {
  max-width: 820px;
  margin: 0 auto;
  padding: 32px 20px 100px;
  background: var(--bg);
}
@media (max-width: 600px) {
  .yt-lesson .container { padding: 20px 16px 80px; }
  .yt-lesson { font-size: 15px; }
}

/* ---------- Theme toggle ---------- */
.yt-lesson .theme-toggle {
  position: fixed;
  top: 150px;
  right: 30px;
  z-index: 100;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 7px 14px;
  cursor: pointer;
  font-size: 13px;
  font-family: var(--fh);
  font-weight: 600;
  color: var(--ink-mute);
  display: flex;
  align-items: center;
  gap: 7px;
  transition: all var(--t-mid);
  box-shadow: 0 2px 12px rgba(0, 0, 0, .25);
}
.yt-lesson .theme-toggle:hover { border-color: var(--ink-mute); color: var(--ink); transform: translateY(-1px); }
.yt-lesson.in-iframe .theme-toggle { position: absolute; top: 12px; right: 16px; }
@media (max-width: 720px) {
  .yt-lesson .theme-toggle { top: auto; bottom: 18px; right: 16px; }
}

/* ---------- Шапка ---------- */
.yt-lesson .lesson-meta {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 18px; flex-wrap: wrap;
}
.yt-lesson .badge {
  font-family: var(--fh); font-size: 11px; font-weight: 700;
  color: var(--accent); background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  padding: 5px 11px; border-radius: var(--r-sm);
  letter-spacing: 1.2px; text-transform: uppercase;
}
.yt-lesson .lesson-num { font-size: 13px; color: var(--ink-faint); font-family: var(--fm); }

@keyframes yt-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.yt-lesson .upd-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--fm); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--green); border: 1px solid rgba(67, 160, 71, .35);
  background: rgba(67, 160, 71, .08); padding: 4px 10px; border-radius: 100px;
}
.yt-lesson .upd-badge::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 6px rgba(67, 160, 71, .8);
  animation: yt-pulse 2.4s ease-in-out infinite;
}

.yt-lesson h1 {
  font-family: var(--fh);
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 700; line-height: 1.2; letter-spacing: -.02em;
  color: var(--ink); margin-bottom: 14px;
  overflow-wrap: break-word; text-wrap: balance;
}
.yt-lesson .lesson-desc {
  font-size: 16px; color: var(--ink-mute); line-height: 1.65;
  margin-bottom: 28px; padding-bottom: 28px; border-bottom: 1px solid var(--line);
}

/* ---------- Паспорт ---------- */
.yt-lesson .lesson-passport {
  position: relative; overflow: hidden;
  border: 1px solid var(--line); background: var(--card);
  border-radius: 16px; padding: 20px 22px; margin: 0 0 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04), 0 10px 30px rgba(0, 0, 0, .18);
}
.yt-lesson.light .lesson-passport { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), 0 10px 24px rgba(26, 20, 8, .06); }
.yt-lesson .lesson-passport::before {
  content: ""; position: absolute; top: 14px; bottom: 14px; left: 0; width: 3px;
  background: linear-gradient(180deg, transparent, var(--accent) 22%, var(--accent) 60%, transparent 96%);
  border-radius: 3px;
}
.yt-lesson .lp-facts { display: flex; flex-wrap: wrap; gap: 16px 26px; margin-bottom: 16px; }
.yt-lesson .lp-item { display: flex; flex-direction: column; }
.yt-lesson .lp-num { font-family: var(--fh); font-size: 18px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.yt-lesson .lp-label { font-family: var(--fm); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); margin-top: 3px; }
.yt-lesson .lp-what-title { font-family: var(--fm); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); display: block; margin-bottom: 8px; }
.yt-lesson .lp-what ul { margin: 0; padding: 0; list-style: none; }
.yt-lesson .lp-what li { font-size: 14px; color: var(--ink-mute); margin-bottom: 6px; padding-left: 22px; position: relative; line-height: 1.55; }
.yt-lesson .lp-what li::before { content: "→"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }

/* ---------- За 60 секунд ---------- */
.yt-lesson .tldr {
  border: 1px solid var(--line); border-radius: 16px;
  background: var(--card); margin: 0 0 18px; overflow: hidden;
  transition: border-color .2s;
}
.yt-lesson .tldr:hover { border-color: var(--line-2); }
.yt-lesson .tldr-toggle { display: flex; align-items: center; gap: 10px; padding: 15px 18px; cursor: pointer; list-style: none; user-select: none; }
.yt-lesson .tldr-toggle::-webkit-details-marker { display: none; }
.yt-lesson .tldr-icon { font-size: 15px; }
.yt-lesson .tldr-title { font-family: var(--fh); font-size: 14px; font-weight: 700; color: var(--ink); }
.yt-lesson .tldr-hint { font-family: var(--fm); font-size: 10.5px; color: var(--ink-faint); letter-spacing: .05em; }
.yt-lesson .tldr-chevron { margin-left: auto; color: var(--ink-faint); transition: transform .25s; }
.yt-lesson .tldr[open] .tldr-chevron { transform: rotate(180deg); }
.yt-lesson .tldr-body { padding: 2px 18px 16px; border-top: 1px solid var(--line); }
.yt-lesson .tldr-body p { font-size: 14px; color: var(--ink-mute); margin: 10px 0 0; line-height: 1.65; }
.yt-lesson .tldr-body ul { margin: 10px 0 0; padding-left: 0; list-style: none; }
.yt-lesson .tldr-body li { font-size: 14px; color: var(--ink-mute); line-height: 1.6; padding-left: 20px; position: relative; margin-bottom: 6px; }
.yt-lesson .tldr-body li::before { content: "•"; position: absolute; left: 4px; color: var(--accent); font-weight: 700; }

/* ---------- Оглавление по датам ---------- */
.yt-lesson .toc {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 0 0 var(--gap-block);
}
.yt-lesson .toc a {
  font-family: var(--fm); font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-mute); background: var(--card); border: 1px solid var(--line);
  border-radius: 100px; padding: 6px 12px;
  transition: border-color var(--t-fast), color var(--t-fast), transform var(--t-fast);
}
.yt-lesson .toc a:hover { border-color: var(--accent-line); color: var(--ink); opacity: 1; transform: translateY(-1px); }
.yt-lesson .toc a.latest { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }

/* ---------- Блоки (один блок = одна дата) ---------- */
.yt-lesson .block {
  margin-bottom: var(--gap-block);
  padding-bottom: var(--gap-block);
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 24px;
}
.yt-lesson .block:last-of-type { border-bottom: none; }
.yt-lesson .block-eyebrow {
  font-family: var(--fh); font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.5px; color: var(--accent);
  margin-bottom: 10px;
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--accent-line); background: var(--accent-soft);
  border-radius: 100px; padding: 5px 12px;
}
.yt-lesson .block-eyebrow::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.yt-lesson .block-title {
  font-family: var(--fh);
  font-size: clamp(20px, 2.5vw, 24px);
  font-weight: 700; color: var(--ink);
  margin-bottom: 18px; letter-spacing: -.015em; line-height: 1.25;
  position: relative; padding-bottom: 12px; text-wrap: balance;
}
.yt-lesson .block-title::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 44px; height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, var(--accent), transparent);
}
.yt-lesson .block > p { font-size: 15px; color: var(--ink-mute); line-height: 1.65; margin-bottom: 16px; }

/* ---------- Карточка обновления ---------- */
.yt-lesson .upd {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  margin-bottom: 12px;
  transition: border-color var(--t-fast);
}
.yt-lesson .upd:hover { border-color: var(--line-2); }
.yt-lesson .upd:last-child { margin-bottom: 0; }
.yt-lesson .upd-head { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.yt-lesson .upd-title {
  font-family: var(--fh); font-size: 16px; font-weight: 700; color: var(--ink);
  line-height: 1.35; flex: 1 1 auto; min-width: 200px;
}
.yt-lesson .upd-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.yt-lesson .tag {
  font-family: var(--fm); font-size: 10px; letter-spacing: .08em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 100px; border: 1px solid var(--line);
  color: var(--ink-faint); background: var(--bg-2); white-space: nowrap;
}
.yt-lesson .tag.map   { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.yt-lesson .tag.pult  { color: var(--blue); border-color: rgba(66, 165, 245, .35); background: var(--blue-soft); }
.yt-lesson .tag.polka { color: var(--green); border-color: rgba(67, 160, 71, .35); background: var(--green-soft); }
.yt-lesson .tag.pz    { color: var(--violet); border-color: rgba(171, 71, 188, .35); background: var(--violet-soft); }
.yt-lesson .tag.lesson{ color: var(--warn); border-color: rgba(255, 193, 7, .35); background: var(--warn-soft); }
.yt-lesson.light .tag.lesson { color: #a67c00; }
.yt-lesson.light .tag.pult { color: #1e6fb8; }
.yt-lesson.light .tag.pz { color: #8e24aa; }

.yt-lesson .upd p { font-size: 14.5px; color: var(--ink-mute); line-height: 1.62; margin-bottom: 8px; }
.yt-lesson .upd p:last-child { margin-bottom: 0; }
.yt-lesson .upd ul { margin: 6px 0 0; padding: 0; list-style: none; }
.yt-lesson .upd li {
  font-size: 14.5px; color: var(--ink-mute); line-height: 1.6;
  padding-left: 20px; position: relative; margin-bottom: 7px;
}
.yt-lesson .upd li:last-child { margin-bottom: 0; }
.yt-lesson .upd li::before { content: "→"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.yt-lesson .upd-where {
  margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line);
  font-size: 13px; color: var(--ink-faint); line-height: 1.55;
}
.yt-lesson .upd-where strong { color: var(--ink-mute); font-weight: 600; }

/* Внутренняя мини-плашка внутри карточки */
.yt-lesson .note {
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-md);
  padding: 12px 16px;
  margin: 12px 0 0;
  font-size: 14px; color: var(--ink-mute); line-height: 1.6;
}
.yt-lesson .note.warn { background: var(--warn-soft); border-color: rgba(255, 193, 7, .30); border-left-color: var(--warn); }
.yt-lesson .note.tip { background: var(--green-soft); border-color: rgba(67, 160, 71, .30); border-left-color: var(--green); }
.yt-lesson .block > .note { margin: 0 0 16px; }

/* Таблица внутри карточки */
.yt-lesson .data-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--r-md); margin: 12px 0 4px; }
.yt-lesson .data-table { width: 100%; border-collapse: collapse; min-width: 420px; font-size: 13px; }
.yt-lesson .data-table th { background: var(--bg-2); padding: 9px 12px; text-align: left; font-family: var(--fh); font-weight: 600; font-size: 12px; color: var(--ink); border-bottom: 1px solid var(--line); }
.yt-lesson .data-table td { padding: 9px 12px; border-bottom: 1px solid var(--line); color: var(--ink-mute); line-height: 1.45; vertical-align: top; }
.yt-lesson .data-table tr:last-child td { border-bottom: none; }
.yt-lesson .data-table td.r { color: var(--accent); }
.yt-lesson .data-table td.g { color: var(--green); }
.yt-lesson .data-table code { white-space: nowrap; }

/* ---------- Где что лежит ---------- */
.yt-lesson .link-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 18px 0 6px; }
@media (max-width: 600px) { .yt-lesson .link-cards { grid-template-columns: 1fr; } }
.yt-lesson .link-card {
  display: flex; flex-direction: column; gap: 6px;
  padding: 16px 18px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-md); text-decoration: none;
  transition: border-color var(--t-fast), transform var(--t-fast), background var(--t-fast);
}
.yt-lesson .link-card:hover { border-color: var(--line-2); transform: translateY(-2px); background: var(--card-2); opacity: 1; }
.yt-lesson .link-card.accent { border-color: var(--accent-line); background: var(--accent-soft); }
.yt-lesson .link-card.accent:hover { border-color: var(--accent); }
.yt-lesson .lc-tag { font-family: var(--fm); font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-faint); }
.yt-lesson .link-card.accent .lc-tag { color: var(--accent); }
.yt-lesson .lc-name { font-family: var(--fh); font-size: 15px; font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.yt-lesson .lc-arr { color: var(--ink-faint); transition: transform var(--t-fast), color var(--t-fast); margin-left: auto; }
.yt-lesson .link-card:hover .lc-arr { transform: translateX(3px); color: var(--accent); }
.yt-lesson .lc-desc { font-size: 13px; line-height: 1.55; color: var(--ink-mute); }
.yt-lesson .lc-url { display: block; margin-top: 4px; font-family: var(--fm); font-size: 11px; line-height: 1.5; color: var(--ink-faint); word-break: break-all; }
.yt-lesson .link-card:hover .lc-url { color: var(--accent); }

/* ---------- CTA и подпись ---------- */
.yt-lesson .lesson-cta {
  background: linear-gradient(135deg, var(--accent-soft), var(--bg-2));
  border: 1px solid var(--accent-line);
  border-radius: var(--r-xl);
  padding: 22px 24px; margin-top: 24px; text-align: center;
}
.yt-lesson .lesson-cta-text { font-size: 14.5px; color: var(--ink-mute); margin-bottom: 12px; }
.yt-lesson .lesson-cta-btn {
  display: inline-block; padding: 11px 22px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff !important; border-radius: var(--r-md);
  font-family: var(--fh); font-weight: 600; font-size: 14px; text-decoration: none;
  box-shadow: 0 10px 26px -8px rgba(229, 57, 53, .55), inset 0 1px 0 rgba(255, 255, 255, .25);
  transition: transform .25s var(--spring), box-shadow .25s;
}
.yt-lesson .lesson-cta-btn:hover { transform: translateY(-2px); opacity: 1; }

.yt-lesson .sig {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap;
  margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--line);
}
.yt-lesson .sig-name { font-family: var(--fh); font-size: 15px; font-weight: 700; color: var(--ink); }
.yt-lesson .sig-role { font-size: 12.5px; color: var(--ink-faint); margin-top: 4px; }
.yt-lesson .colophon { font-family: var(--fm); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); text-align: right; line-height: 1.8; }
@media (max-width: 600px) { .yt-lesson .colophon { text-align: left; } }

/* ---------- Точечная навигация (только вне iframe) ---------- */
.yt-dotnav {
  position: fixed; right: 26px; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 18px; z-index: 90;
}
.yt-lesson.in-iframe .yt-dotnav { display: none; }
@media (max-width: 1100px) { .yt-dotnav { display: none; } }
.yt-dotnav button {
  position: relative; width: 9px; height: 9px; border-radius: 100px;
  border: none; padding: 0; cursor: pointer;
  background: color-mix(in srgb, var(--ink-faint, #6a6a6a) 55%, transparent);
  transition: height .3s var(--spring), background .2s, box-shadow .2s;
}
.yt-dotnav button:hover { background: var(--ink-mute, #b0b0b0); }
.yt-dotnav button.active { height: 24px; background: var(--accent, #e53935); box-shadow: 0 0 10px rgba(229, 57, 53, .55); }
.yt-dotnav button::after {
  content: attr(data-label);
  position: absolute; right: 20px; top: 50%; transform: translateY(-50%) translateX(-4px);
  white-space: nowrap; pointer-events: none;
  font-family: var(--fm, monospace); font-size: 10px; letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink-faint, #6a6a6a);
  background: color-mix(in srgb, var(--card, #1a1a1a) 45%, transparent);
  border: 1px solid transparent; border-radius: 100px; padding: 3px 9px;
  transition: color .2s, background .2s, border-color .2s;
}
.yt-dotnav button:hover::after { color: var(--ink, #f0f0f0); background: color-mix(in srgb, var(--card, #1a1a1a) 82%, transparent); border-color: var(--line, #272727); }
.yt-dotnav button.active::after { color: var(--accent, #e53935); background: color-mix(in srgb, var(--card, #1a1a1a) 82%, transparent); border-color: var(--accent-line, rgba(229, 57, 53, .3)); }

/* ---------- Мягкое появление ---------- */
.yt-lesson .block.reveal, .yt-lesson .lesson-cta.reveal { opacity: 0; transform: translateY(16px); }
.yt-lesson .block.reveal.in, .yt-lesson .lesson-cta.reveal.in { opacity: 1; transform: none; transition: opacity .55s ease, transform .55s ease; }
@media (prefers-reduced-motion: reduce) {
  .yt-lesson .block.reveal, .yt-lesson .lesson-cta.reveal { opacity: 1; transform: none; }
}
