/**
 * Reels WordPress Plugin - Frontend Stylesheet
 * 
 * Luxury hospitality reels carousel and fullscreen lightbox.
 * Replicates Reference Images 1 (Desktop), 2 (Mobile), and 3 (Lightbox).
 */

/* ==========================================================================
   1. Design Tokens / Custom Properties
   ========================================================================== */
:root {
	--reels-bg: #F3EFE6;
	--reels-text: #5C5F5A;
	--reels-eyebrow: #1B1D1B;
	--reels-description: #5C5F5A;
	--reels-card-radius: 24px;
	--reels-btn-bg: #F3EFE6;
	--reels-btn-text: #1d231f;
	--reels-btn-hover-bg: #f4f1ea;
	--reels-badge-bg: rgba(24, 30, 26, 0.55);
	--reels-badge-text: #ffffff;
	--reels-nav-border: #dfdbd2;
	--reels-nav-hover: #1d231f;
	--reels-font-heading: 'Cormorant Garamond', Garamond, Georgia, serif;
	--reels-font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
	--reels-card-aspect: 9 / 16;
	--reels-card-width-desktop: 280px;
	--reels-card-height-desktop: 490px;
	--reels-transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

/* ==========================================================================
   2. Base Section Layout
   ========================================================================== */
.reels-section {
	position: relative;
	width: 100%;
	background-color: var(--reels-bg);
	padding: 70px 0 80px 0;
	box-sizing: border-box;
	font-family: var(--reels-font-body);
	color: var(--reels-text);
	overflow: hidden;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

.reels-container {
	width: 100%;
	max-width: 1340px;
	margin: 0 auto;
	box-sizing: border-box;
}

/* ==========================================================================
   3. Header Area (Eyebrow, Title, Description, Nav Arrows)
   ========================================================================== */
.reels-header {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 32px;
	margin-bottom: 42px;
	box-sizing: border-box;
}

.reels-header-left {
	flex: 1 1 55%;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.reels-eyebrow {
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--reels-eyebrow);
	display: block;
}

.reels-main-title {
	font-family: 'DM Serif Display', serif;
	font-size: 46px;
	font-weight: 300;
	line-height: 1.15;
	color: var(--reels-text);
	margin: 0;
	letter-spacing: -0.01em;
}

.reels-header-right {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: 32px;
}

.reels-description {
	font-size: 14px;
	line-height: 1.5;
	color: var(--reels-description);
	margin: 0;
	max-width: 310px;
	font-family: 'Inter', sans-serif;
}

.reels-nav-controls {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-shrink: 0;
}

.reels-nav-btn {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: 1px solid var(--reels-nav-border);
	background-color: transparent;
	color: var(--reels-text);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	transition: var(--reels-transition);
	outline: none;
}

.reels-nav-btn:hover:not(:disabled) {
	background-color: #ffffff;
	border-color: var(--reels-nav-hover);
	transform: scale(1.05);
	box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.reels-nav-btn:disabled {
	opacity: 0.35;
	cursor: not-allowed;
	transform: none;
}

.reels-nav-btn:focus-visible {
	box-shadow: 0 0 0 2px var(--reels-text);
}

/* ==========================================================================
   4. Carousel Track & Container
   ========================================================================== */
.reels-carousel-wrapper {
	position: relative;
	width: 100%;
	overflow: visible;
}

.reels-carousel-track {
	display: flex;
	gap: 22px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none; /* Firefox */
	-ms-overflow-style: none; /* IE/Edge */
	padding-bottom: 12px;
	padding-top: 4px;
}

.reels-carousel-track::-webkit-scrollbar {
	display: none; /* Chrome, Safari, Opera */
}

/* ==========================================================================
   5. Reel Card
   ========================================================================== */
.reel-card {
	flex: 0 0 var(--reels-card-width-desktop);
	height: var(--reels-card-height-desktop);
	scroll-snap-align: start;
	position: relative;
	border-radius: var(--reels-card-radius);
	overflow: hidden;
	cursor: pointer;
	background-color: #1a1e1b;
	box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
	transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1), box-shadow 0.35s ease;
	outline: none;
	user-select: none;
	-webkit-user-select: none;
}

.reel-card:hover {
	transform: translateY(-5px);
	box-shadow: 0 16px 36px rgba(0, 0, 0, 0.16);
}

.reel-card:focus-visible {
	box-shadow: 0 0 0 3px #1d231f, 0 16px 36px rgba(0, 0, 0, 0.2);
}

.reel-media-wrapper {
	position: relative;
	width: 100%;
	height: 100%;
	overflow: hidden;
}

.reel-video-container {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	background-color: #121513;
}

.reel-video-element {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.reel-youtube-container,
.reel-instagram-container {
	width: 100%;
	height: 100%;
	position: absolute;
	inset: 0;
	overflow: hidden;
}

.reel-yt-iframe-wrap {
	width: 100%;
	height: 100%;
	position: absolute;
	inset: 0;
}

.reel-video-container,
.reel-video-container *,
.reel-video-element,
.reel-youtube-container,
.reel-youtube-container *,
.reel-instagram-container,
.reel-instagram-container *,
.reel-instagram-iframe,
.reel-yt-iframe-wrap,
.reel-yt-iframe-wrap iframe {
	pointer-events: none !important;
}

.reel-instagram-iframe {
	width: 100% !important;
	height: 100% !important;
	border: none;
	display: block;
}

.reel-ig-placeholder {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(45deg, #405de6, #5851db, #833ab4, #c13584, #e1306c, #fd1d1d);
	color: #ffffff;
	font-size: 32px;
}

/* Card Top Badge */
.reel-badge-wrapper {
	position: absolute;
	top: 18px;
	left: 18px;
	z-index: 12;
	pointer-events: none;
}

.reel-badge {
	display: inline-block;
	background-color: var(--reels-badge-bg);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	color: var(--reels-badge-text);
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	padding: 5px 13px;
	border-radius: 999px;
	border: 1px solid rgba(255, 255, 255, 0.18);
}

/* Gradient Scrim */
.reel-scrim {
	position: absolute;
	inset: 0;
	background: linear-gradient(
		180deg,
		rgba(0, 0, 0, 0.15) 0%,
		rgba(0, 0, 0, 0.0) 35%,
		rgba(0, 0, 0, 0.45) 68%,
		rgba(0, 0, 0, 0.88) 100%
	);
	pointer-events: none;
	z-index: 4;
}

/* Card Click Interception Layer - Sits directly above video/iframes to own card clicks */
.reel-card-click-layer {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	z-index: 10;
	cursor: pointer;
	background: transparent;
}

/* Card Bottom Content */
.reel-card-content {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	padding: 22px 20px 20px 20px;
	z-index: 12;
	pointer-events: none;
	display: flex;
	flex-direction: column;
	gap: 14px;
	box-sizing: border-box;
}

.reel-text-group {
	display: flex;
	flex-direction: column;
	gap: 4px;
	pointer-events: none;
}

.reel-title {
	font-family: var(--reels-font-heading);
	font-size: 24px;
	font-weight: 600;
	color: #ffffff;
	margin: 0;
	line-height: 1.2;
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.reel-description {
	font-size: 12.5px;
	line-height: 1.4;
	color: rgba(255, 255, 255, 0.88);
	margin: 0;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

/* Fixed BOOK NOW CTA Button */
.reel-action-group {
	width: 100%;
	pointer-events: auto;
}

.reel-book-btn {
	position: relative;
	z-index: 15;
	pointer-events: auto !important;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	background-color: var(--reels-btn-bg);
	color: var(--reels-btn-text);
	border-radius: 999px;
	padding: 12px 16px;
	font-size: 11.5px;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	text-decoration: none !important;
	box-sizing: border-box;
	transition: var(--reels-transition);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.reel-book-btn,
.reel-book-btn:hover,
.reel-book-btn:focus,
.reel-book-btn:active,
.reel-book-btn:visited,
.reel-book-btn *,
.reel-book-btn:hover * {
	text-decoration: none !important;
	border-bottom: none !important;
}

.reel-book-btn:hover {
	background-color: var(--reels-btn-hover-bg);
	transform: scale(1.02);
	color: var(--reels-btn-text);
}

.reel-btn-arrow {
	display: inline-block;
	text-decoration: none !important;
	border-bottom: none !important;
	box-shadow: none !important;
	font-size: 14px;
	line-height: 1;
	transition: transform 0.2s ease;
}

.reel-book-btn:hover .reel-btn-arrow {
	transform: translateX(3px);
}

/* ==========================================================================
   6. Lightbox Component (Fullscreen Modal matching Reference Image 3)
   ========================================================================== */
.reels-lightbox {
	position: fixed;
	inset: 0;
	width: 100vw;
	height: 100vh;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.35s ease, visibility 0.35s ease;
	box-sizing: border-box;
	overflow: hidden;
}

.reels-lightbox.is-open {
	opacity: 1;
	visibility: visible;
}

/* Backdrop */
.reels-lightbox-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(12, 16, 14, 0.88);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
	z-index: 1;
}

/* Main Lightbox Container */
.reels-lightbox-container {
	position: relative;
	z-index: 2;
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	box-sizing: border-box;
}

/* Side Navigation Arrows in Lightbox */
.reels-lightbox-nav {
	position: relative;
	z-index: 10;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.12);
	border: 1px solid rgba(255, 255, 255, 0.2);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	color: #ffffff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 24px;
	transition: var(--reels-transition);
	outline: none;
}

.reels-lightbox-nav:hover {
	background: rgba(255, 255, 255, 0.25);
	transform: scale(1.1);
}

.reels-lightbox-nav:focus-visible {
	box-shadow: 0 0 0 2px #ffffff;
}

/* Modal Frame - True 9:16 Aspect Ratio Shell */
.reels-lightbox-modal {
	position: relative;
	height: min(86vh, 760px);
	max-height: 86vh;
	aspect-ratio: 9 / 16;
	width: auto;
	max-width: calc(100vw - 120px);
	background-color: #000000;
	border-radius: 24px;
	overflow: hidden;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
	display: flex;
	flex-direction: column;
	transform: scale(0.96);
	transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1);
}

.reels-lightbox.is-open .reels-lightbox-modal {
	transform: scale(1);
}

/* Video Viewport */
.reels-lightbox-video-viewport {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	background-color: #000000;
}

.reels-lightbox-video-mount {
	width: 100%;
	height: 100%;
}

.reels-lightbox-video-mount video,
.reels-lightbox-video-mount iframe {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	border: none;
	pointer-events: auto !important;
}

/* Scrim Gradient in Lightbox */
.reels-lightbox-scrim {
	position: absolute;
	inset: 0;
	background: linear-gradient(
		180deg,
		rgba(0, 0, 0, 0.35) 0%,
		rgba(0, 0, 0, 0.0) 25%,
		rgba(0, 0, 0, 0.3) 60%,
		rgba(0, 0, 0, 0.88) 100%
	);
	pointer-events: none;
	z-index: 10;
}

/* Bottom Overlay Card in Lightbox */
.reels-lightbox-info-overlay {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	padding: 20px;
	z-index: 15;
	box-sizing: border-box;
}

.reels-lightbox-info-card {
	display: flex;
	flex-direction: column;
	gap: 14px;
	background: rgba(20, 25, 22, 0.55);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border: 1px solid rgba(255, 255, 255, 0.14);
	border-radius: 18px;
	padding: 16px 18px;
}

.reels-lightbox-text {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.reels-lightbox-badge {
	align-self: flex-start;
	background-color: rgba(255, 255, 255, 0.2);
	color: #ffffff;
	font-size: 9.5px;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	padding: 3px 10px;
	border-radius: 999px;
	margin-bottom: 2px;
}

.reels-lightbox-title {
	font-family: var(--reels-font-heading);
	font-size: 22px;
	font-weight: 600;
	color: #ffffff;
	margin: 0;
	line-height: 1.2;
}

.reels-lightbox-description {
	font-size: 12px;
	color: rgba(255, 255, 255, 0.82);
	margin: 0;
	line-height: 1.4;
}

.reels-lightbox-action {
	width: 100%;
}

.reels-lightbox-book-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	background-color: var(--reels-btn-bg);
	color: var(--reels-btn-text);
	border-radius: 999px;
	padding: 11px 16px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	text-decoration: none !important;
	box-sizing: border-box;
	transition: var(--reels-transition);
}

.reels-lightbox-book-btn,
.reels-lightbox-book-btn:hover,
.reels-lightbox-book-btn:focus,
.reels-lightbox-book-btn:active,
.reels-lightbox-book-btn:visited,
.reels-lightbox-book-btn *,
.reels-lightbox-book-btn:hover * {
	text-decoration: none !important;
	border-bottom: none !important;
}

.reels-lightbox-book-btn:hover {
	background-color: var(--reels-btn-hover-bg);
	transform: scale(1.02);
}

/* ==========================================================================
   7. Responsive Adaptations (Tablet & Mobile)
   ========================================================================== */

/* Tablet (768px to 1024px) */
@media screen and (max-width: 1024px) {
	.reels-section {
		padding: 56px 0 64px 0;
	}

	.reels-container {
		padding: 0 24px;
	}

	.reels-header {
		flex-direction: column;
		align-items: flex-start;
		gap: 20px;
		margin-bottom: 32px;
	}

	.reels-header-right {
		width: 100%;
		justify-content: space-between;
	}

	.reels-main-title {
		font-size: 38px;
	}

	.reel-card {
		flex: 0 0 250px;
		height: 440px;
	}

	.reels-lightbox-nav {
		margin: 0 12px;
		width: 42px;
		height: 42px;
	}
}

/* Mobile (< 768px) - Strictly Matching Reference Image 2 */
@media screen and (max-width: 767px) {
	.reels-section {
		padding: 44px 0 54px 0;
	}

	.reels-container {
		padding: 0 18px;
	}

	.reels-header {
		flex-direction: column;
		align-items: flex-start;
		gap: 16px;
		margin-bottom: 24px;
	}

	.reels-eyebrow {
		font-size: 10.5px;
	}

	.reels-main-title {
		font-size: 32px;
		line-height: 1.18;
	}

	.reels-header-right {
		width: 100%;
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 16px;
	}

	.reels-description {
		font-size: 12.5px;
		max-width: calc(100% - 110px);
	}

	/* Card peek on right to communicate horizontal scroll */
	.reels-carousel-track {
		gap: 16px;
		padding-right: 24px;
	}

	.reel-card {
		flex: 0 0 calc(100vw - 84px);
		max-width: 310px;
		height: 460px;
	}

	.reel-title {
		font-size: 22px;
	}

	.reel-description {
		font-size: 12px;
	}

	/* Lightbox Mobile optimizations */
	.reels-lightbox-container {
		padding: 12px;
	}

	.reels-lightbox-nav {
		position: absolute;
		top: 50%;
		transform: translateY(-50%);
		margin: 0;
		width: 40px;
		height: 40px;
	}

	.reels-lightbox-prev {
		left: 8px;
	}

	.reels-lightbox-next {
		right: 8px;
	}

	.reels-lightbox-modal {
		height: min(90vh, calc(100vh - 40px));
		max-height: 90vh;
		aspect-ratio: 9 / 16;
		width: auto;
		max-width: calc(100vw - 24px);
		border-radius: 20px;
	}

	.reels-lightbox-info-overlay {
		padding: 14px;
	}
}

/* Lock body scrolling when lightbox is active */
body.reels-lightbox-active {
	overflow: hidden !important;
	touch-action: none;
}
