/* Post grid */
#posts {
  margin-top: var(--space-xl);
}

#posts h2 {
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--color-accent);
  display: inline-block;
}

.post-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
}

@media (min-width: 600px) {
  .post-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

.post-card {
  display: block;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  color: var(--color-text);
  transition:
    box-shadow 0.2s,
    transform 0.2s;
}

.post-card:hover {
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.post-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.post-card-content {
  padding: var(--space-lg);
}

.post-card-content h3 {
  font-size: 1rem;
  margin-bottom: var(--space-sm);
}

.post-card-excerpt {
  color: var(--color-text-muted);
  font-size: 0.875rem;
  line-height: 1.5;
  margin-bottom: var(--space-md);
}

.post-card-date {
  color: var(--color-text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.post-card-author {
  color: var(--color-text-muted);
  font-size: 0.75rem;
}

/* Carousel */
#carousel {
  margin-top: var(--space-xl);
}

#carousel h2 {
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--color-accent);
  display: inline-block;
}

.carousel-wrapper {
  position: relative;
}

.carousel-slides {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  height: 300px;
}

@media (min-width: 600px) {
  .carousel-slides {
    height: 450px;
  }
}

.carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: translateX(100%);
  transition: transform 0.5s ease;
}

.carousel-slide.active {
  transform: translateX(0);
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carousel-slide-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 100px var(--space-xl) var(--space-lg);
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(0, 0, 0, 0.3) 25%,
    rgba(0, 0, 0, 0.7) 55%,
    rgba(0, 0, 0, 0.9) 100%
  );
  border-radius: 0 0 var(--radius) var(--radius);
  color: white;
}

.carousel-slide-content h3 {
  font-size: 1rem;
  margin-bottom: var(--space-md);
  color: white;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

@media (min-width: 600px) {
  .carousel-slide-content {
    padding: 160px var(--space-lg) var(--space-xl);
  }
  .carousel-slide-content h3 {
    font-size: 1.5rem;
  }
}

.carousel-slide-content a {
  display: inline-block;
  padding: var(--space-sm) var(--space-lg);
  background: var(--color-accent);
  color: white;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
}

.carousel-slide-content a:hover {
  text-decoration: none;
  opacity: 0.9;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  cursor: pointer;
  z-index: 1;
  transition: background 0.2s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.carousel-btn:hover {
  background: white;
}

.carousel-btn.prev {
  left: var(--space-sm);
}

.carousel-btn.next {
  right: var(--space-sm);
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: none;
  background: var(--color-border);
  cursor: pointer;
  padding: 0;
  transition: background 0.2s;
}

.carousel-dot.active {
  background: var(--color-accent);
}
