.cw-posts {
  width: 100%;
}

.cw-posts-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
}

.cw-posts-swiper {
  width: 100%;
  overflow: hidden;
}

.cw-posts-swiper .swiper-wrapper {
  display: flex;
}

.cw-posts-swiper .swiper-slide {
  height: auto;
}

.cw-posts-swiper .swiper-pagination {
  position: relative;
  margin-top: 32px;
}

/* Pagination bullets — mapped from the widget's Style > Pagination controls
   onto Swiper's own CSS custom properties, so no !important overrides are
   needed and unstyled bullets still fall back to sane defaults. */
.cw-posts-swiper {
  --swiper-pagination-color: var(--cwpg-dot-active-color, #f58220);
  --swiper-pagination-bullet-inactive-color: var(--cwpg-dot-color, #d9d9d9);
  --swiper-pagination-bullet-inactive-opacity: 1;
  --swiper-pagination-bullet-size: var(--cwpg-dot-size, 8px);
  --swiper-pagination-bullet-horizontal-gap: var(--cwpg-dot-gap, 4px);
}

.cw-posts-swiper .swiper-pagination-bullet {
  transition:
    transform 0.25s ease,
    background-color 0.25s ease;
}

.cw-posts-swiper .swiper-pagination-bullet-active {
  transform: scale(var(--cwpg-dot-active-scale, 1.2));
}

.cw-post-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  height: 100%;
}

.cw-post-card__image {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 16px;
  aspect-ratio: 16/10;
}

.cw-post-card__image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.cw-post-card:hover .cw-post-card__image img {
  transform: scale(1.05);
}

.cw-post-card__image--placeholder {
  background-color: #f0f0f0;
}

.cw-post-card__category.cw-post-card__category--standalone {
  position: static;
  top: auto;
  left: auto;
  margin-bottom: 12px;
}

.cw-posts-empty {
  padding: 40px 20px;
  text-align: center;
  color: #777;
  background: #f7f7f7;
  border: 1px dashed #ccc;
  border-radius: 8px;
}

.cw-post-card__read-more {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-top: 16px;
  text-decoration: none;
  font-weight: 600;
  color: #1d1d1d;
  transition:
    color 0.3s,
    background-color 0.3s;
}

.cw-post-card__category {
  position: absolute;
  top: 16px;
  left: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 14px;
  background: #f58220;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
  border-radius: 100px;
  letter-spacing: 0.5px;
  z-index: 2;
}

.cw-post-card__content {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 15px;
}

.cw-post-card__title {
  margin: 0 0 14px;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.3;
}

.cw-post-card__title a {
  color: #1d1d1d;
  text-decoration: none;
  transition: color 0.3s;
}

.cw-post-card__title a:hover {
  color: #f58220;
}

.cw-post-card__excerpt {
  margin-bottom: 20px;
  font-size: 16px;
  line-height: 1.7;
  color: #666;
}

.cw-post-card__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
  font-size: 14px;
  color: #777;
}

.cw-post-card__separator {
  color: #bdbdbd;
}

@media (max-width: 1024px) {
  .cw-posts-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
  }

  .cw-post-card__title {
    font-size: 22px;
  }
}

@media (max-width: 767px) {
  .cw-posts-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .cw-post-card__title {
    font-size: 20px;
  }

  .cw-post-card__excerpt {
    font-size: 15px;
  }
}
