/* ⚠️ READ _Spec_Starsoft_StyleGuide.md BEFORE making ANY changes */

/* The Modal Gallery Background */
.Modal_Gallery_Background {
    
	display: none; /* Hidden by default */
	position: fixed; /* Stay in place */
	z-index: 1000; /* Sit on top */
	left: 0;
	top: 0;
	width: 100vw; /* Full width */
	height: 100vh; /* Full height */
	overflow: hidden; /* Prevent scrolling */
	background-color: rgb(0,0,0); /* Fallback color */
	background-color: rgba(0,0,0,0.9); /* Black w/ opacity */
}

.Modal_Gallery_Background[style*="display: block"] {
	display: flex !important;
	align-items: center;
	justify-content: center;
}

/* Modal Gallery Content (Image)
   previously: model-content */
.Modal_Gallery_Content {

	position: relative;
	margin: auto;
	display: flex;
	flex-direction: column;
	align-items: center;
	width: fit-content;
	max-width: 90vw;
	max-height: 90vh;
	border-radius: 5px;
	transition: 0.3s;
	animation-name: zoom;
	animation-duration: 0.3s;
	gap: 0;
}

@keyframes zoom {from {transform:scale(0)}
 to {transform:scale(1)}
}

/* Top bar for gallery controls */
.Modal_Gallery_Top_Bar {
	position: relative;
	height: 64px;
	min-width: 343px;
	background: var(--Gray_10);
	z-index: 9999;
	border-radius: 16px 16px 0 0;
	flex-shrink: 0;
}

/* The Close Button - uses shared .Button_Close style from Starsoft.css */
.Modal_Gallery_Content .Button_Close {
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 10000;
}

.Modal_Gallery_Slide {
	position: relative;
	max-height: calc(90vh - 192px);
	min-width: 343px;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 0;
	overflow: hidden;
	flex-shrink: 1;
	background: black;
}

.Modal_Gallery_Slide img{
	position: relative;
	text-align: center;
	border-radius: 0;
	margin: 0;
	max-width: 100%;
	max-height: calc(90vh - 192px);
	width: auto;
	height: auto;
	object-fit: contain;
}

.Modal_Gallery_Caption {
	text-align: center;
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: auto;
	max-width: 60%;
	font-size: 24px;
	line-height: 1;
	color: rgb(180, 180, 180);
	font-family: 'Helvetica Neue', Arial, sans-serif;
	letter-spacing: 0.5px;
	text-shadow: 0px 8px 32px rgba(0, 0, 0, 255);
	z-index: 10000;
	opacity: 0;
	transition: opacity 0.4s ease-in-out;
}

/* JS-triggered fade */
.Modal_Gallery_Caption.fade-in {
	opacity: 1;
	transition: opacity 0.4s ease-in-out;
}

.Modal_Gallery_Caption.fade-out {
	opacity: 0;
	transition: none; /* no fade duration */
}

.youtube-video {
	width: 100%;
	aspect-ratio: 16 / 9;
	border-radius: 0;
}

.Youtube_Container {
	position: relative;
	width: 100%;
	max-width: 1024px;
}

.Youtube_Container iframe {
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	max-width: 1024px;
}

/* Overlay to capture wheel events over YouTube iframe */
.Youtube_Wheel_Overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 1;
	pointer-events: auto;
}

/* Custom play button positioned over YouTube's play button */
.Youtube_Play_Button {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 68px;
	height: 48px;
	z-index: 2;
	background: rgba(23, 23, 23, 0.8);
	border: none;
	border-radius: 8px;
	cursor: pointer;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s;
}

.Youtube_Play_Button:hover {
	background: rgba(230, 33, 23, 0.95);
}

.Youtube_Play_Button::before {
	content: '';
	width: 0;
	height: 0;
	border-left: 12px solid white;
	border-top: 8px solid transparent;
	border-bottom: 8px solid transparent;
	margin-left: 3px;
}

.Pixel_Video {
	height: auto;
	border-radius: 8px;
	image-rendering: pixelated;
	object-fit: contain;
	margin: 0;
	background: black;
}

/* Hide all video controls and overlays */
.Pixel_Video::-webkit-media-controls {
	display: none !important;
}

.Pixel_Video::-webkit-media-controls-enclosure {
	display: none !important;
}

.Pixel_Video::-webkit-media-controls-panel {
	display: none !important;
}

