/* =========================
   NEWS GRID — MULTI-LINE FRIENDLY
========================= */
#news {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin: 24px 0;
}

/* tablets */
@media (min-width: 640px) {
  #news {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* desktops */
@media (min-width: 960px) {
  #news {
    grid-template-columns: repeat(3, 1fr);
  }
}

.news-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s, box-shadow 0.2s;
  padding: 0;
  display: flex;
  flex-direction: column;
}

/* Image */
.news-card img {
  width: 100%;
  height: auto; /* allow natural image height */
  object-fit: cover;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

/* Body */
.news-card__body {
  padding: 16px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Title */
.news-card__body h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0a6ecb;
  margin: 0;
  line-height: 1.4;
  word-wrap: break-word; /* allow long titles to wrap */
}

/* Paragraphs (author, category) */
.news-card__body p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #333;
  word-wrap: break-word;
}

/* Footer */
.news-card__footer {
  padding: 12px 16px;
  border-top: 1px solid #eee;
  font-size: 12px;
  color: #777;
}

/* Hover effect */
.news-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.12);
}

/* Optional: make text readable on small devices */
@media (max-width: 600px) {
  .news-card__body h3 {
    font-size: 1.15rem;
  }
  .news-card__body p {
    font-size: 0.9rem;
  }
}

/* =========================
   BLOG GRID & POST CARDS
========================= */

.post-wrapper {
  padding: 25px;
}

.post-title {
  font-size: 2rem;
  line-height: 1.2;
  margin-bottom: 10px;
}

.post-meta {
  font-size: 0.85rem;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.post-cover {
  max-height: 200px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 25px;
}

.post-content {
  font-size: 1rem;
  line-height: 1.7;
}

.post-content h2 {
  font-size: 1.6rem;
  margin-top: 30px;
}

.post-content h3 {
  font-size: 1.3rem;
  margin-top: 25px;
}

.post-content p,
.post-content li {
  font-size: 0.95rem;
  margin-bottom: 15px;
}

.post-content img {
  width: 100%;
  max-height: 300px;
  object-fit: cover;
  border-radius: 6px;
  margin: 20px 0;
}

/* Blog grid layout */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

/* Individual post card */
.post-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 1.25rem 3rem rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 2rem 4rem rgba(0, 0, 0, 0.15);
}

/* Post image */
.post-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.post-card:hover img {
  transform: scale(1.05);
}

/* Post content */
.post-card h2 {
  font-size: 1.25rem;
  margin: 1rem;
  color: #0a6ecb;
  font-weight: 700;
  line-height: 1.3;
}

.post-card h2 a {
  text-decoration: none;
  color: inherit;
}

.post-card h2 a:hover {
  color: #2ea8ff;
}

/* Post metadata */
.post-card p {
  font-size: 0.875rem;
  margin: 0 1rem 0.5rem 1rem;
  color: #555;
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .post-card img {
    height: 200px;
  }
  .post-card h2 {
    font-size: 1.125rem;
  }
}

/* Empty blog state */
.blog-empty {
  text-align: center;
  padding: 4rem 2rem;
  color: #777;
}

.blog-empty h2 {
  font-size: 1.75rem;
  margin-bottom: 1rem;
}

.blog-empty p {
  font-size: 1rem;
}

/* =========================
   OPTIONAL ENHANCEMENTS
========================= */

/* Smooth fade-in for posts */
.post-card {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.5s forwards;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =========================
   IMAGE OVERLAY
========================= */
.post-card {
  position: relative;
  overflow: hidden;
}

.post-card img {
  display: block;
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.post-card:hover img {
  transform: scale(1.05);
}

/* Overlay container */
.post-card .overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.7), transparent);
  color: #fff;
  padding: 10px 15px;
  font-size: 0.85rem;
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.post-card:hover .overlay {
  opacity: 1;
}

/* Optional: small author and date styles */
.overlay span {
  display: inline-block;
}

.overlay .author {
  font-weight: 600;
}
.overlay .date {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.8);
}

/* Optional: smooth slide-up for overlay instead of just fading */
.post-card .overlay {
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.post-card:hover .overlay {
  opacity: 1;
  transform: translateY(0);
}

/* Optional: subtle text shadow for overlay readability */
.post-card .overlay span {
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

/* Optional: make category badges on post card */
.post-card .category {
  display: inline-block;
  margin: 0 1rem 1rem 1rem;
  padding: 2px 8px;
  font-size: 0.75rem;
  background: #0a6ecb20; /* subtle blue */
  border-radius: 6px;
  color: #0a6ecb;
  font-weight: 500;
}