/* Блог Erudia: главная блога, рубрики, посты. Подключается после redesign-v2.css */

.bl-page {
  --bl-gray: #f5f5f7;
  --bl-wrap: 1040px;
  background: var(--bg);
}

.bl-wrap {
  max-width: calc(var(--bl-wrap) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Шапка страницы */
.bl-head {
  padding: 48px 0 28px;
}

.bl-crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  font-size: 14px;
  color: var(--muted);
}

.bl-crumbs a {
  transition: color 0.18s var(--ease);
}

.bl-crumbs a:hover {
  color: var(--blue);
}

.bl-crumbs span[aria-hidden] {
  color: var(--muted-2);
}

.bl-title {
  font-size: clamp(38px, 6.4vw, 64px);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.045em;
  color: var(--ink);
}

.bl-sub {
  max-width: 620px;
  margin-top: 16px;
  font-size: clamp(18px, 2.1vw, 21px);
  line-height: 1.5;
  color: var(--muted);
  text-wrap: pretty;
}

/* Строка рубрик */
.bl-nav {
  position: sticky;
  top: var(--header-h);
  z-index: 90;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: saturate(1.2) blur(16px);
  -webkit-backdrop-filter: saturate(1.2) blur(16px);
}

.bl-nav__list {
  display: flex;
  gap: 28px;
  overflow-x: auto;
  scrollbar-width: none;
}

.bl-nav__list::-webkit-scrollbar {
  display: none;
}

.bl-nav__list a {
  position: relative;
  flex-shrink: 0;
  padding: 15px 0 14px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--muted);
  white-space: nowrap;
  transition: color 0.18s var(--ease);
}

.bl-nav__list a:hover {
  color: var(--ink);
}

.bl-nav__list a[aria-current="page"] {
  color: var(--ink);
}

.bl-nav__list a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--ink);
}

/* Секции */
.bl-section {
  padding: 56px 0;
}

.bl-section--gray {
  background: var(--bl-gray);
}

.bl-section--first {
  padding-top: 40px;
}

.bl-section--tight {
  padding-top: 0;
}

.bl-feature + .bl-grid {
  margin-top: 20px;
}

.bl-section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
  margin-bottom: 24px;
}

.bl-section__title {
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.bl-section__text {
  max-width: 620px;
  margin: -12px 0 24px;
  font-size: 17px;
  line-height: 1.55;
  color: var(--muted);
}

.bl-more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--blue);
}

.bl-more:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Подпись над заголовком: рубрика */
.bl-eyebrow {
  display: block;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--blue);
}

.bl-date {
  display: block;
  font-size: 14px;
  color: var(--muted);
}

/* Обложки рубрик */
.bl-cover {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  color: var(--blue);
  background: linear-gradient(135deg, #dbeafe 0%, #eff6ff 55%, #f8fbff 100%);
}

.bl-cover--ucheba {
  color: #15803d;
  background: linear-gradient(135deg, #d1fae5 0%, #ecfdf5 55%, #f7fefb 100%);
}

.bl-cover--ai {
  color: #6d28d9;
  background: linear-gradient(135deg, #e9e3ff 0%, #f5f3ff 55%, #fbfaff 100%);
}

.bl-cover--news {
  color: #c2410c;
  background: linear-gradient(135deg, #ffe4cc 0%, #fff7ed 55%, #fffcf8 100%);
}

.bl-cover::before {
  content: "";
  position: absolute;
  inset: auto -10% -45% auto;
  width: 70%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.06;
}

.bl-cover__icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 8px 24px -12px rgba(15, 23, 42, 0.18);
  transition: transform 0.5s var(--ease);
}

.bl-cover__icon svg {
  width: 34px;
  height: 34px;
}

.bl-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Обложки статей 1200×630: показываем целиком, поля в цвет фона обложки */
.bl-cover:has(img) {
  background: #eff6ff;
}

.bl-cover:has(img)::before {
  display: none;
}

.bl-cover:has(img) img {
  object-fit: contain;
}

/* Главный материал */
.bl-feature {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  transition: box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}

.bl-feature:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow);
}

.bl-feature:hover .bl-cover__icon {
  transform: scale(1.06);
}

.bl-feature .bl-cover__icon {
  width: 96px;
  height: 96px;
  border-radius: 26px;
}

.bl-feature .bl-cover__icon svg {
  width: 44px;
  height: 44px;
}

.bl-feature__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px 22px 26px;
}

.bl-feature__title {
  font-family: var(--font-display);
  font-size: clamp(24px, 3.2vw, 34px);
  font-weight: 800;
  line-height: 1.14;
  letter-spacing: -0.035em;
  color: var(--ink);
  text-wrap: balance;
}

.bl-feature__desc {
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink-2);
}

.bl-feature .bl-date {
  margin-top: 4px;
}

