/*
 * /vs/youtube-promote/ section visuals (inc/vs-youtube-promote-visuals.php, enqueued by page-vs-youtube-promote.php only),
 * 2026-11-20. Ops repo docs/design/2026-11-20-vs-youtube-promote-visuals/03-plan.md.
 *
 * The routes, the audience test and the table treatment reuse css/vs-google-ads.css (vga-* classes, loaded before this file);
 * this file holds the drawn Promote flow (vyp-*) and the few overrides. Motion as vs-google-ads.css: the resting state is
 * the finished state; JS adds .vga-anim (animations attached paused, fill "both" shows their start) and .is-in when 35% of
 * the block is in view, which runs them once. Only opacity, translate, scale, colors and width move. Nothing loops.
 */

/* ---- Routes: the Promote side's head reads as a sentence ("With the Promote button, you set"), its badge a megaphone ---- */
.vyp-routes .vga-route--you .vga-route__badge svg,
.vyp-ico {
	width: 20px;
	height: 20px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.vyp-routes .vga-route--you .vga-route__badge {
	color: #444;
}

/* ---- How the Promote button works: six drawn steps ---- */
.vyp-flow {
	max-width: 1100px;
	margin: 34px auto 0;
	text-align: left;
}

.vyp-flow__label {
	margin: 0 0 14px;
	text-align: center;
	line-height: 1;
}

.vyp-flow__label span {
	display: inline-block;
	padding: 7px 12px;
	border-radius: 999px;
	background: #F1F2F4;
	color: #555;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.3;
}

.vyp-flow__steps {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 16px;
	counter-reset: none;
}

.vyp-step {
	position: relative;
	margin: 0;
	padding: 18px 20px 20px;
	border-radius: 18px;
	background: #fff;
	box-shadow: 0 1px 3px rgba(16, 24, 64, 0.07), 0 12px 30px rgba(16, 24, 64, 0.08);
	min-width: 0;
}

.vyp-step__head {
	display: flex;
	align-items: center;
	gap: 9px;
	margin: 0 0 6px;
}

.vyp-step__num {
	flex: 0 0 24px;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: #F1F2F4;
	color: #444;
	font-size: 13px;
	font-weight: 700;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
}

.vyp-step__pic {
	height: 118px;
	margin: 0 0 14px;
	padding: 14px;
	border-radius: 12px;
	background: #F6F7F9;
	box-shadow: inset 0 0 0 1px #ECEDF1;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	box-sizing: border-box;
}

.template-landing .vyp-step__title {
	margin: 0;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.25;
	color: #000;
	text-align: left;
}

.template-landing .vyp-step__text {
	margin: 0;
	font-size: 16px;
	line-height: 1.5;
	color: #292929;
	text-align: left;
}

.vyp-pic {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Step 1: a video row with its three-dot menu open on Promote. */
.vyp-pic--menu {
	position: relative;
	flex-direction: column;
	align-items: stretch;
	gap: 6px;
}

.vyp-row {
	display: flex;
	align-items: center;
	gap: 9px;
	padding: 7px;
	border-radius: 10px;
	background: #fff;
	box-shadow: 0 1px 2px rgba(16, 24, 64, 0.08);
	min-width: 0;
}

.vyp-row img {
	flex: 0 0 68px;
	width: 68px;
	height: 38px;
	border-radius: 6px;
	object-fit: cover;
	display: block;
}

.vyp-row__text {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	line-height: 1.2;
}

.vyp-row__text b {
	font-size: 12px;
	font-weight: 700;
	color: #111;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.vyp-row__text small {
	font-size: 11px;
	color: #666;
}

.vyp-row__dots {
	flex: 0 0 26px;
	height: 26px;
	border-radius: 50%;
	background: #F1F2F4;
	color: #333;
	display: flex;
	align-items: center;
	justify-content: center;
}

.vyp-row__dots .vyp-ico {
	width: 18px;
	height: 18px;
}

.vyp-menu {
	align-self: flex-end;
	padding: 5px;
	border-radius: 10px;
	background: #fff;
	box-shadow: 0 6px 18px rgba(16, 24, 64, 0.16);
}

.vyp-menu__item {
	display: flex;
	align-items: center;
	gap: 7px;
	padding: 6px 12px;
	border-radius: 7px;
	font-size: 13px;
	font-weight: 700;
	color: #111;
}

.vyp-menu__item.is-on {
	background: #EEF3FF;
	color: #0042FF;
}

.vyp-menu__item .vyp-ico {
	width: 17px;
	height: 17px;
}

/* Steps 2 and 3: choice chips; the chosen ones are blue (the selected state of a form). */
.vyp-chips {
	flex-wrap: wrap;
	gap: 6px;
}

.vyp-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 11px 5px;
	border-radius: 999px;
	background: #fff;
	box-shadow: inset 0 0 0 1.5px #D8D8D8;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.2;
	color: #333;
	white-space: nowrap;
}

.vyp-chip.is-on {
	background: #EEF3FF;
	box-shadow: inset 0 0 0 1.5px #0042FF;
	color: #0042FF;
}

.vyp-chip--radio i {
	flex: 0 0 12px;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	box-shadow: inset 0 0 0 1.5px #8A8F99;
	position: relative;
}

.vyp-chip--radio.is-on i {
	box-shadow: inset 0 0 0 1.5px #0042FF;
}

.vyp-chip--radio.is-on i::after {
	content: "";
	position: absolute;
	inset: 3px;
	border-radius: 50%;
	background: #0042FF;
}

.vyp-chip .vyp-ico {
	width: 16px;
	height: 16px;
}

/* Step 4: the budget slider and the end date. */
.vyp-budget {
	flex-direction: column;
	gap: 12px;
}

.vyp-budget__line {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 88%;
}

.vyp-budget__line b {
	font-size: 17px;
	color: #111;
}

.vyp-slider {
	position: relative;
	flex: 1 1 auto;
	height: 6px;
	border-radius: 3px;
	background: #E2E4E9;
}

.vyp-slider i {
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 64%;
	border-radius: 3px;
	background: #0042FF;
}

.vyp-slider i::after {
	content: "";
	position: absolute;
	right: -8px;
	top: 50%;
	width: 16px;
	height: 16px;
	margin-top: -8px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 0 0 2px #0042FF, 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Step 5: the rules a video has to meet. */
.vyp-rules {
	gap: 12px;
	justify-content: flex-start;
}

.vyp-rules__thumb {
	position: relative;
	flex: 0 0 96px;
	width: 96px;
	height: 54px;
	border-radius: 8px;
	overflow: hidden;
}

.vyp-rules__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.vyp-rules__thumb em {
	position: absolute;
	right: 4px;
	bottom: 4px;
	padding: 1px 5px;
	border-radius: 4px;
	background: rgba(0, 0, 0, 0.78);
	color: #fff;
	font-size: 10px;
	font-style: normal;
	font-weight: 700;
	line-height: 1.4;
}

.vyp-rules__list {
	display: flex;
	flex-direction: column;
	gap: 5px;
	min-width: 0;
}

.vyp-rule {
	display: flex;
	align-items: center;
	gap: 7px;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.2;
	color: #222;
	white-space: nowrap;
}

.vyp-rule .vga-box {
	flex-basis: 16px;
	width: 16px;
	height: 16px;
	border-radius: 4px;
}

.vyp-rule .vga-box svg {
	width: 12px;
	height: 12px;
}

/* Step 6: the review status, from "In review" to "Running". */
.vyp-review {
	flex-direction: column;
	gap: 10px;
}

.vyp-status {
	display: flex;
	align-items: center;
	gap: 8px;
}

.vyp-status__a,
.vyp-status__b {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 11px;
	border-radius: 999px;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.2;
	white-space: nowrap;
}

.vyp-status__a {
	background: #fff;
	box-shadow: inset 0 0 0 1.5px #D8D8D8;
	color: #444;
}

.vyp-status__a .vyp-ico {
	width: 16px;
	height: 16px;
}

.vyp-status__arrow {
	width: 18px;
	height: 2px;
	background: #B9BEC9;
	position: relative;
}

.vyp-status__arrow::after {
	content: "";
	position: absolute;
	right: -1px;
	top: -4px;
	border: solid #B9BEC9;
	border-width: 0 2px 2px 0;
	padding: 3px;
	transform: rotate(-45deg);
}

.vyp-status__b {
	background: #ECF8F1;
	box-shadow: inset 0 0 0 1.5px #C4E8D2;
	color: #1D7C45;
}

.vyp-status__b i {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #22A55A;
}

.vyp-review__note {
	font-size: 13px;
	font-weight: 600;
	color: #555;
}

/* Flow motion: the cards arrive one after another; inside each, the chosen state lands. */
@keyframes vypChipOn {
	from { background-color: #fff; box-shadow: inset 0 0 0 1.5px #D8D8D8; color: #333; }
	to { background-color: #EEF3FF; box-shadow: inset 0 0 0 1.5px #0042FF; color: #0042FF; }
}

@keyframes vypSlide {
	from { width: 12%; }
	to { width: 64%; }
}

@keyframes vypMenu {
	from { opacity: 0; scale: 0.85; translate: 0 -6px; }
	to { opacity: 1; scale: 1; translate: 0 0; }
}

@keyframes vypRunning {
	from { opacity: 0; scale: 0.6; }
	to { opacity: 1; scale: 1; }
}

.vga-anim .vyp-step {
	animation: vgaIn 0.45s calc(var(--i) * 0.12s) both paused;
}

.vga-anim .vyp-menu {
	transform-origin: 100% 0;
	animation: vypMenu 0.35s 0.55s both paused;
}

.vga-anim .vyp-chip.is-on {
	animation: vypChipOn 0.3s calc(0.6s + var(--i) * 0.12s) both paused;
}

.vga-anim .vyp-chip--date.is-on {
	animation: vypChipOn 0.3s 1.4s both paused;
}

.vga-anim .vyp-slider i {
	animation: vypSlide 0.8s 0.9s both paused;
}

.vga-anim .vyp-rule .vga-box {
	animation: vgaBox 0.3s calc(1s + var(--i, 0) * 0.1s) both paused;
}

.vga-anim .vyp-status__b {
	animation: vypRunning 0.4s 1.5s both paused;
}

.vga-anim.is-in .vyp-step,
.vga-anim.is-in .vyp-menu,
.vga-anim.is-in .vyp-chip.is-on,
.vga-anim.is-in .vyp-slider i,
.vga-anim.is-in .vyp-rule .vga-box,
.vga-anim.is-in .vyp-status__b {
	animation-play-state: running;
}

/* ---- Phones and tablets ---- */
@media screen and (max-width: 980px) {
	.vyp-flow__steps {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media screen and (max-width: 640px) {
	.vyp-flow {
		margin-top: 24px;
		padding: 0 8px;
	}

	.vyp-flow__steps {
		grid-template-columns: minmax(0, 1fr);
		gap: 12px;
	}

	.vyp-step {
		padding: 14px 16px 16px;
		border-radius: 16px;
	}

	.vyp-step__pic {
		height: 104px;
		margin-bottom: 12px;
	}

	.template-landing .vyp-step__title {
		font-size: 17px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.vga-anim .vyp-step,
	.vga-anim .vyp-menu,
	.vga-anim .vyp-chip,
	.vga-anim .vyp-slider i,
	.vga-anim .vyp-rule .vga-box,
	.vga-anim .vyp-status__b {
		animation: none !important;
	}
}
