/* Elementor Post Grid Widget Styles */

.elementor-post-grid {
  width: 100%;
}

.post-grid-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 0;
  padding: 0;
}

.post-grid-item {
  background: #ffffff;
  border: 1px solid #e1e5e9;
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.post-grid-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.post-thumbnail {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.post-thumbnail a {
  display: block;
  width: 100%;
  height: 100%;
}

.post-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.post-grid-item:hover .post-image {
  transform: scale(1.05);
}

.post-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.post-title {
  margin: 0 0 12px 0;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
}

.post-title a {
  color: #333333;
  text-decoration: none;
  transition: color 0.3s ease;
}

.post-title a:hover {
  color: #007cba;
}

.post-excerpt {
  color: #666666;
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 15px;
  flex-grow: 1;
}

.post-meta {
  margin-bottom: 15px;
  font-size: 12px;
  color: #999999;
}

.post-date {
  font-weight: 500;
}

.read-more-wrapper {
  margin-top: auto;
}

.read-more-btn {
  display: inline-block;
  padding: 8px 16px;
  background-color: #007cba;
  color: #ffffff;
  text-decoration: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}

.read-more-btn:hover {
  background-color: #005a87;
  color: #ffffff;
  text-decoration: none;
  transform: translateY(-1px);
}

/* Responsive Design */

/* Tablet - 2 columns */
@media (max-width: 1024px) and (min-width: 769px) {
  .post-grid-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
  }
}

/* Mobile - 1 column */
@media (max-width: 768px) {
  .post-grid-container {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .post-content {
    padding: 16px;
  }

  .post-title {
    font-size: 16px;
  }

  .post-excerpt {
    font-size: 13px;
  }
}

/* Small mobile adjustments */
@media (max-width: 480px) {
  .post-content {
    padding: 12px;
  }

  .post-title {
    font-size: 15px;
    margin-bottom: 10px;
  }

  .post-excerpt {
    font-size: 12px;
    margin-bottom: 12px;
  }

  .read-more-btn {
    padding: 6px 12px;
    font-size: 13px;
  }
}

/* Dark theme support */
.elementor-post-grid.dark-theme .post-grid-item {
  background: #2c2c2c;
  border-color: #444444;
}

.elementor-post-grid.dark-theme .post-title a {
  color: #ffffff;
}

.elementor-post-grid.dark-theme .post-excerpt {
  color: #cccccc;
}

.elementor-post-grid.dark-theme .post-meta {
  color: #999999;
}

/* Animation classes for enhanced UX */
.post-grid-item.fade-in {
  animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Loading state */
.post-grid-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
}

.post-grid-loading::after {
  content: "";
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #007cba;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* No posts found state */
.post-grid-no-posts {
  text-align: center;
  padding: 40px 20px;
  color: #666666;
  font-style: italic;
}

/* Accessibility improvements */
.post-grid-item:focus-within {
  outline: 2px solid #007cba;
  outline-offset: 2px;
}

.read-more-btn:focus {
  outline: 2px solid #007cba;
  outline-offset: 2px;
}

/* Print styles */
@media print {
  .post-grid-container {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .post-grid-item {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #000;
  }

  .read-more-btn {
    display: none;
  }
}
