/*
 * Apexfito Blog Enhancement Styles v3
 * Compact toolbar + mobile dropdown
 */

/* -- Toolbar Container (more compact) -- */
.apx-blog-toolbar {
  margin-bottom: 28px;
  padding: 20px 24px;
  background: linear-gradient(135deg, #f9f6f7 0%, #f1eaeb 100%);
  border-radius: 12px;
}

/* -- Search (smaller) -- */
.apx-blog-search {
  margin-bottom: 14px;
}

.apx-blog-search form {
  display: flex;
  align-items: center;
  background: #fff;
  border: 1.5px solid #e7edf3;
  border-radius: 10px;
  padding: 4px 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.apx-blog-search form:focus-within {
  border-color: #b22f1e;
  box-shadow: 0 0 0 3px rgba(178, 47, 30, 0.1);
}

.apx-search-icon {
  flex-shrink: 0;
  color: #765155;
  margin-right: 10px;
}

.apx-blog-search input[type="search"] {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  padding: 10px 0;
  background: transparent;
  color: #1b1314;
}

/* -- Category Filter (desktop: buttons, mobile: select) -- */
.apx-blog-categories {
  position: relative;
}

/* Desktop buttons */
.apx-cat-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.apx-cat-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  color: #291012;
  background: #fff;
  border: 1.5px solid #e7edf3;
  border-radius: 20px;
  text-decoration: none !important;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.apx-cat-btn:hover {
  border-color: #b22f1e;
  color: #b22f1e;
  background: #fff5f3;
}

.apx-cat-btn.active {
  background: #b22f1e;
  color: #fff;
  border-color: #b22f1e;
}

.apx-cat-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 10px;
  font-weight: 700;
  border-radius: 9px;
  background: rgba(0,0,0,0.06);
}

.apx-cat-btn.active .apx-cat-count {
  background: rgba(255,255,255,0.25);
  color: #fff;
}

/* Mobile select - hidden by default */
.apx-cat-select-wrap {
  display: none;
}

.apx-cat-select {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  color: #291012;
  background: #fff;
  border: 1.5px solid #e7edf3;
  border-radius: 10px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23765155' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 14px;
  cursor: pointer;
}

.apx-cat-select:focus {
  border-color: #b22f1e;
  outline: none;
  box-shadow: 0 0 0 3px rgba(178, 47, 30, 0.1);
}

/* -- Post Cards -- */
.content-style-boxed .content-area .loop-entry {
  background: #fff;
  border-radius: 14px !important;
  overflow: hidden;
  border: 1px solid #e7edf3;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
  transition: box-shadow 0.3s, transform 0.3s;
  margin-bottom: 0 !important;
}

.content-style-boxed .content-area .loop-entry:hover {
  box-shadow: 0 12px 40px rgba(0,0,0,0.08);
  transform: translateY(-3px);
}

.loop-entry .post-thumbnail img {
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.loop-entry .entry-content-wrap {
  padding: 24px 20px 20px !important;
}

.loop-entry .entry-title {
  font-size: 18px !important;
  line-height: 1.4 !important;
  margin-bottom: 8px !important;
}

.loop-entry .entry-title a {
  color: #1b1314 !important;
  text-decoration: none !important;
  transition: color 0.2s;
}

.loop-entry .entry-title a:hover {
  color: #b22f1e !important;
}

.loop-entry .entry-summary p {
  font-size: 13px;
  color: #765155;
  line-height: 1.7;
  margin-bottom: 14px;
}

.loop-entry .entry-meta {
  font-size: 12px !important;
  color: #765155 !important;
  margin-top: 4px !important;
}

.loop-entry .entry-taxonomies {
  margin-bottom: 8px !important;
}

.loop-entry .entry-taxonomies a {
  display: inline-block;
  padding: 3px 10px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #b22f1e !important;
  background: rgba(178,47,30,0.08);
  border-radius: 6px;
  text-decoration: none !important;
  transition: background 0.2s;
}

.loop-entry .entry-taxonomies a:hover {
  background: rgba(178,47,30,0.15);
}

/* Grid gap */
.content-wrap.kadence-posts-list {
  gap: 24px !important;
}

/* Pagination */
.pagination {
  margin-top: 32px;
  text-align: center;
}

/* -- Responsive -- */
@media (max-width: 1024px) {
  .apx-blog-toolbar {
    padding: 16px;
  }

  .content-wrap.kadence-posts-list {
    gap: 20px !important;
  }

  .loop-entry .post-thumbnail img {
    height: 200px;
  }

  .loop-entry .entry-content-wrap {
    padding: 20px 16px 16px !important;
  }
}

@media (max-width: 767px) {
  .apx-blog-toolbar {
    padding: 14px;
    border-radius: 10px;
  }

  .apx-blog-search {
    margin-bottom: 10px;
  }

  /* Hide desktop buttons, show mobile select */
  .apx-cat-buttons {
    display: none;
  }

  .apx-cat-select-wrap {
    display: block;
    width: 100%;
  }

  .loop-entry .post-thumbnail img {
    height: 200px;
  }

  .loop-entry .entry-content-wrap {
    padding: 16px 14px 14px !important;
  }

  .loop-entry .entry-title {
    font-size: 16px !important;
  }

  .content-wrap.kadence-posts-list {
    gap: 16px !important;
  }
}

/* Tablet: smaller buttons */
@media (min-width: 768px) and (max-width: 1024px) {
  .apx-cat-btn {
    font-size: 11px;
    padding: 4px 12px;
  }
}