/* ═══════════════════════════════════════════════════════════════════════
   Jacquard Weave 57 – Stylesheet
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Container ───────────────────────────────────────────────────────── */
.jw57-container {
	position: relative;
	width: 100%;
	overflow: hidden;
	background: #0e0705;
	cursor: crosshair;
	user-select: none;
	-webkit-user-select: none;
}

.jw57-container canvas {
	display: block;
	width: 100% !important;
	height: 100% !important;
}

/* ── Loading overlay ─────────────────────────────────────────────────── */
.jw57-loading {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	background: #0e0705;
	z-index: 5;
	color: #c8a050;
	font-family: 'Georgia', serif;
	letter-spacing: 0.15em;
	font-size: 13px;
	pointer-events: none;
	transition: opacity 0.8s ease;
}

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

.jw57-loading-spinner {
	width: 42px;
	height: 42px;
	border: 2px solid rgba(200,160,80,0.2);
	border-top-color: #c8a050;
	border-radius: 50%;
	animation: jw57-spin 1.1s linear infinite;
	margin-bottom: 14px;
}

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

/* ── Click-Hint ──────────────────────────────────────────────────────── */
.jw57-hint {
	position: absolute;
	bottom: 14px;
	left: 50%;
	transform: translateX(-50%);
	background: rgba(10,5,2,0.75);
	color: #c8a050;
	border: 1px solid rgba(200,160,80,0.4);
	border-radius: 3px;
	padding: 6px 14px;
	font-family: 'Georgia', serif;
	font-size: 11px;
	letter-spacing: 0.1em;
	pointer-events: none;
	opacity: 1;
	transition: opacity 1.5s ease;
	backdrop-filter: blur(4px);
	white-space: nowrap;
}

.jw57-hint.jw57-hidden {
	opacity: 0;
}

/* ── Gyroscope Button (iOS) ──────────────────────────────────────────── */
.jw57-gyro-btn {
	position: absolute;
	top: 14px;
	right: 14px;
	background: rgba(70,40,15,0.92);
	color: #f0d898;
	border: 1px solid #b8902e;
	border-radius: 4px;
	padding: 8px 14px;
	font-size: 13px;
	font-family: 'Georgia', serif;
	cursor: pointer;
	z-index: 20;
	backdrop-filter: blur(6px);
	letter-spacing: 0.05em;
	transition: background 0.2s ease, transform 0.15s ease;
	display: flex;
	align-items: center;
	gap: 6px;
}

.jw57-gyro-btn:hover {
	background: rgba(100,60,20,0.95);
	transform: scale(1.03);
}

.jw57-gyro-btn:active {
	transform: scale(0.97);
}

/* ── Scroll indicator ────────────────────────────────────────────────── */
.jw57-scroll-indicator {
	position: absolute;
	left: 14px;
	bottom: 14px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	opacity: 0.65;
	pointer-events: none;
}

.jw57-scroll-bar {
	width: 2px;
	height: 40px;
	background: rgba(200,160,80,0.25);
	border-radius: 1px;
	overflow: hidden;
}

.jw57-scroll-fill {
	width: 100%;
	height: 0%;
	background: linear-gradient(to bottom, #c8a050, #f0d070);
	transition: height 0.15s ease;
}

/* ── Lightbox ────────────────────────────────────────────────────────── */
.jw57-lightbox {
	position: absolute;
	inset: 0;
	z-index: 100;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.35s ease;
}

.jw57-lightbox.jw57-lightbox--open {
	opacity: 1;
	pointer-events: all;
}

.jw57-lightbox-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(6, 3, 1, 0.88);
	backdrop-filter: blur(5px);
	cursor: pointer;
}

.jw57-lightbox-frame {
	position: relative;
	z-index: 1;
	max-width: min(88%, 900px);
	max-height: 88%;
	animation: jw57-lb-in 0.3s cubic-bezier(0.22,0.61,0.36,1) both;
}

.jw57-lightbox--open .jw57-lightbox-frame {
	animation: jw57-lb-in 0.3s cubic-bezier(0.22,0.61,0.36,1) both;
}

@keyframes jw57-lb-in {
	from { transform: scale(0.88) translateY(12px); opacity: 0; }
	to   { transform: scale(1)    translateY(0);    opacity: 1; }
}

/* Decorative wooden border */
.jw57-lightbox-border {
	padding: 10px;
	background:
		repeating-linear-gradient(
			0deg,
			rgba(80,45,10,0.9) 0px,
			rgba(60,30,5,0.9)  4px,
			rgba(90,50,15,0.9) 8px
		);
	border: 3px solid #c8a050;
	box-shadow:
		0 0 0 1px #6b3a10,
		0 0 40px rgba(200,160,60,0.25),
		0 0 80px rgba(150,100,30,0.12);
}

.jw57-lightbox-img {
	display: block;
	max-width: 100%;
	max-height: 75vh;
	object-fit: contain;
	filter: sepia(0.08) contrast(1.05);
}

.jw57-lightbox-caption {
	background: rgba(10,5,2,0.9);
	color: #c8a050;
	padding: 9px 14px;
	font-family: 'Georgia', serif;
	font-size: 13px;
	letter-spacing: 0.08em;
	text-align: center;
	border-top: 1px solid rgba(200,160,80,0.3);
	min-height: 1em;
}

.jw57-lightbox-close {
	position: absolute;
	top: -14px;
	right: -14px;
	width: 32px;
	height: 32px;
	background: #4a2408;
	color: #f0d898;
	border: 1px solid #c8a050;
	border-radius: 50%;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 2;
	transition: background 0.2s ease, transform 0.15s ease;
}

.jw57-lightbox-close:hover {
	background: #7a3a10;
	transform: rotate(90deg) scale(1.1);
}

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 768px) {
	.jw57-lightbox-frame {
		max-width: 96%;
	}
	.jw57-lightbox-img {
		max-height: 65vh;
	}
	.jw57-hint {
		font-size: 10px;
		padding: 5px 10px;
	}
}

@media (max-width: 480px) {
	.jw57-lightbox-border {
		padding: 6px;
	}
	.jw57-lightbox-caption {
		font-size: 11px;
		padding: 7px 10px;
	}
}
