/* video-list.css
   Video list page (video-list.html): the row container and the group and topic filters.
   The row itself is in video-row.css. Needs theme.css, page-shell.css, lists.css and video-row.css. */

.rows { display: grid; align-content: start; }

/* ---------- Group and topic filters ---------- */
/* minmax(0, 1fr) and min-width: 0 stop the swipeable topic row from stretching the page wider than the screen */
.filters { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-bottom: 16px; }
.filter-top { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 10px; align-items: center; }
.filter-top, .filter-box, .search-wrap { min-width: 0; }
.filter-box { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 255, 255, .03); }
.filter-box.inline { display: flex; gap: 8px 10px; align-items: flex-start; }
#groupBox { align-items: center; min-height: 42px; padding-top: 6px; padding-bottom: 6px; }
.filter-label { flex: 0 0 auto; margin: 0; color: var(--blue); font-size: 12px; font-weight: 700; white-space: nowrap; }
#topicBox .filter-label { padding-top: 3px; }

/* Slow fading blink on the group prompt: one full cycle every 3.6 seconds */
.blink { animation: blink 3.6s ease-in-out infinite; }
@keyframes blink { 0%, 100% { opacity: .2; } 45%, 55% { opacity: 1; } }
@keyframes blink-text { 0%, 100% { color: rgba(145, 203, 238, .25); } 45%, 55% { color: var(--blue); } } /* phone version: fades the text only, not the label's backing */
@media (prefers-reduced-motion: reduce) { .blink { animation: none !important; } }

.chips { display: flex; flex-wrap: wrap; flex: 1 1 0; min-width: 0; gap: 6px; }
.chip { display: inline-flex; align-items: baseline; gap: 6px; padding: 5px 11px; border: 1px solid rgba(145, 203, 238, .28); border-radius: 999px; color: #c7e5f7; background: rgba(145, 203, 238, .07); font: inherit; font-size: 12px; cursor: pointer; }
.chip .n { color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.chip:hover:not(:disabled) { border-color: rgba(145, 203, 238, .7); }
.chip:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.chip[aria-pressed="true"], .chip[aria-pressed="true"]:hover:not(:disabled) { border-color: var(--orange); color: #fff; background: rgba(244, 163, 74, .18); } /* stays orange even with the pointer over it */
.chip[aria-pressed="true"] .n { color: #f6d3a8; }
.chip:disabled { opacity: .35; cursor: default; }
.chip[hidden] { display: none; }
.chip .star { color: var(--orange); font-size: .95em; } /* the Astro Picks chip */

/* Topic chips run one size smaller than group chips. They sit in ONE row that scrolls sideways: swipe on a phone,
   mouse wheel, drag or trackpad on a PC. The script adds fade-left and fade-right when there is more to scroll to. */
#topicBox { align-items: center; }
#topicChips { flex-wrap: nowrap; overflow-x: auto; gap: 5px; padding-right: 28px; scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
#topicChips::-webkit-scrollbar { display: none; }
#topicChips .chip { flex: 0 0 auto; padding: 3px 9px; font-size: 11px; white-space: nowrap; }
#topicChips .chip .n { font-size: 9px; }
#topicChips.fade-right { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); }
#topicChips.fade-left { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 20px), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 20px), transparent); }
#topicChips.fade-left.fade-right { -webkit-mask-image: linear-gradient(to right, transparent, #000 20px, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, transparent, #000 20px, #000 calc(100% - 28px), transparent); }

@media (max-width: 560px) {
  .filters { gap: 8px; margin-bottom: 10px; }
  .filter-top { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .filter-box { padding: 7px 10px; }
  /* Choose Group sits at the upper left of the box, on its top border like a legend. The four chips go underneath across the full width. */
  #groupBox { position: relative; align-items: center; min-height: 0; padding: 10px 10px 7px; }
  /* The backing hides the border behind the label: the top half matches the page, the bottom half matches the inside of the box */
  #groupBox .filter-label { position: absolute; top: -8px; left: 0; padding: 0 6px; line-height: 16px; background: linear-gradient(to bottom, #0b111d 50%, #131924 50%); animation-name: blink-text; }
  #groupChips { flex: 0 0 auto; width: 100%; gap: 5px; }
  #groupChips .chip { padding: 3px 8px; font-size: 10.5px; }
  #topicChips .chip { padding: 3px 7px; font-size: 9.5px; }
  #topicChips .chip .n { font-size: 8px; }
}

@media (max-width: 380px) {
  #groupChips { gap: 4px; }
  #groupChips .chip { padding: 3px 6px; }
}
