/* Main tab system styles */
.qodef-m-filter.qodef--text-style {
  margin-bottom: 40px !important;
  text-align: center;
  border-bottom: none !important;
  width: 100%;
}

.qodef-m-filter-items {
  justify-content: center;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.qodef-m-filter-item {
  font-size: 16px;
  font-weight: 500;
  color: #333;
  text-decoration: none;
  position: relative;
  padding-bottom: 5px;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  white-space: nowrap; /* Tabs won't break into multiple lines */
}

.qodef-m-filter-item.qodef--active {
  color: #186b9d !important;
}

.qodef-m-filter-item.qodef--active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 20%;
  right: 20%;
  height: 2px;
  background-color: #186b9d;
}

/* Card Styles */
.fa-tab-posts {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  width: 100%;
}

.fa-tab-item {
  width: calc(33.33% - 14px); /* Fixed width for 3 columns */
  margin-bottom: 30px;
  box-sizing: border-box;
}

.qodef-e-inner {
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.qodef-e-media img {
  width: 100%;
  height: 230px !important;
  object-fit: cover;
  display: block;
}

.qodef-e-content {
  padding: 15px 0;
}

/* Category Pills */
.fa-tab-labels {
  margin-bottom: 15px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.fa-tab-label {
  background-color: #9ab3a9;
  color: #fff !important;
  padding: 2px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  text-decoration: none;
}

/* Text styles */
.qodef-e-title {
  font-size: 22px !important;
  font-weight: 700 !important;
  margin-bottom: 5px !important;
  color: #222;
  line-height: 1.3 !important;
}

.qodef-e-subtitle {
  font-size: 16px;
  font-weight: 600;
  color: #777;
  margin-bottom: 15px;
}

.qodef-e-description {
  font-size: 15px;
  color: #666;
  line-height: 1.6;
}

/* --- RESPONSIVE FIXES --- */

@media screen and (max-width: 1024px) {
  .fa-tab-item {
    width: calc(50% - 10px); /* 2 columns on tablets */
  }
}

@media screen and (max-width: 768px) {
  .qodef-m-filter-items {
    justify-content: flex-start;
    overflow-x: auto; /* Scrollable tabs on mobile */
    flex-wrap: nowrap;
    padding-bottom: 10px;
    gap: 15px;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Hide scrollbar for cleaner look but keep scrolling active */
  .qodef-m-filter-items::-webkit-scrollbar {
    display: none;
  }
  .qodef-m-filter-items {
    -ms-overflow-style: none;
    scrollbar-width: none;
  }

  .fa-tab-item {
    width: 100%; /* 1 column on mobile */
  }
  
  .qodef-e-title {
    font-size: 20px !important;
  }
}
