/* ==========================================================================
   Babbage Engine Gallery 41 – Frontend Styles
   Version: 1.0.0
   ========================================================================== */

/* --------------------------------------------------------------------------
   Widget wrapper
   -------------------------------------------------------------------------- */
.beg41-widget-wrapper {
	position: relative;
	width: 100%;
	font-family: Georgia, 'Times New Roman', serif;
	box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   Canvas container
   -------------------------------------------------------------------------- */
.beg41-canvas-wrapper {
	position: relative;
	width: 100%;
	height: 600px;
	max-height: 65vh;
	background-color: #1a1208;
	overflow: hidden;
	border-radius: 4px;
	border: 2px solid #4a3010;
	box-shadow:
		0 0 0 1px #c89040,
		0 8px 32px rgba(0,0,0,0.7),
		inset 0 0 60px rgba(200,144,64,0.04);
	cursor: grab;
}

.beg41-canvas-wrapper:active {
	cursor: grabbing;
}

.beg41-canvas {
	display: block;
	width: 100% !important;
	height: 100% !important;
	outline: none;
}

.beg41-canvas:focus-visible {
	outline: 3px solid #c89040;
	outline-offset: -3px;
}

/* --------------------------------------------------------------------------
   Loading spinner
   -------------------------------------------------------------------------- */
.beg41-loading {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 16px;
	background: #1a1208;
	color: #c89040;
	font-size: 14px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	z-index: 10;
	transition: opacity 0.6s ease;
}

.beg41-loading.beg41-hidden {
	opacity: 0;
	pointer-events: none;
}

.beg41-loading-gear {
	width: 48px;
	height: 48px;
	border: 4px solid #4a3010;
	border-top-color: #c89040;
	border-radius: 50%;
	animation: beg41-spin 1s linear infinite;
}

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

/* --------------------------------------------------------------------------
   Overlay hint
   -------------------------------------------------------------------------- */
.beg41-overlay-hint {
	position: absolute;
	bottom: 14px;
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	align-items: center;
	gap: 8px;
	background: rgba(26, 18, 8, 0.82);
	border: 1px solid rgba(200, 144, 64, 0.4);
	border-radius: 20px;
	padding: 6px 16px;
	color: rgba(200, 144, 64, 0.85);
	font-size: 12px;
	letter-spacing: 0.06em;
	pointer-events: none;
	transition: opacity 0.4s ease;
	white-space: nowrap;
	z-index: 5;
}

.beg41-hint-icon {
	font-size: 16px;
	animation: beg41-spin 3s linear infinite;
}

.beg41-overlay-hint.beg41-hidden {
	opacity: 0;
}

/* --------------------------------------------------------------------------
   Lightbox backdrop
   -------------------------------------------------------------------------- */
.beg41-lightbox {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	visibility: hidden;
	opacity: 0;
	transition: opacity 0.35s ease, visibility 0.35s ease;
}

.beg41-lightbox[aria-hidden="false"] {
	visibility: visible;
	opacity: 1;
}

.beg41-lightbox-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(12, 8, 2, 0.92);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	cursor: pointer;
}

/* --------------------------------------------------------------------------
   Lightbox frame – Brass Column style (default)
   -------------------------------------------------------------------------- */
.beg41-lightbox-frame {
	position: relative;
	z-index: 1;
	background: #1e1408;
	border-radius: 6px;
	max-width: 90vw;
	max-height: 90vh;
	width: 820px;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	box-shadow:
		0 0 0 1px #c89040,
		0 0 0 4px #4a3010,
		0 0 0 5px #c89040,
		0 24px 80px rgba(0,0,0,0.9);
}

/* Ornate corners via pseudo-elements */
.beg41-frame--brass_column::before,
.beg41-frame--brass_column::after {
	content: '';
	position: absolute;
	width: 32px;
	height: 32px;
	border-color: #c89040;
	border-style: solid;
	pointer-events: none;
	z-index: 2;
}
.beg41-frame--brass_column::before {
	top: 6px; left: 6px;
	border-width: 3px 0 0 3px;
}
.beg41-frame--brass_column::after {
	bottom: 6px; right: 6px;
	border-width: 0 3px 3px 0;
}

.beg41-frame--minimal {
	box-shadow: 0 4px 24px rgba(0,0,0,0.8);
	border: 1px solid #4a3010;
}

.beg41-frame--ornate {
	border: 4px solid #c89040;
	box-shadow:
		inset 0 0 12px rgba(200,144,64,0.15),
		0 24px 80px rgba(0,0,0,0.9);
}

/* --------------------------------------------------------------------------
   Lightbox close button
   -------------------------------------------------------------------------- */
.beg41-lightbox-close {
	position: absolute;
	top: 10px;
	right: 12px;
	z-index: 3;
	background: transparent;
	border: 1px solid rgba(200,144,64,0.4);
	color: #c89040;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	font-size: 14px;
	line-height: 1;
	cursor: pointer;
	transition: background 0.2s, border-color 0.2s;
	display: flex;
	align-items: center;
	justify-content: center;
}

