.blog {
  overflow: hidden;
}

.blog-scroll-wrapper {
  position: relative;
  margin-top: 2rem;
  padding: 0 1rem;
}

.blog-scroll {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  padding: 1rem 0.5rem 2rem;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
}

.blog-scroll::-webkit-scrollbar {
  height: 6px;
  background: transparent;
}
.blog-scroll::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 8px;
  transition: background 0.3s;
}
.blog-scroll:hover::-webkit-scrollbar-thumb {
  background: var(--accent);
}

.blog-scroll {
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.blog-scroll.is-dragging {
  cursor: grabbing;
  scroll-behavior: auto !important;
}

/* ---------- Scroll Hint (arrow) ---------- */
.blog-scroll-hint {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: -0.5rem;
  color: var(--muted);
  font-size: 0.9rem;
  transition: opacity 0.4s, transform 0.4s;
  pointer-events: none;
}
.blog-scroll-hint span {
  display: inline-block;
  font-size: 1.3rem;
  animation: hintBounce 1.5s ease-in-out infinite;
}
.blog-scroll-hint span:first-child {
  animation-delay: 0s;
}
.blog-scroll-hint span:last-child {
  animation-delay: 0.2s;
}

@keyframes hintBounce {
  0%, 100% { transform: translateX(0); opacity: 0.6; }
  50% { transform: translateX(10px); opacity: 1; }
}

.blog-card {
  flex: 0 0 320px;
  scroll-snap-align: start;
  background: var(--surface);
  border-radius: var(--border-radius);
  border: 1px solid var(--border);
  box-shadow: 0 4px 12px var(--shadow);
  overflow: hidden;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.4s ease,
              border-color 0.3s;
  position: relative;
  display: flex;
  flex-direction: column;

  opacity: 0;
  transform: translateY(30px);
  animation: cardReveal 0.7s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

.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:nth-child(5) { animation-delay: 0.5s; }
.blog-card:nth-child(6) { animation-delay: 0.6s; }
.blog-card:nth-child(7) { animation-delay: 0.7s; }
.blog-card:nth-child(8) { animation-delay: 0.8s; }
.blog-card:nth-child(9) { animation-delay: 0.9s; }
.blog-card:nth-child(10) { animation-delay: 1.0s; }

@keyframes cardReveal {
  0% {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.blog-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 20px 30px -10px var(--shadow-hover),
              0 0 0 1px var(--accent-glass);
  border-color: var(--accent);
  z-index: 2;
}

.blog-card-image {
  width: 100%;
  height: 200px;
  overflow: hidden;
  position: relative;
}
.blog-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              filter 0.4s;
}
.blog-card:hover .blog-card-image img {
  transform: scale(1.08);
  filter: brightness(1.05) contrast(1.02);
}

.blog-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 1.2rem 0;
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.blog-card-meta span:first-child {
  position: relative;
  padding-right: 0.7rem;
}
.blog-card-meta span:first-child::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
}

.blog-card-title {
  padding: 0.5rem 1.2rem 0.3rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
  transition: color 0.3s;
}
.blog-card:hover .blog-card-title {
  color: var(--accent);
}

.blog-card-excerpt {
  padding: 0.3rem 1.2rem 1rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  flex-grow: 1;
}

.blog-card-cta {
  display: block;
  margin: 0 1.2rem 1.2rem;
  padding: 0.7rem 0;
  text-align: center;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--accent);
  background: var(--accent-glass);
  border-radius: var(--border-radius-small);
  transition: background 0.3s, color 0.3s, transform 0.3s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.blog-card-cta:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-2px);
}

[data-theme="dark"] .blog-card {
  background: var(--surface);
  border-color: var(--border);
}
[data-theme="dark"] .blog-card:hover {
  box-shadow: 0 20px 30px -10px var(--shadow-hover),
              0 0 0 1px rgba(88, 166, 255, 0.25);
}

@media (max-width: 768px) {
  .blog-card {
    flex-basis: 280px;
  }
  .blog-card-image {
    height: 180px;
  }
}