/*
Theme Name: Astra Child
Template: astra
Description: Child theme custom filter + Spectra Post Grid
*/

/* =========================
   FILTER WRAPPER
========================= */
.filter-tabs,
.editor-styles-wrapper .filter-tabs {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 10px !important;
  flex-wrap: wrap !important;
  margin: 0 0 40px 0 !important;
  padding: 0 !important;
  width: 100% !important;
}

/* =========================
   TAB BUTTON — reset mọi style Spectra/Astra có thể inject
========================= */
.filter-tabs .tab,
.editor-styles-wrapper .filter-tabs .tab {
  display: inline-flex !important;
  align-items: center !important;
  padding: 10px 24px !important;
  border-radius: 999px !important;
  border: 1.5px solid #cbd5e1 !important;
  background: #ffffff !important;
  color: #374151 !important;
  font-size: 15px !important;
  font-weight: 500 !important;
  line-height: 1 !important;
  cursor: pointer !important;
  transition: all 0.25s ease !important;
  box-shadow: none !important;
  text-decoration: none !important;
  outline: none !important;
}

.filter-tabs .tab:hover,
.editor-styles-wrapper .filter-tabs .tab:hover {
  border-color: #2563EB !important;
  color: #2563EB !important;
}

/* ACTIVE TAB */
.filter-tabs .tab.active,
.editor-styles-wrapper .filter-tabs .tab.active {
  background: #2563EB !important;
  color: #ffffff !important;
  border-color: #2563EB !important;
}

/* =========================
   CONTAINER wrap chứa filter-tabs — căn giữa và full width
========================= */
.uagb-container-inner-blocks-wrap:has(.filter-tabs) {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  width: 100% !important;
}

/* =========================
   GRID — full width bên trong container đó
========================= */
.uagb-container-inner-blocks-wrap:has(.filter-tabs) .wp-block-uagb-post-grid {
  width: 100% !important;
}

.wp-block-uagb-post-grid {
  transition: all 0.5s ease;
}

/* =========================
   EDITOR SYNC
========================= */
.editor-styles-wrapper .wp-block-uagb-post-grid {
  width: 100%;
}

/* =========================
   FILTER TABS — MOBILE SCROLL
========================= */
@media (max-width: 768px) {
  .filter-tabs {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    justify-content: flex-start !important;
    padding: 0 16px !important;
    margin: 0 -16px 40px !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    /* ẩn scrollbar Firefox */
  }

  .filter-tabs::-webkit-scrollbar {
    display: none !important;
    /* ẩn scrollbar Chrome */
  }

  .filter-tabs .tab {
    flex-shrink: 0 !important;
    /* không cho tab bị co lại */
  }
}