/* ---------- shared ---------- */
.acs-ytp,
.acs-ytp-grid {
	--acs-ytp-accent: #e50914;
}

.acs-ytp-empty {
	padding: 24px;
	text-align: center;
	color: #777;
	border: 1px dashed #ccc;
	border-radius: 8px;
}

/* ---------- EPISODE GRID (3 / 2 / 1) ---------- */
.acs-ytp-grid {
	display: grid;
	grid-template-columns: repeat(var(--acs-ytp-cols, 3), 1fr);
	gap: 24px;
}

/* 2 columns on tablets */
@media ( max-width: 1024px ) {
	.acs-ytp-grid { grid-template-columns: repeat(2, 1fr); }
}

/* 1 column on phones */
@media ( max-width: 640px ) {
	.acs-ytp-grid { grid-template-columns: 1fr; }
}

.acs-ytp-card {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 0;
	background: transparent;
	border: 0;
	cursor: pointer;
	text-align: left;
	font: inherit;
	color: inherit;
}

.acs-ytp-card-thumb {
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	border-radius: 12px;
	overflow: hidden;
	background: #000;
}
.acs-ytp-card-thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .3s ease;
}
.acs-ytp-card:hover .acs-ytp-card-thumb img,
.acs-ytp-card:focus-visible .acs-ytp-card-thumb img {
	transform: scale(1.04);
}

/* play button overlay */
.acs-ytp-play {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 62px;
	height: 62px;
	transform: translate(-50%, -50%);
	border-radius: 50%;
	background: var(--acs-ytp-accent);
	opacity: .92;
	transition: transform .2s ease, opacity .2s ease;
}
.acs-ytp-play::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 54%;
	transform: translate(-50%, -50%);
	border-style: solid;
	border-width: 11px 0 11px 18px;
	border-color: transparent transparent transparent #fff;
}
.acs-ytp-card:hover .acs-ytp-play,
.acs-ytp-card:focus-visible .acs-ytp-play {
	transform: translate(-50%, -50%) scale(1.08);
	opacity: 1;
}

.acs-ytp-card:focus-visible {
	outline: none;
}
.acs-ytp-card:focus-visible .acs-ytp-card-thumb {
	outline: 3px solid var(--acs-ytp-accent);
	outline-offset: 3px;
}

.acs-ytp-card-title {
	font-size: 16px;
	line-height: 1.4;
	font-weight: 600;
}

/* ---------- LIGHTBOX ---------- */
.acs-ytp-lightbox {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgba(0, 0, 0, .88);
	opacity: 0;
	visibility: hidden;
	transition: opacity .2s ease, visibility .2s ease;
}
.acs-ytp-lightbox.is-open {
	opacity: 1;
	visibility: visible;
}

.acs-ytp-lightbox-inner {
	position: relative;
	width: min(1100px, 100%);
	aspect-ratio: 16 / 9;
	background: #000;
	border-radius: 10px;
	overflow: hidden;
	box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}
.acs-ytp-lightbox-inner iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.acs-ytp-close {
	position: absolute;
	top: -14px;
	right: -14px;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: 0;
	background: #fff;
	color: #111;
	font-size: 26px;
	line-height: 44px;
	text-align: center;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(0, 0, 0, .4);
}
.acs-ytp-close:hover { background: #f0f0f0; }
.acs-ytp-close:focus-visible {
	outline: 3px solid var(--acs-ytp-accent);
	outline-offset: 2px;
}

@media ( max-width: 640px ) {
	.acs-ytp-lightbox { padding: 14px; }
	.acs-ytp-close { top: -46px; right: 0; }
}

/* ---------- CLASSIC PLAYER + LIST (layout="player") ---------- */
.acs-ytp {
	display: grid;
	gap: 20px;
	align-items: start;
}
.acs-ytp--right { grid-template-columns: minmax(0, 2.4fr) minmax(220px, 1fr); }
.acs-ytp--left  { grid-template-columns: minmax(220px, 1fr) minmax(0, 2.4fr); }
.acs-ytp--left .acs-ytp-player { order: 2; }
.acs-ytp--left .acs-ytp-list   { order: 1; }
.acs-ytp--bottom { grid-template-columns: 1fr; }

.acs-ytp-frame {
	position: relative;
	width: 100%;
	padding-top: 56.25%;
	background: #000;
	border-radius: 10px;
	overflow: hidden;
}
.acs-ytp-frame iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.acs-ytp-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
	max-height: 480px;
	overflow-y: auto;
	padding-right: 4px;
}
.acs-ytp--bottom .acs-ytp-list {
	flex-direction: row;
	max-height: none;
	overflow-x: auto;
	overflow-y: hidden;
	padding-bottom: 8px;
}

.acs-ytp-item {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	padding: 6px;
	background: transparent;
	border: 1px solid transparent;
	border-radius: 8px;
	cursor: pointer;
	text-align: left;
	transition: background-color .15s ease, border-color .15s ease;
}
.acs-ytp-item:hover { background: rgba(0, 0, 0, .05); }
.acs-ytp-item.is-active {
	border-color: var(--acs-ytp-accent);
	background: rgba(0, 0, 0, .04);
}
.acs-ytp-item:focus-visible {
	outline: 2px solid var(--acs-ytp-accent);
	outline-offset: 2px;
}
.acs-ytp--bottom .acs-ytp-item {
	flex-direction: column;
	width: 180px;
	flex: 0 0 auto;
	align-items: stretch;
}

.acs-ytp-thumb {
	flex: 0 0 auto;
	width: 120px;
	border-radius: 6px;
	overflow: hidden;
	background: #000;
	aspect-ratio: 16 / 9;
}
.acs-ytp--bottom .acs-ytp-thumb { width: 100%; }
.acs-ytp-thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.acs-ytp-item-title {
	font-size: 14px;
	line-height: 1.35;
	font-weight: 500;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

@media ( max-width: 767px ) {
	.acs-ytp--right,
	.acs-ytp--left { grid-template-columns: 1fr; }
	.acs-ytp--left .acs-ytp-player,
	.acs-ytp--left .acs-ytp-list { order: 0; }
	.acs-ytp-list {
		flex-direction: row;
		max-height: none;
		overflow-x: auto;
	}
	.acs-ytp-item {
		flex-direction: column;
		width: 160px;
		flex: 0 0 auto;
	}
	.acs-ytp-thumb { width: 100%; }
}
