/* ── Base ─────────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, sans-serif;
  background: #fff;
  color: #000;
  overflow-y: scroll;
}

a {
  color: #0161a5;
  text-decoration: none;
}

/* ── Page header ─────────────────────────────────────────────────────────── */

#page-header {
  position: sticky;
  top: 0;
  background: #fff;
  border-bottom: 2px solid lightblue;
  padding: 6px 8px 4px;
  z-index: 10;
}

#page-header h1 {
  margin: 0 0 5px;
  font-size: 1.1em;
}

#offline-indicator {
  float: right;
  font-size: 0.75em;
  color: #aaa;
  font-style: italic;
}

/* ── Filter bar (metadata, local) ────────────────────────────────────────── */

#filter-bar {
  margin-bottom: 5px;
}

#filter-input {
  width: 100%;
  padding: 4px 8px;
  border: 2px solid lightblue;
  border-radius: 6px;
  font: inherit;
  font-size: 0.9em;
  outline: none;
}

#filter-input:focus {
  border-color: #0161a5;
}

/* ── Filter chips ────────────────────────────────────────────────────────── */

#channel-filters,
#extra-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 4px;
}

.filterChip {
  border: 2px solid lightblue;
  border-radius: 5px;
  background: #f5f5f5;
  color: inherit;
  font: inherit;
  font-size: 0.82em;
  padding: 1px 7px;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.5;
}

.filterChip.selected {
  background: #e1f0f5;
  color: darkblue;
  font-weight: bold;
  border-color: #0161a5;
}

/* ── Content search bar (server-side) ────────────────────────────────────── */

#content-search-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

#content-search-input {
  flex: 1;
  padding: 4px 8px;
  border: 2px solid lightblue;
  border-radius: 6px;
  font: inherit;
  font-size: 0.9em;
  outline: none;
}

#content-search-input:focus {
  border-color: #0161a5;
}

#content-search-status {
  font-size: 0.78em;
  color: #888;
  white-space: nowrap;
  min-width: 4em; /* prevents layout shift when text changes */
}

/* ── Entry list ──────────────────────────────────────────────────────────── */

#entry-list {
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

/* ── Show more button ────────────────────────────────────────────────────── */

#show-more {
  width: 100%;
  padding: 8px;
  border: 2px solid lightblue;
  border-radius: 8px;
  background: #f5f5f5;
  color: darkblue;
  font: inherit;
  font-size: 0.88em;
  cursor: pointer;
}

#show-more:hover {
  background: #e1f0f5;
}

/* ── Entry card ──────────────────────────────────────────────────────────── */

article.entry {
  border: 2px solid lightblue;
  border-radius: 8px;
  overflow: hidden;
}

article.entry.top {
  border-color: #0161a5;
}

.entryRow {
  display: flex;
  align-items: stretch;
}

a.entryThumbLink {
  flex-shrink: 0;
  display: block;
  line-height: 0;
}

.entryThumbnail {
  display: block;
  height: 5em;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

article.entry header {
  flex: 1;
  min-width: 0;
  padding: 3px 6px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  overflow: hidden;
}

article.entry h2 {
  margin: 0;
  padding: 3px 6px 5px;
  font-size: 0.9em;
  font-weight: bold;
  line-height: 1.3;
}

article.entry h2 a {
  color: #000;
}

article.entry h2 a:hover {
  text-decoration: underline;
}

/* ── Entry metadata spans ────────────────────────────────────────────────── */

.entryFirstLine {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.entryDate {
  font-weight: bold;
  color: #0161a5;
  font-size: 0.85em;
}

.entryChannel {
  font-weight: bold;
  color: darkblue;
  font-size: 0.85em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.entryDuration {
  font-size: 0.82em;
  color: #444;
}

.entryLang {
  font-size: 0.75em;
  color: #888;
}

.entryAuthor {
  font-size: 0.82em;
  color: #444;
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.entryRating {
  font-size: 0.85em;
  letter-spacing: 1px;
  flex-shrink: 0;
}

.entryRating .star {
  color: #e8c840;
}

.entryRating .star.empty {
  color: #888;
}
