/* Alef360 viewer */
.alef360 {
	--alef360-accent: #1e88e5;
	--a360-ui-bg: rgba(18, 20, 24, .62);
	--a360-ui-fg: #fff;
	position: relative;
	width: 100%;
	height: var(--alef360-h, 600px);
	min-height: 280px;
	background: #111;
	overflow: hidden;
	border-radius: 10px;
	color: var(--a360-ui-fg);
	font-family: inherit;
	line-height: 1.5;
	user-select: none;
	-webkit-user-select: none;
	-webkit-tap-highlight-color: transparent;
	isolation: isolate;
	box-sizing: border-box;
}
.alef360 *, .alef360 *::before, .alef360 *::after { box-sizing: border-box; }
@media (max-width: 767px) {
	.alef360 { height: var(--alef360-mh, 75vh); border-radius: 6px; }
}
.alef360 img { max-width: none; height: auto; margin: 0; border: 0; box-shadow: none; }
/* Crawlable poster + description (see Alef360_Frontend::seo_markup): the poster fills the box until the
   viewer is ready, the text is for crawlers and screen readers only. */
.alef360 .alef360-poster { position: absolute; inset: 0; width: 100%; height: 100%; max-width: 100%; object-fit: cover; opacity: .55; }
.alef360.is-ready .alef360-poster { display: none; }
.alef360 .alef360-seo {
	position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
	clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* Fullscreen */
.alef360:fullscreen { width: 100vw; height: 100vh; border-radius: 0; }
.alef360:-webkit-full-screen { width: 100vw; height: 100vh; border-radius: 0; }
.alef360.a360-pseudo-fs {
	position: fixed; inset: 0; z-index: 2147483000;
	width: 100vw; height: 100vh; height: 100dvh; border-radius: 0; min-height: 0;
}
html.a360-noscroll, html.a360-noscroll body { overflow: hidden !important; }

.alef360-pano { position: absolute; inset: 0; width: 100%; height: 100%; }
/* Pannellum positions hotspots with translate() from the left edge; on RTL sites the
   un-set "left" resolves to the right edge and every hotspot lands off-screen. */
.alef360-pano, .alef360-editor .pnlm-container { direction: ltr; }
.pnlm-hotspot-base.a360-hs { left: 0; right: auto; }
.a360-hs-label { direction: rtl; }
.alef360 .pnlm-container { background: #111; font-family: inherit; }
.alef360 .pnlm-load-box {
	background: var(--a360-ui-bg); border-radius: 12px; backdrop-filter: blur(6px);
	font-family: inherit; direction: rtl;
}
.alef360 .pnlm-lbar { border-color: var(--alef360-accent); }
.alef360 .pnlm-lbar-fill { background: var(--alef360-accent); }
.alef360 .pnlm-info-box, .alef360 .pnlm-panorama-info { display: none !important; }
.alef360 .pnlm-error-msg { direction: rtl; font-family: inherit; }

.alef360-loading {
	position: absolute; inset: 0; z-index: 5;
	display: flex; align-items: center; justify-content: center; background: #111;
}
.alef360-spinner, .a360-spin {
	width: 42px; height: 42px; border-radius: 50%;
	border: 3px solid rgba(255, 255, 255, .2); border-top-color: var(--alef360-accent);
	animation: a360-spin .9s linear infinite;
}
@keyframes a360-spin { to { transform: rotate(360deg); } }
.a360-error { padding: 24px; text-align: center; }

/* ---------- Buttons (reset theme styles) ---------- */
.alef360 .a360-btn,
.alef360 .a360-thumb,
.alef360 .a360-map-dot,
.alef360 .a360-map-expand,
.alef360 .a360-modal-close {
	margin: 0; padding: 0; border: 0; min-height: 0; min-width: 0; width: auto;
	background: none; box-shadow: none; text-transform: none; letter-spacing: normal;
	font: inherit; color: inherit; line-height: 1; cursor: pointer; border-radius: 0;
	-webkit-appearance: none; appearance: none; outline-offset: 2px;
}
.alef360 .a360-btn {
	display: flex; align-items: center; justify-content: center;
	width: 42px; height: 42px; border-radius: 50%;
	background: var(--a360-ui-bg); color: #fff;
	backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
	transition: background .2s, transform .15s;
}
.alef360 .a360-btn svg { width: 22px; height: 22px; display: block; }
.alef360 .a360-btn:hover { background: rgba(0, 0, 0, .8); }
.alef360 .a360-btn:active { transform: scale(.92); }
.alef360 .a360-btn.is-active { background: var(--alef360-accent); }
.alef360 .a360-btn[hidden] { display: none; }
.alef360 button:focus-visible, .alef360 .a360-hs:focus-visible { outline: 2px solid var(--alef360-accent); }

.a360-controls {
	position: absolute; z-index: 10; top: 12px; left: 12px;
	display: flex; flex-direction: column; gap: 8px;
}
.a360-title {
	position: absolute; z-index: 9; top: 12px; left: 50%; transform: translateX(-50%);
	max-width: calc(100% - 140px);
	padding: 7px 18px; border-radius: 999px; background: var(--a360-ui-bg);
	backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
	font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
	pointer-events: none; transition: opacity .3s;
}
.a360-title.is-empty, .a360-title[hidden] { display: none; }

.a360-toast {
	position: absolute; z-index: 20; left: 50%; bottom: 24px; transform: translate(-50%, 10px);
	max-width: calc(100% - 32px); padding: 9px 16px; border-radius: 10px;
	background: rgba(0, 0, 0, .78); font-size: 14px; text-align: center;
	opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
}
.a360-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.a360-gallery-open .a360-toast { bottom: 128px; }

/* ---------- Compass ---------- */
.a360-compass {
	position: absolute; z-index: 10; top: 12px; left: 64px;
	width: 46px; height: 46px; border-radius: 50%; background: var(--a360-ui-bg);
	border: 2px solid rgba(255, 255, 255, .5); pointer-events: none;
}
.a360-compass-needle { position: absolute; inset: 0; }
.a360-compass-needle::before {
	content: ""; position: absolute; left: 50%; top: 6px; margin-left: -5px;
	border: 5px solid transparent; border-bottom: 14px solid #e53935; border-top: 0;
}
.a360-compass-needle span { position: absolute; left: 0; right: 0; bottom: 4px; text-align: center; font-size: 10px; font-weight: 700; }

/* ---------- Gallery ---------- */
.a360-gallery {
	position: absolute; z-index: 8; left: 0; right: 0; bottom: 0;
	padding: 28px 10px 10px;
	background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, .75));
	transform: translateY(105%); transition: transform .35s ease;
}
.a360-gallery-open .a360-gallery { transform: none; }
.a360-gallery-track {
	display: flex; gap: 8px; overflow-x: auto; overscroll-behavior-x: contain;
	scroll-snap-type: x proximity; padding-bottom: 4px; scrollbar-width: thin;
}
.alef360 .a360-thumb {
	flex: 0 0 auto; width: 128px; scroll-snap-align: center;
	display: flex; flex-direction: column; gap: 4px; border-radius: 8px; overflow: hidden;
	background: rgba(0, 0, 0, .45); border: 2px solid transparent; transition: border-color .2s, transform .2s;
}
.alef360 .a360-thumb img { display: block; width: 100%; height: 64px; object-fit: cover; }
.alef360 .a360-thumb span { display: block; padding: 0 6px 6px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.alef360 .a360-thumb:hover { transform: translateY(-2px); }
.alef360 .a360-thumb.is-active { border-color: var(--alef360-accent); }

/* ---------- Floor plan ---------- */
.a360-map {
	position: absolute; z-index: 9; top: 12px; right: 12px;
	width: 220px; padding: 6px; border-radius: 10px; background: var(--a360-ui-bg);
	backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
	transition: width .3s;
}
.a360-map.is-large { width: min(560px, calc(100% - 90px)); }
.a360-map-hidden .a360-map { display: none; }
.a360-map-inner { position: relative; }
.alef360 .a360-map-inner img { display: block; width: 100%; border-radius: 6px; }
.alef360 .a360-map-dot {
	position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%;
	background: #fff; border: 3px solid var(--alef360-accent); box-shadow: 0 1px 4px rgba(0, 0, 0, .5);
	transition: transform .2s;
}
.alef360 .a360-map-dot:hover { transform: scale(1.3); }
.alef360 .a360-map-dot.is-active { background: var(--alef360-accent); border-color: #fff; z-index: 2; }
.a360-radar {
	display: none; position: absolute; left: 50%; top: 50%; width: 84px; height: 84px; pointer-events: none;
	transform: translate(-50%, -50%) rotate(var(--a360-heading, 0deg));
	border-radius: 50%;
	background: conic-gradient(from -35deg, color-mix(in srgb, var(--alef360-accent) 70%, transparent) 0deg 70deg, transparent 70deg);
	-webkit-mask: radial-gradient(circle, #000 20%, transparent 70%);
	mask: radial-gradient(circle, #000 20%, transparent 70%);
}
.a360-map-dot.is-active .a360-radar { display: block; }
.alef360 .a360-map-expand {
	position: absolute; top: 10px; left: 10px; width: 26px; height: 26px; border-radius: 6px;
	display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .55); color: #fff;
}
.alef360 .a360-map-expand svg { width: 16px; height: 16px; }

/* ---------- Hotspots ---------- */
.alef360 .a360-hs, .alef360-editor .a360-hs {
	--a360-size: 1;
	cursor: pointer; outline: none;
}
.a360-hs-label {
	position: absolute; top: 100%; left: 50%; transform: translate(-50%, 6px);
	padding: 4px 10px; border-radius: 6px; background: rgba(0, 0, 0, .75); color: #fff;
	font-size: 13px; line-height: 1.4; white-space: nowrap; pointer-events: none;
	opacity: 0; transition: opacity .2s;
}
.a360-hs:hover .a360-hs-label, .a360-hs:focus-visible .a360-hs-label,
.a360-hs--info .a360-hs-label, .a360-hs--door .a360-hs-label { opacity: 1; }
@media (hover: none) { .a360-hs-label { opacity: 1; } }

/* Ground arrow (Street View style): drawn on a tilted plane, rotated toward its direction. */
.a360-hs--arrow { width: calc(84px * var(--a360-size)); height: calc(84px * var(--a360-size)); }
.a360-arrow { width: 100%; height: 100%; perspective: 240px; }
.a360-arrow-ground {
	width: 100%; height: 100%; border-radius: 50%;
	transform: rotateX(56deg) rotateZ(calc(var(--a360-dir, 0deg) + var(--a360-rot, 0deg)));
	transform-style: preserve-3d;
	background: radial-gradient(circle, rgba(255, 255, 255, .22) 0 55%, rgba(255, 255, 255, 0) 70%);
	transition: background .2s;
}
.a360-arrow-ground svg {
	display: block; width: 100%; height: 100%;
	fill: #fff; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .55));
	animation: a360-nudge 1.6s ease-in-out infinite;
}
.a360-hs--arrow:hover .a360-arrow-ground { background: radial-gradient(circle, color-mix(in srgb, var(--alef360-accent) 55%, transparent) 0 55%, transparent 70%); }
.a360-hs--arrow:hover svg { fill: #fff; animation-duration: .8s; }
@keyframes a360-nudge {
	0%, 100% { transform: translateY(4%); }
	50% { transform: translateY(-10%); }
}

/* Door */
.a360-hs--door { width: calc(54px * var(--a360-size)); height: calc(80px * var(--a360-size)); }
.a360-door { width: 100%; height: 100%; perspective: 260px; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .5)); }
.a360-door-frame {
	position: relative; width: 100%; height: 100%;
	border: 3px solid #f5f5f5; border-bottom-width: 0; border-radius: 6px 6px 0 0;
	background: radial-gradient(ellipse at center, #fff8d6 0%, #ffd36b 45%, #b8862b 100%);
	box-shadow: 0 0 0 0 rgba(255, 211, 107, .7);
	animation: a360-glow 2.2s ease-out infinite;
}
.a360-door-leaf {
	position: absolute; inset: 2px 2px 0 2px; border-radius: 3px 3px 0 0;
	background:
		linear-gradient(rgba(255, 255, 255, .12), rgba(255, 255, 255, .12)) 18% 12% / 64% 32% no-repeat,
		linear-gradient(rgba(255, 255, 255, .12), rgba(255, 255, 255, .12)) 18% 58% / 64% 32% no-repeat,
		linear-gradient(135deg, #8d5a2b, #5d3a1a);
	transform-origin: 0 50%;
	transition: transform .55s cubic-bezier(.3, .7, .3, 1);
	backface-visibility: hidden;
}
.a360-door-knob {
	position: absolute; right: 12%; top: 52%; width: 16%; aspect-ratio: 1; border-radius: 50%;
	background: #ffd54f; box-shadow: 0 0 2px rgba(0, 0, 0, .6);
}
.a360-hs--door:hover .a360-door-leaf { transform: rotateY(-28deg); }
.a360-hs--door.is-open .a360-door-leaf { transform: rotateY(-100deg); }
@keyframes a360-glow {
	0% { box-shadow: 0 0 0 0 rgba(255, 211, 107, .7); }
	100% { box-shadow: 0 0 0 14px rgba(255, 211, 107, 0); }
}

/* Round pins: info / link / image / video */
.a360-hs--info, .a360-hs--link, .a360-hs--image, .a360-hs--video {
	width: calc(44px * var(--a360-size)); height: calc(44px * var(--a360-size));
}
.a360-pin {
	position: relative; width: 100%; height: 100%; border-radius: 50%;
	display: flex; align-items: center; justify-content: center;
	background: var(--alef360-accent); color: #fff; border: 2px solid #fff;
	box-shadow: 0 3px 10px rgba(0, 0, 0, .45); transition: transform .2s;
}
.a360-pin::after {
	content: ""; position: absolute; inset: -2px; border-radius: 50%; border: 2px solid #fff;
	animation: a360-pulse 2s ease-out infinite;
}
.a360-pin svg { width: 62%; height: 62%; }
.a360-pin--info svg circle, .a360-pin--video svg circle { display: none; }
.a360-hs:hover .a360-pin { transform: scale(1.12); }
@keyframes a360-pulse {
	0% { transform: scale(1); opacity: .8; }
	100% { transform: scale(1.7); opacity: 0; }
}

/* ---------- Modal ---------- */
.a360-modal {
	position: absolute; inset: 0; z-index: 30;
	display: flex; align-items: center; justify-content: center; padding: 16px;
	background: rgba(0, 0, 0, .6); opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s;
	user-select: text; -webkit-user-select: text;
}
.a360-modal.is-open { opacity: 1; visibility: visible; }
.a360-modal-box {
	position: relative; width: min(640px, 100%); max-height: 100%; overflow: auto;
	background: #fff; color: #222; border-radius: 12px; padding: 22px; direction: rtl; text-align: right;
	box-shadow: 0 20px 50px rgba(0, 0, 0, .4); transform: translateY(12px); transition: transform .25s;
}
.a360-modal.is-open .a360-modal-box { transform: none; }
.a360-modal[data-kind="image"] .a360-modal-box,
.a360-modal[data-kind="video"] .a360-modal-box { width: min(980px, 100%); padding: 12px; background: #000; color: #fff; }
.alef360 .a360-modal-close {
	position: absolute; top: 8px; left: 8px; z-index: 2; width: 34px; height: 34px; border-radius: 50%;
	display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .55); color: #fff;
}
.alef360 .a360-modal-close svg { width: 20px; height: 20px; }
.a360-modal-body h3 { margin: 4px 0 10px; font-size: 19px; color: inherit; }
.a360-modal-body .a360-info-text { font-size: 15px; line-height: 1.9; }
.a360-modal-body .a360-info-text img { max-width: 100%; height: auto; }
.alef360 .a360-info-img { display: block; width: calc(100% + 44px); max-width: none; margin: -22px -22px 14px; border-radius: 12px 12px 0 0; max-height: 300px; object-fit: cover; }
.a360-figure { margin: 0; text-align: center; }
.alef360 .a360-figure img { max-width: 100%; max-height: 75vh; width: auto; border-radius: 6px; }
.a360-figure figcaption { margin-top: 8px; }
.a360-video { position: relative; aspect-ratio: 16 / 9; width: 100%; background: #000; }
.a360-video iframe, .a360-video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.a360-more {
	display: inline-block; margin-top: 8px; padding: 8px 18px; border-radius: 8px;
	background: var(--alef360-accent); color: #fff !important; text-decoration: none !important;
}

/* ---------- Small screens ---------- */
@media (max-width: 600px) {
	.alef360 .a360-btn { width: 38px; height: 38px; }
	.alef360 .a360-btn svg { width: 20px; height: 20px; }
	.a360-controls { top: 10px; left: 10px; gap: 6px; }
	.a360-title { top: auto; bottom: 14px; max-width: calc(100% - 24px); font-size: 13px; padding: 6px 14px; }
	.a360-gallery-open .a360-title { bottom: 124px; }
	.a360-map { width: 140px; top: 10px; right: 10px; }
	.a360-compass { left: 56px; top: 10px; width: 40px; height: 40px; }
	.alef360 .a360-thumb { width: 104px; }
	.alef360 .a360-thumb img { height: 54px; }
	.a360-toast { bottom: 60px; font-size: 13px; }
}
@media (max-height: 420px) {
	.a360-controls { flex-direction: row; flex-wrap: wrap; max-width: 50%; }
}
@media (prefers-reduced-motion: reduce) {
	.a360-arrow-ground svg, .a360-pin::after, .a360-door-frame { animation: none; }
}

/* ---------- Scene strip under the photo (tour setting «galleryPosition: below») ---------- */
.alef360.a360-gallery-below { --a360-strip: 104px; }
.a360-gallery-below.a360-gallery-open .alef360-pano { bottom: var(--a360-strip); height: auto; }
.a360-gallery-below .a360-gallery {
	height: var(--a360-strip); padding: 10px; background: #15171b;
	border-top: 1px solid rgba(255, 255, 255, .08);
}
.a360-gallery-below.a360-gallery-open .a360-toast { bottom: calc(var(--a360-strip) + 20px); }
@media (max-width: 600px) {
	.alef360.a360-gallery-below { --a360-strip: 92px; }
	.a360-gallery-below.a360-gallery-open .a360-title { bottom: calc(var(--a360-strip) + 12px); }
}

/* No «Pannellum 2.5.6» box with a link to pannellum.org on right-click. */
.pnlm-about-msg { display: none !important; }
