/* ==========================================================================
   Community Library — additional styles
   ========================================================================== */

.library-page .container { max-width: 1320px; }

/* Hero */
.library-hero {
  padding: 80px 0 40px;
  position: relative;
}
.library-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--primary-soft); color: var(--primary-bright);
  padding: 6px 14px; border-radius: 999px; font-size: 0.85rem; font-weight: 500;
  border: 1px solid var(--primary-line); margin-bottom: 20px;
}
.library-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5.5vw, 4rem);
  font-weight: 700; line-height: 1.05;
  letter-spacing: -0.03em;
  max-width: 18ch;
  margin-bottom: 24px;
}
.library-title .grad {
  background: linear-gradient(135deg, var(--primary-bright), #22d3ee);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.library-title .counter {
  font-family: var(--font-display);
  background: linear-gradient(135deg, #4ADE80, #22d3ee);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  font-size: 1.1em; font-weight: 800;
  display: inline-block;
}
.library-sub {
  font-size: 1.1rem; color: var(--text-soft); max-width: 65ch; margin-bottom: 32px; line-height: 1.7;
}
.library-stats {
  display: flex; gap: 16px; flex-wrap: wrap;
}
.stat-pill {
  display: inline-flex; align-items: baseline; gap: 8px;
  padding: 10px 18px; background: var(--bg-elev);
  border: 1px solid var(--border); border-radius: 999px;
}
.stat-pill strong {
  font-family: var(--font-display);
  font-size: 1.3rem; color: var(--primary-bright); font-weight: 700;
}
.stat-pill span { font-size: 0.85rem; color: var(--text-muted); }

/* Filters */
.library-filters {
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 64px; z-index: 50;
  background: rgba(15, 17, 23, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.filter-bar {
  display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
}
.filter-bar input {
  flex: 1; min-width: 240px;
  background: var(--bg-elev); border: 1px solid var(--border);
  color: var(--text); padding: 10px 16px; border-radius: 10px;
  font-family: var(--font-sans); font-size: 0.9rem;
  transition: all 0.15s;
}
.filter-bar input:focus { outline: none; border-color: var(--primary-bright); }
.filter-bar input::placeholder { color: var(--text-muted); }

.filter-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; background: var(--bg-elev);
  border: 1px solid var(--border); border-radius: 999px;
  color: var(--text-soft); font-size: 0.85rem; font-weight: 500;
  cursor: pointer; transition: all 0.15s;
  font-family: var(--font-sans);
}
.chip:hover { border-color: var(--primary-bright); color: var(--text); }
.chip.active {
  background: var(--primary); color: white; border-color: var(--primary-bright);
}
.chip .count {
  font-family: var(--font-mono); font-size: 0.75rem;
  background: rgba(255,255,255,0.1); padding: 1px 6px; border-radius: 999px;
}
.chip.active .count { background: rgba(255,255,255,0.2); }

/* Grid */
.library-grid-section { padding: 40px 0 80px; }
.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.library-empty {
  text-align: center; padding: 80px 0; color: var(--text-muted);
  font-size: 1.1rem;
}

/* Card */
.tweet-card {
  display: block; text-decoration: none; color: inherit;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: all 0.2s; position: relative;
  cursor: pointer;
}
.tweet-card:hover {
  border-color: var(--primary-bright);
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.4), 0 0 0 1px var(--primary-bright);
}
.tweet-card .cover {
  width: 100%; aspect-ratio: 16/9;
  background: var(--bg-elev-2) center/cover no-repeat;
  position: relative; overflow: hidden;
}
.tweet-card .cover::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(15,17,23,0.7));
  pointer-events: none;
}
.tweet-card .cat-badge {
  position: absolute; top: 12px; left: 12px;
  background: rgba(15,17,23,0.85);
  color: var(--primary-bright);
  padding: 4px 10px; border-radius: 6px;
  font-size: 0.72rem; font-weight: 600;
  border: 1px solid var(--primary-line);
  backdrop-filter: blur(4px);
  z-index: 2;
}
.tweet-card .img-count {
  position: absolute; bottom: 12px; right: 12px;
  background: rgba(15,17,23,0.85);
  color: var(--text-soft);
  padding: 4px 10px; border-radius: 6px;
  font-size: 0.72rem; font-weight: 500;
  font-family: var(--font-mono);
  backdrop-filter: blur(4px);
  z-index: 2;
}
.tweet-card .body { padding: 16px 18px 20px; }
.tweet-card .title {
  font-family: var(--font-display);
  font-size: 1.05rem; font-weight: 600;
  line-height: 1.35; letter-spacing: -0.01em;
  margin-bottom: 8px; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.tweet-card .desc {
  font-size: 0.85rem; color: var(--text-muted); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
  margin-bottom: 12px;
}
.tweet-card .meta {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.75rem; color: var(--text-muted);
  padding-top: 12px; border-top: 1px solid var(--border);
}
.tweet-card .date {
  font-family: var(--font-mono);
}
.tweet-card .arrow {
  color: var(--primary-bright); font-weight: 600;
  transition: transform 0.2s;
}
.tweet-card:hover .arrow { transform: translateX(4px); }

@media (max-width: 700px) {
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-chips { justify-content: flex-start; }
  .library-grid { grid-template-columns: 1fr; }
  .library-stats { gap: 8px; }
  .stat-pill { padding: 8px 14px; font-size: 0.85rem; }
}
