/* Author profile — compact post filters */

.af {
  margin-bottom: 1.5rem;
}

.af-panel {
  background: var(--surface, #12161f);
  border: 1px solid var(--border-soft, var(--border, #232838));
  border-radius: 16px;
  padding: 0.85rem 1rem 1rem;
}

/* Toolbar */
.af-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.af-search-wrap {
  position: relative;
  flex: 1 1 12rem;
  min-width: 10rem;
}

.af-search-icon {
  position: absolute;
  inset-inline-start: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1rem;
  height: 1rem;
  color: var(--text-muted, #8b93a7);
  pointer-events: none;
  opacity: 0.7;
}

.af-search {
  width: 100%;
  background: var(--bg, #0b0e14);
  border: 1px solid var(--border-soft, var(--border, #232838));
  border-radius: 11px;
  padding: 0.5rem 0.85rem 0.5rem 2.15rem;
  color: var(--text, #e6e9f0);
  font-size: 0.875rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}

html[dir="rtl"] .af-search {
  padding: 0.5rem 2.15rem 0.5rem 0.85rem;
}

.af-search:focus {
  border-color: color-mix(in srgb, var(--accent, #e3b341) 45%, var(--border-soft));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, #e3b341) 14%, transparent);
}

.af-select {
  appearance: none;
  background: var(--bg, #0b0e14);
  border: 1px solid var(--border-soft, var(--border, #232838));
  border-radius: 11px;
  padding: 0.48rem 1.85rem 0.48rem 0.75rem;
  color: var(--text, #e6e9f0);
  font-size: 0.84rem;
  font-family: inherit;
  cursor: pointer;
  max-width: 10.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%238b93a7' d='M1.4 0.6 6 5.2 10.6.6 12 2 6 8 0 2z'%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 0.65rem center;
  background-size: 0.65rem;
}

html[dir="rtl"] .af-select {
  padding: 0.48rem 0.75rem 0.48rem 1.85rem;
  background-position: right 0.65rem center;
}

.af-apply {
  white-space: nowrap;
  min-height: 2.2rem;
}

.af-count {
  margin-inline-start: auto;
  font-size: 0.8rem;
  color: var(--text-muted, #8b93a7);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  padding: 0.25rem 0.15rem;
}

.af-count strong {
  color: var(--text, #e6e9f0);
  font-weight: 650;
}

.af-count-sep {
  opacity: 0.45;
  margin: 0 0.1rem;
}

/* Active filter chips */
.af-active {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-soft, var(--border, #232838));
}

.af-active-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.55rem 0.28rem 0.7rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent, #e3b341) 35%, var(--border-soft));
  background: color-mix(in srgb, var(--accent, #e3b341) 10%, transparent);
  color: var(--accent, #e3b341);
  font-size: 0.78rem;
  font-weight: 550;
  text-decoration: none !important;
  max-width: 16rem;
}

.af-active-chip span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.af-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 50%;
  font-size: 0.95rem;
  line-height: 1;
  opacity: 0.75;
  background: color-mix(in srgb, var(--text) 8%, transparent);
}

.af-active-chip:hover .af-x {
  opacity: 1;
}

.af-clear {
  font-size: 0.78rem;
  color: var(--text-muted, #8b93a7);
  text-decoration: none !important;
  margin-inline-start: 0.15rem;
}

.af-clear:hover {
  color: var(--accent, #e3b341);
}

/* Tabs — only one taxonomy group visible */
.af-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-soft, var(--border, #232838));
}

.af-tab {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted, #8b93a7);
  font-size: 0.8rem;
  font-weight: 550;
  font-family: inherit;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.12s, background 0.12s, border-color 0.12s;
}

.af-tab:hover {
  color: var(--text, #e6e9f0);
  background: color-mix(in srgb, var(--text) 5%, transparent);
}

.af-tab.is-active {
  color: var(--accent, #e3b341);
  background: color-mix(in srgb, var(--accent, #e3b341) 12%, transparent);
  border-color: color-mix(in srgb, var(--accent, #e3b341) 30%, var(--border-soft));
}

.af-panels {
  margin-top: 0.7rem;
}

.af-panel-body {
  display: none;
}

.af-panel-body.is-open {
  display: block;
  animation: af-fade 0.15s ease;
}

@keyframes af-fade {
  from { opacity: 0; transform: translateY(2px); }
  to { opacity: 1; transform: none; }
}

.af-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.af-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.32rem 0.72rem;
  border-radius: 999px;
  border: 1px solid var(--border-soft, var(--border, #232838));
  background: var(--bg, #0b0e14);
  color: var(--text-muted, #8b93a7);
  font-size: 0.78rem;
  text-decoration: none !important;
  transition: border-color 0.12s, background 0.12s, color 0.12s;
  max-width: 14rem;
}

.af-pill:hover {
  color: var(--text, #e6e9f0);
  border-color: color-mix(in srgb, var(--accent, #e3b341) 30%, var(--border-soft));
}

.af-pill.is-active {
  color: var(--accent, #e3b341);
  font-weight: 650;
  border-color: color-mix(in srgb, var(--accent, #e3b341) 45%, var(--border-soft));
  background: color-mix(in srgb, var(--accent, #e3b341) 12%, var(--surface));
}

.af-pill .n {
  font-size: 0.68rem;
  opacity: 0.7;
  direction: ltr;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 576px) {
  .af-panel {
    padding: 0.75rem;
    border-radius: 14px;
  }

  .af-select {
    flex: 1 1 auto;
    max-width: none;
  }

  .af-count {
    margin-inline-start: 0;
    width: 100%;
    text-align: end;
    padding-top: 0.15rem;
  }

  .af-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .af-tabs::-webkit-scrollbar {
    display: none;
  }

  .af-tab {
    flex: 0 0 auto;
  }
}
