/* =============================================
   BLOG — АРХИВ
   ============================================= */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.25rem, 3vw, 1.75rem);
}

.posts-grid--related {
  grid-template-columns: repeat(3, 1fr);
}

.blog-archive__empty {
  color: var(--color-muted);
  text-align: center;
  padding: 3rem 0;
}

/* =============================================
   BLOG — КАРТОЧКА
   ============================================= */
.post-card {
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow var(--transition), border-color var(--transition);
}

.post-card:hover {
  border-color: var(--color-border-dark);
  box-shadow: var(--shadow);
}

.post-card__media {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--color-bg-soft);
}

.post-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.post-card:hover .post-card__img { transform: scale(1.03); }

.post-card__placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  background: var(--color-bg-warm);
}

.post-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.35rem 1.5rem 1.5rem;
  gap: 0.5rem;
}

.post-card__date {
  font-size: 0.75rem;
  color: var(--color-muted);
  letter-spacing: 0.02em;
}

.post-card__title {
  font-size: 1.05rem;
  line-height: 1.35;
  margin: 0;
}

.post-card__title a {
  transition: color var(--transition);
}

.post-card__title a:hover { color: var(--color-muted); }

.post-card__excerpt {
  font-size: 0.875rem;
  color: var(--color-muted);
  line-height: 1.65;
  margin: 0;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card__more {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-primary);
  transition: gap var(--transition);
}

.post-card__more:hover { gap: 0.55rem; }

.post-card--compact .post-card__excerpt {
  -webkit-line-clamp: 2;
}

/* =============================================
   BLOG — ПАГИНАЦИЯ
   ============================================= */
.posts-pagination {
  margin-top: clamp(2rem, 4vw, 3rem);
}

.posts-pagination .nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
}

.posts-pagination a,
.posts-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 0.75rem;
  font-size: 0.875rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  transition: background var(--transition), border-color var(--transition);
}

.posts-pagination a:hover {
  background: var(--color-bg-soft);
  border-color: var(--color-border-dark);
}

.posts-pagination .current {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

/* =============================================
   BLOG — СТРАНИЦА СТАТЬИ
   ============================================= */
.post-hero {
  background: var(--color-primary);
  color: #fff;
  padding-block: clamp(2rem, 5vw, 3rem);
}

.post-hero__date {
  display: block;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 0.75rem;
}

.post-hero__title {
  color: #fff;
  font-size: clamp(1.5rem, 3.5vw, 2.25rem);
  max-width: 820px;
  margin-bottom: 1rem;
}

.post-hero__cats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.post-hero__cats a {
  font-size: 0.75rem;
  padding: 0.3rem 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.75);
  transition: background var(--transition), color var(--transition);
}

.post-hero__cats a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.post-featured {
  padding-block: clamp(1.5rem, 3vw, 2rem);
  background: var(--color-bg-soft);
}

.post-featured__figure {
  margin: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.post-featured__img {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
}

.post-body__inner {
  max-width: 760px;
  margin-inline: auto;
}

.blog-content {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--color-text);
}

.blog-content > *:first-child { margin-top: 0; }

.blog-content h2,
.blog-content h3,
.blog-content h4 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: var(--color-primary);
}

.blog-content h2 { font-size: 1.5rem; }
.blog-content h3 { font-size: 1.25rem; }

.blog-content p { margin-bottom: 1.25rem; }

.blog-content a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.blog-content a:hover { color: var(--color-muted); }

.blog-content ul,
.blog-content ol {
  list-style: disc;
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
}

.blog-content ol { list-style: decimal; }

.blog-content li { margin-bottom: 0.45rem; }

.blog-content img {
  border-radius: var(--radius-lg);
  margin-block: 1.5rem;
}

.blog-content figure {
  margin-block: 1.5rem;
}

.blog-content figcaption {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-top: 0.5rem;
}

.blog-content blockquote {
  margin: 1.5rem 0;
  padding: 1.25rem 1.5rem;
  border-left: 3px solid var(--color-primary);
  background: var(--color-bg-soft);
  font-style: italic;
  color: var(--color-muted);
}

.blog-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  overflow-x: auto;
  display: block;
}

.blog-content th,
.blog-content td {
  border: 1px solid var(--color-border);
  padding: 0.6rem 0.85rem;
  text-align: left;
}

.blog-content th {
  background: var(--color-bg-soft);
  font-weight: 600;
}

.post-related__all {
  text-align: center;
  margin-top: clamp(2rem, 4vw, 2.5rem);
}

/* =============================================
   BLOG — АДАПТИВ
   ============================================= */
@media (max-width: 960px) {
  .posts-grid,
  .posts-grid--related {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .posts-grid,
  .posts-grid--related {
    grid-template-columns: 1fr;
  }
}
