/* Areso Product Videos - loaded only on product pages that have videos */

/* ---- Video slides inside the Journal swiper gallery ---- */

.product-video-slide {
	position: relative;
	cursor: pointer;
}

.product-video-slide img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
	object-fit: cover;
}

.product-video-thumb {
	position: relative;
	cursor: pointer;
}

.product-video-thumb img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
	object-fit: cover;
}

/* ---- Source placeholder (used when no thumbnail is available) ---- */

.pv-placeholder {
	display: block;
	width: 100%;
	aspect-ratio: 1 / 1;
	background: #1a1a1a;
	position: relative;
}

/* Instagram: brand gradient + CSS-drawn glyph (no external image) */
.pv-placeholder-instagram {
	background: radial-gradient(circle at 30% 110%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285aeb 90%);
}

.pv-placeholder-instagram::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 38%;
	height: 38%;
	transform: translate(-50%, -50%);
	border: 3px solid #fff;
	border-radius: 22%;
}

.pv-placeholder-instagram::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 16%;
	height: 16%;
	transform: translate(-50%, -50%);
	border: 3px solid #fff;
	border-radius: 50%;
}

.pv-placeholder-tiktok {
	background: #0d0d0d;
}

.pv-placeholder-youtube {
	background: #181818;
}

.pv-placeholder-file {
	background: linear-gradient(135deg, #2b2b2b 0%, #101010 100%);
}

/* In the thumbnails strip the theme rounds the <img> thumbs; the CSS
   placeholder (shown only when no thumbnail could be fetched) matches. */
.additional-image .pv-placeholder {
	border-radius: 50%;
}

/* ---- Play icon overlay (pure CSS) ---- */

.pv-play {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.55);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
	transition: transform 0.15s ease, background 0.15s ease;
	pointer-events: none;
	z-index: 2;
}

.pv-play::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 55%;
	transform: translate(-50%, -50%);
	border-style: solid;
	border-width: 11px 0 11px 18px;
	border-color: transparent transparent transparent #fff;
}

.product-video-slide:hover .pv-play {
	background: rgba(0, 0, 0, 0.75);
	transform: translate(-50%, -50%) scale(1.08);
}

/* Smaller play badge for the thumbnails strip */
.pv-play-sm {
	width: 26px;
	height: 26px;
}

.pv-play-sm::after {
	border-width: 5px 0 5px 8px;
}

/* ---- Lightweight modal (independent from Journal lightbox/PhotoSwipe) ---- */

.pv-modal {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.88);
	padding: 12px;
	-webkit-tap-highlight-color: transparent;
}

.pv-modal-content {
	position: relative;
	background: #000;
	width: min(92vw, 960px);
	aspect-ratio: 16 / 9;
	max-height: 90vh;
	border-radius: 4px;
}

/* Portrait sources (Instagram Reels / TikTok) */
.pv-modal-portrait .pv-modal-content {
	width: auto;
	height: min(88vh, 740px);
	aspect-ratio: 9 / 16;
	max-width: 92vw;
}

.pv-modal iframe,
.pv-modal video {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	border: 0;
	border-radius: 4px;
	z-index: 2;
	background: #000;
}

.pv-modal video {
	object-fit: contain;
}

.pv-modal-close {
	position: absolute;
	top: -44px;
	right: 0;
	width: 36px;
	height: 36px;
	line-height: 34px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.15);
	color: #fff;
	font-size: 22px;
	text-align: center;
	cursor: pointer;
	z-index: 3;
}

.pv-modal-close:hover {
	background: rgba(255, 255, 255, 0.3);
}

/* CSS spinner shown behind the iframe while it loads */
.pv-modal-spinner {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 40px;
	height: 40px;
	margin: -20px 0 0 -20px;
	border: 3px solid rgba(255, 255, 255, 0.25);
	border-top-color: #fff;
	border-radius: 50%;
	animation: pv-spin 0.8s linear infinite;
	z-index: 1;
}

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

body.pv-modal-open {
	overflow: hidden;
}

/* ---- Full-view lightbox (lightgallery) iframe slides ---- */

/* Instagram's embed page scales the media to the container width, so a
   full-width lightbox slide shows the reel zoomed/cropped. Constrain the
   slide's video container to real reel proportions (9:16), centered.
   Covers both lightGallery generations: v1 wraps iframes in a 16:9
   padding-bottom box (.lg-video), v2 sizes .lg-video-cont directly.
   TikTok Player v1 and YouTube letterbox themselves. */
.lg-outer .lg-video-cont:has(iframe[src*="instagram.com"]),
.lg-outer .lg-item:has(iframe[src*="instagram.com"]) .lg-video-cont {
	width: min(92vw, calc((100vh - 220px) * 9 / 16)) !important;
	max-width: min(92vw, calc((100vh - 220px) * 9 / 16)) !important;
	height: calc(100vh - 220px) !important;
	max-height: calc(100vh - 220px) !important;
}

/* v1 aspect-ratio wrapper: neutralise the fixed 16:9 padding hack */
.lg-outer .lg-video-cont:has(iframe[src*="instagram.com"]) .lg-video,
.lg-outer .lg-item:has(iframe[src*="instagram.com"]) .lg-video {
	height: 100% !important;
	padding-bottom: 0 !important;
}

.lg-outer iframe[src*="instagram.com"] {
	position: absolute !important;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	margin: auto;
	width: 100% !important;
	height: 100% !important;
	background: #000;
	border: 0;
}

@media (max-width: 760px) {
	.lg-outer .lg-video-cont:has(iframe[src*="instagram.com"]),
	.lg-outer .lg-item:has(iframe[src*="instagram.com"]) .lg-video-cont {
		width: min(96vw, calc((100vh - 160px) * 9 / 16)) !important;
		max-width: min(96vw, calc((100vh - 160px) * 9 / 16)) !important;
		height: calc(100vh - 160px) !important;
		max-height: calc(100vh - 160px) !important;
	}
}

/* ---- Mobile ---- */

@media (max-width: 760px) {
	.pv-play {
		width: 44px;
		height: 44px;
	}

	.pv-play::after {
		border-width: 9px 0 9px 14px;
	}

	.pv-modal {
		padding: 8px;
	}

	.pv-modal-content {
		width: 96vw;
	}

	.pv-modal-portrait .pv-modal-content {
		height: min(80vh, 700px);
		max-width: 96vw;
	}

	.pv-modal-close {
		top: -42px;
	}
}
