/* ── Posts Widget ───────────────────────────────────────────────────────── */

/* Filter */
.pkae-posts__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}
.pkae-posts__filter-btn {
  border: none;
  cursor: pointer;
  font-size: .9rem;
  padding: 6px 18px;
  border-radius: 999px;
  background: #f0f0f0;
  color: #333;
  transition: background .25s, color .25s;
}
.pkae-posts__filter-btn.pkae-active,
.pkae-posts__filter-btn:hover { background: #6040e0; color: #fff; }

/* Grid */
.pkae-posts__grid {
  display: grid;
  grid-template-columns: repeat(var(--pkae-posts-cols, 3), 1fr);
  column-gap: var(--pkae-posts-col-gap, 20px);
  row-gap: var(--pkae-posts-row-gap, 20px);
}

/* Masonry */
.pkae-posts--masonry .pkae-posts__grid {
  display: block;
  column-count: var(--pkae-posts-cols, 3);
  column-gap: var(--pkae-posts-col-gap, 20px);
}
.pkae-posts--masonry .pkae-posts__item {
  break-inside: avoid;
  margin-bottom: var(--pkae-posts-row-gap, 20px);
}

/* Item */
.pkae-posts__item {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  transition: box-shadow .3s, transform .3s;
  display: flex;
  flex-direction: column;
}
.pkae-posts__item:hover { box-shadow: 0 8px 30px rgba(0,0,0,.12); transform: translateY(-3px); }

/* Image */
.pkae-posts__img {
  overflow: hidden;
  flex-shrink: 0;
}
.pkae-posts__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s ease;
}
.pkae-posts__item:hover .pkae-posts__img img { transform: scale(1.05); }

/* Content */
.pkae-posts__content { padding: 20px; flex: 1; display: flex; flex-direction: column; }

/* Category */
.pkae-posts__cat { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.pkae-posts__cat a {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #6040e0;
  text-decoration: none;
  background: rgba(96,64,224,.1);
  padding: 3px 10px;
  border-radius: 999px;
  transition: background .2s, color .2s;
}
.pkae-posts__cat a:hover { background: #6040e0; color: #fff; }

/* Title */
.pkae-posts__title { margin: 0 0 .5em; font-size: 1.1rem; line-height: 1.35; }
.pkae-posts__title a { color: inherit; text-decoration: none; }
.pkae-posts__title a:hover { color: #6040e0; }

/* Meta */
.pkae-posts__meta {
  display: flex;
  flex-wrap: wrap;
  gap: .75em;
  font-size: .8rem;
  color: #888;
  margin-bottom: .75em;
}
.pkae-posts__meta a { color: inherit; text-decoration: none; }
.pkae-posts__meta-item::before { content: ''; }
.pkae-posts__meta-item + .pkae-posts__meta-item::before { content: '·'; margin-right: .75em; }

/* Excerpt */
.pkae-posts__excerpt { font-size: .9rem; color: #555; line-height: 1.6; margin: 0 0 1em; flex: 1; }

/* CTA */
.pkae-posts__cta {
  display: inline-flex;
  align-items: center;
  gap: .4em;
  margin-top: auto;
  padding: .45rem 1.1rem;
  border-radius: 4px;
  background: #6040e0;
  color: #fff;
  font-size: .85rem;
  font-weight: 600;
  text-decoration: none;
  transition: opacity .2s;
  align-self: flex-start;
}
.pkae-posts__cta:hover { opacity: .85; }

/* Overlay skin */
.pkae-posts--overlay .pkae-posts__item { position: relative; }
.pkae-posts--overlay .pkae-posts__img { position: absolute; inset: 0; height: 100% !important; }
.pkae-posts--overlay .pkae-posts__content {
  position: relative;
  z-index: 2;
  background: linear-gradient(transparent 0%, rgba(0,0,0,.85) 100%);
  color: #fff;
  justify-content: flex-end;
  min-height: 280px;
}
.pkae-posts--overlay .pkae-posts__title a,
.pkae-posts--overlay .pkae-posts__excerpt,
.pkae-posts--overlay .pkae-posts__meta { color: #fff; }
.pkae-posts--overlay .pkae-posts__cat a { background: rgba(255,255,255,.2); color: #fff; }

/* Card skin */
.pkae-posts--card .pkae-posts__item { box-shadow: 0 2px 12px rgba(0,0,0,.08); }

/* List skin */
.pkae-posts--list .pkae-posts__grid { grid-template-columns: 1fr; }
.pkae-posts--list .pkae-posts__item { flex-direction: row; }
.pkae-posts--list .pkae-posts__img { width: 200px; flex-shrink: 0; height: auto !important; }
.pkae-posts--list .pkae-posts__img img { height: 100%; }

/* Pagination */
.pkae-posts__pagination { margin-top: 2rem; }
.pkae-posts__pagination ul { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0; justify-content: center; }
.pkae-posts__pagination a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 4px;
  background: #f0f0f0;
  color: #333;
  text-decoration: none;
  font-size: .9rem;
  transition: background .2s, color .2s;
}
.pkae-posts__pagination a.current,
.pkae-posts__pagination a:hover { background: #6040e0; color: #fff; }

/* Load More */
.pkae-posts__load-more-wrap { text-align: center; margin-top: 2rem; }
.pkae-posts__load-more {
  padding: .6rem 2rem;
  background: #6040e0;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .2s;
}
.pkae-posts__load-more:hover { opacity: .85; }
.pkae-posts__load-more:disabled { opacity: .5; cursor: default; }

/* No posts */
.pkae-posts__no-posts { text-align: center; padding: 2rem; color: #888; }

/* Hidden filter items */
.pkae-posts__item.pkae-hidden { display: none; }

/* Responsive */
@media (max-width: 1024px) {
  .pkae-posts__grid { grid-template-columns: repeat(var(--pkae-posts-cols-t, 2), 1fr); }
  .pkae-posts--masonry .pkae-posts__grid { column-count: var(--pkae-posts-cols-t, 2); }
}
@media (max-width: 767px) {
  .pkae-posts__grid { grid-template-columns: repeat(var(--pkae-posts-cols-m, 1), 1fr); }
  .pkae-posts--masonry .pkae-posts__grid { column-count: var(--pkae-posts-cols-m, 1); }
  .pkae-posts--list .pkae-posts__item { flex-direction: column; }
  .pkae-posts--list .pkae-posts__img { width: 100%; }
}
