/* Custom Post Grid Styles */
.cpg-grid {
  display: grid;
  gap: 30px;
  width: 100%;
  margin: 0;
  padding: 0;
}

/* Grid Columns */
.cpg-columns-1 {
  grid-template-columns: repeat(1, 1fr);
}

.cpg-columns-2 {
  grid-template-columns: repeat(2, 1fr);
}

.cpg-columns-3 {
  grid-template-columns: repeat(3, 1fr);
}

.cpg-columns-4 {
  grid-template-columns: repeat(4, 1fr);
}

.cpg-columns-5 {
  grid-template-columns: repeat(5, 1fr);
}

.cpg-columns-6 {
  grid-template-columns: repeat(6, 1fr);
}

/* Responsive Grid */
@media (max-width: 1024px) {
  .cpg-columns-4,
  .cpg-columns-5,
  .cpg-columns-6 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .cpg-columns-3,
  .cpg-columns-4,
  .cpg-columns-5,
  .cpg-columns-6 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .cpg-columns-2,
  .cpg-columns-3,
  .cpg-columns-4,
  .cpg-columns-5,
  .cpg-columns-6 {
    grid-template-columns: repeat(1, 1fr);
  }
}

/* Card Styles */
.cpg-card {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  height: 100%;
}

.cpg-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Card Image */
.cpg-card-image {
  position: relative;
  width: 100%;
  padding-top: 66.67%; /* 3:2 Aspect Ratio */
  overflow: hidden;
  background: #f5f5f5;
}

.cpg-card-image a {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.cpg-card-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.cpg-card:hover .cpg-card-image img {
  transform: scale(1.05);
}

/* Card Content */
.cpg-card-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 24px;
  gap: 12px;
}

/* Category Badge */
.cpg-card-category {
  margin-bottom: 4px;
}

.cpg-category-badge {
  display: inline-block;
  padding: 4px 12px;
  background: #f0f4ff;
  color: #0066ff;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 4px;
}

/* Card Title */
.cpg-card-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
  color: #1a1a1a;
}

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

.cpg-card-title a:hover {
  color: #0066ff;
}

/* Card Meta */
.cpg-card-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 14px;
  color: #999999;
}

.cpg-meta-author,
.cpg-meta-date {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cpg-card-meta svg {
  flex-shrink: 0;
}

/* Card Excerpt */
.cpg-card-excerpt {
  flex: 1;
  font-size: 15px;
  line-height: 1.6;
  color: #666666;
  margin: 0;
}

/* Read More Button */
.cpg-read-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: #0066ff;
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.2s ease;
  align-self: flex-start;
  margin-top: 8px;
}

.cpg-read-more:hover {
  background: #0052cc;
  transform: translateX(2px);
}

.cpg-read-more svg {
  transition: transform 0.2s ease;
}

.cpg-read-more:hover svg {
  transform: translateX(4px);
}

/* Ensure equal card heights */
.cpg-grid {
  align-items: stretch;
}

.cpg-card {
  display: flex;
  flex-direction: column;
}

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

.cpg-pagination ul {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.cpg-pagination li {
  margin: 0;
}

.cpg-pagination a,
.cpg-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 600;
  color: #666666;
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.2s ease;
  gap: 6px;
  /* Added border to enable hover border color effect */
  border: 2px solid transparent;
}

.cpg-pagination a:hover {
  /* Removed background color, keeping only border color change on hover */
  /* Border color is controlled by Elementor widget settings */
}

.cpg-pagination .current {
  color: #ffffff;
  background: #0066ff;
  pointer-events: none;
}

.cpg-pagination .dots {
  pointer-events: none;
  color: #999999;
}

.cpg-pagination svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Responsive Pagination */
@media (max-width: 480px) {
  .cpg-pagination a,
  .cpg-pagination span {
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    font-size: 13px;
  }

  .cpg-pagination {
    gap: 4px;
  }

  .cpg-pagination ul {
    gap: 4px;
  }
}

