/* Главная, блок «Блог» (templates/public/home/blog.html).

   Карусель карточек с 3D-обложками глав. Лента — нативная прокрутка со
   scroll-snap: слева начинается по краю контента, справа уходит за край
   окна (отрицательный правый отступ до края экрана). Сверху и снизу у
   ленты запас под тень карточек, его съедают отрицательные поля.
   Стрелки и полоса положения — blog.js; без скрипта они скрыты. */
.bl { --bl-g: clamp(16px, 4vw, 48px); }   /* боковое поле, как у .wrap */

.bl-hd { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 40px; }
.bl-t { display: grid; gap: 18px; min-width: 0; }
.bl-kick {
  display: inline-flex; align-items: center; gap: 8px; width: max-content;
  padding: 6px 13px 6px 7px; border-radius: var(--pill);
  font-size: 13.5px; font-weight: 600; color: var(--ink-2);
  background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--border);
}
.bl-kick b { padding: 3px 9px; border-radius: var(--pill); font-size: 12px; font-weight: 700; color: #fff; background: var(--ink); }
.bl-hd h2 { margin: 0; font-size: clamp(32px, 4.6vw, 48px); line-height: 1.06; letter-spacing: -.03em; }
.bl-hd h2 em {
  font-style: normal; color: transparent;
  background: linear-gradient(95deg, #1f7bff, #17bfe0 55%, #2ee59d);
  -webkit-background-clip: text; background-clip: text;
}
.bl-sub { margin: 0; font-size: 17.5px; line-height: 1.55; color: var(--ink-2); }
.bl-act { display: flex; align-items: center; gap: 12px; flex: none; }
.bl-act .btn { min-height: 48px; padding: 0 24px; }
.bl-arrows { display: flex; gap: 8px; }
.bl-arr {
  display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%;
  font: 500 20px/1 var(--font); color: var(--ink); background: var(--surface);
  box-shadow: inset 0 0 0 1.5px var(--border); cursor: pointer; transition: background .15s, opacity .15s;
}
.bl-arr:hover:not(:disabled) { background: var(--surface-2); }
.bl-arr:disabled { opacity: .4; cursor: default; }
.bl-arr:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent); outline-offset: 2px; }
.bl-arrows[hidden], .bl-bar[hidden] { display: none; }

/* лента: слева поле контента, справа — до края окна */
.bl-track {
  display: grid; grid-auto-flow: column; grid-auto-columns: min(392px, 82vw); gap: 22px;
  margin: -10px calc(50% - 50vw) -34px calc(-1 * var(--bl-g));
  padding: 10px calc(50vw - 50%) 64px var(--bl-g);
  scroll-padding-inline: var(--bl-g);
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scrollbar-width: none;
}
.bl-track::-webkit-scrollbar { display: none; }

.bl-card {
  scroll-snap-align: start; display: flex; flex-direction: column; overflow: hidden;
  border-radius: 28px; color: var(--ink); text-decoration: none; background: var(--surface);
  box-shadow: 0 0 0 1px var(--border-2), 0 30px 60px -30px rgba(25, 30, 80, .28);
  transition: box-shadow .2s;
}
.bl-card:hover { color: var(--ink); box-shadow: 0 0 0 1px var(--border), 0 34px 64px -28px rgba(25, 30, 80, .34); }
.bl-card:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 40%, transparent); outline-offset: 3px; }
.bl-cov { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: #dfe6fb; }
.bl-cov img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.bl-card:hover .bl-cov img { transform: scale(1.04); }
.bl-grade {
  position: absolute; left: 14px; top: 14px; display: inline-flex; align-items: center; height: 26px; padding: 0 10px;
  border-radius: var(--pill); font-size: 12.5px; font-weight: 700; white-space: nowrap; color: var(--ink);
  background: rgba(255, 255, 255, .8); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.bl-bd { flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 22px 24px; }
.bl-chap { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; line-height: 1.3; color: var(--muted); }
.bl-chap::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: linear-gradient(135deg, #4d97ff, #33d0ec); }
.bl-bd h3 { margin: 0; font-size: 22px; line-height: 1.2; letter-spacing: -.015em; }
.bl-bd p { flex: 1; margin: 0; font-size: 15.5px; line-height: 1.55; color: var(--muted); }
.bl-ft {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--border);
  font-size: 13.5px; color: var(--muted);
}
.bl-read { font-size: 15px; font-weight: 700; white-space: nowrap; color: var(--accent); }

/* полоса положения ленты */
.bl-bar { position: relative; height: 4px; max-width: 280px; border-radius: 4px; background: var(--border); overflow: hidden; }
.bl-bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 40%; border-radius: 4px; background: var(--ink); }

@media (max-width: 720px) {
  .bl-hd { flex-direction: column; align-items: stretch; gap: 18px; margin-bottom: 26px; }
  .bl-sub { font-size: 16px; }
  .bl-act { justify-content: space-between; }
  .bl-act .btn { min-height: 44px; padding: 0 20px; font-size: 15px; }
  .bl-arr { width: 44px; height: 44px; }
  .bl-track { gap: 14px; margin-bottom: -24px; padding-bottom: 50px; }
  .bl-bd { padding: 18px; }
  .bl-bd h3 { font-size: 20px; }
  .bl-bd p { font-size: 15px; }
  .bl-bar { max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  .bl-cov img { transition: none; }
  .bl-card:hover .bl-cov img { transform: none; }
}
