/* Base Typography & Magical Theme */
.sunbury-map-container, .sunbury-directory-wrapper, .sunbury-modal {
	font-family: 'Playfair Display', serif;
	color: #2c1e10;
}
h1, h2, h3, h4, .vendor-info h3 {
	font-family: 'Cinzel', serif;
	font-weight: 700;
	color: #1a1005;
	letter-spacing: 1px;
}

/* Map Container - Full Screen Immersive */
.sunbury-map-container.immersive-map {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	border-radius: 0;
	border: none;
	z-index: 1;
	background: #e8d5a8; /* Parchment base */
	transition: background-color 0.5s ease;
}

#sunbury-fantasy-map {
	width: 100%;
	height: 100%;
	background-color: transparent;
}

/* Glassmorphism Popup - Adjusted for Parchment */
.leaflet-popup-content-wrapper {
	background: rgba(244, 236, 216, 0.9) !important;
	border: 2px solid #8b6e4e;
	border-radius: 8px !important;
	box-shadow: 4px 4px 15px rgba(0, 0, 0, 0.3) !important;
	color: #2c1e10;
	font-family: 'Playfair Display', serif;
}
.leaflet-popup-tip {
	background: rgba(244, 236, 216, 0.9) !important;
	border-top: 2px solid #8b6e4e;
	border-left: 2px solid #8b6e4e;
}
.leaflet-popup-content h4 {
	font-size: 24px;
	color: #1a1005;
	text-shadow: none;
	border-bottom: 1px dashed #8b6e4e;
	padding-bottom: 5px;
	margin-bottom: 10px;
}
.leaflet-popup-content p {
	color: #3e2c1c;
}
.leaflet-container a.leaflet-popup-close-button {
	color: #1a1005 !important;
}

/* Magical Footprints */
.magical-footstep-icon {
	background: none;
	border: none;
}
.footstep-emoji {
	font-size: 24px;
	text-shadow: 0 0 5px rgba(0,0,0,0.5);
	opacity: 0;
	animation: stepFadeIn 0.4s ease forwards;
}
@keyframes stepFadeIn {
	0% { opacity: 0; transform: scale(0.5); }
	100% { opacity: 1; transform: scale(1); }
}

/* Guide Button */
.sunbury-path-btn {
	background: #2c1e10;
	border: 1px solid #1a1005;
	border-radius: 4px;
	padding: 8px 12px;
	color: #f4ecd8;
	font-weight: bold;
	font-size: 14px;
	cursor: pointer;
	width: 100%;
	font-family: 'Playfair Display', serif;
	transition: background 0.3s;
}
.sunbury-path-btn:hover {
	background: #4a331c;
}

/* Floating Action Panel */
.demo-action-panel.floating-actions {
	position: fixed;
	top: 20px;
	right: 20px;
	z-index: 1000;
	display: flex;
	gap: 15px;
}

/* Directory Sidebar - Parchment Scroll */
.sunbury-directory-wrapper.immersive-sidebar {
	position: fixed;
	top: 20px;
	left: 20px;
	width: 350px;
	height: calc(100vh - 40px);
	z-index: 1000;
	background: rgba(244, 236, 216, 0.95);
	border: 2px solid #8b6e4e;
	border-radius: 8px;
	padding: 20px;
	box-shadow: 5px 5px 20px rgba(0,0,0,0.4);
	overflow-y: auto;
	box-sizing: border-box;
	transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
	transform: translateX(-120%);
}
.sunbury-directory-wrapper.immersive-sidebar.open {
	transform: translateX(0);
}

.sunbury-directory-filters input {
	width: 100%;
	padding: 12px;
	border: 1px dashed #8b6e4e;
	background: transparent;
	font-family: 'Playfair Display', serif;
	font-size: 16px;
	color: #2c1e10;
	margin-bottom: 20px;
	box-sizing: border-box;
}
.sunbury-directory-filters input::placeholder {
	color: #8b6e4e;
	font-style: italic;
}

