/* Catalogue detail layout and shared movie components. */
#title-page.title-page--catalog { background: transparent; box-shadow: none; border-radius: 0; padding: 0; }
.title-page--catalog .breadcrumbs { margin-bottom: 22px; }
.title-page--catalog .title-layout { grid-template-columns: 236px minmax(0, 1fr); gap: 34px; }
.title-page--catalog .title-aside { gap: 12px; }
.title-page--catalog .title-poster { border: 1px solid var(--border-strong); border-radius: var(--radius); }
.title-page--catalog .title-actions { margin: 0; gap: 8px; }
.title-page--catalog .title-rate { padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.title-page--catalog .title-rate__score { font-size: 18px; }
.title-page--catalog .title-actions :is(a, button) { min-height: 44px; border-radius: var(--radius-sm); box-shadow: none; }
.title-page--catalog .title-actions .title-watch { background: color-mix(in srgb, var(--green) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--green) 50%, var(--border)); color: var(--text-strong); }
.title-page--catalog .title-actions .title-watch:is(:hover, :focus-visible) { background: color-mix(in srgb, var(--green) 18%, var(--surface)); border-color: var(--green); }
.title-page--catalog .title-watch svg { color: var(--accent-text); width: 20px; height: 20px; }
.title-page--catalog .title-info { min-width: 0; }
.title-page--catalog .title-info__name { font-size: 34px; line-height: 1.15; letter-spacing: -.025em; margin: 0 0 8px; overflow-wrap: anywhere; }
.title-page--catalog .title-info__original { margin: 0 0 10px; font-size: 13px; color: var(--text-soft); }
.title-page--catalog .title-info__age { padding: 2px 6px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font-size: 11px; }
.title-page--catalog .title-info__meta { margin: 0; color: var(--text-soft); font-size: 13px; }
.title-page--catalog .title-info__meta:empty { display: none; }
.title-page--catalog .title-info__ratings { flex-wrap: wrap; gap: 8px; margin: 18px 0 22px; }
.title-page--catalog .title-info__ratings:not(:has(span)) { display: none; }
.title-page--catalog .title-info__ratings > span { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border: 1px solid color-mix(in srgb, var(--star) 35%, var(--border)); border-radius: var(--radius-sm); background: color-mix(in srgb, var(--star) 11%, var(--surface)); color: var(--text-strong); font-size: 14px; font-weight: 600; }
.title-page--catalog .title-info__ratings svg { color: var(--star); }
.title-page--catalog .title-info__ratings .imdb-chip { background: none; padding: 0; color: var(--star); font-weight: 600; }
.title-page--catalog .title-specs--compact { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; margin: 0; padding: 20px 22px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.title-page--catalog .title-specs--compact .title-specs__row { grid-template-columns: 88px minmax(0, 1fr); gap: 12px; }
.title-page--catalog .title-specs dt { font-size: 12px; color: var(--text-soft); }
.title-page--catalog .title-specs dd { display: block; overflow: visible; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.title-page--catalog .title-plot { margin: 24px 0 0; padding-top: 20px; border-top: 1px solid var(--border); }
.title-page--catalog .title-plot__title { font-size: 18px; margin-bottom: 10px; }
.title-page--catalog .title-plot .title-info__desc { font-size: 13px; line-height: 1.65; color: var(--text-soft); }

/* Homepage text is kept once, complete, in the template. The native checkbox
   expands it without a script, duplicated content or an engine-specific excerpt. */
body:has(.home-catalog) .page { padding-bottom: 36px; }
body:has(.home-catalog) .home-seo .descr { position: relative; max-width: 850px; padding: 28px 0; }
.home-description { display: block; }
.home-description h2 { font-size: 21px; line-height: 1.3; margin: 0 0 10px; }
.home-description__text { max-width: 78ch; font-size: 14px; line-height: 1.8; color: var(--text-soft); }
.home-description__text p { margin: 0 0 16px; }
.home-description__text > :last-child { margin-bottom: 0; }
.home-description__toggle { position: absolute; width: 1px; height: 1px; padding: 0; border: 0; clip-path: inset(50%); overflow: hidden; }
.home-description__toggle:not(:checked) ~ .home-description__text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; max-height: 5.4em; overflow: hidden; }
.home-description__more { display: flex; align-items: center; gap: 14px; width: fit-content; min-height: 44px; margin-top: 4px; cursor: pointer; font-size: 13px; color: var(--accent-text); border-radius: var(--radius-sm); }
.home-description__more:hover { color: var(--green-deep); }
.home-description__collapse { display: none; }
.home-description__toggle:checked ~ .home-description__more .home-description__expand { display: none; }
.home-description__toggle:checked ~ .home-description__more .home-description__collapse { display: inline; }
.home-description__toggle:checked ~ .home-description__more svg { transform: rotate(180deg); }
.home-description__toggle:focus-visible ~ .home-description__more { outline: 2px solid var(--accent-text); outline-offset: 4px; }
.home-seo:not(:has(.home-description__text > *, .home-description__text:not(:empty))) { display: none; }

.footer { padding-top: 30px; }
.footer__top { gap: 40px; padding-bottom: 26px; }
.footer .logo { font-size: 22px; }
.footer__brand > p { max-width: 32ch; font-size: 13px; line-height: 1.6; }
.footer .socials { gap: 8px; flex-wrap: wrap; }
.footer .socials a { width: 32px; height: 32px; border: 1px solid var(--border-strong); border-color: var(--border-strong) !important; background: transparent !important; color: var(--text-soft) !important; box-shadow: none; }
.footer .socials a:is(:hover, :focus-visible) { background: var(--hover-soft) !important; border-color: var(--accent-text) !important; color: var(--accent-text) !important; }
.footer .socials svg { width: 15px; height: 15px; }
.footer__bottom { font-size: 12px; padding-top: 20px; }

@media (max-width: 900px) {
  .title-page--catalog .title-specs--compact { grid-template-columns: minmax(0, 1fr); gap: 14px; }
}
@media (max-width: 768px) {
  .title-page--catalog .title-layout { grid-template-columns: 160px minmax(0, 1fr); gap: 18px; }
  .title-page--catalog .title-info__name { font-size: 26px; }
  .title-page--catalog .title-specs--compact { padding: 16px; }
  .title-page--catalog .title-specs--compact .title-specs__row { grid-template-columns: 76px minmax(0, 1fr); gap: 10px; }
  .footer__top { gap: 24px; }
  .footer .socials a { width: 44px; height: 44px; }
}
@media (max-width: 520px) {
  .title-page--catalog .title-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .title-page--catalog .title-aside { max-width: 240px; }
  .title-page--catalog .title-info__name { font-size: 26px; }
}

/* Compact voting picker; its numeric average lives beside the other scores. */
.title-page--catalog .title-rate { padding: 4px 0; border: 0; background: transparent; }
.title-rate .title-rate__top, .title-rate .title-rate__pick { justify-content: center; gap: 6px; }
.title-rate .title-rate__top, .title-rate .title-rate__pick { width: 100%; min-width: 0; }
.title-rate .title-rate__star { flex: 0 1 38px; }
html .title-rate .title-rate__star { width: 38px; height: 44px; padding: 0; font-size: 28px; line-height: 1; color: color-mix(in srgb, var(--text-soft) 38%, var(--surface)); background: transparent !important; border: 0; filter: none !important; box-shadow: none; transition: color .16s ease, transform .16s ease; }
html .title-rate .title-rate__star:is(.is-active, .is-mine) { color: var(--star); }
html .title-rate .title-rate__star:is(.is-hover, :hover, :focus-visible) { color: var(--accent-text); transform: translateY(-2px); }
html .title-rate .title-rate__star:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 0; border-radius: var(--radius-sm); }

