/* CGN YouTube Playlists: shared styles (tabs, thumbnails, player) */

.cgn-ytp {
	--ytp-accent: #1e5a66;
	--ytp-gap: 24px;
	--ytp-radius: 14px;
	--ytp-cols: 3;
	--ytp-cards: 3;
	--ytp-list-items: 5;

	--ytp-text: #15171a;
	--ytp-muted: #5b6168;
	--ytp-line: #e3e4e1;
	--ytp-line-strong: #d0d2cd;
	--ytp-chip: #eef0ee;
	--ytp-seg: #ecede9;
	--ytp-seg-on: #ffffff;
	--ytp-surface: #f6f6f4;
	--ytp-surface-strong: #eeefeb;
	--ytp-thumb: #e3e4e1;
	--ytp-on: var(--ytp-accent);
	--ytp-on-text: #ffffff;

	display: flex;
	flex-direction: column;
	gap: 28px;
	color: var(--ytp-text);
}
.cgn-ytp.is-dark {
	--ytp-text: #ffffff;
	--ytp-muted: #a3a8ae;
	--ytp-line: rgba(255, 255, 255, 0.14);
	--ytp-line-strong: rgba(255, 255, 255, 0.28);
	--ytp-chip: rgba(255, 255, 255, 0.08);
	--ytp-seg: rgba(255, 255, 255, 0.08);
	--ytp-seg-on: #2c3036;
	--ytp-surface: rgba(255, 255, 255, 0.05);
	--ytp-surface-strong: rgba(255, 255, 255, 0.1);
	--ytp-thumb: #2a2e33;
	--ytp-on: #ffffff;
	--ytp-on-text: #121417;
}

.cgn-ytp *,
.cgn-ytp *::before,
.cgn-ytp *::after { box-sizing: border-box; }

/* Neutralize theme button styles (Hello and others style every <button>). */
.cgn-ytp.cgn-ytp button,
.cgn-ytp.cgn-ytp button:hover,
.cgn-ytp.cgn-ytp button:focus,
.cgn-ytp.cgn-ytp button:active {
	-webkit-appearance: none;
	appearance: none;
	width: auto;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	box-shadow: none;
	color: inherit;
	font: inherit;
	letter-spacing: inherit;
	line-height: inherit;
	text-align: inherit;
	text-decoration: none;
	text-transform: none;
	cursor: pointer;
}
.cgn-ytp :focus-visible {
	outline: 2px solid var(--ytp-on);
	outline-offset: 3px;
}
.cgn-ytp [hidden] { display: none !important; }

/* Tabs */
.cgn-ytp__tabs {
	display: flex;
	gap: 28px;
	max-width: 100%;
	overflow-x: auto;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}
.cgn-ytp__tabs::-webkit-scrollbar { display: none; }

.cgn-ytp.cgn-ytp button.cgn-ytp__tab {
	display: inline-flex;
	flex: var(--ytp-tab-grow, 0) 0 auto;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 44px;
	color: var(--ytp-muted);
	font-size: 15px;
	font-weight: 600;
	white-space: nowrap;
	transition: color 0.2s, background-color 0.2s, border-color 0.2s;
}
/* Alignment (Style → Tabs → Alignment). Auto margins only take up free space,
   so when the tabs overflow they fall back to 0 and the row stays scrollable. */
.cgn-ytp.cgn-ytp .cgn-ytp__tabs > button.cgn-ytp__tab:first-child { margin-left: var(--ytp-tabs-start, 0); }
.cgn-ytp.cgn-ytp .cgn-ytp__tabs > button.cgn-ytp__tab:last-child { margin-right: var(--ytp-tabs-end, 0); }

.cgn-ytp.cgn-ytp button.cgn-ytp__tab:hover,
.cgn-ytp.cgn-ytp button.cgn-ytp__tab.is-active { color: var(--ytp-text); }
.cgn-ytp__count {
	font-size: 12px;
	font-weight: 700;
	opacity: 0.75;
}