.Pixel_Video::-webkit-media-controls-overlay-play-button {
	display: none !important;
}

.Pixel_Video::-webkit-media-controls-overlay-cast-button {
	display: none !important;
}

.Pixel_Video::-moz-media-controls {
	display: none !important;
}

.Modal_Gallery_Slide video {
	height: auto;
	border-radius: 0;
	image-rendering: pixelated;
}

.cursor {
  	cursor: pointer;
}

/* Bottom bar for gallery navigation */
.Modal_Gallery_Bottom_Bar {
	position: relative;
	height: 64px;
	min-width: 343px;
	background: var(--Gray_10);
	z-index: 9999;
	border-radius: 0 0 16px 16px;
	flex-shrink: 0;
}

/* Next & previous buttons */

.Button_Prev,
.Button_Next {
	color: var(--Gray_120);
	cursor: pointer;
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 48px;
	height: 48px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: 0.2s ease;
	user-select: none;
	-webkit-user-select: none;
	z-index: 10000;
}

.Button_Prev .Chevron,
.Button_Next .Chevron {
	width: 24px;
	height: 24px;
	border-width: 0 8px 8px 0;
	border-color: var(--Gray_120);
}

.Button_Next:hover .Chevron,
.Button_Prev:hover .Chevron {
	border-color: rgb(210,210,210);
}

/* Position the "prev/next" buttons below image edges */
.Button_Next {
	right: 8px;
}

.Button_Prev {
  	left: 8px;
}

@keyframes zoom {from {transform:scale(0)}
 to {transform:scale(1)}
}

.Button_Sound {
	position: absolute;
	top: 48px;
	transform: translateY(-50%);
	right: 60px; /* just left of the close button */
	font-size: 32px;
	line-height: 1;
	color: rgb(180,180,180);
	background: transparent;
	border: none;
	cursor: pointer;
	z-index: 10001;
	display: none; /* hidden by default */
	transition: color 0.2s ease;
}

.Button_Sound:hover {
	color: rgb(240,240,240);
}
/* Mobile responsiveness - below 768px */
@media (max-width: 768px) {
	.Modal_Gallery_Content {
		max-width: 100vw;
		border-radius: 0;
	}
	
	.Modal_Gallery_Top_Bar {
		border-radius: 0;
	}
	
	.Modal_Gallery_Bottom_Bar {
		border-radius: 0;
	}
	
	.Youtube_Container {
		width: 100vw;
	}
	
	.Modal_Gallery_Caption {
		font-size: 14px;
		max-width: 80%;
	}
}

/* Landscape phone - below 640px height */
@media (max-height: 640px) {
	/* Hide navbar and footer */
	#Navigation_Container {
		display: none !important;
	}
	
	#Bar_Social {
		display: none !important;
	}
	
	#Bar_Social {
		display: none !important;
	}
	
	/* Hide modal bars */
	.Modal_Gallery_Top_Bar,
	.Modal_Gallery_Bottom_Bar {
		display: none !important;
	}
	
	/* Make content full screen */
	.Modal_Gallery_Content {
		max-width: 100vw;
		max-height: 100vh;
		border-radius: 0;
	}
	
	/* Allow slide to fill full height */
	.Modal_Gallery_Slide {
		max-height: 100vh;
	}
	
	/* Maintain aspect ratio for YouTube in landscape */
	.Youtube_Container {
		width: 100vw;
		height: 100vh;
		display: flex;
		align-items: center;
		justify-content: center;
		background: black;
	}
	
	.youtube-video {
		width: 100vw;
		height: 56.25vw; /* 16:9 ratio */
		max-height: 100vh;
	}
	
	/* Overlay audio button on video */
	.Button_Sound {
		position: fixed;
		top: 20px;
		right: 80px;
		z-index: 10002;
	}
	
	/* Make chevrons smaller and overlay on video */
	.Button_Prev,
	.Button_Next {
		position: fixed;
		top: 50%;
		transform: translateY(-50%);
		width: 32px;
		height: 32px;
		z-index: 10002;
	}
	
	.Button_Prev .Chevron,
	.Button_Next .Chevron {
		width: 16px;
		height: 16px;
		border-width: 0 5px 5px 0;
	}
	
	.Button_Prev {
		left: 0;
	}
	
	.Button_Next {
		right: 0;
	}
}
