/* ╔══════════════════════════════════════════════════════╗
 ║  BLOG.CSS — стили ленты и одиночного поста (Bootstrap) ║
 ╚══════════════════════════════════════════════════════╝ */

/* ────────── ОСНОВНЫЕ ПЕРЕМЕННЫЕ ────────── */
:root {
  --accent: #0d6efd;
  --radius: .75rem;
}

/* ===================================================== */
/*                     ЛЕНТА БЛОГА                       */
/* ===================================================== */

/* Hero списка */
.blog-hero {
  max-width: 42rem;
  margin-inline: auto;
  text-align: center;
}

.blog-search input {
  min-width: 17rem;
  padding-left: 2.5rem;
}

.blog-search .bi {
  position: absolute;
  left: .9rem;
  top: 50%;
  transform: translateY(-50%);
  opacity: .5;
}

/* Карточка поста */
.post-card {
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: 0 2px 4px rgba(0, 0, 0, .05);
  transition: transform .25s ease, box-shadow .25s ease;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, .08);
}

.img-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}

.post-card:hover .img-cover {
  transform: scale(1.03);
}

/* Анимация появления элементов при скролле */
.js-observe {
  opacity: 0;
  transform: translateY(24px);
}

.js-observe.show {
  opacity: 1;
  transform: none;
  transition: opacity .5s ease, transform .5s ease;
}

/* Ссылки */
a.link-dark:hover {
  color: var(--accent);
  text-decoration: none;
}

/* Masonry плавнее перестраивается */
[data-masonry] {
  transition: height .4s ease;
}

/* ===================================================== */
/*                     SINGLE POST                       */
/* ===================================================== */

/* Hero-обложка */
.single-hero {
  height: clamp(50vh, 70vh, 720px);
  background-size: cover;
  background-position: center;
  position: relative;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, .3);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 1rem;
  margin-bottom: -1px !important;
  z-index: 1;
}

.single-hero::before {
  /* универсальное затемнение */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
      rgba(0, 0, 0, .75) 0%,
      rgba(0, 0, 0, .45) 40%,
      rgba(0, 0, 0, .45) 60%,
      rgba(0, 0, 0, .75) 100%);
}

.single-hero>div {
  position: relative;
  z-index: 1;
}

.single-hero__title {
  display: inline-block;
  max-width: 50rem;
  padding: .6rem 1.2rem;
  border-radius: .35rem;
  background: rgba(0, 0, 0, .35);
  backdrop-filter: blur(2px);
  line-height: 1.2;
  text-shadow:
    0 2px 4px rgba(0, 0, 0, .35),
    0 4px 12px rgba(0, 0, 0, .35);
}

/* мета-строка под заголовком */
.single-hero__meta {
  text-shadow: 0 1px 2px rgba(0, 0, 0, .4);
}

/* Убираем разрыв между header и main */
main.container-lg {
  margin-top: 0 !important;
  padding-top: 4rem !important;
}

/* Дополнительно убираем все возможные отступы */
.single-hero+main {
  margin-top: 0 !important;
}

/* Убираем серый фон body для статей */
body {
  background: #ffffff !important;
}

/* Дополнительно перекрываем все возможные селекторы body */
html body,
body.single,
body.single-post {
  background: #ffffff !important;
}

/* Перекрываем контейнер приложения */
.app-wrap {
  background: #ffffff !important;
}

