/* ==========================================================================
   Kinotheatre — parser-actors: фильмы/сериалы на странице актёра
   ========================================================================== */

.kt-actor-films {
	display: grid;
	grid-template-columns: 1fr;
	gap: 14px;
}

@media (min-width: 768px) {
	.kt-actor-films {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 16px;
	}
}

.kt-actor-film {
	margin: 0;
	min-width: 0;
	background: var(--kt-bg-elevated, #14141a);
	border: 1px solid var(--kt-border, rgba(255, 255, 255, 0.08));
	border-radius: var(--kt-radius, 8px);
	overflow: hidden;
	transition: border-color 0.2s, background 0.2s;
}

.kt-actor-film:hover {
	border-color: rgba(229, 9, 20, 0.35);
	background: var(--kt-bg-surface, #1c1c24);
}

.kt-actor-film__link {
	display: flex;
	gap: 12px;
	height: 100%;
	color: inherit;
	text-decoration: none;
}

.kt-actor-film__poster {
	flex: 0 0 100px;
	width: 100px;
	overflow: hidden;
	background: var(--kt-bg-surface, #1c1c24);
}

.kt-actor-film__poster img {
	width: 100%;
	height: 100%;
	min-height: 140px;
	object-fit: cover;
}

.kt-actor-film__body {
	flex: 1;
	min-width: 0;
	padding: 12px 12px 12px 0;
}

.kt-actor-film__title {
	margin: 0 0 8px;
	font-size: 0.9375rem;
	font-weight: 700;
	line-height: 1.3;
	color: var(--kt-text, #f5f5f7);
	transition: color 0.2s;
}

.kt-actor-film__link:hover .kt-actor-film__title {
	color: var(--kt-accent, #e50914);
}

.kt-actor-film__meta {
	margin: 0 0 8px;
	font-size: 0.75rem;
	line-height: 1.45;
	color: var(--kt-text-dim, #6b6b78);
}

.kt-actor-film__meta p {
	margin: 0 0 3px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.kt-actor-film__meta b {
	font-weight: 600;
	color: var(--kt-text-muted, #9a9aa8);
}

.kt-actor-film__desc {
	margin: 0;
	font-size: 0.75rem;
	line-height: 1.45;
	color: var(--kt-text-dim, #6b6b78);
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.kt-actor-film__rating {
	display: inline-block;
	margin-top: 6px;
	padding: 2px 7px;
	font-size: 0.6875rem;
	font-weight: 700;
	color: var(--kt-accent, #e50914);
	background: rgba(229, 9, 20, 0.12);
	border: 1px solid rgba(229, 9, 20, 0.25);
	border-radius: var(--kt-radius-sm, 4px);
}

/* Ссылки актёров/режиссёров в карточке фильма */
.kt-person-card {
	position: relative;
	display: inline-flex;
	vertical-align: middle;
	margin: 0 2px 6px 0;
}

.kt-cast-chip {
	display: inline-flex;
	vertical-align: middle;
	margin: 0;
}

.kt-cast-chip__link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 10px 4px 4px;
	font-size: 0.8125rem;
	color: var(--kt-text-muted, #9a9aa8);
	text-decoration: none;
	background: var(--kt-bg-surface, #1c1c24);
	border: 1px solid var(--kt-border, rgba(255, 255, 255, 0.08));
	border-radius: 999px;
	transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.kt-cast-chip__link:hover {
	color: var(--kt-text, #f5f5f7);
	border-color: rgba(229, 9, 20, 0.4);
	background: var(--kt-bg-hover, #252530);
}

.kt-cast-chip__img {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	object-fit: cover;
}

.kt-cast-chip__name {
	line-height: 1.2;
}

.kt-cast-link {
	color: var(--kt-accent, #e50914);
	text-decoration: none;
}

.kt-cast-link:hover {
	text-decoration: underline;
}

.kt-full__dl dd .kt-cast-chip,
.kt-full__dl dd .kt-cast-link {
	line-height: 1.6;
}

.kt-full__dl dd:has(.kt-cast-chip),
.kt-full__dl dd:has(.kt-cast-link),
.kt-full__dl dd:has(.kt-person-card) {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
}

/* --- Всплывающая карточка актёра / режиссёра --- */
.kt-person-popup {
	position: fixed;
	z-index: 10050;
	width: min(380px, calc(100vw - 24px));
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.15s ease, visibility 0.15s ease;
}

.kt-person-popup.is-visible {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

.kt-person-popup__card {
	display: flex;
	gap: 14px;
	padding: 14px;
	background: var(--kt-bg-elevated, #14141a);
	border: 1px solid var(--kt-border, rgba(255, 255, 255, 0.1));
	border-radius: var(--kt-radius-lg, 12px);
	box-shadow: 0 16px 48px rgba(0, 0, 0, 0.65);
}

.kt-person-popup__photo {
	flex: 0 0 88px;
	width: 88px;
	overflow: hidden;
	border-radius: var(--kt-radius, 8px);
	background: var(--kt-bg-surface, #1c1c24);
}

.kt-person-popup__photo img {
	display: block;
	width: 100%;
	height: 118px;
	object-fit: cover;
}

.kt-person-popup__body {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.kt-person-popup__title {
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.25;
	color: var(--kt-text, #f5f5f7);
	text-decoration: none;
	transition: color 0.15s;
}

.kt-person-popup__title:hover {
	color: var(--kt-accent, #e50914);
}

.kt-person-popup__career {
	font-size: 0.8125rem;
	line-height: 1.4;
	color: var(--kt-text-muted, #9a9aa8);
}

.kt-person-popup__org {
	font-size: 0.75rem;
	font-style: italic;
	color: var(--kt-text-dim, #6b6b78);
}

.kt-person-popup__meta {
	font-size: 0.75rem;
	line-height: 1.45;
	color: var(--kt-text-dim, #6b6b78);
}

.kt-person-popup__works {
	margin-top: 4px;
	font-size: 0.75rem;
	line-height: 1.5;
	color: var(--kt-text-muted, #9a9aa8);
}

.kt-person-popup__works b {
	display: block;
	margin-bottom: 4px;
	font-size: 0.6875rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--kt-text-dim, #6b6b78);
}

.kt-person-popup__works a {
	color: var(--kt-text, #f5f5f7);
	text-decoration: none;
}

.kt-person-popup__works a:hover {
	color: var(--kt-accent, #e50914);
	text-decoration: underline;
}

.kt-person-popup__more {
	display: inline-flex;
	align-self: flex-start;
	margin-top: 6px;
	padding: 6px 12px;
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--kt-text, #f5f5f7);
	text-decoration: none;
	background: var(--kt-bg-surface, #1c1c24);
	border: 1px solid var(--kt-border, rgba(255, 255, 255, 0.1));
	border-radius: 999px;
	transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.kt-person-popup__more:hover {
	color: #fff;
	background: var(--kt-accent, #e50914);
	border-color: var(--kt-accent, #e50914);
}

.kt-person-card:hover .kt-cast-chip__link,
.kt-person-card:focus-within .kt-cast-chip__link {
	color: var(--kt-text, #f5f5f7);
	border-color: rgba(229, 9, 20, 0.45);
	background: var(--kt-bg-hover, #252530);
}

.kt-content--persons {
	display: block;
	width: 100%;
}

.kt-content--persons .kt-grid:has(> .kt-actor-page),
.kt-content--list .kt-grid:has(> .kt-actor-page) {
	display: block;
}

.kt-grid > .kt-actor-page {
	grid-column: 1 / -1;
	max-width: 960px;
	margin-inline: auto;
}

@media (max-width: 480px) {
	.kt-person-popup__card {
		flex-direction: row;
		padding: 12px;
	}

	.kt-person-popup__photo {
		flex-basis: 72px;
		width: 72px;
	}

	.kt-person-popup__photo img {
		height: 96px;
	}
}
