/**
 * AWYB Video Tours Widget
 *
 * Desktop: heading/copy + decorative circles, a large featured "stage", and a
 * thumbnail strip that swaps the stage. Mobile: the strip becomes a centered
 * Swiper carousel and the circles stack below the heading/copy.
 */

.awyb-video-tours {
	--awyb-video-tours-active-border: #000000;
	position: relative;
	padding: 128px var(--spacing-margins-l, 24px);
	background-color: var(--neutrals-white, #ffffff);
	overflow: hidden;
}

.awyb-video-tours__inner {
	position: relative;
	max-width: var(--container-max-width, 1280px);
	margin: 0 auto;
	display: flex;
	flex-direction: column;
	gap: 64px;
}

/* ---------------------------------------------------------------- Intro */
.awyb-video-tours__intro {
	position: relative;
}

.awyb-video-tours__header {
	display: flex;
	flex-direction: column;
	gap: 24px;
	max-width: 576px;
}

.awyb-video-tours__title {
	margin: 0;
	font-family: var(--font-family-headings, "Resolve Sans");
	font-size: var(--text-xl-font-size, 48px);
	font-weight: 700;
	line-height: 1.1;
	color: var(--neutrals-black, #000);
}

.awyb-video-tours__copy {
	margin: 0;
	font-family: var(--font-family-body);
	font-size: 16px;
	line-height: 24px;
	color: var(--neutrals-black, #000);
}

/* Decorative circles: absolute top-right on desktop. */
.awyb-video-tours__circles {
	position: absolute;
	top: 0;
	right: 0;
	width: min(46%, 700px);
	height: 100%;
	pointer-events: none;
}

.awyb-video-tours__circle {
	position: absolute;
	display: block;
	border-radius: 50%;
	background-size: cover;
	background-position: center;
}

.awyb-video-tours__circle--1 {
	width: 460px;
	height: 460px;
	right: 18%;
	top: -75px;
}

.awyb-video-tours__circle--2 {
	width: 238px;
	height: 238px;
	right: 0;
	top: -36px;
	border: solid 10px var(--neutrals-white, #ffffff);
	z-index: 10;
}

/* ---------------------------------------------------------------- Stage */
.awyb-video-tours__stage {
	position: relative;
	width: 100%;
}

.awyb-video-tours__feature {
	width: 100%;
}

.awyb-video-tours__feature[hidden] {
	display: none;
}

/* ---------------------------------------------------------------- Media */
.awyb-video-tours__media {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: #000;
}

.awyb-video-tours__poster {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100% !important;
	object-fit: cover;
	display: block;
}

.awyb-video-tours__media.is-playing .awyb-video-tours__poster,
.awyb-video-tours__media.is-playing .awyb-video-tours__play {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}

.awyb-video-tours__media video,
.awyb-video-tours__media iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	object-fit: cover;
}

.awyb-video-tours__play {
	position: absolute;
	inset: 0;
	margin: auto;
	width: 64px;
	height: 64px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: none;
	background: transparent;
	color: var(--neutrals-white, #ffffff);
	cursor: pointer;
	z-index: 2;
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.awyb-video-tours__play svg {
	filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.35));
}

.awyb-video-tours__play:hover {
	transform: scale(1.06);
	background-color: unset;
}

/* ---------------------------------------------------- Thumbnails / carousel */
.awyb-video-tours__carousel {
	position: relative;
	padding: 0 88px;
}

.awyb-video-tours__swiper {
	width: 100%;
	overflow: hidden;
}

.awyb-video-tours__slide {
	height: auto;
	box-sizing: border-box;
	width: min(225px, 78vw); /* Mobile: centered peek, capped at the thumb max. */
	max-width: 225px;
}

.awyb-video-tours__thumb {
	display: block;
	width: 100%;
	padding: 0;
	border: 3px solid transparent;
	background: none;
	cursor: pointer;
	transition: border-color 0.2s ease;
}

/* Thumbnails share the .poster class (for first-frame sync) but must stay in
   flow, unlike the absolutely-positioned stage poster. */
.awyb-video-tours__thumb-image {
	position: static;
	inset: auto;
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	object-fit: cover;
}

.awyb-video-tours__thumb.is-active {
	border-color: var(--awyb-video-tours-active-border);
}

.awyb-video-tours__thumb:focus-visible {
	outline: 2px solid var(--awyb-video-tours-active-border);
	outline-offset: 2px;
}

/* Desktop & tablet: thumbs cap at 225px but shrink so at least 4 are visible. */
@media (min-width: 768px) {
	.awyb-video-tours__slide {
		width: min(225px, calc((100% - 72px) / 4));
	}
}

/* Arrows */
.awyb-video-tours__arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 64px;
	height: 64px;
	border: none;
	border-radius: 50%;
	background: #e5e7eb;
	color: #000;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
	transition: transform 0.2s ease, opacity 0.2s ease;
	z-index: 3;
}

.awyb-video-tours__arrow--prev {
	left: 0;
}

.awyb-video-tours__arrow--next {
	right: 0;
}

.awyb-video-tours__arrow:hover {
	transform: translateY(-50%) scale(1.06);
}

.awyb-video-tours__arrow.swiper-button-disabled {
	opacity: 0.4;
	cursor: default;
}

/* ---------------------------------------------------------------- Tablet */
@media (max-width: 1024px) {
	.awyb-video-tours {
		padding: 64px var(--spacing-margins-m, 18px);
	}

	.awyb-video-tours__inner {
		gap: 40px;
	}

	/* Circles drop into flow, stacked below the heading/copy. */
	.awyb-video-tours__intro {
		display: flex;
		flex-direction: column;
		gap: 32px;
	}

	.awyb-video-tours__header {
		max-width: none;
	}

	.awyb-video-tours__circles {
		position: static;
		width: 100%;
		height: auto;
		display: flex;
		justify-content: center;
		align-items: center;
		gap: 16px;
	}

	.awyb-video-tours__circle {
		position: static;
		max-width: none;
		flex: 0 0 auto;
	}

	.awyb-video-tours__circle--1 {
		width: 44vw;
		height: 44vw;
		max-width: 300px;
		max-height: 300px;
	}

	.awyb-video-tours__circle--2 {
		width: 28vw;
		height: 28vw;
		max-width: 180px;
		max-height: 180px;
		margin-left: -40px;
		align-self: flex-start;
	}

	/* Stage stays visible on tablet/mobile; leave room for the arrows. */
	.awyb-video-tours__carousel {
		padding: 0 56px;
	}

	.awyb-video-tours__arrow {
		width: 44px;
		height: 44px;
	}

	.awyb-video-tours__arrow--prev {
		left: 0;
	}

	.awyb-video-tours__arrow--next {
		right: 0;
	}
}

@media (max-width: 767px) {
	.awyb-video-tours {
		padding: 40px 0;
	}

	.awyb-video-tours__intro {
		padding: 0 18px;
	}

	/* Mobile picker behaves like the Media Carousel: swipe only, no arrows. */
	.awyb-video-tours__carousel {
		padding: 0;
	}

	.awyb-video-tours__arrow {
		display: none;
	}
}
