/* =========================================================
   library.css — /content "The Library"
   - Full responsive card grid (reuses the teaser visual language).
   - Category filter chips.
   - "long videos" horizontal scroll-snap rows, grouped per category /
     character. Each row is self-contained so new character sections
     can be dropped in without touching anything else.
   ========================================================= */

/* The library breathes wider than the homepage card column. */
.container--wide { max-width: 880px; }

.lib-head {
  text-align: center;
  padding: 8px 0 4px;
}
.lib-title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 34px;
  line-height: 1.05;
  color: var(--text);
}
.lib-sub {
  font-size: 13px;
  color: var(--text-soft);
  margin-top: 6px;
}

/* ---- section label ---- */
.lib-section-label {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 22px;
  color: var(--text);
  margin: 30px 0 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.lib-section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--border-soft), transparent);
}

/* ---- filter chips ---- */
.lib-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 18px 0 22px;
}
.filter-chip {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--surface);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  border: 0.5px solid var(--border);
  color: var(--text-soft);
  cursor: pointer;
  transition: border-color 0.25s var(--ease), color 0.25s var(--ease), background 0.25s var(--ease);
}
.filter-chip:hover { border-color: var(--accent); color: var(--text); }
.filter-chip.is-active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 4px 14px -4px var(--accent-glow);
}

/* ---- the grid ---- */
.lib-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}
@media (min-width: 600px) {
  .lib-grid { gap: 18px; }
}

.lib-card {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--bg-2), var(--bg-3));
  border: 0.5px solid var(--border);
  box-shadow: 0 14px 36px -14px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  display: block;
  text-decoration: none;
  color: #fff;
}
.lib-card[hidden] { display: none; }

.lib-card-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0;
}
.lib-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(0, 0, 0, 0.5) 100%);
  z-index: 1;
}
.lib-card-meta {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 11px;
  z-index: 2;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
}
.lib-card-tag {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.85;
}
.lib-card-title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 18px;
  line-height: 1.1;
  margin-top: 2px;
}
.lib-card-new {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* =========================================================
   long-video rows (horizontal scroll-snap carousels)
   ========================================================= */
.vrow { position: relative; margin-bottom: 8px; }

.vrow-track {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 4px 2px 14px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.vrow-track::-webkit-scrollbar { display: none; }

.vcard {
  flex: 0 0 auto;
  width: 230px;
  scroll-snap-align: start;
  text-decoration: none;
  color: var(--text);
}
.vcard-thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 14px;
  overflow: hidden;
  border: 0.5px solid var(--border);
  box-shadow: 0 10px 26px -12px rgba(0, 0, 0, 0.4);
}
.vcard-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.vcard-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, 0.45));
}
.vcard-play {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 30px;
  opacity: 0.92;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}
.vcard-dur {
  position: absolute;
  bottom: 8px;
  right: 8px;
  z-index: 3;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  padding: 2px 7px;
  border-radius: 6px;
  letter-spacing: 0.04em;
}
.vcard-title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 16px;
  margin-top: 8px;
  color: var(--text);
}
.vcard-tags {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ---- optional arrow controls ---- */
.vrow-arrow {
  position: absolute;
  top: calc(50% - 24px);
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--surface-strong);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border: 0.5px solid var(--border);
  color: var(--text);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 4;
  font-size: 16px;
}
@media (min-width: 760px) {
  .vrow:hover .vrow-arrow { display: flex; }
}
.vrow-arrow--prev { left: -6px; }
.vrow-arrow--next { right: -6px; }
