 

.dynamic-posts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 20px; /* Default gap, can be overridden by Elementor control */
  position: relative;
   /* To show spinner */
}

.dynamic-posts-loading-spinner {
  display: none; /* Hidden by default, shown by JS */
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 4px solid rgba(0, 0, 0, 0.1);
  border-top: 4px solid #0073aa;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

.dynamic-posts-grid.loading .dynamic-posts-loading-spinner {
  display: block;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.dynamic-post-item {
  background-color: #194C9F;
  border-radius: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease;
  color: #fff;
}

.dynamic-post-item:hover {
  transform: translateY(-3px);
}

.dynamic-post-thumbnail {
  width: 100%;
  height: 200px; /* Fixed height for thumbnails */
  overflow: hidden;
}

.dynamic-post-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.dynamic-post-content {
  padding: 20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
      justify-content: space-between;
}
.dynamic-post-title {
  font-size: 18px;
  font-weight: 600;
  margin-top: 0;
  margin-bottom: 10px;
  line-height: normal;
  min-height: 55px;
}

.dynamic-post-title a {
  text-decoration: none;
  color: #fff; /* Default title color, can be overridden by Elementor control */
  transition: color 0.2s ease;
}

.dynamic-post-title a:hover {
}

.dynamic-post-excerpt {
  font-size: 14px;
  color: #666; /* Default excerpt color, can be overridden by Elementor control */
  margin-bottom: 15px;
  line-height: 1.5;
  flex-grow: 1; /* Allows excerpt to take available space */
}

.dynamic-post-meta {
  font-size: 12px;
  color: #999;
  margin-bottom: 10px;
}

.dynamic-posts-load-more-btn {
  background-color: #0073aa;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  display: block;
  width: fit-content;
  margin: 30px auto 0;
  transition: background-color 0.3s ease;
}

.dynamic-posts-load-more-btn:hover {
  background-color: #005177;
}
.dynamic-posts-load-more-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}
.dynamic-post-read-more {
  display: inline-block;
  background-color: #fff;
  padding: 8px 35px 8px 15px;
  border-radius: 0;
  text-decoration: none;
  font-size: 16px;
   /* Pushes button to the bottom */
  align-self: flex-start; /* Aligns button to the start of its container */
  transition: background-color 0.2s ease;
  font-weight: 500;
  font-family: "Poppins", Sans-serif;
  line-height: normal;
  color: #194C9F !important;
}
.dynamic-post-read-more {position: relative;}
.no-dynamic-posts {
  grid-column: 1 / -1; /* Span across all columns */
  text-align: center;
  padding: 40px;
  color: #666;
  font-size: 16px;
}
.dynamic-post-read-more::after {
    position: absolute;
    content: "";
    width: 18px;
    height: 18px;
    right: 0;
    top: 0;
    transform: translate(-8px, 10px);
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
    background-image: url("https://cbk.programmer.co.ke/wp-content/uploads/2025/06/Arrow.svg");
}



@media only screen and (max-width: 1199px) {
.dynamic-posts-grid {
    grid-template-columns: 1fr 1fr 1fr;
}
}

@media only screen and (max-width: 768px) {
.dynamic-posts-grid {
    grid-template-columns: 1fr 1fr ;
}
.dynamic-post-title {
    font-size: 16px; 
}
.dynamic-post-read-more { 
    font-size: 14px; 
}
.dynamic-post-read-more::after { 
    width: 16px;
    height: 16px; 
}
}

@media only screen and (max-width: 520px) {
.dynamic-posts-grid {
    grid-template-columns: 1fr;
}
.dynamic-post-content {
    padding: 15px; 
}
}