.beg41-lightbox-close:hover,
.beg41-lightbox-close:focus-visible {
	background: rgba(200,144,64,0.15);
	border-color: #c89040;
	outline: none;
}

/* --------------------------------------------------------------------------
   Lightbox media area
   -------------------------------------------------------------------------- */
.beg41-lightbox-media {
	flex: 1;
	min-height: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 48px 32px 16px;
	overflow: hidden;
}

.beg41-lightbox-media img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	display: block;
	border-radius: 3px;
}

.beg41-lightbox-media iframe,
.beg41-lightbox-media video {
	width: 100%;
	max-height: 55vh;
	border: none;
	border-radius: 3px;
}

/* Transition classes */
.beg41-lightbox-media.beg41-trans-fade {
	animation: beg41-fade-in 0.35s ease both;
}
.beg41-lightbox-media.beg41-trans-slide {
	animation: beg41-slide-in 0.35s ease both;
}
.beg41-lightbox-media.beg41-trans-zoom {
	animation: beg41-zoom-in 0.35s ease both;
}
.beg41-lightbox-media.beg41-trans-compute {
	animation: beg41-compute-in 0.5s steps(8) both;
}

@keyframes beg41-fade-in {
	from { opacity: 0; }
	to   { opacity: 1; }
}
@keyframes beg41-slide-in {
	from { opacity: 0; transform: translateX(40px); }
	to   { opacity: 1; transform: translateX(0); }
}
@keyframes beg41-zoom-in {
	from { opacity: 0; transform: scale(0.85); }
	to   { opacity: 1; transform: scale(1); }
}
@keyframes beg41-compute-in {
	from { opacity: 0; filter: blur(8px) brightness(3); }
	to   { opacity: 1; filter: blur(0) brightness(1); }
}

/* --------------------------------------------------------------------------
   Lightbox caption
   -------------------------------------------------------------------------- */
.beg41-lightbox-caption {
	padding: 8px 32px;
	color: rgba(200,144,64,0.8);
	font-size: 13px;
	letter-spacing: 0.06em;
	text-align: center;
	min-height: 24px;
}

/* --------------------------------------------------------------------------
   Lightbox navigation
   -------------------------------------------------------------------------- */
.beg41-lightbox-nav {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	padding: 12px 24px 16px;
	border-top: 1px solid rgba(200,144,64,0.2);
}

.beg41-nav-prev,
.beg41-nav-next {
	background: transparent;
	border: 1px solid rgba(200,144,64,0.45);
	color: #c89040;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	cursor: pointer;
	font-size: 16px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s, border-color 0.2s;
	flex-shrink: 0;
}
.beg41-nav-prev:hover,
.beg41-nav-next:hover,
.beg41-nav-prev:focus-visible,
.beg41-nav-next:focus-visible {
	background: rgba(200,144,64,0.15);
	border-color: #c89040;
	outline: none;
}

/* --------------------------------------------------------------------------
   Gear nav list
   -------------------------------------------------------------------------- */
.beg41-gear-nav-list {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	list-style: none;
	margin: 0;
	padding: 0;
	justify-content: center;
}

.beg41-gear-nav-list li {
	margin: 0;
}

.beg41-gear-nav-list button {
	background: rgba(74,48,16,0.6);
	border: 1px solid rgba(200,144,64,0.35);
	color: rgba(200,144,64,0.7);
	border-radius: 3px;
	padding: 4px 10px;
	font-size: 11px;
	letter-spacing: 0.05em;
	cursor: pointer;
	transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.beg41-gear-nav-list button:hover,
.beg41-gear-nav-list button:focus-visible {
	background: rgba(200,144,64,0.2);
	color: #c89040;
	border-color: #c89040;
	outline: none;
}

.beg41-gear-nav-list button.beg41-nav-active {
	background: rgba(200,144,64,0.25);
	color: #e8b860;
	border-color: #c89040;
}

/* --------------------------------------------------------------------------
   Editor placeholder (Elementor backend)
   -------------------------------------------------------------------------- */
.beg41-editor-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	background-color: #1a1208 !important;
}

/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	.beg41-loading-gear,
	.beg41-hint-icon {
		animation: none !important;
	}
	.beg41-lightbox-media {
		animation: none !important;
	}
	.beg41-lightbox {
		transition: none !important;
	}
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
	.beg41-canvas-wrapper {
		height: 400px;
		max-height: 60vw;
	}
	.beg41-lightbox-frame {
		max-width: 96vw;
		max-height: 96vh;
	}
	.beg41-lightbox-media {
		padding: 44px 16px 12px;
	}
	.beg41-lightbox-nav {
		padding: 10px 12px 14px;
		gap: 8px;
	}
	.beg41-overlay-hint {
		font-size: 11px;
		padding: 5px 12px;
	}
}
