/* Инструкции используют сетку, типографику и отступы главной; общие элементы — в site.css. */

.docs-page { min-height: 100svh; isolation: isolate; }
.docs-page .docs-main, .docs-page .site-footer { position: relative; z-index: 1; }
.docs-main { padding-top: 72px; padding-bottom: 72px; }

/* Заголовок раздела */
.docs-hero { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: clamp(36px, 4vw, 64px); align-items: center; }
.docs-heading { min-width: 0; container-type: inline-size; }
.docs-hero h1 { margin: 0; font-size: clamp(2.35rem, 12cqi, 5rem); line-height: 1.03; letter-spacing: -.04em; font-weight: 800; }
.docs-hero h1 span { color: var(--eco); }
.docs-intro { min-width: 0; }
.docs-lead { margin: 0; max-width: 46ch; font-size: 1.0625rem; line-height: 1.65; color: var(--muted); }
.docs-service-link { display: inline-flex; align-items: center; gap: 14px; margin-top: 28px; padding-bottom: 7px; border-bottom: 1px solid var(--rule); font-size: .875rem; line-height: 1.5; font-weight: 700; transition: color .25s, border-color .25s; }
.docs-service-link span { display: inline-block; transition: transform .25s; }
.docs-service-link:hover { color: var(--accent); border-color: var(--accent); }
.docs-service-link:hover span { transform: translate(2px, -2px); }