.cgn-ytp.cgn-ytp--tabs-underline .cgn-ytp__tabs { box-shadow: inset 0 -1px 0 var(--ytp-line); }
.cgn-ytp.cgn-ytp--tabs-underline button.cgn-ytp__tab {
	padding: 12px 0;
	border-bottom: 2px solid transparent;
}
.cgn-ytp.cgn-ytp--tabs-underline button.cgn-ytp__tab.is-active,
.cgn-ytp.cgn-ytp--tabs-underline button.cgn-ytp__tab.is-active:hover { border-bottom: 2px solid var(--ytp-on); }

.cgn-ytp.cgn-ytp--tabs-pill .cgn-ytp__tabs { gap: 8px; }
.cgn-ytp.cgn-ytp--tabs-pill button.cgn-ytp__tab {
	padding: 10px 18px;
	border-radius: 999px;
	background: var(--ytp-chip);
}
.cgn-ytp.cgn-ytp--tabs-pill button.cgn-ytp__tab.is-active,
.cgn-ytp.cgn-ytp--tabs-pill button.cgn-ytp__tab.is-active:hover {
	background: var(--ytp-on);
	color: var(--ytp-on-text);
}

.cgn-ytp.cgn-ytp--tabs-segmented .cgn-ytp__tabs {
	align-self: var(--ytp-tabs-self, flex-start);
	gap: 2px;
	padding: 4px;
	border-radius: 999px;
	background: var(--ytp-seg);
}
.cgn-ytp.cgn-ytp--tabs-segmented button.cgn-ytp__tab {
	padding: 9px 18px;
	border-radius: 999px;
}
.cgn-ytp.cgn-ytp--tabs-segmented button.cgn-ytp__tab.is-active,
.cgn-ytp.cgn-ytp--tabs-segmented button.cgn-ytp__tab.is-active:hover {
	background: var(--ytp-seg-on);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Thumbnail / player */
.cgn-ytp.cgn-ytp button.cgn-ytp__thumb,
.cgn-ytp__frame {
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	border-radius: var(--ytp-radius);
	background: var(--ytp-thumb);
}
.cgn-ytp .cgn-ytp__thumb img {
	position: absolute;
	inset: 0;
	width: 100%;
	max-width: none;
	height: 100%;
	border-radius: 0;
	object-fit: cover;
	transition: transform 0.4s ease;
}
.cgn-ytp.cgn-ytp button.cgn-ytp__thumb:hover img { transform: scale(1.04); }

.cgn-ytp__play {
	position: absolute;
	top: 50%;
	left: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	margin: -28px 0 0 -28px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.95);
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
	transition: transform 0.2s ease;
}
.cgn-ytp__play svg {
	width: 24px;
	height: 24px;
	margin-left: 2px;
	fill: var(--ytp-accent);
}
.cgn-ytp.cgn-ytp button.cgn-ytp__thumb:hover .cgn-ytp__play { transform: scale(1.08); }

.cgn-ytp__duration {
	position: absolute;
	right: 10px;
	bottom: 10px;
	padding: 3px 8px;
	border-radius: 6px;
	background: rgba(10, 12, 14, 0.8);
	color: #ffffff;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.4;
}

.cgn-ytp__frame iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

/* Card text */
.cgn-ytp .cgn-ytp__title {
	margin: 14px 0 0;
	color: inherit;
	font-size: 17px;
	font-weight: 700;
	line-height: 1.35;
}
.cgn-ytp .cgn-ytp__date {
	margin: 6px 0 0;
	color: var(--ytp-muted);
	font-size: 14px;
	line-height: 1.4;
}

/* Editor-only notice */
.cgn-ytp-notice {
	padding: 16px 20px;
	border: 1px dashed #c3c4c7;
	border-radius: 6px;
	background: #f6f7f7;
	color: #3c434a;
	font-size: 14px;
	line-height: 1.5;
}
.cgn-ytp-notice.is-error {
	border-color: #f86368;
	background: #fcf0f1;
	color: #8a2424;
}