/* Тело поста */
.single-body {
  max-width: 760px;
  margin-inline: auto;
  font-size: 1.125rem !important;
  /* Увеличен с 1.06rem до 1.125rem (18px) */
  line-height: 1.6 !important;
  /* Улучшен с 1.75 до 1.6 для оптимальной читаемости */
  word-spacing: 0.05em !important;
  /* Добавлен небольшой интервал между словами */
  font-family: "PT Root UI", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

/* Принудительная типографика для всех элементов в контенте */
.single-body,
.single-body * {
  font-family: "PT Root UI", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

.single-body h2,
.single-body h3 {
  margin-top: 2.5rem !important;
  margin-bottom: 1.2rem !important;
  /* Увеличен отступ снизу */
  font-weight: 600 !important;
  line-height: 1.3 !important;
  /* Добавлен line-height для заголовков */
  font-family: "PT Root UI", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

.single-body h2 {
  font-size: 1.75rem !important;
  /* Явно задан размер h2 */
}

.single-body h3 {
  font-size: 1.5rem !important;
  /* Явно задан размер h3 */
}

/* Параграфы */
.single-body p {
  margin-bottom: 1.25rem !important;
  /* Увеличены отступы между параграфами */
  font-size: 1.125rem !important;
  line-height: 1.6 !important;
  font-family: "PT Root UI", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

/* Изображения в статье */
.single-body img {
  max-width: 100%;
  height: auto;
  border-radius: .6rem;
  margin: 2rem 0;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .08);
}

/* Кодовые блоки */
.single-body pre {
  background: #212529;
  color: #f8f9fa;
  padding: 1.25rem 1.5rem;
  border-radius: .5rem;
  overflow: auto;
  font-size: .9rem;
}

/* Списки */
.single-body ul,
.single-body .wp-block-list {
  list-style: disc !important;
  list-style-position: outside !important;
  margin: 1.75rem 0;
  /* Увеличены отступы */
  padding-left: 1.75rem;
  /* Уменьшен отступ для лучшего выравнивания */
}

.single-body ol {
  list-style: decimal !important;
  list-style-position: outside !important;
  margin: 1.75rem 0;
  /* Увеличены отступы */
  padding-left: 1.75rem;
  /* Уменьшен отступ для лучшего выравнивания */
}

/* Нумерованные списки WordPress (если нужна нумерация вместо точек) */
.single-body ul.numbered-list,
.single-body .wp-block-list.numbered-list {
  list-style: decimal !important;
  counter-reset: list-counter;
}

.single-body li,
.single-body .wp-block-list li {
  margin-bottom: 0.5rem;
  /* Уменьшен для лучшего группирования */
  line-height: 1.5;
  /* Оптимизирован line-height для списков */
  padding-left: 0.25rem;
  /* Небольшой отступ от маркера */
  display: list-item !important;
  list-style: inherit !important;
}

/* Принудительное отображение маркеров для WordPress блоков */
.single-body .wp-block-list li {
  list-style: disc !important;
  display: list-item !important;
  list-style-position: outside !important;
}

/* Если нужны номера для .wp-block-list */
.single-body .wp-block-list.ordered li {
  list-style: decimal !important;
}

/* Вложенные списки */
.single-body ul ul,
.single-body ol ol,
.single-body ul ol,
.single-body ol ul {
  margin: 0.75rem 0;
  /* Увеличены отступы для вложенных списков */
  padding-left: 1.5rem;
  /* Отступ для вложенности */
}

.single-body ul ul {
  list-style-type: circle !important;
}

.single-body ul ul ul {
  list-style-type: square !important;
}

/* Отмена Bootstrap reset для списков в статьях */
.single-body ul,
.single-body ol {
  margin-bottom: 1rem !important;
  padding-left: 2rem !important;
}

.single-body ul li,
.single-body ol li {
  margin-bottom: 0.5rem !important;
}

/* Убираем возможные конфликты с Bootstrap */
.single-body .list-unstyled {
  list-style: disc !important;
  padding-left: 1.75rem !important;
}

/* Цитаты */
.single-body blockquote {
  margin: 2rem 0;
  padding: 1.5rem 2rem;
  border-left: 4px solid var(--accent);
  background: rgba(13, 110, 253, 0.05);
  border-radius: 0 .5rem .5rem 0;
  font-style: italic;
  font-size: 1.1rem;
  line-height: 1.5;
  color: #495057;
}

.single-body blockquote p:last-child {
  margin-bottom: 0;
}

/* Ссылки в тексте */
.single-body a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: all 0.2s ease;
}

.single-body a:hover {
  color: #0056b3;
  text-decoration-thickness: 2px;
}

/* Выделение текста */
.single-body strong,
.single-body b {
  font-weight: 600;
  color: #212529;
}

.single-body em,
.single-body i {
  font-style: italic;
  color: #495057;
}

/* Таблицы */
.single-body table {
  width: 100%;
  margin: 2rem 0;
  font-size: .95rem;
  border-collapse: collapse;
}

.single-body th,
.single-body td {
  padding: .6rem .8rem;
  border: 1px solid #dee2e6;
}

/* ===================================================== */
/*                     ️ ХЛЕБНЫЕ КРОШКИ                    */
/* ===================================================== */

.breadcrumb {
  --bs-breadcrumb-divider: '/';
  justify-content: center;
  background: transparent;
  margin-bottom: 0;
}

.breadcrumb-item a {
  color: #fff;
  text-decoration: none;
}

.breadcrumb-item a:hover {
  text-decoration: underline;
}

.breadcrumb-item.active {
  color: #e9ecef;
}
