/*
 * About page 360° virtual tour.
 *
 * Plain CSS for the same reason as the nav drawer and the chat widget: the
 * theme ships without node_modules, so a rule that needs `npm run build:css`
 * before it renders is a rule that renders broken. Markup is the tia-tour__*
 * block in about-page-template.php; js/virtual-tour.js drives it.
 *
 * Pannellum's own rules are overridden through .tia-tour so they win whatever
 * order the two stylesheets load in.
 */

.tia-tour {
	--tia-tour-primary: #4f46e5;
	--tia-tour-ink: #0f172a;
	--tia-tour-muted: #64748b;
	--tia-tour-line: #e2e8f0;
}

/* ---------------------------------------------------------------------------
 * Stage — the framed viewport. The first room's small preview sits blurred
 * behind the viewer while the full panorama downloads.
 * ------------------------------------------------------------------------- */
.tia-tour__stage {
	position: relative;
	overflow: hidden;
	aspect-ratio: 16 / 9;
	border-radius: 1.5rem;
	background-color: var(--tia-tour-ink);
	box-shadow: 0 30px 60px -30px rgb(15 23 42 / 0.45);
	isolation: isolate;
}

.tia-tour__stage::before {
	content: '';
	position: absolute;
	inset: -24px;
	z-index: -1;
	background: var(--tia-tour-preview, none) center / cover no-repeat;
	filter: blur(14px);
	opacity: 0.7;
}

/* Taller on a phone: a 16:9 strip at 360px wide is too thin to drag around in. */
@media (max-width: 639px) {
	.tia-tour__stage {
		aspect-ratio: 4 / 3;
		border-radius: 1rem;
	}
}

.tia-tour__viewer {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.tia-tour .pnlm-container {
	background: transparent;
	font-family: inherit;
}

/* Pannellum parks its zoom/fullscreen buttons top-left, under the badge. */
.tia-tour .pnlm-controls-container {
	top: 16px;
	left: auto;
	right: 16px;
}

.tia-tour .pnlm-controls {
	border: 0;
	border-radius: 10px;
	overflow: hidden;
	box-shadow: 0 6px 16px -6px rgb(15 23 42 / 0.4);
}

.tia-tour .pnlm-load-box {
	border-radius: 14px;
	background-color: rgb(15 23 42 / 0.75);
	font-size: 15px;
	font-weight: 700;
}

/* ---------------------------------------------------------------------------
 * Badge — the "Virtual Tour / room name" card, top-left.
 * ------------------------------------------------------------------------- */
.tia-tour__badge {
	position: absolute;
	top: 16px;
	left: 16px;
	z-index: 2;
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 12px 18px;
	border-radius: 14px;
	background: rgb(255 255 255 / 0.94);
	box-shadow: 0 10px 24px -12px rgb(15 23 42 / 0.45);
	pointer-events: none;
}

.tia-tour__badge-title {
	font-size: 18px;
	font-weight: 800;
	line-height: 1.2;
	color: var(--tia-tour-primary);
}

.tia-tour__badge-room {
	font-size: 14px;
	font-weight: 600;
	color: var(--tia-tour-muted);
}

@media (max-width: 639px) {
	.tia-tour__badge {
		top: 10px;
		left: 10px;
		padding: 8px 12px;
		border-radius: 10px;
	}

	.tia-tour__badge-title {
		font-size: 14px;
	}

	.tia-tour__badge-room {
		font-size: 12px;
	}

	.tia-tour .pnlm-controls-container {
		top: 10px;
		right: 10px;
	}
}

/* ---------------------------------------------------------------------------
 * Hint — centred until the visitor first drags, then fades for good.
 * ------------------------------------------------------------------------- */
.tia-tour__hint {
	position: absolute;
	left: 50%;
	bottom: 20px;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 16px 8px 12px;
	border-radius: 999px;
	background: rgb(15 23 42 / 0.65);
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	white-space: nowrap;
	transform: translateX(-50%);
	backdrop-filter: blur(6px);
	pointer-events: none;
	transition: opacity 0.4s ease;
}

.tia-tour__hint .material-symbols-outlined {
	font-size: 22px;
}

.tia-tour__hint.is-dismissed {
	opacity: 0;
}

/* ---------------------------------------------------------------------------
 * Room switcher — centred above the stage rather than over it, so it never
 * sits in the way of a drag on a phone.
 * ------------------------------------------------------------------------- */
.tia-tour__rooms {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px;
	margin-bottom: 24px;
}

.tia-tour__room {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 20px 10px 16px;
	border: 1px solid var(--tia-tour-line);
	border-radius: 999px;
	background: #fff;
	color: var(--tia-tour-ink);
	font-size: 13px;
	font-weight: 700;
	cursor: pointer;
	transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.tia-tour__room .material-symbols-outlined {
	font-size: 18px;
	color: var(--tia-tour-primary);
}

.tia-tour__room:hover {
	border-color: rgb(79 70 229 / 0.4);
	background: rgb(79 70 229 / 0.06);
}

.tia-tour__room[aria-pressed='true'] {
	border-color: var(--tia-tour-primary);
	background: var(--tia-tour-primary);
	color: #fff;
	box-shadow: 0 10px 20px -10px rgb(79 70 229 / 0.6);
}

.tia-tour__room[aria-pressed='true'] .material-symbols-outlined {
	color: #fff;
}

.tia-tour__room:focus-visible {
	outline: 2px solid var(--tia-tour-primary);
	outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	.tia-tour__hint,
	.tia-tour__room {
		transition: none;
	}
}
