/* Custom styles for post previews */
.post-preview {
  display: flex;
  align-items: flex-start;
  margin-bottom: 20px;
  padding: 15px;
  background-color: var(--mdc-theme-surface);
  background-color: rgba(0, 0, 0, 0.08); /* Slightly darker surface */
  background-image: url('/assets/pattern.png'); /* Your pattern image */
  background-size: cover; /* Scale the image to cover the entire background */
  background-repeat: no-repeat; /* Prevent repeating the image */
  background-position: center center; /* Center the image */
  border-radius: 8px;
  box-shadow: var(--mdc-elevation-z1);
  transition: transform 0.2s ease-in-out;
  position: relative;
}

/* Ensure the entire post is clickable */
.card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

/* Hover effect on the whole card */
.post-preview:hover {
  transform: translateY(-5px);
  box-shadow: var(--mdc-elevation-z3); /* Make shadow deeper when hovered */
}

/* Overlay to darken the background */
.post-preview::before {
  content: ''; 
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.2); /* Darker overlay to enhance readability */
  border-radius: 8px;
  z-index: -1; /* Ensure the overlay is behind the content */
}

/* Left column: Image */
.post-image {
  flex: 0 0 60px;
  margin-right: 15px;
}

.post-thumbnail {
  width: 140px;
  object-fit: cover;
  border-radius: 8px;
}

/* Right column: Content */
.post-content {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

/* Title styles */
.post-title h3 {
  font-size: 1.2em;
  margin: 0;
  color: var(--mdc-theme-on-surface);
}

/* Make sure links in the card don’t have underlines and inherit text color */
.post-title a {
  text-decoration: none;
  color: inherit;
}

.post-title a:hover {
  text-decoration: none;
}

/* Preview text (below title) */
.post-preview-text {
  margin-top: 10px;
  font-size: 1em;
  color: var(--mdc-theme-on-surface);
}

.post-preview-text p {
  margin: 0;
}

/* Optional: Add media query for mobile responsiveness */
@media (max-width: 768px) {
  .post-preview {
    flex-direction: column;
    align-items: flex-start;
  }

  .post-image {
    margin-right: 0;
    margin-bottom: 10px;
  }
}