/* Фильтр по ролям */
.docs-filter { display: flex; flex-wrap: wrap; gap: 10px; }
.docs-chip { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 54px; padding: 12px 20px; border: 1px solid var(--rule); border-radius: 999px; background: transparent; font-size: 1rem; font-weight: 700; color: var(--muted); transition: color .25s, border-color .25s, background .25s; }
.docs-chip span { font-size: .75rem; font-weight: 400; color: var(--muted); }
.docs-chip:hover { color: var(--accent); border-color: var(--accent); background: #00857408; }
.docs-chip[aria-pressed="true"] { color: #fff; border-color: var(--accent); background: var(--accent); }
.docs-chip[aria-pressed="true"] span { color: #ffffffc7; }

/* Продукт и группы по ролям */
.docs-product { margin-top: 96px; }
.docs-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 44px 28px; margin: 40px 0 0; padding: 0; list-style: none; }
.docs-item { min-width: 0; }

/* Карточка ролика */
.docs-card { display: flex; flex-direction: column; gap: 14px; height: 100%; }
.docs-poster { position: relative; display: block; aspect-ratio: 4 / 5; overflow: hidden; border-radius: 6px; background: #1d1e1e; box-shadow: 0 0 0 1px #17281e24; transition: transform .3s cubic-bezier(.22, 1, .36, 1), box-shadow .3s; }
.docs-poster img { display: block; width: 100%; height: 100%; object-fit: contain; }
.docs-poster::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, #0b1615a6); pointer-events: none; }
.docs-play { position: absolute; z-index: 1; left: 14px; bottom: 14px; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--eco); color: #fff; box-shadow: 0 10px 22px -8px #009d8dcc; transition: transform .2s, background .2s; }
.docs-play svg { width: 22px; height: 22px; margin-left: 2px; }
.docs-time { position: absolute; z-index: 1; right: 12px; bottom: 16px; padding: 4px 9px; border-radius: 999px; background: #0b1615b8; color: #fff; font-size: .75rem; font-weight: 700; font-variant-numeric: tabular-nums; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.docs-card:hover .docs-poster { transform: translateY(-4px); box-shadow: 0 10px 22px -16px #142c2540, 0 0 0 1px #009d8d66; }
.docs-card:hover .docs-play { transform: scale(1.1); background: #00b09e; }
.docs-card-role { margin-top: 4px; margin-bottom: -6px; font-size: .6875rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; color: var(--accent); }
.docs-card-title { font-size: 1.125rem; font-weight: 700; line-height: 1.4; letter-spacing: -.015em; transition: color .25s; }
.docs-card:hover .docs-card-title { color: var(--accent); }
.docs-card-text { margin-top: -4px; font-size: .9375rem; line-height: 1.7; color: var(--muted); }

/* Общие куски страницы ролика: метка роли, текст, кнопки */
.docs-info-tag { margin: 0; font-size: .75rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.docs-info-text { margin: 0; font-size: 1rem; line-height: 1.6; color: var(--muted); }
.docs-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.docs-button { display: inline-flex; cursor: pointer; align-items: center; gap: 8px; padding: 11px 18px; border: 1px solid var(--rule); border-radius: 999px; background: #ffffffa6; font-size: .8125rem; font-weight: 700; color: var(--ink); transition: border-color .2s, color .2s, background .2s; }
.docs-button svg { width: 16px; height: 16px; flex: none; }
.docs-button:hover { border-color: var(--accent); color: var(--accent); }
.docs-button-primary { background: var(--eco); border-color: var(--eco); color: #fff; }
.docs-button-primary:hover { background: #00b09e; border-color: #00b09e; color: #fff; }
.docs-status { min-height: 1.25em; margin: 0; font-size: .75rem; color: var(--accent); }


@media (min-width: 1650px) {
  .docs-main { padding-top: 88px; }
}
@media (max-width: 1200px) {
  .docs-main { padding-top: 56px; }
  .docs-hero { gap: 36px; }
  .docs-grid { gap: 36px 20px; }
}
@media (min-width: 851px) and (max-width: 1100px) {
  .docs-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 850px) {
  .docs-main { padding-top: 34px; padding-bottom: 40px; }
  .docs-hero { grid-template-columns: 1fr; gap: 24px; }
  .docs-product { margin-top: 64px; }
  .docs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 18px; margin-top: 32px; }
}
@media (max-width: 560px) {
  .docs-main { padding-top: 30px; }
  .docs-hero h1 { font-size: clamp(2.35rem, 11cqi, 4.5rem); }
  .docs-lead { font-size: 1rem; }
  .docs-product { margin-top: 56px; }
  .docs-filter { gap: 8px; }
  .docs-chip { min-height: 48px; padding: 12px 14px; font-size: .875rem; }
  .docs-grid { gap: 30px 14px; }
  .docs-play { width: 40px; height: 40px; left: 10px; bottom: 10px; }
  .docs-play svg { width: 18px; height: 18px; }
  .docs-time { right: 8px; bottom: 12px; font-size: .6875rem; }
  .docs-card-title { font-size: 1rem; }
  .docs-card-text { font-size: .875rem; line-height: 1.65; }
}
@media (hover: none) {
  .docs-card:hover .docs-poster { transform: none; }
}

/* Страница ролика */
.lesson-crumbs { padding-top: 0; }
.lesson-crumbs a { display: inline-flex; align-items: center; gap: 8px; font-size: .875rem; font-weight: 700; color: var(--muted); transition: color .2s; }
.lesson-crumbs a:hover { color: var(--accent); }
.lesson-crumbs svg { width: 18px; height: 18px; }
.lesson { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); grid-template-areas: 'info video'; gap: clamp(36px, 4vw, 64px); align-items: center; padding: 36px 0 72px; }
.lesson-video { grid-area: video; justify-self: center; width: min(100%, 360px); aspect-ratio: 9 / 16; border-radius: 6px; overflow: hidden; background: #1d1e1e; box-shadow: 0 0 0 1px #17281e24; }
.lesson-player { display: block; width: 100%; height: 100%; object-fit: contain; background: #070e0b; }
.lesson-info { grid-area: info; min-width: 0; container-type: inline-size; }
.lesson-info h1 { margin: 0; font-size: clamp(2.35rem, 12cqi, 5rem); line-height: 1.03; letter-spacing: -.04em; font-weight: 800; }
.lesson-info .docs-info-tag { margin-bottom: 18px; }
.lesson-info .docs-info-text { max-width: 46ch; margin: 24px 0 0; font-size: 1.0625rem; line-height: 1.65; }
.lesson-info .docs-actions { margin-top: 30px; }
.lesson-pagers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.lesson-pager { display: flex; flex-direction: column; gap: 8px; padding: 22px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); transition: color .25s, border-color .25s; }
.lesson-pager span { font-size: .6875rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.lesson-pager strong { font-size: 1.0625rem; font-weight: 800; letter-spacing: -.01em; }
.lesson-pager:hover { border-color: var(--accent); color: var(--accent); }
.lesson-pager-prev { grid-column: 1; }
.lesson-pager-next { grid-column: 2; text-align: right; }
.lesson-more { padding-top: 72px; }
.lesson-more h2 { margin: 0; font-size: clamp(1.75rem, 3vw, 2.5rem); font-weight: 700; line-height: 1.2; letter-spacing: -.03em; }

/* «Поделиться»: на <details>, чтобы меню открывалось и без скрипта; скрипт добавляет «Скопировать ссылку»,
   закрытие по щелчку снаружи и по Esc, а на телефоне — системное окно «Поделиться» */
.share { position: relative; }
.share > summary { list-style: none; }
.share > summary::-webkit-details-marker { display: none; }
.share-menu { position: absolute; z-index: 6; top: calc(100% + 10px); left: 0; display: flex; flex-direction: column; min-width: 236px; padding: 8px; border: 1px solid var(--rule); border-radius: 14px; background: #fffffff2; box-shadow: 0 22px 44px -18px #142c2570; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.share-item { display: flex; align-items: center; width: 100%; padding: 11px 14px; border: 0; border-radius: 9px; background: none; font-size: .9375rem; font-weight: 600; color: var(--ink); text-align: left; cursor: pointer; transition: background .15s, color .15s; }
.share-item:hover, .share-item:focus-visible { background: #e7f3ef; color: var(--accent); }

@media (max-width: 850px) {
  .lesson { grid-template-columns: 1fr; grid-template-areas: 'info' 'video'; gap: 32px; padding: 30px 0 40px; }
  .lesson-video { width: min(100%, 340px); }
  .lesson-info { width: 100%; }
  .lesson-pagers { grid-template-columns: 1fr; }
  .lesson-pager-prev, .lesson-pager-next { grid-column: 1; text-align: left; }
  .lesson-more { padding-top: 36px; }
}
