/* Раздел «Обучение»: каталог /education и страницы материалов /education/<slug> */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:            #090909;
  --bg-card:       #0f1113;
  --accent:        #00D4FC;
  --accent-dim:    rgba(0,212,252,0.08);
  --accent-border: rgba(0,212,252,0.22);
  --text:          #eef2f7;
  --text-muted:    rgba(238,242,247,0.55);
  --text-faint:    rgba(238,242,247,0.22);
  --line:          rgba(238,242,247,0.08);
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Roboto", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 32px; }

.label {
  font-family: 'Roboto Condensed', sans-serif;
  font-weight: 400;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.30em;
  color: var(--accent);
}

h1, h2, h3 {
  font-family: 'Roboto Condensed', sans-serif;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  text-wrap: balance;
  color: var(--text);
}

/* ─── HERO ─── */
.page-hero { padding: 130px 0 48px; }
.page-hero .label { display: block; margin-bottom: 14px; }
.page-hero h1 { font-size: clamp(32px, 4.4vw, 60px); line-height: 0.95; }
.page-hero p { max-width: 56ch; margin-top: 16px; color: var(--text-muted); font-size: 16px; }

/* ─── META (тип · длительность) ─── */
.edu-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-family: 'Roboto Condensed', sans-serif;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
}
.edu-tag {
  font-weight: 600;
  color: #090909;
  background: var(--accent);
  padding: 2px 8px;
  border-radius: 3px;
}
.edu-tag.ghost { color: var(--accent); background: var(--accent-dim); border: 1px solid var(--accent-border); }

/* ─── КАРТОЧКИ ─── */
.edu-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
a.edu-card:hover {
  border-color: var(--accent-border);
  transform: translateY(-2px);
  box-shadow: 0 0 32px rgba(0,212,252,0.10);
}

.edu-cover {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
}
.edu-cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s; }
a.edu-card:hover .edu-cover img { transform: scale(1.03); }
.edu-cover::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(9,9,9,0) 55%, rgba(9,9,9,0.55));
  pointer-events: none;
}
.edu-cover .play,
.player .play {
  position: absolute;
  left: 50%; top: 50%;
  width: 64px; height: 64px;
  margin: -32px 0 0 -32px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 32px rgba(0,212,252,0.45);
  z-index: 1;
}
.edu-cover .play::before,
.player .play::before {
  content: "";
  position: absolute;
  left: 26px; top: 20px;
  border-left: 18px solid #090909;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
}

.edu-body { display: flex; flex-direction: column; gap: 12px; padding: 22px 24px 26px; flex: 1; }
.edu-body h2, .edu-body h3 { font-size: 22px; line-height: 1.08; letter-spacing: -0.01em; }
.edu-body p { color: var(--text-muted); font-size: 15px; line-height: 1.6; }
.edu-more {
  margin-top: auto;
  padding-top: 6px;
  font-family: 'Roboto Condensed', sans-serif;
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
}

/* главный материал — широкая карточка над сеткой */
.edu-card.featured { flex-direction: row; border-color: var(--accent-border); margin-bottom: 28px; }
.edu-card.featured .edu-cover { flex: 0 0 58%; aspect-ratio: auto; min-height: 340px; }
.edu-card.featured .edu-body { padding: 36px 36px 36px; justify-content: center; gap: 16px; }
.edu-card.featured .edu-body h2 { font-size: clamp(26px, 2.6vw, 36px); line-height: 1.0; }
.edu-card.featured .edu-more { margin-top: 8px; }

.edu-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  padding-bottom: 96px;
}

/* заглушка «скоро» */
.edu-card.soon { border-style: dashed; background: transparent; }
.edu-card.soon .edu-cover {
  display: flex; align-items: center; justify-content: center;
  background: repeating-linear-gradient(135deg, rgba(0,212,252,0.04) 0 12px, transparent 12px 24px);
}
.edu-card.soon .edu-cover::after { display: none; }
.edu-card.soon .edu-cover span {
  font-family: 'Roboto Condensed', sans-serif;
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.30em; color: var(--text-faint);
}

/* ─── СТРАНИЦА МАТЕРИАЛА ─── */
.crumbs {
  display: flex; gap: 8px; flex-wrap: wrap;
  font-family: 'Roboto Condensed', sans-serif;
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--text-faint);
  margin-bottom: 20px;
}
.crumbs a { color: var(--text-muted); text-decoration: none; transition: color .2s; }
.crumbs a:hover { color: var(--accent); }

.lesson-hero { padding: 110px 0 28px; }
.lesson-hero h1 { font-size: clamp(30px, 4.2vw, 56px); line-height: 0.95; margin: 14px 0 0; max-width: 24ch; }
.lesson-hero .lead { max-width: 64ch; margin-top: 18px; color: var(--text-muted); font-size: 17px; }

