/* =========================================================
   Tech Talks: WordPress posts (assets/js/wpBlogPosts.js)
   Cards reuse the classes in blogs-section.css; everything
   added here is scoped under .cc-wp-*.
   ========================================================= */

.cc-wp-hidden {
  display: none !important;
}

.cc-wp-posts {
  flex: 3;
  display: flex;
  gap: 30px;
  min-width: 0;
}

/* Card is a link: reset link styling, keep the original card look */
.cc-wp-card {
  flex: 1 1 0;
  min-width: 0;
  color: inherit;
  text-decoration: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.cc-wp-card:hover {
  transform: translateY(-4px);
  box-shadow: rgba(149, 157, 165, 0.35) 0px 12px 28px;
}
.cc-wp-card:focus-visible {
  outline: 2px solid var(--primary-theme-color);
  outline-offset: 3px;
}

/* Fill the 220px thumbnail regardless of the image's shape */
.cc-wp-card .cc-wp-img {
  height: 100%;
}
.cc-wp-card .cc-wp-img img {
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.cc-wp-card:hover .cc-wp-img img {
  transform: scale(1.05);
}

/* Stronger shading than the static cards: featured images often contain
   their own text, which made the white title hard to read */
.cc-wp-card .blogs-overlay {
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.88),
    rgba(0, 0, 0, 0.6) 45%,
    rgba(0, 0, 0, 0.15)
  );
}

/* No featured image: branded gradient placeholder */
.cc-wp-img-fallback {
  background: linear-gradient(
    135deg,
    var(--primary-theme-color),
    var(--pri-secondary-color),
    var(--secondary-color)
  );
}

/* Long titles and excerpts stay within the card */
.cc-wp-title {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cc-wp-card .blogs-description {
  overflow-wrap: anywhere;
}
.cc-wp-card .blogs-read-more {
  margin-top: auto;
}
.cc-wp-card .blogs-info-container {
  flex: 1;
}

/* ---------- Loading skeleton ---------- */
.cc-wp-skeleton {
  flex: 1 1 0;
  min-width: 0;
  border-radius: 5px;
  box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;
  overflow: hidden;
  padding-bottom: 20px;
}
.cc-wp-skeleton-img,
.cc-wp-skeleton-line {
  background: linear-gradient(90deg, #eceff1 25%, #f6f7f8 50%, #eceff1 75%);
  background-size: 200% 100%;
  animation: cc-wp-shimmer 1.4s ease-in-out infinite;
}
.cc-wp-skeleton-img {
  height: 220px;
  margin-bottom: 20px;
}
.cc-wp-skeleton-line {
  height: 14px;
  margin: 0 20px 12px;
  border-radius: 4px;
}
.cc-wp-skeleton-short {
  width: 55%;
}

@keyframes cc-wp-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cc-wp-skeleton-img,
  .cc-wp-skeleton-line,
  .cc-wp-card,
  .cc-wp-card .cc-wp-img img {
    animation: none;
    transition: none;
  }
}

/* ---------- Empty / error message ---------- */
.cc-wp-state {
  flex: 1;
  min-height: 220px;
  border-radius: 5px;
  box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 15px;
  text-align: center;
}
.cc-wp-state-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}
.cc-wp-state-link {
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
}

/* ---------- Tablet: two cards per row ---------- */
@media screen and (min-width: 769px) and (max-width: 1024px) {
  .cc-wp-posts {
    flex: 2;
    flex-wrap: wrap;
  }
  .cc-wp-card,
  .cc-wp-skeleton {
    flex: 1 1 calc(50% - 15px);
  }
}

/* ---------- Mobile: stacked (matches blogs-section.css) ---------- */
@media screen and (max-width: 768px) {
  .cc-wp-posts {
    flex-direction: column;
  }
}
