.blog {
  margin-top: -8rem;
  position: relative;
  background: linear-gradient(
    to bottom,
    transparent 30%,
    #a1ffce1a 60%,
    transparent 90%
    ); /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
    
    background-color: var(--bg-transit); /*for fallbaack also*/
}

.blog-container>:first-child{
  padding-top: 15rem;

}

.blog-container {
  width: 100%;
  margin-inline: auto;
  padding-block: 60px;
  /* padding-inline: 10rem; */
  height: 110vh;
  margin-bottom: 0.5rem;
  overflow: hidden; /* hide scrollbar by default */
  -webkit-overflow-scrolling: touch;

  /*  existing scrollable container styles */
  scrollbar-width: none;
  scroll-behavior: smooth;
  scrollbar-color: #4caf50 #f0f0f0; /* Thumb and track color (Firefox) */
  &:hover {
    overflow-y: auto; /* enable vertical scrollbar on hover */
  }
  &::-webkit-scrollbar {
    width: 8px; /* Make it slim */
    display: none; /* Chrome, Safari, Edge */
  }
  &::-webkit-scrollbar-track {
    background: #f0f0f0; /* Track background */
    border-radius: 4px;
  }
  &::-webkit-scrollbar-thumb {
    background-color: #4caf50; /* Thumb color */
    border-radius: 4px;
    border: 2px solid transparent; /* Optional: makes thumb thinner */
    background-clip: content-box; /* Allows border to show through */
  }
  &::-webkit-scrollbar-thumb:hover {
    background-color: #388e3c; /* Darker on hover */
  }
}

.container_slide > div {
  width: 84%;
  padding-left: 5%;
}

.blog-card {
  width: 100%;
  display: flex;
  border-radius: 0.3px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  margin-bottom: 5rem;
}
.blog-img {
  width: 30%;
  /* width: 350px; */
  /* max-width: 350px; */
  height: auto;
  box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, 0.06);
  overflow: hidden;
  /* display: flex; */
  padding: 4rem 2rem 1rem ;
}

.blog-img-item {
  position: relative;
  display: inline-block;
  height: fit-content;
  /* width: 550px; */
  width: 100%;
  padding-left: 2rem;
}

.blog-img-item img {
  transition: all 1.2s ease;
}

.blog-img-item::before {
  content: "";
  position: absolute;
  width: 550px;
  bottom: -1rem;
  left: -2rem;
  height: 0.5rem;
  display: block;
  border-radius: 0.03rem;
  border-bottom: 0.2rem inset #4caf50;

  pointer-events: none;
  z-index: -1;
}

.blog-img img {
  object-fit: cover;
  width: 100%;
  height: auto;
  align-self: center;
  transition: all 1.7s;
}

figcaption{
  text-align: center;
  font-size: 2rem;
  padding: 4rem 0;
  transition: all 2.7s;
}

.blog-img:hover .blog-img-item img {
  transform: translate3d(-2rem, -2rem, -3rem) scale(1.05);
}
.blog-img:hover figcaption {
  transform: translate3d(2rem, 2rem, -3rem) scale(1.05);
}

.blog h2 {
  font-family: "Questrial", serif;
  font-size: 4.5rem;
  line-height: 1;
  margin-bottom: 2rem;
  padding-top: 7rem;
}

.blog-container > div:first-child> h2{
  padding-top: 3.5rem;
}

/* 3rd part */
.blog-wrapper {
  display: flex;
  flex-direction: column;
  align-items: flex-end; /* right align */
}

.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.1);
}

.blog-content {
  padding-inline: 2.5rem;
  padding-block: 2rem;
  flex: 1;
  width: 80%;
  hyphens: auto;
}

.blog-content p, .blog-content ul {
  font-size: 1.95rem;
  color: var(--secondary-text);
  hyphens: auto;
}
.blog-content ul{
  list-style: none;
}
.has-colon{
  font-style: italic;
}
/* for li items after second+ has-colon that is inside li-column */
.li-column li{
  list-style: none;
}
.li-column:not(:last-child){
  border-right: 0.5px solid rgba(0,0,0, 10%);
}

.blog-content h3 {
  font-size: 3rem;
  line-height: 1;
  color: var(--text);
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  text-transform: lowercase;
}
.read-more-wrapper {
  text-align: right;
  margin-block: 2rem;
  padding: 0;
}

/* blog pagination and search */
.blog-pagination {
  width: 14rem;
  position: absolute;
  top: 26rem;
  right: 4%;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-radius: 0.3rem;
  box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, 0.26);
  padding: 1rem 0;
  gap: 0.8rem;
}

#blog-pagination-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0.8rem 0;
  max-height: 10rem;  
  overflow-y: auto;

  scroll-behavior: smooth;
  white-space: nowrap;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

#blog-pagination-list::-webkit-scrollbar {
  display: none;
}

.blog-page-btn {
  background: none;
  border: none;
  padding: 6px 12px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
  text-align: left;
  transition: all 0.2s;
  transform: scale(1);
  color: var(--secondary-text);

  flex-shrink: 0;
  font-weight: 600;
}

.blog-page-btn.active,
.blog-page-btn:hover,
.blog-page-btn:focus {
  background: #7daa6a22;
  color: #2d4c1e;
}

.blog-page-btn.active {
  transform: scale(1.12);
}

#blog-prev,
#blog-next {
  background: none;
  border: none;
  font-size: 1.7rem;
  color: #7daa6a;
  cursor: pointer;
  transition: color 0.2s;
}

#blog-prev:hover,
#blog-next:hover {
  color: #4e7c3a;
}

@media (max-width: 1124px) {
  .blog-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    flex-wrap: wrap;
  }

  .container_slide > div {
    width: 74.4% !important;
    padding-left: 5% !important;
  }

  .blog-img {
    width: 100%; /* Ensure image container is full width */
    padding-inline: 0; /* Remove padding for smaller screens */
    padding-top: 2rem; /* Adjust spacing if needed */
    margin-bottom: 1rem;
    justify-content: center;
  }

  .blog-img-item {
    width: 100%; /* Let image take full container */
  }

  .blog-img-item::before {
    width: 100%; /* Adjust underline to match full width */
    left: 0;
  }

  .blog-content {
    width: 100%;
    padding-inline: 1.5rem; /* reduce horizontal padding */
    box-sizing: border-box;
  }

  .read-more-wrapper {
    text-align: center;
    padding-inline: 1rem;
  }
}

@media (max-width: 450px) {
  .container_slide > div {
    width: 64% !important;
  }
  .blog-pagination {
    top: 34rem;
    width: 14.4rem !important;
  }
}
