/**
 * gallery-filters.css — revised for Avada masonry post cards
 */

/* ── Sidebar shell ────────────────────────────────────────────────────── */

.cgf-sidebar {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1.5;
  color: #333;
  position: sticky;
  top: 100px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

/* ── Header ───────────────────────────────────────────────────────────── */

.cgf-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #e8e8e8;
}

.cgf-sidebar-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #111;
}

.cgf-clear-all {
  display: none;
  background: none;
  border: none;
  padding: 0;
  font-size: 12px;
  color: #888;
  cursor: pointer;
  text-decoration: underline;
  transition: color 0.15s;
}

.cgf-clear-all.cgf-visible { display: inline-block; }
.cgf-clear-all:hover { color: #333; }

/* ── Active tag chips ─────────────────────────────────────────────────── */

.cgf-active-tags {
  display: none;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 16px;
  border-bottom: 1px solid #e8e8e8;
}

.cgf-active-tags.cgf-has-tags { display: flex; }

.cgf-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f0f0f0;
  border-radius: 100px;
  padding: 3px 8px 3px 10px;
  font-size: 12px;
  color: #333;
  white-space: nowrap;
}

.cgf-chip--pid {
  background: #eef2ff;
  color: #3b4ea8;
}

.cgf-chip-remove {
  background: none;
  border: none;
  padding: 0 2px;
  font-size: 11px;
  color: #999;
  cursor: pointer;
  line-height: 1;
  transition: color 0.15s;
}

.cgf-chip-remove:hover { color: #333; }

/* ── Filter groups ────────────────────────────────────────────────────── */

.cgf-groups { padding: 4px 0 8px; }

.cgf-group { border-bottom: 1px solid #f0f0f0; }
.cgf-group:last-child { border-bottom: none; }

/* ── Accordion toggle ─────────────────────────────────────────────────── */

.cgf-group-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: none;
  border: none;
  padding: 11px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #222;
  cursor: pointer;
  text-align: left;
  letter-spacing: 0.02em;
  transition: background 0.1s;
}

.cgf-group-toggle:hover { background: #fafafa; }

.cgf-chevron {
  font-size: 16px;
  color: #aaa;
  transition: transform 0.2s;
  display: inline-block;
  line-height: 1;
}

.cgf-chevron--up { transform: rotate(180deg); }

/* ── Group body / collapse ────────────────────────────────────────────── */

.cgf-group-body {
  overflow: hidden;
  transition: max-height 0.25s ease, opacity 0.2s;
  max-height: 800px;
  opacity: 1;
}

.cgf-group-body.cgf-collapsed {
  max-height: 0;
  opacity: 0;
}

/* ── Term list ────────────────────────────────────────────────────────── */

.cgf-term-list {
  list-style: none;
  margin: 0;
  padding: 0 0 8px 0;
}

.cgf-term-list li { margin: 0; padding: 0; }

.cgf-term-btn {
  display: flex;
  align-items: center;
  width: 100%;
  background: none;
  border: none;
  padding: 6px 16px;
  font-size: 13px;
  color: #555;
  cursor: pointer;
  text-align: left;
  transition: background 0.1s, color 0.15s;
  gap: 6px;
}

.cgf-term-btn:hover { background: #f5f5f5; color: #111; }
.cgf-term-btn.cgf-active { color: #111; font-weight: 600; }

/* Active dot indicator */
.cgf-term-btn::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: background 0.15s;
  border: 1px solid #ccc;
}

.cgf-term-btn.cgf-active::before {
  background: #333;
  border-color: #333;
}

.cgf-term-count {
  margin-left: auto;
  font-size: 11px;
  color: #bbb;
  font-weight: 400;
  flex-shrink: 0;
}

.cgf-term-btn.cgf-active .cgf-term-count { color: #888; }

/* ── Results summary ──────────────────────────────────────────────────── */

.cgf-results-summary {
  padding: 10px 16px;
  font-size: 12px;
  color: #999;
  border-top: 1px solid #f0f0f0;
  text-align: center;
}

/* ── Project ID link on cards ─────────────────────────────────────────── */

.cgf-project-link-wrap {
  padding: 8px 0 4px;
  text-align: center;
}

.cgf-project-link {
  display: inline-block;
  font-size: 12px;
  color: #666;
  text-decoration: none;
  border-bottom: 1px solid #ccc;
  transition: color 0.15s, border-color 0.15s;
  padding-bottom: 1px;
}

.cgf-project-link:hover { color: #111; border-color: #111; }

/* ── Hidden cards ─────────────────────────────────────────────────────── */

li.post-card.cgf-hidden {
  display: none !important;
}

/* ── Responsive ───────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .cgf-sidebar {
    position: static;
    max-height: none;
    overflow-y: visible;
    margin-bottom: 1.5rem;
  }

  .cgf-group-body {
    max-height: 0;
    opacity: 0;
  }

  .cgf-group-toggle[aria-expanded="true"] + .cgf-group-body {
    max-height: 800px;
    opacity: 1;
  }
}
