/* Shared interaction surfaces; borders should not double as hover fills. */
:root {
  --row-hover: #f2f0eb;
  --row-selected: #eeeae3;
  --control-hover: #ece8e0;
  --subtle-border: #e6e2da;
}
:root[data-theme="dark"] {
  --row-hover: #101010;
  --row-selected: #181818;
  --control-hover: #202020;
  --subtle-border: #242424;
}
.result-table tbody tr:hover,
.episode-row[data-row-episode]:hover,
.suggestion:hover,
.suggestion:focus-visible { background: var(--row-hover); }
.episode-row.selected,
.episode-row.selected:hover { background: var(--row-selected); }
.search-button:hover,
#site-header #theme-toggle:hover,
#title-release-results .row-actions > *:hover { background: var(--control-hover); }
.title-section-nav { gap: 20px; margin: 20px 0 16px; border-color: var(--subtle-border); }
.title-section-nav button { transition: color .12s; }
.title-section-nav button:hover { color: var(--ink); }
.title-section-nav button[aria-pressed="true"] { border-color: var(--red); }
.result-table td, .episode-row, .critic-comment { border-bottom-color: var(--subtle-border); }
.suggestions { border-color: var(--line); border-radius: 5px; padding: 4px; }
.suggestion { border-radius: 3px; }
.episode-row { border-radius: 3px; }
.episode-row.selected { border-left: 0; box-shadow: inset 2px 0 var(--red); }
.title-releases { margin-top: 20px; }
.release-skeleton {
  height: 132px;
  background: repeating-linear-gradient(to bottom, transparent 0 16px, var(--row-hover) 16px 28px, transparent 28px 44px);
  background-size: 76% 100%;
  background-repeat: no-repeat;
}
#title-release-results .source-results .result-name { line-height: 1.4; }
#title-release-results .source-facts { margin-top: 4px; gap: 4px 8px; }
.title-releases .source-filter-menu .title-filters { box-shadow: 0 6px 20px #0002; }
.critic-comment { padding: 16px 0; }
.critic-comment blockquote, .critic-comment .critic-summary { margin: 10px 0 14px; }
@media (hover: hover) {
  .poster-link:hover img, .poster-link:hover .poster-placeholder { transform: none; filter: brightness(.94); box-shadow: none; }
}
@media (min-width: 761px) {
  body:not(.player-view) .title-intro .film-overview { gap: 20px; }
  body:not(.player-view) .film-summary { margin: 12px 0; line-height: 1.65; }
  .result-table td { padding-top: 10px; padding-bottom: 10px; }
  .episode-row { padding: 10px 8px; }
  .title-breadcrumb { margin-bottom: 16px; }
}
@media (min-width: 851px) {
  body.player-view main { gap: 20px; }
  body.player-view #title-view.has-episodes:not([hidden]) { padding-left: 14px; border-left-color: var(--subtle-border); }
  .player-view .title-section-nav { background: var(--paper); gap: 18px; padding: 0 8px; margin: 0; }
  .player-view .title-section-nav button { padding: 10px 0; }
  .player-view .episode-guide-header { background: var(--paper); padding: 12px 8px 10px; border-color: var(--subtle-border); }
  .player-view .episode-guide-header .rail-title { font-size: 17px; margin-bottom: 8px; }
  .player-view .season-picker select { padding: 5px 22px 5px 8px; }
  .player-view .episode-row { padding: 10px 8px; gap: 10px; min-height: 72px; }
  .player-view .episode-row .episode-play { top: 12px; }
  .player-view .episode-row.selected { padding-left: 8px; box-shadow: inset 2px 0 var(--red); }
  .player-view .episode-row:focus-visible { outline-color: var(--link); }
  .player-view .title-releases { margin-top: 14px; }
}
@media (max-width: 760px) {
  .title-section-nav { gap: 20px; margin: 14px 0 12px; }
  .episode-row.selected { padding-left: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .title-section-nav button, .episode-row { transition: none; }
}

/* Keep nested sticky cells inside their own layer, below the section tabs. */
#title-view { background: var(--paper); isolation: isolate; }
.ratings-graph-wrap { isolation: isolate; }
@media (min-width: 851px) {
  .player-view .title-section-nav { height: 40px; box-sizing: border-box; z-index: 5; }
  .player-view .episode-guide-header { top: 40px; z-index: 4; }
}

/* Episode details should be a small annotation, not obscure a whole season. */
.ratings-tooltip,
[data-theme="dark"] .ratings-tooltip {
  width: 208px; padding: 8px 10px; border-radius: 5px;
  background: #242424; color: #f5f5f5; border: 1px solid #444;
  font: 11px/1.4 Georgia, serif; box-shadow: 0 3px 12px #0003;
}
.ratings-tooltip strong { font-size: 12px; line-height: 1.35; margin: 2px 0 4px; }
.ratings-tooltip span { font-size: 11px; margin: 0; color: #eee; }
.ratings-tooltip small { font-size: 10px; color: #bbb; margin-top: 3px; }
.ratings-tooltip .tooltip-episode { margin: 0; }

/* The matrix leads; highlights read as compact lists underneath it. */
.title-reception { container-type: inline-size; }
.ratings-heatmap-layout, .player-view .ratings-heatmap-layout { display: flex; flex-direction: column; gap: 16px; }
.ratings-heatmap-layout .ratings-graph-wrap { order: 0; width: 100%; margin: 0; }
.heatmap-insights, .player-view .heatmap-insights {
  order: 1; display: grid; grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 20px; width: 100%; border-top: 1px solid var(--subtle-border); padding-top: 14px;
}
.heatmap-insights section { margin: 0; min-width: 0; }
.heatmap-insights h4 { color: var(--muted); font-size: 11px; font-weight: normal; margin: 0 0 10px; }
.heatmap-pick { display: grid; grid-template-columns: 24px minmax(0,1fr); gap: 8px; margin-bottom: 9px; line-height: 1.4; }
.heatmap-pick a { font-size: 12px; }
.heatmap-pick small { display: inline; margin-left: 6px; white-space: nowrap; }
.heatmap-best-score { float: none; margin-left: 12px; }
@container (max-width: 480px) {
  .heatmap-insights, .player-view .heatmap-insights { grid-template-columns: 1fr; gap: 14px; }
  .heatmap-insights section + section { border-top: 1px solid var(--subtle-border); padding-top: 12px; }
}
