/**
 * Interactive tour pages
 *
 * Every page under /product-tours/<slug>/: the bar that pins under the site
 * header, the step text and chips, the screenshot with its markers and tips,
 * the finish card, and the phone callout. Behavior is
 * /assets/js/tour-player.js; the index has its own sheet, product-tours.css.
 *
 * The screenshot area stays dark in both themes, since it frames the app.
 *
 * @copyright   2026, ON1
 */

/* !- Bar
   Full width, rule included, so it covers the page scrolling under it.
   --header-offset is #site-header's height, set from the javascript, so it
   pins below the header rather than under it. */
#tour-page .tour-bar {
	background: var(--bg-950);
	border-bottom: 1px solid var(--bg-700);
	position: sticky;
	top: var(--header-offset, 0px);
	z-index: 30;
}

.tour-bar-in {
	align-items: center;
	display: flex;
	gap: 0.625rem;
	min-height: 3.5rem;
	padding: 0.5rem 0;
}

.tour-bar-mid {
	flex: 1;
	min-width: 0;
	text-align: center;
}

.tour-bar-title {
	color: var(--text-50);
	font-size: var(--text-base);
	font-weight: 700;
	line-height: 1.25;
	margin: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.tour-bar-sub {
	color: var(--text-500);
	font-size: var(--text-sm);
	line-height: 1.3;
	margin: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* All tours, Prev tour and Next tour */
.tour-bar-btn {
	background: var(--bg-800);
	border: 1px solid var(--bg-700);
	border-radius: var(--border-radius);
	color: var(--text-100);
	display: inline-block;
	flex: none;
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1;
	padding: 0.5625rem 0.875rem;
	text-decoration: none;
	white-space: nowrap;
}

.tour-bar-btn:hover {
	border-color: var(--bg-500);
	color: var(--text-50);
}

.tour-bar-btn.is-home {
	background: var(--blue-500);
	border-color: var(--blue-500);
	color: var(--white);
}

.tour-bar-btn.is-home:hover {
	background: var(--blue-600);
	border-color: var(--blue-600);
	color: var(--white);
}

.tour-bar-tours {
	display: flex;
	flex: none;
	gap: 0.5rem;
}

.tour-bar-sep {
	background: var(--bg-700);
	flex: none;
	height: 1.625rem;
	width: 1px;
}

/* Back · Step 1/5 · Next */
.tour-stepper {
	align-items: center;
	background: var(--bg-800);
	border: 1px solid var(--bg-700);
	border-radius: var(--border-radius);
	display: flex;
	flex: none;
	overflow: hidden;
}

.tour-stepper button {
	background: transparent;
	border: 0;
	color: var(--text-50);
	cursor: pointer;
	font-size: var(--text-base);
	font-weight: 700;
	line-height: 1;
	min-height: 2.375rem;
	padding: 0.625rem 1rem;
}

.tour-stepper button:disabled {
	cursor: default;
	opacity: 0.35;
}

.tour-stepper .is-next {
	background: var(--blue-500);
	color: var(--white);
}

.tour-stepper-pos {
	border-left: 1px solid var(--bg-700);
	border-right: 1px solid var(--bg-700);
	color: var(--text-300);
	font-size: var(--text-sm);
	font-variant-numeric: tabular-nums;
	font-weight: 600;
	min-width: 8.25rem;
	padding: 0 0.625rem;
	text-align: center;
	white-space: nowrap;
}

.tour-bar-btn:focus-visible,
.tour-stepper button:focus-visible {
	outline: 2px solid var(--blue-400);
	outline-offset: 2px;
}

/* !- Tour body */
#tour-page .tour-player {
	display: grid;
	gap: 0.875rem;
	padding: 1.25rem 0 2.5rem 0;
}

.tour-note {
	align-items: flex-start;
	background: var(--green-transparent);
	border: 1px solid var(--green-500);
	border-radius: var(--border-radius);
	display: flex;
	font-size: var(--text-base);
	gap: 0.625rem;
	line-height: 1.45;
	padding: 0.625rem 0.75rem;
}

.tour-note strong {
	color: var(--text-50);
}

.tour-note > i {
	color: var(--green-500);
	font-size: var(--text-xl);
}

.tour-note button {
	background: none;
	border: 0;
	color: inherit;
	cursor: pointer;
	margin-left: auto;
	opacity: 0.7;
	padding: 0 0.25rem;
}

.tour-eyebrow {
	align-items: center;
	color: var(--text-500);
	display: flex;
	flex-wrap: wrap;
	font-size: var(--text-mini);
	font-weight: 600;
	gap: 0.5rem;
	letter-spacing: 0.08em;
	margin: 0;
	text-transform: uppercase;
}

.tour-eyebrow .tour-app {
	color: var(--green-500);
}

.tour-badge {
	border: 1px solid;
	border-radius: var(--border-radius);
	font-size: var(--text-mini);
	font-weight: 800;
	letter-spacing: 0.06em;
	line-height: 1.3;
	padding: 0.125rem 0.375rem;
}

.tour-badge.is-max {
	background: var(--gold-transparent);
	border-color: var(--gold-500);
	color: var(--gold-500);
}

.tour-badge.is-new {
	background: var(--green-transparent);
	border-color: var(--green-500);
	color: var(--green-500);
}

.tour-step-text h2 {
	font-size: var(--text-2xl);
	font-weight: 900;
	line-height: 1.15;
	margin: 0 0 0.5rem 0;
	text-wrap: balance;
}

.tour-caption {
	color: var(--text-200);
	margin: 0;
}

/* !- Chips */
.tour-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.375rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.tour-chips li {
	margin: 0;
}

.tour-chips button {
	align-items: center;
	background: var(--bg-850);
	border: 1px solid var(--bg-700);
	border-radius: var(--border-radius);
	color: var(--text-400);
	cursor: pointer;
	display: flex;
	font-size: var(--text-sm);
	gap: 0.375rem;
	padding: 0.25rem 0.625rem 0.25rem 0.25rem;
	white-space: nowrap;
}

.tour-chips button:hover {
	border-color: var(--blue-500);
	color: var(--text-100);
}

.tour-chip-num {
	align-items: center;
	background: var(--bg-700);
	border-radius: 50%;
	color: var(--text-100);
	display: flex;
	flex: none;
	font-size: var(--text-mini);
	font-weight: 700;
	height: 18px;
	justify-content: center;
	width: 18px;
}

.tour-chips .is-on {
	background: var(--blue-500);
	border-color: var(--blue-500);
	color: var(--white);
	font-weight: 600;
}

.tour-chips .is-on:hover {
	color: var(--white);
}

.tour-chips .is-on .tour-chip-num {
	background: var(--white);
	color: var(--blue-500);
}

.tour-chips .is-past .tour-chip-num {
	background: var(--green-500);
	color: var(--green-950);
}

/* !- Screenshot
   The viewport clips the stage when it's zoomed in on a phone */
.tour-viewport {
	background: #1f1f1f;
	border: 1px solid #3a3a3a;
	border-radius: var(--border-radius);
	overflow: clip;
	position: relative;
}

.tour-stage {
	-webkit-user-select: none;
	aspect-ratio: 1600 / 960;
	cursor: pointer;
	position: relative;
	transform-origin: 0 0;
	transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
	user-select: none;
}

.tour-stage > img {
	display: block;
	height: 100%;
	pointer-events: none;
	width: 100%;
}

.tour-hots {
	inset: 0;
	position: absolute;
}

/* Only the current marker shows */
.tour-hot,
.tour-hot-extra {
	background: color-mix(in srgb, var(--green-500) 10%, transparent);
	border: 2px solid var(--green-500);
	border-radius: var(--border-radius);
	opacity: 0;
	pointer-events: none;
	position: absolute;
	transition: opacity 0.3s ease;
}

.tour-hot {
	cursor: pointer;
	padding: 0;
}

.tour-hot.is-current,
.tour-hot-extra.is-current {
	opacity: 1;
	pointer-events: auto;
}

.tour-hot-extra.is-current {
	pointer-events: none;
}

.tour-hot.is-current {
	animation: tour-hot 1.6s ease-out infinite;
}

.tour-hot.is-clicked {
	animation: none;
	background: color-mix(in srgb, var(--green-500) 28%, transparent);
}

.tour-hot:focus-visible {
	outline: 2px solid var(--blue-400);
	outline-offset: 3px;
}

@keyframes tour-hot {
	0% {
		box-shadow: 0 0 0 0 color-mix(in srgb, var(--green-500) 55%, transparent);
	}

	70% {
		box-shadow: 0 0 0 12px color-mix(in srgb, var(--green-500) 0%, transparent);
	}

	100% {
		box-shadow: 0 0 0 0 color-mix(in srgb, var(--green-500) 0%, transparent);
	}
}

.tour-hot-num {
	align-items: center;
	background: var(--green-500);
	border-radius: 50%;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
	color: var(--green-950);
	display: flex;
	font-size: var(--text-mini);
	font-weight: 800;
	height: 20px;
	justify-content: center;
	left: -23px;
	position: absolute;
	top: -23px;
	width: 20px;
}

.tour-viewport.is-zoomed .tour-hot,
.tour-viewport.is-zoomed .tour-hot-extra {
	border-width: 1.5px;
}

.tour-viewport.is-zoomed .tour-hot-num {
	display: none;
}

/* Placed by the javascript, from the marker's corner plus its offsets */
.tour-tip {
	background: #2b2b2b;
	border: 1px solid #3a3a3a;
	border-radius: var(--border-radius);
	box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
	color: #e6e6e6;
	font-size: 0.9375rem;
	line-height: 1.4;
	max-width: 70%;
	opacity: 0;
	padding: 0.625rem 0.75rem;
	pointer-events: none;
	position: absolute;
	transition: opacity 0.2s;
	visibility: hidden;
	z-index: 5;
}

.tour-tip.is-shown {
	opacity: 1;
	visibility: visible;
}

.tour-tip strong,
.tour-callout strong {
	color: #f2f2f2;
	font-weight: 700;
}

.tour-tip > strong:first-child {
	display: block;
}

.tour-tip-cta {
	color: var(--green-500);
	display: block;
	font-size: var(--text-mini);
	font-weight: 600;
	margin-top: 0.375rem;
}

.tour-stage.is-compact .tour-tip {
	display: none;
}

/* !- Finish card */
.tour-finish {
	background: #2b2b2b;
	border: 1px solid #3a3a3a;
	border-radius: var(--border-radius);
	box-shadow: 0 14px 40px rgba(0, 0, 0, 0.6);
	color: #e6e6e6;
	cursor: default;
	display: grid;
	gap: 0.75rem;
	left: 50%;
	max-height: 94%;
	overflow: auto;
	padding: 1.125rem;
	position: absolute;
	top: 50%;
	transform: translate(-50%, -50%);
	width: min(580px, 92%);
	z-index: 6;
}

.tour-finish:not([hidden]) {
	animation: tour-finish 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.25);
}