@media (min-width: 820px) {
  .bl-feature {
    grid-template-columns: 1.25fr 1fr;
  }

  .bl-feature .bl-cover {
    aspect-ratio: auto;
    min-height: 340px;
  }

  .bl-feature__body {
    justify-content: center;
    padding: 40px 40px 40px 36px;
  }
}

/* Сетка плиток */
.bl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.bl-grid--compact {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.bl-tile {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  transition: box-shadow 0.3s var(--ease), border-color 0.3s var(--ease), transform 0.3s var(--ease);
}

a.bl-tile:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

a.bl-tile:hover .bl-cover__icon {
  transform: scale(1.08);
}

.bl-tile__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  padding: 18px 20px 20px;
}

.bl-tile__title {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: -0.025em;
  color: var(--ink);
}

.bl-tile__desc {
  font-size: 15.5px;
  line-height: 1.5;
  color: var(--muted);
}

.bl-tile .bl-date {
  margin-top: auto;
  padding-top: 6px;
}

.bl-grid--compact .bl-tile__body {
  padding: 14px 16px 16px;
}

.bl-grid--compact .bl-tile__title {
  font-size: 16px;
}

.bl-grid--compact .bl-cover__icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
}

.bl-grid--compact .bl-cover__icon svg {
  width: 26px;
  height: 26px;
}

/* Плитка «скоро»: тема запланирована, поста ещё нет */
.bl-tile--soon {
  border-style: dashed;
  background: transparent;
}

.bl-tile--soon .bl-cover {
  aspect-ratio: 16 / 7;
  filter: saturate(0.4);
  opacity: 0.7;
}

.bl-tile--soon .bl-eyebrow {
  color: var(--muted);
}

.bl-tile--soon .bl-tile__title {
  color: var(--ink-2);
}

/* Рубрики */
.bl-rubrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 16px;
}

.bl-rubric {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px 22px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  transition: box-shadow 0.3s var(--ease), border-color 0.3s var(--ease), transform 0.3s var(--ease);
}

.bl-rubric:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.bl-rubric .bl-cover {
  width: 48px;
  height: 48px;
  aspect-ratio: 1;
  margin-bottom: 6px;
  border-radius: 14px;
}

.bl-rubric .bl-cover::before {
  display: none;
}

.bl-rubric .bl-cover__icon {
  width: auto;
  height: auto;
  border-radius: 0;
  background: none;
  box-shadow: none;
}

.bl-rubric .bl-cover svg {
  width: 24px;
  height: 24px;
}

.bl-rubric__title {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--ink);
}

.bl-rubric__text {
  font-size: 15.5px;
  line-height: 1.5;
  color: var(--muted);
}

.bl-rubric__count {
  margin-top: auto;
  padding-top: 4px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
}

.bl-rubric__count--soon {
  color: var(--muted-2);
}

/* Шаги «с чего начать» */
.bl-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  counter-reset: bl-step;
}

.bl-steps li {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  counter-increment: bl-step;
}

.bl-steps li::before {
  content: counter(bl-step);
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: var(--ink);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.bl-steps strong {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.bl-steps p {
  font-size: 15.5px;
  line-height: 1.5;
  color: var(--muted);
}

.bl-steps a {
  display: inline-block;
  margin-top: 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--blue);
}

.bl-steps a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Пустая рубрика */
.bl-empty {
  margin-bottom: 28px;
  font-size: 17px;
  line-height: 1.55;
  color: var(--muted);
}

.bl-empty strong {
  color: var(--ink);
  font-weight: 650;
}

/* Ссылки на страницы сервиса */
.bl-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.bl-links a {
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-2);
  transition: border-color 0.18s var(--ease), color 0.18s var(--ease);
}

.bl-links a:hover {
  border-color: var(--blue-mist);
  color: var(--blue);
}

@media (max-width: 640px) {
  .bl-head {
    padding: 28px 0 20px;
  }

  .bl-nav__list {
    gap: 22px;
  }

  .bl-section {
    padding: 40px 0;
  }

  .bl-section--first {
    padding-top: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bl-feature,
  .bl-tile,
  .bl-rubric,
  .bl-cover__icon {
    transition: none;
  }

  a.bl-tile:hover,
  .bl-rubric:hover {
    transform: none;
  }
}

/* Главная блога: карточки «С чего начать», якоря разделов */
.bl-hubs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.bl-hub {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  transition: box-shadow 0.3s var(--ease), border-color 0.3s var(--ease), transform 0.3s var(--ease);
}

.bl-hub:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.bl-hub__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  padding: 16px 18px 18px;
}

.bl-hub__title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: -0.025em;
  color: var(--ink);
}

.bl-hub__cta {
  margin-top: auto;
  padding-top: 4px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--blue);
}

.bl-page section[id] {
  scroll-margin-top: calc(var(--header-h) + 52px);
}

.bl-section__more {
  margin-top: 24px;
}

@media (prefers-reduced-motion: reduce) {
  .bl-hub { transition: none; }
  .bl-hub:hover { transform: none; }
}
