/* Аудиотека «Обучение»: архивные аудио-лекции Гуру по годам. */

.at-back { margin-bottom: 14px; }
.at-back-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* --- Фото-карточка «Аудиотека Гуру» --- */

.at-cover {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 320px;
  border-radius: 18px;
  overflow: hidden;
  text-decoration: none;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
}

.at-cover-photo {
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image: url('/assets/learning/guru-lectures.webp?v=20261114-guru-v1');
  background-size: cover;
  background-position: center 78%;
}

.at-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    180deg,
    rgba(13, 17, 23, 0.08) 0%,
    rgba(13, 17, 23, 0.32) 46%,
    rgba(13, 17, 23, 0.78) 74%,
    rgba(13, 17, 23, 0.94) 100%
  );
}

.at-cover-copy {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 18px 16px 16px;
}

/* Весь текст на фото — белый (по решению владельца). */
.at-cover-title {
  font-size: 21px;
  line-height: 1.22;
  font-weight: 650;
  color: #fff;
}

.at-cover-sub {
  font-size: 13px;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.82);
}

.at-cover .at-progress { margin-top: 4px; }
.at-cover .at-progress-text { color: #fff; }
.at-cover .at-progress-track { background: rgba(255, 255, 255, 0.3); }
.at-cover .at-progress-fill { background: #fff; }

.at-cover:active { transform: scale(0.985); }

/* --- Прогресс --- */

.at-progress { display: flex; align-items: center; gap: 10px; margin-top: 2px; }
.at-progress-track {
  position: relative;
  display: block;
  flex: 1 1 auto;
  height: 4px;
  border-radius: 2px;
  background: var(--surface-soft);
  overflow: hidden;
  min-width: 60px;
}
.at-progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  display: block;
  border-radius: 2px;
  background: var(--good);
  transition: width .25s ease;
}
.at-progress-text {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
  white-space: nowrap;
}

/* --- Каталог годов --- */

.at-years { display: flex; flex-direction: column; gap: 10px; }

.at-year {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px;
  border: 1px solid var(--surface-soft);
  border-radius: 14px;
  background: var(--surface-raised);
  text-decoration: none;
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}
.at-year:active { transform: scale(0.99); }
.at-year:focus-visible { outline: 2px solid #78a5ff; outline-offset: 2px; }

.at-year-info { display: flex; flex: 1 1 auto; flex-direction: column; gap: 3px; min-width: 0; }
.at-year-title { font-size: 17px; font-weight: 620; line-height: 1.2; }
.at-year-count { font-size: 12px; color: var(--subtle); line-height: 1.3; }
.at-year .at-progress { flex: 1 1 160px; margin-top: 0; }
.at-year-chevron { flex: 0 0 auto; color: var(--subtle); }
.at-year-chevron svg { width: 18px; height: 18px; }

/* --- Шапка года --- */

.at-header { display: flex; flex-direction: column; gap: 8px; padding: 16px; margin-bottom: 14px; }
.at-header-title { margin: 0; font-size: 22px; line-height: 1.25; font-weight: 650; }

/* --- Карточка лекции --- */

.at-lectures { display: flex; flex-direction: column; gap: 10px; }

.at-lecture {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--surface-soft);
  border-radius: 14px;
  background: var(--surface-raised);
}

.at-lecture-main {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 0;
  background: none;
  border: 0;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.at-lecture-main:focus-visible { outline: 2px solid #78a5ff; outline-offset: 2px; border-radius: 10px; }

.at-lecture-icon {
  position: relative;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(120, 165, 255, 0.12);
  color: #9dc0ff;
}
.at-lecture-icon svg { width: 22px; height: 22px; }
.at-lecture-play { display: grid; place-items: center; }
.at-lecture-pause { display: none; place-items: center; }
.at-lecture.is-playing .at-lecture-play { display: none; }
.at-lecture.is-playing .at-lecture-pause { display: grid; }

.at-lecture-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
  font-size: 14.5px;
  line-height: 1.35;
  font-weight: 530;
}

.at-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.at-duration {
  margin-left: auto;
  padding: 9px 2px 9px 10px;
  color: var(--muted);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* --- Индикатор «Прослушано» --- */

.at-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 7px 13px;
  border: 1px solid var(--surface-soft);
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 530;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.at-toggle:focus-visible { outline: 2px solid #78a5ff; outline-offset: 2px; }
.at-toggle-icon { display: none; place-items: center; color: #57c690; }
.at-toggle-icon svg { width: 13px; height: 13px; }
.at-lecture.is-listened .at-toggle-icon { display: grid; }
.at-lecture.is-listened .at-toggle { border-color: rgba(87, 198, 144, 0.4); color: #57c690; }
/* Начатая лекция: голубой индикатор с прогрессом «Прослушано 12:34 из 30:41». */
.at-lecture.is-started .at-toggle { border-color: rgba(157, 192, 255, 0.4); color: #9dc0ff; }

/* --- Плеер (нижняя панель) --- */

.at-player {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: rgba(10, 14, 20, 0.96);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
}

.at-player-main {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 1 auto;
  min-width: 0;
  padding: 0;
  background: none;
  border: 0;
  color: #fff;
  text-align: left;
  cursor: pointer;
}
.at-player-icon {
  position: relative;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(120, 165, 255, 0.16);
  color: #9dc0ff;
}
.at-player-icon svg { width: 20px; height: 20px; }
.at-player-play-icon { display: grid; place-items: center; }
.at-player-pause-icon { display: none; place-items: center; }
.at-player.is-playing .at-player-play-icon { display: none; }
.at-player.is-playing .at-player-pause-icon { display: grid; }
.at-player-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  overflow: hidden;
  font-size: 13px;
  font-weight: 560;
  line-height: 1.3;
}

.at-player-timeline {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1 1 120px;
  min-width: 90px;
}
.at-player-track {
  position: relative;
  display: block;
  flex: 1 1 auto;
  height: 18px;
  cursor: pointer;
}
.at-player-track::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 7px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.18);
}
.at-player-fill {
  position: absolute;
  left: 0;
  top: 7px;
  height: 4px;
  width: 0;
  border-radius: 2px;
  background: #9dc0ff;
}
/* Тайм-код на своей строке: прослушано слева, длина дорожки справа. */
.at-player-times {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.at-player-time {
  flex: 0 0 auto;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.7);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.at-player-time-total {
  color: rgba(255, 255, 255, 0.45);
}

.at-player-status { flex: 0 1 auto; font-size: 11px; color: #ffb18a; min-width: 0; }

.at-player-close {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  cursor: pointer;
}

/* --- Заглушка загрузки --- */

.at-skeleton { padding: 22px 16px; }
