/*
* Plugin Name: Scribblebox
* Description: Styles for the Scribblebox plugin.
*/

/* Trigger elements */
.scribblebox-trigger {
	cursor: pointer;
	color: #0073aa; /* WordPress blue */
	text-decoration: underline;
}

.scribblebox-trigger:hover {
	color: #0096cc;
}

/* Shadowbox Overlay */
#scribblebox-overlay {
	display: none;
	opacity:0; /* Hidden by default */
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.7);
	z-index: 99999; 
	justify-content: center; /* For centering content within */
	align-items: center; 
	overscroll-behavior: contain;
	transition: opacity 0.3s ease-in-out;
}

/* Shadowbox Content Box */
#scribblebox-content {
	padding: 20px;
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	max-width: 90%;
	max-height: 90vh;
	box-sizing: border-box;
	justify-content:center;
	align-items: center;
}
/* Navigation Buttons */
.scribblebox-nav-button {
	display: none;
	position: fixed;
	top: 50%; 
	transform: translateY(-50%);
	background-color: rgba(0, 0, 0, 0.5);
	color: white;
	border: none;
	padding: 10px 15px;
	font-size: 2em; 
	cursor: pointer;
	z-index: 100000; /* Ensure buttons are above content */
	border-radius: 4px;
	transition: background-color 0.2s ease-in-out;
}
#scribblebox-prev {
	left: 20px;
}

#scribblebox-next {
	right: 20px;
}

.scribblebox-nav-button:hover {
	background-color: rgba(0, 0, 0, 0.7);
}

.scribblebox-nav-button.is-visible {
display: flex;
}


/* Close Button */
#scribblebox-close {
	position: absolute;
	top: 10px;
	right: 15px;
	font-size: 28px;
	cursor: pointer;
	color: #555;
	font-weight: bold;
	line-height: 1;
}

#scribblebox-close:hover {
	color: #e00;
}

/* Inner Content Styling */
#scribblebox-inner-content {
	padding: 10px;
	text-align: center;
	position: relative;
	min-height: 75vh;
	min-width: 20vw;
}
#scribblebox-inner-content img {
	border-radius: 8px;
	box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
	max-width: 88vw;
	max-height: 80vh;
	height: auto;
	display: block;
	margin: 15px auto;
	border-radius: 4px;
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	opacity: 0;
	transition: opacity 0.5s ease-in-out;
}

#scribblebox-inner-content img.active {
	opacity: 1; 
}

body.scribblebox-open-no-scroll {
	overflow: hidden;
	position: fixed; /* Helps with fixed positioning on iOS */
	width: 100%; /* Important for fixed position to work correctly */
}

.scribblebox-caption {
	color: #fff;
	text-align: center;
	margin-top: 10px;
	font-size: 0.9em;
	max-width: 100%;
}


/* Responsive adjustments */
@media (max-width: 768px) {
	#scribblebox-content {
		max-width: 95%;
		padding: 15px;
	}
	#scribblebox-close {
		font-size: 24px;
		top: 8px;
		right: 10px;
	}
	.scribblebox-nav-button {
		padding: 8px 12px;
		font-size: 1.5em;
	}
}