/* -------------------------------------------------------------
 * Tools Directory - Modern UI Redesign (3 Columns Grid)
 * ------------------------------------------------------------- */

/* Wider container specifically for tools directory & homepage to fit 3 columns comfortably */
.home .leaf-tool-wrapper,
.page-id-7 .leaf-tool-wrapper,
#leaf-tools-directory,
.leaf-hero-wrap {
  max-width: 1160px;
  margin-left: auto;
  margin-right: auto;
}

.leaf-directory-filter-bar {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 2.75rem;
}

.leaf-directory-filter-btn,
button.leaf-directory-filter-btn {
  padding: 9px 20px;
  border-radius: 9999px;
  border: 1px solid #e2e8f0 !important;
  background: #ffffff !important;
  color: #64748b !important;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.leaf-directory-filter-btn:hover,
button.leaf-directory-filter-btn:hover {
  background: #f8fafc !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
  transform: translateY(-1px);
}

.leaf-directory-filter-btn.active,
button.leaf-directory-filter-btn.active {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%) !important;
  border-color: transparent !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
  font-weight: 700;
}

/* ── 3 Columns Grid Layout ──────────────────────────────────── */
.leaf-directory-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.leaf-directory-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 1.65rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px -2px rgba(15, 23, 42, 0.04);
}

.leaf-directory-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3.5px;
  background: linear-gradient(90deg, #10b981, #38bdf8);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.leaf-directory-card:hover {
  transform: translateY(-5px);
  border-color: #a7f3d0;
  box-shadow: 0 16px 30px -6px rgba(5, 150, 105, 0.14), 0 0 1px 1px rgba(16, 185, 129, 0.2);
}

.leaf-directory-card:hover::before {
  opacity: 1;
}

.leaf-directory-card-badge-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.leaf-dir-badge {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: 9999px;
}

.leaf-dir-badge.live {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.leaf-dir-badge.roadmap {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

.leaf-dir-category {
  font-size: 0.78rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.leaf-directory-icon-wrap {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: #ecfdf5;
  color: #059669;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  border: 1px solid #d1fae5;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.08);
}

.leaf-directory-icon-wrap svg {
  width: 22px;
  height: 22px;
}

.leaf-directory-card-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.leaf-directory-card-desc {
  font-size: 0.9rem;
  color: #64748b;
  line-height: 1.55;
  margin-bottom: 1.25rem;
  flex-grow: 1;
}

.leaf-directory-card-cta {
  font-size: 0.9rem;
  font-weight: 700;
  color: #059669;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: gap 0.2s ease;
  margin-top: auto;
}

.leaf-directory-card:hover .leaf-directory-card-cta {
  gap: 9px;
}

/* Tablet: 2 Columns */
@media (max-width: 980px) {
  .leaf-directory-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
  }
}

/* Mobile: 1 Column */
@media (max-width: 620px) {
  .leaf-directory-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .leaf-directory-card {
    padding: 1.4rem 1.25rem;
  }
}