@keyframes tour-finish {
	from {
		opacity: 0;
		transform: translate(-50%, calc(-50% + 14px)) scale(0.97);
	}

	to {
		opacity: 1;
		transform: translate(-50%, -50%);
	}
}

.tour-finish h2 {
	align-items: center;
	color: #f2f2f2;
	display: flex;
	font-size: var(--text-xl);
	font-weight: 900;
	gap: 0.5rem;
	margin: 0;
}

.tour-finish h2 i {
	color: var(--green-500);
}

.tour-finish p {
	font-size: var(--text-base);
	margin: 0;
}

.tour-finish-nav {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.tour-finish-nav a,
.tour-finish-nav button {
	background: #1f1f1f;
	border: 1px solid #4a4a4a;
	border-radius: var(--border-radius);
	color: #e6e6e6;
	cursor: pointer;
	display: inline-block;
	font-size: var(--text-base);
	font-weight: 600;
	line-height: 1;
	padding: 0.625rem 1rem;
	text-decoration: none;
}

.tour-finish-nav a:hover,
.tour-finish-nav button:hover {
	border-color: #6a6a6a;
	color: #fff;
}

.tour-finish-nav .is-next {
	background: var(--blue-500);
	border-color: var(--blue-500);
	color: var(--white);
}

.tour-deeper {
	border-top: 1px solid #3a3a3a;
	display: grid;
	gap: 0.375rem;
	padding-top: 0.75rem;
}

.tour-deeper h3 {
	color: #9a9a9a;
	font-size: var(--text-sm);
	letter-spacing: 0.08em;
	margin: 0;
	text-transform: uppercase;
}

.tour-deeper ul {
	display: flex;
	flex-wrap: wrap;
	gap: 0.375rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.tour-deeper li {
	margin: 0;
}

.tour-deeper a {
	background: #1f1f1f;
	border: 1px solid #3a3a3a;
	border-radius: var(--border-radius);
	color: #e6e6e6;
	display: inline-block;
	font-size: 0.9375rem;
	padding: 0.375rem 0.625rem;
	text-decoration: none;
}

.tour-deeper a:hover {
	border-color: var(--blue-400);
	color: #fff;
}

.tour-deeper .tour-deeper-done {
	color: var(--green-500);
	display: none;
}

.tour-deeper .is-done .tour-deeper-done {
	display: inline;
}

/* !- Below the screenshot */
.tour-callout {
	background: var(--bg-850);
	border: 1px solid var(--bg-700);
	border-radius: var(--border-radius);
	display: grid;
	gap: 0.625rem;
	line-height: 1.45;
	padding: 0.75rem 0.875rem;
}

.tour-callout strong {
	color: var(--text-50);
}

.tour-callout-num {
	align-items: center;
	background: var(--green-500);
	border-radius: 50%;
	color: var(--green-950);
	display: inline-flex;
	font-size: var(--text-sm);
	font-weight: 800;
	height: 22px;
	justify-content: center;
	margin-right: 0.375rem;
	vertical-align: 1px;
	width: 22px;
}

/* The tip's title sits beside the number, with its text on the line below */
.tour-callout-num + strong::after {
	content: "";
	display: block;
}

.tour-callout-row {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	justify-content: space-between;
}

.tour-callout-btns {
	display: flex;
	gap: 0.5rem;
}

.tour-btn {
	background: var(--bg-800);
	border: 1px solid var(--bg-700);
	border-radius: var(--border-radius);
	color: var(--text-100);
	cursor: pointer;
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1;
	padding: 0.5rem 0.875rem;
}

.tour-btn:hover {
	border-color: var(--bg-500);
	color: var(--text-50);
}

.tour-btn:disabled {
	cursor: default;
	opacity: 0.45;
}

.tour-btn.is-next {
	background: var(--blue-500);
	border-color: var(--blue-500);
	color: var(--white);
	font-size: var(--text-base);
	min-height: 2.625rem;
	padding: 0.6875rem 1.25rem;
}

.tour-nav {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 0.625rem;
}

.tour-hint {
	color: var(--text-500);
	font-size: var(--text-sm);
	font-variant-numeric: tabular-nums;
}

.tour-legend {
	display: grid;
	gap: 0.375rem;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	list-style: none;
	margin: 0;
	padding: 0;
}

.tour-legend li {
	align-items: center;
	background: var(--bg-850);
	border-radius: var(--border-radius);
	display: flex;
	font-size: 0.9375rem;
	gap: 0.5rem;
	margin: 0;
	min-width: 0;
	padding: 0.375rem 0.625rem;
}

.tour-legend-num {
	align-items: center;
	background: var(--bg-700);
	border-radius: 50%;
	display: flex;
	flex: none;
	font-size: var(--text-mini);
	font-weight: 700;
	height: 20px;
	justify-content: center;
	width: 20px;
}

.tour-legend .is-current {
	outline: 1px solid var(--green-500);
}

.tour-legend .is-current .tour-legend-num {
	background: var(--green-500);
	color: var(--green-950);
}

.tour-legend .is-done {
	opacity: 0.55;
}

.tour-legend .is-done .tour-legend-num {
	background: transparent;
	border: 1px solid var(--green-500);
	color: var(--green-500);
}

@media (prefers-reduced-motion: reduce) {
	.tour-hot.is-current,
	.tour-finish:not([hidden]) {
		animation: none;
	}

	.tour-stage {
		transition: none;
	}
}

/* !- Narrower bars */
@media (max-width: 991.98px) {
	.tour-bar-sub {
		display: none;
	}

	.tour-stepper-pos {
		min-width: 0;
	}
}

@media (max-width: 767.98px) {
	.tour-bar-btn .tour-bar-lbl,
	.tour-stepper .tour-bar-lbl,
	.tour-stepper-pos .tour-stepper-long,
	.tour-bar-sep {
		display: none;
	}

	.tour-bar-btn {
		padding: 0.5625rem 0.6875rem;
	}

	.tour-stepper button {
		padding: 0.625rem 0.75rem;
	}
}

/* !- Phone */
@media (max-width: 575.98px) {
	.tour-bar-tours {
		display: none;
	}

	#tour-page .tour-player {
		gap: 0.75rem;
		padding: 0.875rem 0 2rem 0;
	}

	.tour-step-text h2 {
		font-size: var(--text-xl);
	}

	.tour-chips {
		flex-wrap: nowrap;
		overflow-x: auto;
		scrollbar-width: none;
	}

	.tour-chips::-webkit-scrollbar {
		display: none;
	}

	.tour-chips li {
		flex: none;
	}

	.tour-nav,
	.tour-legend {
		display: none;
	}

	/* Too big to sit on the screenshot, so it follows it instead */
	.tour-finish {
		box-shadow: none;
		max-height: none;
		position: static;
		transform: none;
		width: 100%;
	}

	.tour-finish:not([hidden]) {
		animation: none;
	}
}