.title-info__ratings { flex-wrap: wrap; gap: 8px; }
#title-page .title-info__ratings > span { --score-accent: var(--star); display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border: 1px solid color-mix(in srgb, var(--score-accent) 38%, var(--border)); border-radius: var(--radius-sm); background: color-mix(in srgb, var(--score-accent) 10%, var(--surface)); color: var(--text-strong); font-size: 14px; font-weight: 600; }
#title-page .title-info__ratings > .rating-kp { --score-accent: var(--rating-kp-accent, color-mix(in srgb, var(--star) 80%, var(--text-strong))); }
#title-page .title-info__ratings > .rating-tmdb { --score-accent: var(--rating-tmdb-accent, var(--green)); }
#title-page .title-info__ratings > .rating-site { --score-accent: var(--accent-text); }
#title-page .title-info__ratings :is(svg, .rating-mark, .imdb-chip) { color: var(--score-accent); background: none; padding: 0; }

/* The text is present once; a native checkbox expands long plots. */
.plot-fold__toggle { position: absolute; width: 1px; height: 1px; padding: 0; clip-path: inset(50%); overflow: hidden; }
.title-plot:not(.is-foldable) .plot-fold__toggle { display: none; }
.plot-fold__button { display: none; }
.title-plot.is-foldable:not(:has(.plot-fold__toggle:checked)) .title-info__desc { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 6; line-clamp: 6; max-height: 9.9em; overflow: hidden; }
.title-plot.is-foldable .plot-fold__button { display: flex; align-items: center; gap: 12px; width: fit-content; min-height: 44px; margin-top: 6px; color: var(--accent-text); font-size: 13px; cursor: pointer; border-radius: var(--radius-sm); }
.plot-fold__collapse, .plot-fold__toggle:checked ~ .plot-fold__button .plot-fold__expand { display: none; }
.plot-fold__toggle:checked ~ .plot-fold__button .plot-fold__collapse { display: inline; }
.plot-fold__toggle:checked ~ .plot-fold__button > [aria-hidden] { transform: rotate(180deg); }
.plot-fold__toggle:focus-visible ~ .plot-fold__button { outline: 2px solid var(--accent-text); outline-offset: 3px; }

