.trending-page .trending-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 56px) var(--page-gutter) 64px;
}

#panel-trending .trending-panel {
  padding-top: 4px;
}

.trending-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin-bottom: 20px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elev);
}

.trending-filter-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 140px;
  flex: 1 1 160px;
  max-width: 220px;
}

.trending-filter-field-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.trending-filter-platform-field {
  min-width: 140px;
  max-width: 220px;
}

.trending-filter-picker {
  position: relative;
  width: 100%;
}

.trending-filter-picker > summary {
  list-style: none;
  cursor: pointer;
}

.trending-filter-picker > summary::-webkit-details-marker {
  display: none;
}

.trending-filter-picker-summary {
  box-sizing: border-box;
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 36px;
  padding: 0 28px 0 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  line-height: 1.25;
}

.trending-filter-picker-summary::after {
  content: '';
  position: absolute;
  right: 10px;
  top: 50%;
  width: 12px;
  height: 12px;
  margin: 0;
  transform: translateY(-50%);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238c97ad' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")
    center / contain no-repeat;
  transition: transform 0.15s ease;
}

.trending-filter-picker[open] > .trending-filter-picker-summary::after {
  transform: translateY(-50%) rotate(180deg);
}

.trending-filter-picker-icon {
  display: inline-flex;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  align-items: center;
  justify-content: center;
}

.trending-filter-picker-icon .platform-filter-icon,
.trending-filter-picker-icon img,
.trending-filter-picker-icon svg {
  width: 16px;
  height: 16px;
}

.trending-filter-picker-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: inherit;
}

.trending-filter-dropdown-list {
  position: absolute;
  z-index: 30;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  margin: 0;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elev);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
  max-height: 260px;
  overflow-y: auto;
}

.trending-filter-dropdown-list .platform-filter-option {
  flex-direction: row;
  justify-content: flex-start;
  align-items: center;
  text-align: left;
  width: 100%;
}

.trending-filter-dropdown-list .platform-filter-label {
  flex: 1;
  text-align: left;
}

.trending-because {
  display: block;
  margin-top: 4px;
  font-size: 0.78rem;
  color: var(--accent);
}

.trending-hero {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 40px;
}

.trending-hero h1 {
  margin: 0 0 12px;
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  line-height: 1.1;
}

.trending-lead {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.55;
}

.trending-section {
  margin-bottom: 40px;
  min-width: 0;
}

.trending-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
  /*
   * Match the rhythm that .trending-section provides between
   * other sibling sections, plus a touch extra so the following
   * "Trending movies" block reads as a fresh section break (TV
   * column cards above → Movies section below).
   */
  margin-bottom: 48px;
}

.trending-columns .trending-section {
  margin-bottom: 0;
}

.trending-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.trending-section-head h2 {
  margin: 0;
  font-size: 1.35rem;
}

.trending-section-head .muted {
  margin: 4px 0 0;
  font-size: 0.88rem;
}

.trending-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.trending-item {
  display: grid;
  grid-template-columns: auto 72px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-elev);
}

.trending-rank {
  width: 2rem;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--accent);
  text-align: center;
}

.trending-poster {
  width: 72px;
  height: 108px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
}

.trending-info h3 {
  margin: 0 0 4px;
  font-size: 1rem;
  line-height: 1.25;
}

.trending-info p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.84rem;
  line-height: 1.4;
}

.trending-count {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--good, var(--accent));
}

.trending-action {
  flex-shrink: 0;
  align-self: center;
}

.trending-action--with-dismiss {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.trending-item--dismissible .suggestion-dismiss-btn {
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.trending-item--dismissible .suggestion-dismiss-btn:hover:not(:disabled),
.trending-item--dismissible .suggestion-dismiss-btn:focus-visible {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--bg-elev-2);
}

.trending-item--dismissible .suggestion-dismiss-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.trending-action-btn {
  padding: 4px 10px;
  min-width: 0;
  min-height: 0;
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  border-radius: 8px;
}

.trending-action .ghost.trending-action-btn {
  color: var(--text-muted);
  border-color: var(--border);
  background: transparent;
}

.trending-action .ghost.trending-action-btn:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--bg-elev-2);
}

.trending-in-library-btn {
  color: var(--text-dim);
  background: transparent;
  border-color: var(--border);
  opacity: 1;
  cursor: default;
}

.trending-in-library-btn:disabled {
  opacity: 1;
}

.trending-empty {
  margin: 0;
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
  border: 1px dashed var(--border);
  border-radius: 12px;
}

.trending-episode-item {
  cursor: pointer;
}

.trending-episode-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.trending-episode-score {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.trending-episode-meta {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.trending-episode-poster {
  object-fit: cover;
}

@media (max-width: 900px) {
  .trending-columns {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .trending-columns .trending-section {
    margin-bottom: 0;
  }
}

@media (min-width: 901px) {
  .trending-columns .trending-item {
    grid-template-columns: auto 56px 1fr auto;
    gap: 12px;
  }

  .trending-columns .trending-poster {
    width: 56px;
    height: 84px;
  }
}

@media (max-width: 640px) {
  .trending-item {
    grid-template-columns: auto 56px 1fr;
    grid-template-areas:
      'rank poster info'
      'action action action';
  }

  .trending-rank {
    grid-area: rank;
  }

  .trending-poster {
    grid-area: poster;
    width: 56px;
    height: 84px;
  }

  .trending-info {
    grid-area: info;
  }

  .trending-action {
    grid-area: action;
    justify-self: end;
  }

  #panel-trending .trending-filters {
    flex-direction: column;
    gap: 10px;
    padding: 12px;
  }

  #panel-trending .trending-filter-field {
    min-width: 0;
    max-width: none;
    flex: 1 1 100%;
  }
}
