/* UCKG Virtual Tours, ported from reference/catford-tour.html. */

:root {
	--uckg-vt-navy: var(--uckg-navy, #203760);
	--uckg-vt-blue: var(--uckg-blue, #1d77f1);
	--uckg-vt-red: var(--uckg-red, #f3141a);
	--uckg-vt-lavender: var(--uckg-lavender, #eff0f6);
	--uckg-vt-slate: var(--uckg-slate, #020d20);

	--uckg-vt-surface: var(--uckg-vt-lavender);
	--uckg-vt-heading: var(--uckg-vt-navy);
	--uckg-vt-ink-soft: #4a5672;
	--uckg-vt-line: #dde0ec;
	--uckg-vt-card: #ffffff;

	--uckg-vt-viewer-bg: #020d20;
	--uckg-vt-viewer-ink: #ffffff;
	--uckg-vt-viewer-soft: rgba(255, 255, 255, 0.68);
	--uckg-vt-viewer-chip: rgba(255, 255, 255, 0.10);
	--uckg-vt-viewer-chip-hover: rgba(255, 255, 255, 0.18);

	--uckg-vt-r-lg: 16px;
	--uckg-vt-r-md: 12px;

	--uckg-vt-font: "JUST Sans", sans-serif;
}

/* ---------- Tour section: [uckg_virtual_tour] ---------- */

.uckg-vt-section {
	box-sizing: border-box;
	width: 100%;
	color: var(--uckg-vt-slate);
	font-family: var(--uckg-vt-font);
	font-size: 16px;
	line-height: 1.55;
	scroll-margin-top: 100px;
}

.uckg-vt-section *,
.uckg-vt-section *::before,
.uckg-vt-section *::after {
	box-sizing: border-box;
}

.uckg-vt-head {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: baseline;
	gap: 8px 24px;
	margin-bottom: 20px;
}

.uckg-vt-head h2 {
	margin: 0;
	color: var(--uckg-vt-heading);
	font-family: var(--uckg-vt-font);
	font-size: 26px;
	font-weight: 800;
	letter-spacing: -0.01em;
	line-height: 1.2;
}

.uckg-vt-head p {
	margin: 0;
	color: var(--uckg-vt-ink-soft);
	font-size: 14px;
}

.uckg-vt-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
	gap: 20px;
}

.uckg-vt-room {
	appearance: none;
	display: flex;
	flex-direction: column;
	margin: 0;
	padding: 0;
	overflow: hidden;
	border: 1px solid var(--uckg-vt-line);
	border-radius: var(--uckg-vt-r-lg);
	background: var(--uckg-vt-card);
	color: inherit;
	font: inherit;
	text-align: left;
	cursor: pointer;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.uckg-vt-room:hover,
.uckg-vt-room:focus {
	background: var(--uckg-vt-card);
	color: inherit;
	transform: translateY(-3px);
	box-shadow: 0 14px 30px -18px rgba(2, 13, 32, 0.45);
}

.uckg-vt-room__ph {
	position: relative;
	display: block;
	aspect-ratio: 16 / 10;
	max-width: 100%;
	overflow: hidden;
	background: var(--uckg-vt-surface);
}

.uckg-vt-room__ph img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.6s ease;
}

.uckg-vt-room:hover .uckg-vt-room__ph img {
	transform: scale(1.04);
}

.uckg-vt-badge {
	position: absolute;
	left: 12px;
	top: 12px;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 5px 10px 5px 8px;
	border-radius: 999px;
	background: rgba(2, 13, 32, 0.72);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.06em;
	line-height: 1.2;
}

.uckg-vt-badge svg {
	width: 14px;
	height: 14px;
}

.uckg-vt-room__meta {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	padding: 14px 16px 16px;
}

.uckg-vt-room__name {
	display: block;
	min-width: 0;
	color: var(--uckg-vt-heading);
	font-size: 16px;
	font-weight: 700;
	line-height: 1.3;
}

.uckg-vt-room__area {
	display: block;
	margin-bottom: 2px;
	color: var(--uckg-vt-ink-soft);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.uckg-vt-room__desc {
	display: -webkit-box;
	margin-top: 4px;
	overflow: hidden;
	color: var(--uckg-vt-ink-soft);
	font-size: 14px;
	font-weight: 400;
	line-height: 1.45;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
}

.uckg-vt-room__go {
	display: grid;
	place-items: center;
	flex: none;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: var(--uckg-vt-surface);
	color: var(--uckg-vt-blue);
}

.uckg-vt-room__go svg {
	width: 16px;
	height: 16px;
}

/* ---------- Look inside: [uckg_look_inside] ---------- */

.uckg-vt-look {
	appearance: none;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 14px 22px;
	border: 0;
	border-radius: 999px;
	background: var(--uckg-vt-blue);
	color: #fff;
	font-family: var(--uckg-vt-font);
	font-size: 15px;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: transform 0.15s ease, background-color 0.15s ease;
}

.uckg-vt-look:hover,
.uckg-vt-look:focus {
	background: #0f63d6;
	color: #fff;
	text-decoration: none;
}

.uckg-vt-look:active {
	transform: scale(0.98);
}

.uckg-vt-look svg {
	width: 18px;
	height: 18px;
	flex: none;
}

.uckg-vt-room:focus-visible,
.uckg-vt-look:focus-visible,
.uckg-vt__strip button:focus-visible,
.uckg-vt__btn:focus-visible {
	outline: 3px solid var(--uckg-vt-red);
	outline-offset: 3px;
}

/* ---------- Branch list: [uckg_vt_branches] (fallback) ---------- */

.uckg-vt-branches {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
	gap: 20px;
	margin: 0;
	padding: 0;
	list-style: none;
	font-family: var(--uckg-vt-font);
}

.uckg-vt-branches__item {
	overflow: hidden;
	border: 1px solid var(--uckg-vt-line);
	border-radius: var(--uckg-vt-r-lg);
	background: var(--uckg-vt-card);
}

.uckg-vt-branches__media {
	display: block;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: var(--uckg-vt-surface);
}

.uckg-vt-branches__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.uckg-vt-branches__body {
	padding: 14px 16px 16px;
}

.uckg-vt-branches__title {
	margin: 0 0 2px;
	font-size: 16px;
	line-height: 1.3;
}

.uckg-vt-branches__title a {
	color: var(--uckg-vt-heading);
	text-decoration: none;
}

.uckg-vt-branches__meta {
	margin: 0 0 12px;
	color: var(--uckg-vt-ink-soft);
	font-size: 14px;
}

/* ---------- Viewer overlay (always dark, by design) ---------- */

html.uckg-vt-locked {
	overflow: hidden;
}

.uckg-vt {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: grid;
	grid-template-rows: auto minmax(0, 1fr) auto;
	background: var(--uckg-vt-viewer-bg);
	color: var(--uckg-vt-viewer-ink);
	font-family: var(--uckg-vt-font);
	font-size: 16px;
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
	color-scheme: dark;
}

.uckg-vt[hidden] {
	display: none !important;
}

.uckg-vt *,
.uckg-vt *::before,
.uckg-vt *::after {
	box-sizing: border-box;
}

.uckg-vt__top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: calc(12px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 12px max(16px, env(safe-area-inset-left, 0px));
}

.uckg-vt__title {
	min-width: 0;
}

.uckg-vt__title small {
	display: block;
	color: var(--uckg-vt-viewer-soft);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.1em;
	line-height: 1.4;
	text-transform: uppercase;
}

.uckg-vt__title span {
	display: block;
	overflow: hidden;
	color: var(--uckg-vt-viewer-ink);
	font-size: 18px;
	font-weight: 700;
	line-height: 1.4;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.uckg-vt__ctrls {
	display: flex;
	flex: none;
	gap: 8px;
}

.uckg-vt__counter {
	align-self: center;
	padding-inline: 4px;
	color: var(--uckg-vt-viewer-soft);
	font-size: 13px;
	font-variant-numeric: tabular-nums;
}

.uckg-vt__btn {
	appearance: none;
	display: grid;
	place-items: center;
	width: 42px;
	height: 42px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--uckg-vt-viewer-chip);
	color: var(--uckg-vt-viewer-ink);
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.uckg-vt__btn:hover,
.uckg-vt__btn:focus {
	background: var(--uckg-vt-viewer-chip-hover);
	color: var(--uckg-vt-viewer-ink);
}

.uckg-vt__btn svg {
	width: 20px;
	height: 20px;
}

.uckg-vt__btn[hidden] {
	display: none;
}

.uckg-vt__btn--close,
.uckg-vt__btn--close:focus {
	background: #fff;
	color: var(--uckg-vt-slate);
}

.uckg-vt__btn--close:hover {
	background: #e6e9f2;
	color: var(--uckg-vt-slate);
}

.uckg-vt__stage {
	position: relative;
	min-height: 0;
}

.uckg-vt__pano {
	position: absolute;
	inset: 0;
}

.uckg-vt__hint {
	position: absolute;
	left: 50%;
	bottom: 18px;
	z-index: 3;
	padding: 8px 14px;
	border-radius: 999px;
	background: rgba(2, 13, 32, 0.7);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	font-size: 13px;
	white-space: nowrap;
	pointer-events: none;
	transform: translateX(-50%);
	transition: opacity 0.5s ease;
}

.uckg-vt__hint.gone {
	opacity: 0;
}

/* Shown while Pannellum itself is loading; after that Pannellum's own load box takes over. */
.uckg-vt__loading {
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 2;
	width: 40px;
	height: 40px;
	margin: -20px 0 0 -20px;
	border: 3px solid rgba(255, 255, 255, 0.25);
	border-top-color: var(--uckg-vt-blue);
	border-radius: 50%;
	pointer-events: none;
	animation: uckg-vt-spin 0.9s linear infinite;
}

.uckg-vt__loading[hidden] {
	display: none;
}

@keyframes uckg-vt-spin {
	to {
		transform: rotate(360deg);
	}
}

.uckg-vt__error {
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 4;
	max-width: 320px;
	margin: 0;
	padding: 14px 18px;
	border-radius: var(--uckg-vt-r-md);
	background: rgba(2, 13, 32, 0.9);
	color: #fff;
	font-size: 15px;
	text-align: center;
	transform: translate(-50%, -50%);
}

.uckg-vt__error[hidden] {
	display: none;
}

.uckg-vt__strip {
	display: flex;
	gap: 10px;
	overflow-x: auto;
	scrollbar-width: thin;
	padding: 12px max(16px, env(safe-area-inset-right, 0px)) calc(14px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
}

.uckg-vt__strip[hidden] {
	display: none;
}

.uckg-vt__strip button {
	appearance: none;
	flex: none;
	width: 132px;
	margin: 0;
	padding: 0;
	overflow: hidden;
	border: 2px solid transparent;
	border-radius: var(--uckg-vt-r-md);
	background: var(--uckg-vt-viewer-chip);
	color: var(--uckg-vt-viewer-ink);
	font: inherit;
	text-align: left;
	cursor: pointer;
	opacity: 0.72;
	transition: opacity 0.15s ease, border-color 0.15s ease;
}

.uckg-vt__strip button:hover,
.uckg-vt__strip button:focus {
	background: var(--uckg-vt-viewer-chip);
	color: var(--uckg-vt-viewer-ink);
	opacity: 1;
}

.uckg-vt__strip button[aria-current="true"] {
	border-color: var(--uckg-vt-blue);
	opacity: 1;
}

.uckg-vt__strip img {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 10;
	object-fit: cover;
}

.uckg-vt__strip span {
	display: block;
	overflow: hidden;
	padding: 6px 8px 7px;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.4;
	white-space: nowrap;
	text-overflow: ellipsis;
}

/* Same font stack as the approved prototype, on every piece of tour text, whatever the theme sets. */
.uckg-vt-section,
.uckg-vt-section *,
.uckg-vt-look,
.uckg-vt-look *,
.uckg-vt-branches,
.uckg-vt-branches *,
.uckg-vt,
.uckg-vt * {
	font-family: var(--uckg-vt-font);
}

/* No Pannellum credit box on right click. The licence stays in assets/vendor/pannellum/LICENSE. */
.uckg-vt .pnlm-about-msg {
	display: none !important;
}

/* Room Tour widget buttons without a link open the tour, so show them as clickable. */
html.uckg-vt-ready .uckg-room-tour__card span.uckg-room-tour__button,
html.uckg-vt-ready .uckg-vt-cards .uckg-room-tour__button {
	cursor: pointer;
}

/* Pannellum tweaks to suit the brand. */
.uckg-vt .pnlm-container {
	background: var(--uckg-vt-viewer-bg);
	font-family: var(--uckg-vt-font);
}

.uckg-vt .pnlm-load-box {
	background: rgba(2, 13, 32, 0.8);
	border-radius: var(--uckg-vt-r-md);
}

.uckg-vt .pnlm-lbar-fill {
	background: var(--uckg-vt-blue);
}

.uckg-vt .pnlm-controls {
	border-radius: 10px;
}

.uckg-vt .pnlm-controls-container {
	top: 12px;
	left: max(12px, env(safe-area-inset-left, 0px));
}

@media (max-width: 640px) {
	.uckg-vt-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 12px;
	}

	.uckg-vt-room__meta {
		padding: 10px 12px 12px;
	}

	.uckg-vt-room__name {
		font-size: 14px;
	}

	.uckg-vt-room__desc {
		font-size: 13px;
	}

	.uckg-vt-room__go {
		display: none;
	}

	.uckg-vt-badge {
		left: 8px;
		top: 8px;
	}

	.uckg-vt__strip button {
		width: 108px;
	}

	.uckg-vt__btn--prev,
	.uckg-vt__btn--next {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.uckg-vt-section *,
	.uckg-vt-look,
	.uckg-vt,
	.uckg-vt * {
		transition: none !important;
	}

	.uckg-vt-room:hover,
	.uckg-vt-room:hover .uckg-vt-room__ph img {
		transform: none;
	}

	.uckg-vt__loading {
		animation-duration: 3s;
	}
}
