.custom-news-grid {
  display: flex;
  gap: 16px;
  margin: 0 auto;
}

.news-card {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    cursor: pointer;
    transition: transform 0.3s ease, background-color 0.5s ease, background-size 0.5s ease;
    background-color: #fff;
    background-image: url(https://almoosa.haikode.com/wp-content/uploads/2026/01/Asset-5@4x6.svg);
    background-position: -12% 95%;
    background-size: 20%;
    background-repeat: no-repeat;
}

.news-card:hover {
  background-color: #0f3c55;
    background-size: 30%;
    background-image: url(https://almoosa.haikode.com/wp-content/uploads/2026/01/Asset-6@4x6.svg);
    color: #fff;
}
.news-card:hover h3, .news-card:hover span {
    color: #fff;
}
/* Featured card - top right, spans 1 column and 2 rows */
.news-card-featured {
  grid-column: 3 / 4;
  grid-row: 1 / 3;
  min-height: 450px;
}

/* Small cards - top left and middle, 1 column each */
.news-card-small {
  grid-row: 1 / 2;
  height: 220px;
}

.news-card-small:nth-of-type(2) {
  grid-column: 1 / 2;
}

.news-card-small:nth-of-type(3) {
  grid-column: 2 / 3;
}

/* Wide bottom card - spans 2 columns */
.news-card-wide-bottom {
  grid-column: 1 / 3;
  grid-row: 2 / 3;
  height: 220px;
}

.news-overlay {
  position: absolute;
  inset: 0;
  /* background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.3) 50%, rgba(0,0,0,0.1) 100%); */
  z-index: 1;
}

.news-content {
  position: relative;
  padding: 24px;
  z-index: 2;
  width: 100%;
}

.news-content h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.5;
  /* color: #fff; */
  font-weight: 600;
}

.news-content .read-more {
  font-size: 14px;
  opacity: 0.9;
  display: block;
  margin-top: 8px;
}

/* Featured card specific styles */
.news-card-featured .news-overlay {
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 40%, rgba(0,0,0,0.1) 100%);
}

.news-card-featured .news-content {
  padding: 28px;
  padding-bottom: 110px; /* Make room for the arrow button */
}

.news-card-featured .news-content h3 {
  font-size: 26px;
  line-height: 1.4;
  font-weight: 700;
  margin-bottom: 12px;
}

/* Badges (top-right) */
.news-badges {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  gap: 10px;
  z-index: 3;
}

.news-badges .badge {
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 500;
}

.news-badges .badge-category {
  background: rgba(255, 255, 255, 0.95);
  color: #333;
}

.news-badges .badge-time {
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  backdrop-filter: blur(10px);
}

/* Back arrow button container (bottom-left) with negative border radius in TOP-LEFT */
.back-arrow-btn {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 90px;
  height: 90px;
  z-index: 3;
  text-decoration: none;
  background: transparent;
}

/* White background with cut-out corner in TOP-LEFT */
.back-arrow-btn::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #fff;
  border-radius: 0 0 0 20px;
  -webkit-mask: 
    radial-gradient(circle at top left, transparent 24px, black 24px);
  mask: 
    radial-gradient(circle at top left, transparent 24px, black 24px);
}

/* Green circle with arrow */
.back-arrow-btn::after {
  content: '';
  position: absolute;
  bottom: 16px;
  left: 16px;
  width: 52px;
  height: 52px;
  background: #10b981;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
  box-shadow: 0 2px 12px rgba(16, 185, 129, 0.3);
}

.back-arrow-btn:hover::after {
  background: #059669;
}

/* Arrow SVG positioning */
.back-arrow-btn svg {
  position: absolute;
  bottom: 30px;
  left: 30px;
  width: 24px;
  height: 24px;
  color: #fff;
  z-index: 1;
}

/* CTA link styling */
.cta-link {
  display: inline-block;
  margin-top: 12px;
  font-size: 15px;
  color: #fff;
  text-decoration: underline;
  opacity: 0.95;
  transition: opacity 0.2s ease;
}

.cta-link:hover {
  opacity: 1;
  color: #fff;
}

/* Mobile responsive */
@media (max-width: 968px) {
  .custom-news-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }
  
  .news-card-featured,
  .news-card-small,
  .news-card-wide-bottom {
    grid-column: 1 / -1 !important;
    grid-row: auto !important;
    height: 280px !important;
    min-height: 280px !important;
  }
  
  .news-card-featured .news-content h3 {
    font-size: 22px;
  }
}

@media (max-width: 640px) {
  .news-badges {
    top: 16px;
    right: 16px;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
  }
  
  .back-arrow-btn {
    width: 80px;
    height: 80px;
  }
  
  .back-arrow-btn::after {
    width: 46px;
    height: 46px;
    bottom: 14px;
    left: 14px;
  }
  
  .back-arrow-btn svg {
    bottom: 25px;
    left: 25px;
    width: 22px;
    height: 22px;
  }
  
  .news-card-featured .news-content {
    padding: 20px;
    padding-bottom: 100px;
  }
}

/* Card */
.blog-card {
  position: relative;
  width: 628px;
  height: 500px;
  border-radius: 24px;
  overflow: hidden;
  cursor: pointer;
  transform: scaleX(-1);
}

/* Image */
.image-wrapper {
  width: 100%;
  height: 100%;
  position: relative;
  clip-path: path("M 0,500 L 0,0 L 628,0 L 628,332 A 24,24 0,0,1 604,356 L 580,356 L 510,356 A 24,24 0,0,0 492,380 L 492,476 A 24,24 0,0,1 468,500 Z");
  

}

.image-wrapper .d-img {
  max-width: unset !important;
  object-fit: cover;
  max-height: 100%; ;
  object-fit: cover;
  transition: transform 0.5s ease;
  transform: scaleX(-1);
}

/* .blog-card:hover img {
  transform: scale(1.1);
} */

/* Dark overlay */
.overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.6), rgba(0,0,0,0.1));
}

/* Content */
.content {
  position: absolute;
  bottom: 20px;
  left: 20px;
  max-width: 400px;
  color: white;
}

/* Tags */
.tags {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  justify-content: end;
}


.tags .tag {
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(5px);
    transform: scaleX(-1);
  text-align: right;
}
.tagstwo {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  justify-content: start;
}

.tagstwo .tag {
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #55B047;
  backdrop-filter: blur(5px);
  text-align: right;
  color: white !important;
}
/* Title */
.title {
  font-size: 24px;
  font-weight: bold;
  line-height: 1.4;
  transform: scaleX(-1);
  text-align: right;
}

/* Arrow button */
.arrow {
  position: absolute;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 3px solid #55B047;
  color: #55B047;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  transition: all 0.3s ease;
}

.blog-card:hover .arrow {
  background: #55B047;
  color: white;
  transform: rotate(-30deg);
}

.posts-list {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}
.posts-list .news-card{
  flex-grow: 1;
}

@media (max-width: 968px) {
  .blog-card {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    border-radius: 20px;
    transform: none;
  }

  .image-wrapper {
    clip-path: none; /* Disable complex shape on mobile */
  }

  .image-wrapper img {
    transform: none;
  }
  .hidemobile {
    display: none;   
    }
    .showmobile {
        display: block;
    }
    .first-post-wrapper {
        display:none !important;
    }
}