.has-trailer-dialog { overflow: hidden; }
.trailer-dialog { width: min(960px, calc(100% - 32px)); max-width: none; max-height: calc(100svh - 32px); padding: 0; margin: auto; overflow: auto; color: var(--text-strong); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: 0 24px 80px color-mix(in srgb, var(--text-strong) 20%, transparent); }
.trailer-dialog::backdrop { background: color-mix(in srgb, var(--card-overlay-bg, #080b0d) 78%, transparent); backdrop-filter: blur(5px); }
.trailer-dialog__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 12px 8px 20px; }
.trailer-dialog__head h2 { margin: 0; font-size: 18px; }
.trailer-dialog__head button[type="button"] { display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; min-width: 44px; padding: 0; border: 1px solid var(--border); border-radius: 50%; background: transparent; color: var(--text-strong); line-height: 1; box-shadow: none; }
.trailer-dialog__head button svg { display: block; width: 24px; height: 24px; }
.trailer-dialog__head button[type="button"]:is(:hover, :focus-visible) { background: var(--hover-soft); border-color: var(--accent-text); color: var(--accent-text); }
.trailer-dialog__stage { aspect-ratio: 16 / 9; background: var(--poster-bg); }
.trailer-dialog__stage iframe { display: block; width: 100%; height: 100%; border: 0; }

/* Episode stills use their natural wide composition, without a hover treatment. */
#title-page.title-page--episode { padding: 0; background: transparent; box-shadow: none; }
.title-page--episode .title-layout { grid-template-columns: minmax(240px, 360px) minmax(0, 1fr); gap: 30px; }
.title-page--episode .title-poster { aspect-ratio: 16 / 9; border: 1px solid var(--border-strong); border-radius: var(--radius); }
.title-page--episode .title-info__name { font-size: clamp(24px, 2.6vw, 34px); line-height: 1.2; letter-spacing: -.025em; }
.title-page--episode .title-info__meta { color: var(--text-soft); line-height: 1.7; }
.episode-shots .ep-block-title, .episode-cast .ep-block-title { display: none; }
.episode-shots :is(.tmdb-stills, .ms-shots__mosaic) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.episode-shots :is(.tmdb-stills, .ms-shots__mosaic):has(> :only-child) { grid-template-columns: minmax(0, 760px); }
.episode-shots :is(.still, .ms-shots__item) { grid-column: auto; grid-row: auto; width: 100%; height: auto; aspect-ratio: 16 / 9; padding: 0; border: 1px solid var(--border-strong); background: var(--poster-bg); border-radius: var(--radius); box-shadow: none; }
.episode-shots :is(.still, .ms-shots__item):is(:hover, :focus) { filter: none; background: var(--poster-bg); }
.episode-shots :is(.still, .ms-shots__item) img, .episode-shots :is(.still, .ms-shots__item):hover img { width: 100%; height: 100%; object-fit: cover; transform: none; filter: none; opacity: 1; transition: none; }
.episode-shots .ms-shots__eye { display: none; }
.episode-shots :is(.still, .ms-shots__item):focus-visible { outline: 2px solid var(--accent-text); outline-offset: 4px; }

/* One season viewport keeps the page and the controls stationary when switching. */
.ms-graph.ms-graph--tabs .ms-graph__tabs { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 16px; padding-bottom: 6px; scrollbar-width: thin; }
.ms-graph.ms-graph--tabs .pmovie__episodes-graph-season { margin: 0; border: 0; border-radius: 0; background: transparent; overflow: visible; }
.ms-graph.ms-graph--tabs .pmovie__episodes-graph-season[hidden], .ms-graph.ms-graph--tabs summary { display: none; }
.ms-graph.ms-graph--tabs .pmovie__episodes-graph-season.is-tab-active { animation: none; }
.ms-graph.ms-graph--tabs .pmovie__episodes-graph-season[open] .pmovie__episodes-graph-list { height: min(480px, 60svh); max-height: none; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; overscroll-behavior: contain; border: 0; transition: none; }
.ms-graph.ms-graph--tabs .ms-graph__cols { margin: 0; }
.ms-graph.ms-graph--tabs .ms-graph__tab[type="button"] { border: 1px solid var(--border); border-radius: var(--radius-sm); }
.ms-graph.ms-graph--tabs .ms-graph__tab[type="button"].is-active { background: color-mix(in srgb, var(--green) 13%, var(--surface)); border-color: var(--accent-text); color: var(--text-strong); }
.ms-graph.ms-graph--tabs .ms-graph__tab[type="button"]:focus-visible { outline: 2px solid var(--accent-text); outline-offset: -3px; }

@media (max-width: 768px) {
  .title-page--episode .title-layout { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .title-page--episode .title-aside { max-width: 520px; }
  .episode-shots :is(.tmdb-stills, .ms-shots__mosaic) { grid-template-columns: minmax(0, 1fr); }
  .ms-graph.ms-graph--tabs .ms-graph__cols { display: none; }
  .ms-graph.ms-graph--tabs .pmovie__episodes-graph-season[open] .pmovie__episodes-graph-list { height: min(420px, 60svh); }
}
@media (prefers-reduced-motion: reduce) {
  html .title-rate .title-rate__star { transition: none; }
}