/* Loading State */
.cpg-grid.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Empty State */
.cpg-grid + p {
  text-align: center;
  padding: 40px 20px;
  color: #999999;
  font-size: 16px;
}

/* Single Post Template Styles */

/* Single Post Wrapper */
.cpg-single-post-wrapper {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 20px;
}

.cpg-single-post {
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Single Post Featured Image */
.cpg-single-featured-image {
  width: 100%;
  max-height: 500px;
  overflow: hidden;
  background: #f5f5f5;
}

.cpg-single-featured-image img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

/* Single Post Content */
.cpg-single-content {
  padding: 40px;
}

/* Single Post Header */
.cpg-single-header {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid #e5e5e5;
}

.cpg-single-categories {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.cpg-single-category-badge {
  display: inline-block;
  padding: 6px 14px;
  background: #f0f4ff;
  color: #0066ff;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 4px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.cpg-single-category-badge:hover {
  background: #0066ff;
  color: #ffffff;
}

.cpg-single-title {
  margin: 0 0 16px 0;
  font-size: 36px;
  font-weight: 700;
  line-height: 1.3;
  color: #1a1a1a;
}

.cpg-single-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 15px;
  color: #999999;
}

.cpg-single-author,
.cpg-single-date {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cpg-single-meta svg {
  flex-shrink: 0;
}

/* Single Post Body */
.cpg-single-body {
  font-size: 17px;
  line-height: 1.8;
  color: #333333;
  margin-bottom: 40px;
}

.cpg-single-body p {
  margin-bottom: 20px;
}

.cpg-single-body h2,
.cpg-single-body h3,
.cpg-single-body h4 {
  margin-top: 32px;
  margin-bottom: 16px;
  color: #1a1a1a;
  font-weight: 700;
}

.cpg-single-body h2 {
  font-size: 28px;
}

.cpg-single-body h3 {
  font-size: 24px;
}

.cpg-single-body h4 {
  font-size: 20px;
}

.cpg-single-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 24px 0;
}

.cpg-single-body ul,
.cpg-single-body ol {
  margin-bottom: 20px;
  padding-left: 24px;
}

.cpg-single-body li {
  margin-bottom: 8px;
}

.cpg-single-body a {
  color: #0066ff;
  text-decoration: underline;
  transition: color 0.2s ease;
}

.cpg-single-body a:hover {
  color: #0052cc;
}

/* Single Post Navigation */
.cpg-single-navigation {
  display: flex;
  gap: 20px;
  padding-top: 32px;
  border-top: 1px solid #e5e5e5;
}

.cpg-nav-prev,
.cpg-nav-next {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.cpg-nav-prev:hover,
.cpg-nav-next:hover {
  background: #e9ecef;
  transform: translateY(-2px);
}

.cpg-nav-next {
  justify-content: flex-end;
  text-align: right;
}

.cpg-nav-prev svg,
.cpg-nav-next svg {
  flex-shrink: 0;
  color: #0066ff;
}

.cpg-nav-prev span,
.cpg-nav-next span {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cpg-nav-prev small,
.cpg-nav-next small {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #999999;
  font-weight: 600;
}

.cpg-nav-prev strong,
.cpg-nav-next strong {
  font-size: 15px;
  color: #1a1a1a;
  font-weight: 600;
}

/* Responsive Single Post */
@media (max-width: 768px) {
  .cpg-single-content {
    padding: 24px;
  }

  .cpg-single-title {
    font-size: 28px;
  }

  .cpg-single-body {
    font-size: 16px;
  }

  .cpg-single-navigation {
    flex-direction: column;
  }

  .cpg-nav-next {
    justify-content: flex-start;
    text-align: left;
  }
}

@media (max-width: 480px) {
  .cpg-single-post-wrapper {
    padding: 20px 10px;
  }

  .cpg-single-content {
    padding: 20px;
  }

  .cpg-single-title {
    font-size: 24px;
  }
}