.player {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--accent-border);
  box-shadow: 0 0 40px rgba(0,212,252,0.12);
  background: #000;
}
.player button.poster {
  all: unset;
  position: absolute; inset: 0;
  cursor: pointer;
}
.player button.poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.player button.poster::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, rgba(9,9,9,0.1), rgba(9,9,9,0.55));
}
.player .play { width: 84px; height: 84px; margin: -42px 0 0 -42px; transition: transform .2s; }
.player .play::before { left: 34px; top: 26px; border-left-width: 24px; border-top-width: 16px; border-bottom-width: 16px; }
.player button.poster:hover .play { transform: scale(1.08); }
.player button.poster:focus-visible { outline: 2px solid var(--accent); outline-offset: -4px; }
.player .poster-note {
  position: absolute; left: 0; right: 0; bottom: 14px; z-index: 1;
  text-align: center; font-size: 12px; color: rgba(238,242,247,0.7);
}
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.lesson-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 48px;
  padding: 48px 0 96px;
}
.lesson-text h2, .chapters h2 { font-size: 24px; line-height: 1.05; margin-bottom: 16px; }
.lesson-text p { color: var(--text-muted); margin-bottom: 16px; max-width: 68ch; }
.lesson-text ul { list-style: none; margin: 0 0 28px; }
.lesson-text li {
  position: relative;
  padding: 9px 0 9px 22px;
  border-bottom: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 15px;
}
.lesson-text li::before {
  content: ""; position: absolute; left: 2px; top: 19px;
  width: 7px; height: 7px; border-radius: 1px; background: var(--accent);
}
.lesson-text li strong { color: var(--text); font-weight: 600; }

.cta-box {
  margin-top: 8px;
  padding: 24px;
  border: 1px solid var(--accent-border);
  border-radius: 10px;
  background: var(--accent-dim);
}
.cta-box h3 { font-size: 20px; margin-bottom: 8px; }
.cta-box p { margin-bottom: 18px; }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  font-family: 'Roboto Condensed', sans-serif;
  font-weight: 600; font-size: 14px;
  text-transform: uppercase; letter-spacing: 0.10em;
  padding: 12px 26px; border-radius: 4px;
  text-decoration: none; transition: opacity .2s, background .2s, border-color .2s;
}
.btn.primary { color: #090909; background: var(--accent); }
.btn.primary:hover { opacity: .88; }
.btn.secondary { color: var(--accent); border: 1px solid var(--accent-border); }
.btn.secondary:hover { background: var(--accent-dim); border-color: var(--accent); }

/* таймкоды */
.chapters { align-self: start; position: sticky; top: 84px; }
.chapters ol {
  list-style: none;
  max-height: 560px;
  overflow-y: auto;
  border-top: 1px solid var(--line);
  scrollbar-width: thin;
  scrollbar-color: var(--text-faint) transparent;
}
.chapters li { border-bottom: 1px solid var(--line); }
.chapters button {
  all: unset;
  box-sizing: border-box;
  display: flex; gap: 12px; width: 100%;
  padding: 9px 4px;
  cursor: pointer;
  font-size: 14px; line-height: 1.4;
  color: var(--text-muted);
  transition: color .15s, background .15s;
}
.chapters button:hover, .chapters button:focus-visible { color: var(--text); background: rgba(0,212,252,0.05); }
.chapters time {
  flex: 0 0 58px;
  font-family: 'Roboto Condensed', sans-serif;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

/* ─── АДАПТИВ ─── */
@media (max-width: 1000px) {
  .edu-grid { grid-template-columns: repeat(2, 1fr); }
  .lesson-layout { grid-template-columns: 1fr; gap: 40px; }
  .chapters { position: static; }
  .chapters ol { max-height: 420px; }
}
@media (max-width: 760px) {
  .edu-card.featured { flex-direction: column; }
  .edu-card.featured .edu-cover { flex: none; aspect-ratio: 16 / 9; min-height: 0; }
  .edu-card.featured .edu-body { padding: 22px 24px 26px; }
}
@media (max-width: 600px) {
  .wrap { padding: 0 20px; }
  .page-hero { padding: 100px 0 32px; }
  .lesson-hero { padding: 90px 0 20px; }
  .edu-grid { grid-template-columns: 1fr; gap: 20px; padding-bottom: 64px; }
  .edu-card.featured { margin-bottom: 20px; }
  .player { border-radius: 8px; margin: 0 -4px; }
  .player .play { width: 68px; height: 68px; margin: -34px 0 0 -34px; }
  .player .play::before { left: 27px; top: 21px; border-left-width: 20px; border-top-width: 13px; border-bottom-width: 13px; }
  .lesson-layout { padding: 36px 0 64px; }
}
@media (prefers-reduced-motion: reduce) {
  .edu-card, .edu-cover img { transition: none; }
}