.sunbury-vendor-list {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 15px;
}
.quiz-options {
	display: flex;
	flex-direction: column;
	gap: 15px;
	margin-top: 25px;
}
.quiz-btn {
	padding: 14px 20px;
	border: 2px solid #4a331c;
	background: #f4ecd8;
	border-radius: 6px;
	font-family: 'Playfair Display', serif;
	font-weight: bold;
	cursor: pointer;
	transition: all 0.2s ease-in-out;
	font-size: 18px;
	color: #2c1e10;
	box-shadow: 2px 2px 5px rgba(0,0,0,0.2);
}
.quiz-btn:hover {
	background: #4a331c;
	color: #f4ecd8;
	transform: translateY(-2px);
}
.sunbury-vendor-item {
	background: rgba(255,255,255,0.4);
	border: 1px solid #cbb89d;
	padding: 15px;
	border-radius: 4px;
	cursor: pointer;
	transition: background 0.3s;
}
.sunbury-vendor-item:hover {
	background: rgba(220,195,150,0.5);
}
.vendor-guild {
	display: inline-block;
	font-family: 'Cinzel', serif;
	font-size: 16px;
	color: #634324;
	margin-right: 10px;
}

.qr-scanner-frame {
	width: 250px;
	height: 250px;
	margin: 20px auto;
	border: 4px solid #8b6e4e;
	border-radius: 10px;
	position: relative;
	background: #1a1005;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}
.qr-scanner-frame p {
	color: #e8d5a8;
	z-index: 2;
	font-family: 'Cinzel', serif;
	font-size: 20px;
}
.scan-line {
	position: absolute;
	top: 0; left: 0; width: 100%; height: 4px;
	background: #cbb89d;
	box-shadow: 0 0 15px #cbb89d;
	animation: scan 2s linear infinite;
	z-index: 3;
}

/* Modals */
.sunbury-modal {
	position: fixed;
	top: 0; left: 0; width: 100%; height: 100%;
	background: rgba(0,0,0,0.7);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 9999;
}
.glass-modal {
	background: #f4ecd8;
	border: 3px solid #4a331c;
	padding: 40px;
	border-radius: 8px;
	box-shadow: 0 0 30px rgba(0,0,0,0.8);
	max-width: 500px;
	width: 90%;
	text-align: center;
	position: relative;
}
.sunbury-close-modal {
	position: absolute;
	top: 15px; right: 20px;
	font-size: 28px;
	cursor: pointer;
	color: #4a331c;
}

/* Buttons */
.sunbury-action-btn {
	padding: 10px 20px;
	border: 2px solid #4a331c;
	background: #f4ecd8;
	color: #4a331c;
	font-family: 'Playfair Display', serif;
	font-weight: bold;
	cursor: pointer;
	border-radius: 4px;
	transition: all 0.3s;
	box-shadow: 2px 2px 5px rgba(0,0,0,0.3);
}
.sunbury-action-btn:hover {
	background: #4a331c;
	color: #f4ecd8;
}
.spell-btn {
	background: #2c1e10;
	color: #f4ecd8;
	border-color: #1a1005;
}

/* Nocturne Mode Overrides (Absinthe/Teal) */
body.nocturne-mode {
    background-color: #0b1a1c;
}
body.nocturne-mode .sunbury-map-container.immersive-map {
	background: #0b1a1c;
}
body.nocturne-mode .sunbury-directory-wrapper.immersive-sidebar {
	background: rgba(11, 26, 28, 0.95);
	border-color: #3f5f46;
	color: #e2edd5;
	box-shadow: 0 0 20px rgba(116, 153, 46, 0.15);
}
body.nocturne-mode h1, body.nocturne-mode h2, body.nocturne-mode h3, body.nocturne-mode .vendor-info h3 {
	color: #8da66c;
	text-shadow: 0 0 10px rgba(141, 166, 108, 0.4);
}
body.nocturne-mode .sunbury-vendor-item {
	background: rgba(141, 166, 108, 0.05);
	border-color: #1f3630;
	color: #b0c797;
}
body.nocturne-mode .sunbury-directory-filters input {
	color: #e2edd5;
	border-color: #3f5f46;
}
body.nocturne-mode .sunbury-directory-filters input::placeholder {
	color: #5d7a63;
}
body.nocturne-mode .footstep-emoji {
	text-shadow: 0 0 15px #8da66c, 0 0 30px #4d663b;
}
body.nocturne-mode .vendor-modal-social a {
	background: #1f3630;
	color: #e2edd5;
}

/* --- Immersive Section Backgrounds --- */
.bg-vintage-damask {
	background-color: #2a1114 !important;
	background-image: url('https://sunburyartsandcuriosities.com/wp-content/plugins/sunbury-curiosities/public/images/bg_vintage_damask.jpg') !important;
	background-repeat: repeat !important;
	background-size: 500px !important;
	background-position: center !important;
	color: #f4ecd8 !important;
}
.bg-mystic-parchment {
	background-color: #e5d7c3 !important;
	background-image: url('https://sunburyartsandcuriosities.com/wp-content/plugins/sunbury-curiosities/public/images/bg_mystic_parchment.jpg') !important;
	background-size: cover !important;
	background-position: center !important;
	color: #2c1e10 !important;
}
.bg-apothecary-wood {
	background-color: #1a120b !important;
	background-image: url('https://sunburyartsandcuriosities.com/wp-content/plugins/sunbury-curiosities/public/images/bg_apothecary_wood.jpg') !important;
	background-size: cover !important;
	background-position: center !important;
	color: #f4ecd8 !important;
}
body.nocturne-mode .spell-btn {
	background: #e8d5a8;
	color: #0b1a1c;
	box-shadow: 0 0 15px rgba(141, 166, 108, 0.3);
}
body.nocturne-mode .glass-modal {
    background: #0b1a1c;
    border-color: #3f5f46;
    color: #e2edd5;
}
body.nocturne-mode .sunbury-close-modal {
    color: #e2edd5;
}

/* --- Immersive Utilities --- */

/* Mystic Heading */
.mystic-heading {
	font-weight: 700;
	color: #2c1e10; /* Very dark rich brown for high contrast */
	text-shadow: 1px 1px 0px rgba(255, 255, 255, 0.6), 0 0 12px rgba(212, 175, 55, 0.5); /* subtle highlight + ambient gold glow */
	position: relative;
	display: inline-block;
	padding-bottom: 8px;
	margin-bottom: 10px;
	text-transform: uppercase;
	letter-spacing: 3px;
}
.mystic-heading::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 15%;
	width: 70%;
	height: 1px;
	background: linear-gradient(90deg, transparent, #8b6e4e, transparent);
	box-shadow: 0 1px 3px rgba(139, 110, 78, 0.5);
}

/* Magic Sparkle Effect */
.sunbury-magic-sparkle {
    position: absolute;
    font-size: 18px;
    pointer-events: none;
    z-index: 10;
    opacity: 0;
    animation: sparkleAnim 1.5s ease-out forwards;
}
@keyframes sparkleAnim {
    0% { opacity: 0; transform: scale(0.5) translateY(0) rotate(0deg); }
    20% { opacity: 1; transform: scale(1.2) translateY(-10px) rotate(15deg); filter: drop-shadow(0 0 5px #d4af37); }
    100% { opacity: 0; transform: scale(0.8) translateY(-30px) rotate(45deg); filter: drop-shadow(0 0 10px #aa771c); }
}

/* Glowing Ink */
.glowing-ink {
	transition: text-shadow 0.3s ease, color 0.3s ease;
}
.glowing-ink:hover {
	color: #634324;
	text-shadow: 0 0 10px rgba(193, 154, 107, 0.8);
}

/* Make Glowing Ink pulse automatically on touch devices where hover isn't possible */
@media (hover: none) {
	.glowing-ink {
		animation: mysticPulse 3s infinite alternate ease-in-out;
	}
}

@keyframes mysticPulse {
	0% { color: inherit; text-shadow: none; }
	100% { color: #634324; text-shadow: 0 0 10px rgba(193, 154, 107, 0.8); }
}

/* Image Frames */
.frame-victorian-gold {
	border: 8px solid #b89947;
	border-radius: 2px;
	box-shadow: 0 0 10px rgba(0,0,0,0.5), inset 0 0 10px rgba(0,0,0,0.5);
	padding: 4px;
	background: #fff;
}
.frame-dark-wood {
	display: block;
	background-color: #f4ecd8; /* Give it a parchment inner background */
	padding: 25px;
	border: 12px solid #3e2c1c;
	border-radius: 4px;
	box-shadow: 4px 4px 15px rgba(0,0,0,0.6), inset 0 0 15px rgba(0,0,0,0.4);
	color: #2c1e10;
	position: relative;
}
.frame-torn-paper {
	border: 4px solid #f4ecd8;
	box-shadow: 2px 2px 8px rgba(0,0,0,0.2);
	/* Simple CSS approximation of torn edge */
	filter: drop-shadow(0 0 3px rgba(0,0,0,0.3));
	border-radius: 2px 10px 4px 8px;
}

/* Worn Fabric with Tape */
.frame-fabric-taped {
	background-color: #d8d0c5;
	background-image: url("data:image/svg+xml,%3Csvg width='10' height='10' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h20v20H0z' fill='%23b8afa1' fill-opacity='0.2' fill-rule='evenodd'/%3E%3Cpath d='M2 2h2v2H2zM6 6h2v2H6z' fill='%239a8c78' fill-opacity='0.3'/%3E%3C/svg%3E");
	padding: 20px 30px;
	border: 1px solid #c2b5a1;
	border-radius: 3px;
	box-shadow: 2px 4px 10px rgba(0,0,0,0.1);
	position: relative;
	color: #3e2c1c;
	display: inline-block;
	margin-top: 15px;
}
.frame-fabric-taped::before {
	content: '';
	position: absolute;
	top: -12px;
	left: 50%;
	transform: translateX(-50%) rotate(-2deg);
	width: 80px;
	height: 30px;
	background: rgba(255, 255, 255, 0.6);
	box-shadow: 0 1px 3px rgba(0,0,0,0.1);
	border-radius: 2px;
	z-index: 2;
}

/* Worn Fabric with Safety Pin */
.frame-fabric-pinned {
	background-color: #d8d0c5;
	background-image: url("data:image/svg+xml,%3Csvg width='10' height='10' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h20v20H0z' fill='%23b8afa1' fill-opacity='0.2' fill-rule='evenodd'/%3E%3Cpath d='M2 2h2v2H2zM6 6h2v2H6z' fill='%239a8c78' fill-opacity='0.3'/%3E%3C/svg%3E");
	padding: 20px 30px;
	border-radius: 3px;
	box-shadow: 2px 4px 10px rgba(0,0,0,0.1);
	position: relative;
	color: #3e2c1c;
	border: 2px dashed #bbaaa0;
	display: inline-block;
}
.frame-fabric-pinned::after {
	content: '';
	position: absolute;
	top: 10px;
	left: 15px;
	width: 45px;
	height: 15px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 30'%3E%3Cpath d='M90 10 C95 10 95 20 90 20 L20 20 C10 20 10 10 20 10 L85 10' fill='none' stroke='%23555' stroke-width='5' stroke-linecap='round'/%3E%3Ccircle cx='15' cy='15' r='7' fill='%23555'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-size: contain;
	transform: rotate(-10deg);
	z-index: 2;
	opacity: 0.8;
}

/* --- Vendor Cards Grid --- */
.sunbury-vendor-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
	gap: 25px;
	padding: 20px 0;
}

.sunbury-card-item {
	background: #f4ecd8;
	border: 2px solid #8b6e4e;
	border-radius: 6px;
	padding: 15px;
	text-align: center;
	cursor: pointer;
	position: relative;
	box-shadow: 3px 3px 10px rgba(0,0,0,0.15);
	transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s;
	background-image: url('data:image/svg+xml,%3Csvg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"%3E%3Cg fill="%23cbb89d" fill-opacity="0.2" fill-rule="evenodd"%3E%3Ccircle cx="3" cy="3" r="3"/%3E%3Ccircle cx="13" cy="13" r="3"/%3E%3C/g%3E%3C/svg%3E'); /* Subtle texture */
}

.sunbury-card-item:hover {
	transform: translateY(-8px) rotate(-1deg);
	box-shadow: 5px 15px 25px rgba(0,0,0,0.3);
	border-color: #b89947;
}

.sunbury-card-image-wrap {
	width: 100%;
	height: 180px;
	overflow: hidden;
	border: 2px solid #4a331c;
	margin-bottom: 15px;
	border-radius: 4px;
	background: #2c1e10;
}

.sunbury-card-image-wrap img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.5s, filter 0.5s;
	filter: sepia(0.4) contrast(1.1);
}

.sunbury-card-item:hover .sunbury-card-image-wrap img {
	transform: scale(1.05);
	filter: sepia(0) contrast(1);
}

.sunbury-card-item h3 {
	font-family: 'Playfair Display', serif;
	font-size: 20px;
	margin: 0 0 5px 0;
	color: #2c1e10;
}

.sunbury-card-guild {
	font-family: 'Cinzel', serif;
	font-size: 16px;
	color: #8b6e4e;
}

/* Vendor Modal Specific Styling */
.vendor-detail-modal .glass-modal {
	max-width: 700px;
	background: #e8d5a8;
	background-image: url('data:image/svg+xml,%3Csvg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"%3E%3Cg fill="%23cbb89d" fill-opacity="0.2" fill-rule="evenodd"%3E%3Ccircle cx="3" cy="3" r="3"/%3E%3Ccircle cx="13" cy="13" r="3"/%3E%3C/g%3E%3C/svg%3E');
	border: 6px solid #4a331c;
	border-radius: 4px;
	text-align: left;
	display: flex;
	flex-direction: column;
	gap: 20px;
}
@media (min-width: 768px) {
	.vendor-detail-modal .glass-modal {
		flex-direction: row;
	}
}

.vendor-modal-image {
	flex: 0 0 40%;
	border: 4px solid #3e2c1c;
	border-radius: 4px;
	overflow: hidden;
	background: #000;
}
.vendor-modal-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.vendor-modal-info {
	flex: 1;
}
.vendor-modal-info h2 {
	font-family: 'Playfair Display', serif;
	font-size: 32px;
	margin: 0 0 10px 0;
	color: #1a1005;
	border-bottom: 2px dashed #8b6e4e;
	padding-bottom: 10px;
}
.vendor-modal-desc {
	font-family: 'Outfit', sans-serif;
	font-size: 16px;
	line-height: 1.6;
	color: #3e2c1c;
	margin-bottom: 20px;
}

.vendor-modal-socials {
	display: flex;
	gap: 15px;
	margin-top: 20px;
	padding-top: 20px;
	border-top: 1px solid #cbb89d;
}

body.nocturne-mode .sunbury-card-item {
	background: #112022;
	border-color: #1f3630;
}
body.nocturne-mode .sunbury-card-item h3 {
	color: #e2edd5;
}
body.nocturne-mode .sunbury-card-guild {
	color: #5d7a63;
}
body.nocturne-mode .vendor-detail-modal .glass-modal {
	background: #0b1a1c;
	border-color: #3f5f46;
}
body.nocturne-mode .vendor-modal-info h2 {
	color: #8da66c;
	border-bottom-color: #1f3630;
}
body.nocturne-mode .vendor-modal-desc {
	color: #b0c797;
}

