/* Стили страниц блога: список статей (плитки) и детальная страница.
   Использует переменные и типографику из global.css / styles.css —
   подключать вместе с ними. */

.blog-hero {
  padding: 64px 4rem 24px;
  text-align: center;
}

.blog-hero .section-title {
  text-align: center;
}

.blog-hero-subtitle {
  max-width: 640px;
  margin: 1rem auto 0;
  text-align: center;
}

.blog-section {
  padding: 24px 4rem 100px;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  align-items: stretch;
}

.blog-card {
  display: flex;
  flex-direction: column;
  border: 1px solid #f0e3d6;
  border-radius: 24px;
  overflow: hidden;
  background-color: var(--white);
  box-shadow: 0 10px 30px rgba(33, 33, 33, 0.06);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  height: 100%;
}

.blog-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 36px rgba(33, 33, 33, 0.1);
}

.blog-card-image-wrapper {
  width: 100%;
  aspect-ratio: 16 / 10;
  background-color: var(--primary-bg);
  overflow: hidden;
}

.blog-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.blog-card-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  flex: 1;
}

.blog-card-date {
  font-size: 13px;
  font-weight: 500;
  color: var(--primary-color);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.blog-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text-dark);
}

.blog-card-preview {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-light);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 0;
  font-size: 18px;
  color: var(--text-light);
}

.blog-pagination {
  display: flex;
  justify-content: center;
  margin-top: 48px;
}

.blog-load-more {
  max-width: 280px;
}

.blog-load-more[hidden] {
  display: none;
}

/* ─── Детальная страница статьи ─────────────────────────────────────── */

.article-section {
  padding: 56px 4rem 100px;
}

.article-container {
  max-width: 800px;
  margin: 0 auto;
}

.article-back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 500;
  color: var(--primary-color);
  margin-bottom: 32px;
}

.article-back-link:hover {
  text-decoration: underline;
}

.article-date {
  font-size: 14px;
  font-weight: 500;
  color: var(--primary-color);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.article-title {
  margin-top: 12px;
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-dark);
}

.article-cover {
  width: 100%;
  max-height: 440px;
  object-fit: cover;
  border-radius: 24px;
  margin-top: 32px;
}

.article-content {
  margin-top: 40px;
  font-size: 17px;
  line-height: 1.8;
  color: var(--text-dark-secondary, var(--text-dark));
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4 {
  margin-top: 2em;
  margin-bottom: 0.6em;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text-dark);
}

.article-content h1 { font-size: 2.1rem; }
.article-content h2 { font-size: 1.75rem; }
.article-content h3 { font-size: 1.35rem; }
.article-content h4 { font-size: 1.15rem; }

.article-content p {
  max-width: none;
  margin-bottom: 1.2em;
}

/* Глобальный сброс ul { list-style: none } из global.css прячет маркеры,
   поэтому внутри статьи возвращаем браузерные по умолчанию через revert.
   Инлайновый list-style-type от CKEditor (круг, квадрат и т.п.) при этом
   имеет больший приоритет и сохраняется. */
.article-content ul,
.article-content ol {
  margin: 0 0 1.2em;
  padding-left: 1.4em;
  list-style: revert;
}

.article-content li {
  list-style: revert;
  margin-bottom: 0.5em;
}

/* Подчеркиваем только настоящие ссылки (с href): CKEditor может
   сохранять служебные якоря <a> без href вокруг текста — их не трогаем. */
.article-content a[href] {
  color: var(--primary-color);
  text-decoration: underline;
}

.article-content blockquote {
  margin: 1.6em 0;
  padding: 0.6em 1.4em;
  border-left: 4px solid var(--primary-color);
  background-color: var(--primary-bg);
  border-radius: 0 12px 12px 0;
  color: var(--text-dark);
}

.article-content img {
  width: 100%;
  border-radius: 16px;
  margin: 1.6em 0;
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.6em 0;
}

.article-content table td,
.article-content table th {
  border: 1px solid #e5d9cc;
  padding: 10px 14px;
}

@media (max-width: 1200px) {
  .blog-hero,
  .blog-section,
  .article-section {
    padding-inline: 2rem;
  }
}

@media (max-width: 900px) {
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .blog-hero,
  .blog-section,
  .article-section {
    padding-inline: 1.25rem;
  }

  .article-title {
    font-size: 2rem;
  }
}

@media (max-width: 600px) {
  .blog-grid {
    grid-template-columns: 1fr;
  }
}
