/* resources/css/blog-cards.css */

/* === Контейнер секции === */
.blog-section {
  padding: 4rem 1rem;
  background: linear-gradient(180deg, #ffffff 0%, #f8f5f0 100%);
}

.blog-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.blog-title {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  color: #2d3748;
  margin-bottom: 0.75rem;
}

.blog-subtitle {
  font-size: 1.1rem;
  color: #64748b;
  max-width: 600px;
  margin: 0 auto;
}

/* === Сетка карточек === */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  max-width: 1200px;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .blog-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .blog-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* === Карточка блога (Shorts style) === */
.blog-card {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  aspect-ratio: 9/16;
  background: linear-gradient(180deg, #4a7c59 0%, #3a6347 100%);
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-decoration: none;
  display: block;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

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

/* Фоновое изображение */
.blog-card-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.blog-card:hover .blog-card-image {
  transform: scale(1.08);
}

/* Градиент-оверлей для читаемости текста */
.blog-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    transparent 40%,
    rgba(0, 0, 0, 0.6) 80%,
    rgba(0, 0, 0, 0.85) 100%
  );
  pointer-events: none;
}

/* Контент карточки */
.blog-card-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem;
  color: #ffffff;
  z-index: 2;
}

/* Заголовок блога */
.blog-card-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Мета-информация */
.blog-card-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.9);
}

/* Аватар автора */
.blog-card-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.8);
  background: #c9a961;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: #2d3748;
}

.blog-card-author {
  font-weight: 500;
}

.blog-card-date {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.8rem;
}

/* Лайки */
.blog-card-likes {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
  background: rgba(255, 255, 255, 0.15);
  padding: 0.25rem 0.5rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

.blog-card-likes svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

/* Кнопка "Смотреть все" */
.blog-view-all {
  display: block;
  text-align: center;
  margin-top: 2rem;
  color: #4a7c59;
  font-weight: 600;
  text-decoration: none;
  padding: 0.75rem 2rem;
  border: 2px solid #4a7c59;
  border-radius: 50px;
  transition: all 0.3s ease;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

.blog-view-all:hover {
  background: #4a7c59;
  color: #ffffff;
}

/* === Анимация появления === */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.blog-card {
  animation: slideUp 0.5s ease forwards;
  opacity: 0;
}

.blog-card:nth-child(1) { animation-delay: 0.1s; }
.blog-card:nth-child(2) { animation-delay: 0.2s; }
.blog-card:nth-child(3) { animation-delay: 0.3s; }
.blog-card:nth-child(4) { animation-delay: 0.4s; }

.blog-card.animate-in {
  opacity: 1;
  transform: translateY(0);
}
