/* ============================================
   NEWS SECTION REDESIGN - FINAL WORKING VERSION
   ============================================ */

/* 1. Make sure everything is visible initially */
#ba-64323d8d24f44850211522 {
  display: block !important;
  visibility: visible !important;
  padding: 40px 0;
  background-color: #f9fafa;
}

/* 2. Base article styles for all views */
#ba-64323d8d24f44850211522 .astroid-article-item {
  position: relative;
  margin-bottom: 25px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  background: white;
  aspect-ratio: 16/9;
  width: 100%;
  cursor: pointer;
}

#ba-64323d8d24f44850211522 .astroid-article-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Article image - full coverage */
#ba-64323d8d24f44850211522 .astroid-article-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.5s ease;
  display: block;
  position: absolute;
  top: 0;
  left: 0;
}

#ba-64323d8d24f44850211522 .astroid-article-item:hover img {
  transform: scale(1.05);
}

/* Article overlay with title - positioned at bottom of image */
#ba-64323d8d24f44850211522 .astroid-article-item .article-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.9) 0%,
    rgba(0, 0, 0, 0.6) 50%,
    transparent 100%
  );
  padding: 30px 20px 20px 20px;
  color: white;
  z-index: 2;
  pointer-events: none;
}

/* Title styling */
#ba-64323d8d24f44850211522 .astroid-article-item .article-title {
  margin: 0;
  font-size: 18px;
  line-height: 1.4;
  font-weight: 600;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

#ba-64323d8d24f44850211522 .astroid-article-item .article-title a {
  color: white !important;
  text-decoration: none;
  font-weight: 600;
  pointer-events: auto;
  display: block;
}

/* Hide original title if it's outside */
#ba-64323d8d24f44850211522
  .astroid-article-item
  .astroid-article-heading:not(.article-title) {
  display: none;
}

/* 3. On desktop: create slider + stacked layout */
@media (min-width: 992px) {
  /* Hide original grid */
  #ba-64323d8d24f44850211522 .row-cols-lg-3 {
    display: none !important;
  }

  /* Create new layout container */
  #ba-64323d8d24f44850211522 .astroid-articles {
    display: grid !important;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    max-width: 1600px;
    margin: 0 auto;
  }

  /* LEFT SIDE - SLIDER (4 articles) */
  .custom-slider-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 20px;
    height: 650px;
  }

  .slider-article {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    aspect-ratio: 16/9;
    width: 100%;
  }

  .slider-article:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  }

  .slider-article img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.5s ease;
    position: absolute;
    top: 0;
    left: 0;
  }

  .slider-article:hover img {
    transform: scale(1.05);
  }

  .slider-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(
      to top,
      rgba(0, 0, 0, 0.9) 0%,
      rgba(0, 0, 0, 0.6) 50%,
      transparent 100%
    );
    padding: 30px 20px 20px 20px;
    color: white;
    z-index: 2;
  }

  .slider-title {
    margin: 0;
    font-size: 18px;
    line-height: 1.4;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  }

  .slider-title a {
    color: white !important;
    text-decoration: none;
    font-weight: 600;
    display: block;
  }

  /* RIGHT SIDE - STACKED (next articles) */
  .custom-stacked-list {
    display: flex !important;
    flex-direction: column;
    gap: 15px;
    height: 650px;
    overflow-y: auto;
    padding-right: 10px;
  }

  .stacked-article {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    background: white;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  }

  .stacked-article:hover {
    background: #f0f7f6 !important;
    transform: translateX(5px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  }

  .stacked-thumb {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
    aspect-ratio: 16/9;
  }

  .stacked-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    position: absolute;
    top: 0;
    left: 0;
  }

  .stacked-content {
    flex: 1;
    min-width: 0;
  }

  .stacked-content h4 {
    margin: 0 !important;
    font-size: 16px !important;
    line-height: 1.4 !important;
    color: #333 !important;
    font-weight: 500;
  }

  .stacked-content a {
    color: #333 !important;
    text-decoration: none !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    font-size: 16px !important;
    font-weight: 500;
  }

  .stacked-article:hover .stacked-content a {
    color: #218576 !important;
  }

  /* Scrollbar */
  .custom-stacked-list::-webkit-scrollbar {
    width: 6px;
  }

  .custom-stacked-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
  }

  .custom-stacked-list::-webkit-scrollbar-thumb {
    background: #218576;
    border-radius: 3px;
  }
}

/* 4. On mobile/tablet: show enhanced original layout */
@media (max-width: 991px) {
  #ba-64323d8d24f44850211522 .row-cols-lg-3 {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    padding: 0 15px;
  }

  /* Make articles consistent size */
  #ba-64323d8d24f44850211522 .astroid-article-item {
    aspect-ratio: 16/9;
    margin-bottom: 0;
  }

  /* Ensure overlay is visible on mobile */
  #ba-64323d8d24f44850211522 .astroid-article-item .article-overlay {
    opacity: 1;
    background: linear-gradient(
      to top,
      rgba(0, 0, 0, 0.95) 0%,
      rgba(0, 0, 0, 0.7) 50%,
      transparent 100%
    );
    padding: 30px 15px 15px 15px;
  }

  /* Adjust title size for mobile */
  #ba-64323d8d24f44850211522 .astroid-article-item .article-title {
    font-size: 16px;
  }

  /* Hide custom layouts on mobile */
  .custom-slider-grid,
  .custom-stacked-list {
    display: none !important;
  }
}

/* 5. Small mobile devices */
@media (max-width: 480px) {
  #ba-64323d8d24f44850211522 .row-cols-lg-3 {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  #ba-64323d8d24f44850211522 .astroid-article-item .article-title {
    font-size: 15px;
  }
}

/* 6. Responsive adjustments for desktop */
@media (max-width: 1300px) and (max-height: 690px),
  (max-width: 1265px) and (max-height: 585px) and (-webkit-min-device-pixel-ratio: 1.5),
  (max-width: 1265px) and (max-height: 585px) and (min-resolution: 144dpi) {
  .custom-slider-grid,
  .custom-stacked-list {
    height: 500px;
  }

  .slider-title {
    font-size: 15px;
  }

  .stacked-content a {
    font-size: 14px;
  }

  .stacked-thumb {
    width: 70px;
    height: 70px;
  }
}
