/* -----------------------------------------------------------------------
   Posts Grid — structural defaults only.
   Anything a user can set in the Style tab is deliberately left unset here
   so Elementor's generated CSS wins without needing !important.
   -------------------------------------------------------------------- */

.cpg-wrap {
  position: relative;
}

.cpg-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 30px;
  row-gap: 30px;
}

.cpg-item {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin: 0;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

/* Image ------------------------------------------------------------------ */

.cpg-thumb {
  display: block;
  overflow: hidden;
  line-height: 0;
}

.cpg-thumb img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.4s ease;
}

/* Body ------------------------------------------------------------------- */

.cpg-body {
  min-width: 0;
}

.cpg-title {
  margin: 0 0 10px;
  overflow-wrap: break-word;
}

.cpg-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.cpg-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.cpg-meta a {
  color: inherit;
  text-decoration: none;
}

.cpg-meta a:hover {
  text-decoration: underline;
}

.cpg-meta-sep {
  opacity: 0.6;
}

.cpg-excerpt {
  margin-bottom: 14px;
}

.cpg-readmore {
  align-self: flex-start;
  display: inline-block;
  margin-top: auto;
  text-decoration: none;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.cpg-empty {
  padding: 20px 0;
}

/* Pagination ------------------------------------------------------------- */

.cpg-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 40px;
}

.cpg-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.cpg-pagination .page-numbers.dots {
  pointer-events: none;
}

/* Editor: keep pagination visible but non-navigating inside the preview. */
.cpg-pagination--editor .page-numbers {
  cursor: default;
}

/* AJAX loading state ------------------------------------------------------ */

.cpg-wrap.is-loading .cpg-grid {
  opacity: 0.45;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.cpg-wrap.is-loading::after {
  content: "";
  position: absolute;
  top: 40px;
  left: 50%;
  width: 34px;
  height: 34px;
  margin-left: -17px;
  border: 3px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  opacity: 0.7;
  animation: cpg-spin 0.7s linear infinite;
}

@keyframes cpg-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cpg-item,
  .cpg-thumb img,
  .cpg-readmore,
  .cpg-pagination .page-numbers {
    transition: none;
  }
  .cpg-wrap.is-loading::after {
    animation: none;
  }
}

/* Accessibility ----------------------------------------------------------- */

.cpg-wrap .screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
