/**
 * Front-end YouTube CTA styles.
 */

.ytm-sticky-bar,
.ytm-sticky-bar * {
	box-sizing: border-box;
}

.ytm-sticky-bar {
	--ytm-ink: #ffffff;
	--ytm-muted: #aeb9c5;
	--ytm-red: #d9253f;
	--ytm-red-deep: #b81830;
	position: fixed;
	z-index: 9998;
	right: max(14px, env(safe-area-inset-right));
	bottom: max(14px, env(safe-area-inset-bottom));
	left: max(14px, env(safe-area-inset-left));
	display: block;
	width: auto;
	max-width: 1180px;
	margin: 0 auto;
	padding: 11px 14px;
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 16px;
	background: #141d28;
	box-shadow: 0 14px 38px rgba(13, 22, 33, 0.28);
	color: var(--ytm-ink);
	direction: rtl;
	font-family: iransans, IRANSans, Tahoma, Arial, sans-serif;
	opacity: 0;
	visibility: hidden;
	transform: translateY(calc(100% + 28px));
	pointer-events: none;
	transition: transform 0.58s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease, visibility 0.58s ease;
}

.ytm-sticky-inner {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	max-width: 1180px;
	margin: 0 auto;
}

.ytm-sticky-bar.ytm-is-visible {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
	pointer-events: auto;
}

.ytm-sticky-bar.ytm-is-dismissed {
	display: none;
}

.ytm-sticky-thumb {
	display: block;
	width: 67px;
	height: 43px;
	flex: 0 0 auto;
	border-radius: 9px;
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
	background: linear-gradient(135deg, #21396f, #4ba4bb);
	object-fit: cover;
}

.ytm-thumb-placeholder {
	display: grid;
	place-items: center;
	background: linear-gradient(135deg, #21396f, #4ba4bb);
	color: rgba(255, 255, 255, 0.9);
}

.ytm-thumb-placeholder svg {
	width: 19px;
	height: 19px;
}

.ytm-sticky-copy {
	min-width: 0;
	flex: 1 1 auto;
	text-align: right;
}

.ytm-sticky-copy strong,
.ytm-sticky-copy span {
	display: block;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ytm-sticky-copy strong {
	color: var(--ytm-ink);
	font-family: gramaphone, Gramaphone, gramophone, Gramophone, iransans, IRANSans, Tahoma, Arial, sans-serif;
	font-size: 15px;
	font-weight: 500;
	line-height: 1.45;
}

.ytm-sticky-copy span {
	margin-top: 3px;
	color: var(--ytm-muted);
	font-size: 11px;
	line-height: 1.35;
}

.ytm-watch-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 34px;
	flex: 0 0 auto;
	padding: 0 10px;
	border-radius: 9px;
	background: var(--ytm-red);
	color: #ffffff;
	text-decoration: none;
	font-size: 11px;
	font-weight: 600;
	line-height: 1;
	white-space: nowrap;
	transition: background-color 0.2s ease, transform 0.2s ease;
}

.ytm-watch-link:hover {
	background: var(--ytm-red-deep);
	color: #ffffff;
	transform: translateY(-1px);
}

.ytm-watch-link:active {
	transform: translateY(0) scale(0.98);
}

.ytm-watch-link:focus-visible,
.ytm-close-button:focus-visible {
	outline: 3px solid #ffffff;
	outline-offset: 3px;
}

.ytm-watch-link svg {
	width: 12px;
	height: 12px;
	flex: 0 0 auto;
	fill: currentColor;
	stroke: none;
}

.ytm-close-button {
	display: grid;
	width: 40px;
	height: 40px;
	flex: 0 0 auto;
	place-items: center;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.1);
	color: #b9c3cd;
	cursor: pointer;
	font-family: inherit;
	font-size: 16px;
	line-height: 1;
	transition: background-color 0.2s ease, color 0.2s ease;
	-webkit-tap-highlight-color: transparent;
}

.ytm-close-button:hover {
	background: rgba(255, 255, 255, 0.18);
	color: #ffffff;
}

@media (max-width: 640px) {
	.ytm-sticky-bar {
		right: max(8px, env(safe-area-inset-right));
		bottom: max(8px, env(safe-area-inset-bottom));
		left: max(8px, env(safe-area-inset-left));
		width: auto;
		padding: 8px 10px;
		border-radius: 13px;
	}

	.ytm-sticky-inner {
		gap: 9px;
	}

	.ytm-sticky-thumb {
		width: 55px;
		height: 38px;
	}

	.ytm-sticky-copy strong {
		font-size: 14px;
	}

	.ytm-sticky-copy span {
		font-size: 10px;
	}

	.ytm-watch-link {
		min-height: 34px;
		padding-right: 9px;
		padding-left: 9px;
	}

	.ytm-close-button {
		width: 40px;
		height: 40px;
	}
}

@media (max-width: 359px) {
	.ytm-sticky-thumb {
		display: none;
	}

	.ytm-sticky-copy span {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ytm-sticky-bar,
	.ytm-watch-link,
	.ytm-close-button {
		transition: none;
	}
}
