/* Our Coverage — editorial library (faceted dictionary + card grid) */

.ed-lib {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ed-lib-hero {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  padding: 4px 0 8px;
}

@media (max-width: 1100px) {
  .ed-lib-hero { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
  .ed-lib-hero { grid-template-columns: repeat(2, 1fr); }
}

.ed-lib-stat {
  background: linear-gradient(145deg, var(--bg-card) 0%, rgba(99, 102, 241, 0.06) 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  position: relative;
  overflow: hidden;
}

.ed-lib-stat::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  opacity: 0.9;
}

.ed-lib-stat-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.ed-lib-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
}

.ed-lib-stat-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.ed-lib-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.ed-lib-search {
  flex: 1;
  min-width: 220px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-primary, transparent);
  color: inherit;
  font-size: 13px;
}

.ed-lib-search:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.ed-lib-toolbar-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.ed-lib-select {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-primary, transparent);
  color: inherit;
  font-size: 12px;
}

.ed-lib-view-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.ed-lib-view-btn {
  padding: 7px 12px;
  font-size: 12px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.ed-lib-view-btn.active {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  font-weight: 600;
}

.ed-lib-active {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 0;
}

.ed-lib-active:empty {
  display: none;
}

.ed-lib-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid rgba(99, 102, 241, 0.35);
  background: rgba(99, 102, 241, 0.12);
  color: #a5b4fc;
}

.ed-lib-chip button {
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  opacity: 0.8;
}

.ed-lib-chip button:hover { opacity: 1; }

.ed-lib-body {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

@media (max-width: 960px) {
  .ed-lib-body { grid-template-columns: 1fr; }
  .ed-lib-sidebar { max-height: 320px; overflow: auto; }
}

.ed-lib-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  position: sticky;
  top: 12px;
  max-height: calc(100vh - 180px);
  overflow: auto;
}

.ed-lib-facet {
  margin-bottom: 14px;
}

.ed-lib-facet:last-child { margin-bottom: 0; }

.ed-lib-facet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.ed-lib-facet-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.ed-lib-facet-count {
  font-size: 10px;
  color: var(--text-muted);
}

.ed-lib-facet-search {
  width: 100%;
  padding: 6px 8px;
  margin-bottom: 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font-size: 11px;
}

.ed-lib-facet-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 160px;
  overflow: auto;
}

.ed-lib-facet-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  width: 100%;
}

.ed-lib-facet-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
}

.ed-lib-facet-item.active {
  background: rgba(99, 102, 241, 0.18);
  border-color: rgba(99, 102, 241, 0.4);
  color: #c7d2fe;
}

.ed-lib-facet-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ed-lib-facet-n {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 6px;
  border-radius: 999px;
}

.ed-lib-main {
  min-width: 0;
}

.ed-lib-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.ed-lib-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}

.ed-lib-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.ed-lib-card:hover {
  border-color: rgba(99, 102, 241, 0.45);
  transform: translateY(-1px);
}

.ed-lib-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.ed-lib-card-brand {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #818cf8;
}

.ed-lib-card-views {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.ed-lib-card-title {
  font-size: 15px;
  font-weight: 650;
  line-height: 1.35;
  color: var(--text-primary);
  text-decoration: none;
}

.ed-lib-card-title:hover { color: #818cf8; }

.ed-lib-card-snippet {
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ed-lib-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 11px;
  color: var(--text-muted);
}

.ed-lib-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.ed-lib-tag {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.ed-lib-tag.taxonomy {
  color: #60a5fa;
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.25);
}

.ed-lib-tag.cms {
  color: #a78bfa;
  background: rgba(139, 92, 246, 0.12);
  border-color: rgba(139, 92, 246, 0.25);
}

.ed-lib-tag.client {
  color: #34d399;
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.25);
}

.ed-lib-tag.state {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.25);
}

.ed-lib-tag.commercial {
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.28);
  cursor: help;
}

.ed-lib-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
  border: 1px dashed var(--border);
  border-radius: 12px;
}

.ed-lib-table-wrap .dept-table th.ed-sort.active {
  color: #818cf8;
}

.ed-lib-dict-note {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
  padding: 10px 12px;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 8px;
  margin-bottom: 12px;
}
