.insights-grid-header {
  max-width: 784px;
  padding-top: 28px;
}

.insights-grid-section .pagination-container {
  margin-top: 81px;
}

.insights-grid-grid-item-post {
  height: 319px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
  cursor: pointer;
  text-decoration: none;
  overflow: hidden;
}

/* Background layer */
.insights-grid-zoom-bg{
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: transform 0.4s ease;
  will-change: transform;
  z-index: 0;
}

.insights-grid-body{
  margin-top: 50px;
}

.insights-grid-grid-item-post:hover .insights-grid-zoom-bg{
  transform: scale(1.05);
}

/* highlight title on hover remains */
.insights-grid-grid-item-post:hover .insights-grid-grid-item-post-title{
  color: #00ECC2 !important;
}

.insights-grid-grid-item-post::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 211px;
  background: linear-gradient(
    180deg,
    rgba(217, 217, 217, 0) 0%,
    rgba(0, 0, 0, 0.7) 100%
  );
  pointer-events: none;
  z-index: 1;
}

.insights-grid-filter-title{
  font-size: 24px !important;
  padding-bottom: 2px;
}

.insights-grid-dropdown-header .dropdown-label{
  font-size: 18px;
  font-weight: 400;
  color: #000;
  transition: color 0.2s ease;
}

.insights-grid-dropdown-header .dropdown-label:hover{
  color: #00ECC2;
}

/* Highlight label when dropdown is open */
.insights-grid-dropdown.open .dropdown-label{
  color: #00ECC2;
}

.insights-grid-filters{
  display: flex;
  gap: 19px;
  flex-direction:row;
  align-items: flex-end;
  position: relative !important;
  z-index: 99 !important;
}

/* ensure overlay and text above zoom layer */
.insights-grid-bottom-overlay{
  position: absolute;
  bottom: 0; left:0; right:0;
  z-index: 2;
  width: 100%;
  padding-left: 20px;
  padding-right: 20px;
  box-sizing: border-box;
}

.insights-grid-grid-item-post-date {
  color: white !important;
  display: flex;
  align-content: space-around;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: flex-end;
  gap: 10px;
  height: 20px;
  margin-bottom: 6px;
}

.insights-grid-grid-item-post-title {
  color: white !important;
  max-width: 449px;
  max-height: 100px;
  text-overflow: ellipsis;
  overflow: hidden;
  display: -webkit-box;
  line-clamp: 4;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  margin: 0;
  margin-bottom: 20px;
}

.insights-grid-grid {
  margin: 0;

  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

@media (max-width: 800px) {
  .insights-grid-grid {
    grid-template-columns: repeat(1, 1fr);
  }

  .insights-grid-bottom-overlay {
    padding-bottom: 28px;
  }
}

/* --- Dropdown Filter Styles --- */
.insights-grid-dropdown {
  position: relative;
}

.insights-grid-dropdown-header {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
}

.dropdown-arrow {
  transition: transform 0.2s ease;
  transform: rotate(90deg); 
  user-select: none;
  height: 12px;
  margin-left: 10px;
  margin-right: 16px;
}

.insights-grid-dropdown.open .dropdown-arrow {
  transform: rotate(-90deg); 
}

.insights-grid-dropdown-options {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  background: #ffffff;
  box-shadow: 0 4px 10px rgba(0,0,0,0.07);
  z-index: 20;
  display: none;
  min-width: 180px;
  padding: 10px;
  border-radius: 5px;
}

.insights-grid-dropdown-options .insights-grid-tags-item,
.insights-grid-dropdown-options .insights-grid-sort-item {
  padding: 8px 12px;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  color: #A4C1FF;
  font-size: 18px !important;
  transform: translateX(0px);
  transition: transform 0.2s ease;
}

.insights-grid-dropdown-options .insights-grid-tags-item:hover,
.insights-grid-dropdown-options .insights-grid-sort-item:hover {
  transform: translateX(3px);
  color: #00ECC2; /* highlight active */
}

.insights-grid-dropdown-options .active {
  color: #00ECC2; /* highlight active */
  transform: translateX(0px) !important;

}

/* AOS Mobile Fallback - Ensure elements are visible when AOS is disabled on mobile */
@media (max-width: 768px) {
  /* Ensure insights grid items are visible */
  .insights-grid-grid-item-post[data-aos] {
    opacity: 1 !important;
    transform: none !important;
    visibility: visible !important;
  }
  
  /* Ensure pagination content is visible */
  .pagination-content[data-aos] {
    opacity: 1 !important;
    transform: none !important;
    visibility: visible !important;
  }
  
  /* Ensure pagination container is visible */
  .pagination-container[data-aos] {
    opacity: 1 !important;
    transform: none !important;
    visibility: visible !important;
  }
  
  /* Ensure any other AOS elements in insights grid are visible */
  .insights-grid-section [data-aos] {
    opacity: 1 !important;
    transform: none !important;
    visibility: visible !important;
  }
}

/* Ensure dropdown doesn't overflow viewport on small screens */
@media (max-width: 600px) {
  .insights-grid-dropdown-options {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: calc(100% - 40px);
    max-height: 70vh;
    overflow-y: auto;
    border-radius: 6px;
  }

  .insights-grid-filters{
    display: flex;
    gap: 12px;
    flex-direction:column;
    align-items: flex-start;
  }

  /* Overlay */
  .insights-grid-overlay{
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 18;
    opacity: 0;
    transition: opacity 0.2s ease;
  }
  .insights-grid-overlay.show{
    opacity: 1;
  }
}
