:root {
	--bg-dark: #0a0a0a; --bg-panel: #111111; --bg-item: #1a1a1a; --bg-item-hover: #222222;
	--text-main: #e0e0e0; --text-muted: #888888; --border: #222;
	--accent: var(--wp--preset--color--accent, #ff3b3b); 
	--font-ui: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
	--font-read: "Merriweather", "Georgia", serif;
	--story-font-size: 1.25rem;
	--sidebar-width: 320px; --header-height: 50px; --dock-height: 70px;
}

body { 
	height: 100%; margin: 0; padding: 0; 
	background: var(--bg-dark); color: var(--text-main); font-family: var(--font-ui); 
	overflow: hidden; 
}

#wpadminbar { display: none !important; }
a { text-decoration: none; color: inherit; transition: 0.2s; }
.fade-in { animation: fadeIn 0.4s ease forwards; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

#app-container { display: flex; flex-direction: column; height: 100vh; }

#top-nav { height: var(--header-height); background: rgba(10,10,10,0.95); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 15px; z-index: 500; backdrop-filter: blur(10px); }
.nav-brand { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.nav-brand:hover { color: var(--accent); }

/* STRICT LOGO CONSTRAINT */
.brand-logo { 
	height: 40px !important; 
	max-height: 40px !important; 
	width: auto; 
	border-radius: 4px; 
	object-fit: contain; 
}

.nav-controls { display: flex; gap: 8px; align-items: center; }
.control-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 13px; text-transform: uppercase; font-weight: 600; padding: 6px 10px; border-radius: 4px; transition: 0.2s; display: flex; align-items: center; gap: 6px; }
.control-btn:hover { color: var(--text-main); background: var(--bg-item); }
.control-btn.active { color: var(--accent); }

.control-select { background: #000; color: var(--text-muted); border: 1px solid #333; padding: 4px 8px; border-radius: 4px; font-size: 12px; outline: none; max-width: 180px; }
.control-select:focus { border-color: var(--accent); color: var(--text-main); }

#progress-bar { position: absolute; top: var(--header-height); left: 0; height: 3px; background: var(--accent); width: 0%; z-index: 600; transition: width 0.1s; }

#workspace { display: flex; flex: 1; overflow: hidden; position: relative; }

#sidebar { width: var(--sidebar-width); background: var(--bg-panel); border-right: 1px solid var(--border); display: flex; flex-direction: column; z-index: 400; transition: transform 0.3s ease; flex-shrink: 0; }
.filter-panel { padding: 15px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.filter-select { background: var(--bg-dark); color: var(--text-main); border: 1px solid var(--border); padding: 8px; border-radius: 4px; font-size: 12px; outline: none; }
.filter-select:focus { border-color: var(--accent); }

.post-list { flex: 1; overflow-y: auto; padding: 10px; }
.post-card { padding: 15px; margin-bottom: 8px; background: var(--bg-item); border-radius: 6px; border-left: 2px solid transparent; cursor: pointer; }
.post-card:hover { background: var(--bg-item-hover); }
.post-card.active { background: var(--bg-item-hover); border-left-color: var(--accent); }
.pc-title { font-size: 14px; font-weight: 600; line-height: 1.3; margin-bottom: 5px; display: block; }
.pc-meta { font-size: 11px; color: var(--text-muted); display: flex; justify-content: space-between; }

#reader { flex: 1; overflow-y: auto; position: relative; scroll-behavior: smooth; background: var(--bg-dark); }

.hero-section { 
	min-height: 60vh; 
	height: auto;     
	position: relative; 
	display: flex; 
	flex-direction: column; 
	justify-content: flex-end; 
	z-index: 10;
}
.hero-bg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.6; transition: opacity 0.5s; z-index: 0; }
.hero-vignette { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(to top, var(--bg-dark) 5%, transparent 80%); z-index: 1; }

.hero-content { 
	position: relative; 
	z-index: 5; 
	padding: 80px 40px 40px; 
	max-width: 800px; 
	margin: 0 auto; 
	width: 100%; 
}

.story-title { font-family: var(--font-read); font-size: 3.5rem; line-height: 1.1; margin-bottom: 15px; text-shadow: 0 4px 20px rgba(0,0,0,0.8); }
.story-desc { font-size: 1.3rem; line-height: 1.5; color: #ccc; margin-bottom: 20px; font-style: italic; max-width: 700px; }
.story-meta { display: flex; gap: 15px; font-size: 0.85rem; color: #ccc; text-transform: uppercase; letter-spacing: 1px; font-weight: 600; }
.meta-pill { background: rgba(255,255,255,0.1); padding: 5px 12px; border-radius: 20px; backdrop-filter: blur(5px); }

.body-container { 
	max-width: 740px; 
	margin: 0 auto; 
	padding: 60px 20px 150px; 
	position: relative; 
	z-index: 5; 
	background: var(--bg-dark); 
}

.story-text { font-family: var(--font-read); font-size: var(--story-font-size); line-height: 1.8; color: #d6d6d6; transition: font-size 0.2s ease; }
.story-text p { margin-bottom: 1.8em; }

.skeleton { background: #1a1a1a; border-radius: 4px; animation: pulse 1.5s infinite; }
.sk-title { height: 60px; width: 70%; margin-bottom: 20px; }
.sk-line { height: 15px; margin-bottom: 15px; width: 100%; }
.sk-line.short { width: 60%; }
@keyframes pulse { 0% { opacity: 0.5; } 50% { opacity: 1; } 100% { opacity: 0.5; } }

/* AUDIO DOCK */
#audio-dock { position: fixed; bottom: 0; left: 0; width: 100%; height: var(--dock-height); background: rgba(15,15,15,0.98); border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 30px; z-index: 600; transform: translateY(100%); transition: transform 0.3s ease; backdrop-filter: blur(10px); }
#audio-dock.visible { transform: translateY(0); }
.dock-left { display: flex; align-items: center; gap: 15px; width: 200px; }
.dock-play-btn { width: 40px; height: 40px; border-radius: 50%; background: var(--text-main); border: none; cursor: pointer; color: var(--bg-dark); font-size: 18px; display: flex; align-items: center; justify-content: center; transition: 0.2s; }
.dock-play-btn:hover { background: var(--accent); color: white; }
.dock-center { flex: 1; display: flex; align-items: center; gap: 15px; max-width: 600px; margin: 0 20px; }
.dock-time { font-size: 12px; color: var(--text-muted); font-family: monospace; width: 40px; text-align: center; }
.dock-progress-container { flex: 1; height: 4px; background: #333; border-radius: 2px; position: relative; cursor: pointer; }
.dock-progress-fill { height: 100%; background: var(--accent); width: 0%; border-radius: 2px; position: relative; }
.dock-progress-handle { width: 12px; height: 12px; background: var(--text-main); border-radius: 50%; position: absolute; right: -6px; top: -4px; opacity: 0; transition: opacity 0.2s; }
.dock-progress-container:hover .dock-progress-handle { opacity: 1; }
.dock-status { font-size: 12px; color: var(--accent); font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }

/* MODAL */
#pay-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); z-index: 1000; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 0.2s; backdrop-filter: blur(5px); }
#pay-modal.visible { opacity: 1; pointer-events: auto; }
.modal-box { background: #1a1a1a; border: 1px solid #333; padding: 30px; border-radius: 8px; width: 90%; max-width: 400px; text-align: center; box-shadow: 0 10px 40px rgba(0,0,0,0.5); }
.modal-title { font-size: 1.5rem; margin-bottom: 10px; color: #fff; font-weight: 700; }
.modal-text { color: #aaa; margin-bottom: 20px; font-size: 0.95rem; line-height: 1.5; }
.modal-stat-row { display: flex; justify-content: space-between; margin-bottom: 10px; padding: 10px; background: #111; border-radius: 4px; font-size: 0.9rem; }
.stat-label { color: #888; }
.stat-val { color: #fff; font-weight: 600; }
.stat-val.bad { color: #ff3b3b; }
.stat-val.good { color: #00ff88; }
.btn-row { display: flex; gap: 10px; margin-top: 20px; }
.modal-btn { flex: 1; padding: 12px; border-radius: 4px; border: none; font-weight: 600; cursor: pointer; transition: 0.2s; text-transform: uppercase; letter-spacing: 1px; font-size: 0.8rem; }
.btn-cancel { background: #333; color: #ccc; }
.btn-cancel:hover { background: #444; color: #fff; }
.btn-confirm { background: var(--accent); color: #fff; }
.btn-confirm:hover { filter: brightness(1.2); }
.btn-confirm:disabled { opacity: 0.5; cursor: not-allowed; filter: none; }

.read-more-toggle:hover { color: var(--accent) !important; text-decoration: underline; }

#cinema-exit-btn { position: fixed; top: 20px; right: 20px; background: rgba(0,0,0,0.5); color: white; border: 1px solid #444; padding: 8px 16px; border-radius: 20px; cursor: pointer; z-index: 9999; display: none; backdrop-filter: blur(5px); text-transform: uppercase; font-size: 12px; letter-spacing: 1px; }
#cinema-exit-btn:hover { background: var(--accent); border-color: var(--accent); }
body.cinema-mode #sidebar, body.cinema-mode #top-nav { transform: translateY(-100%); display: none; }
body.cinema-mode #audio-dock { display: flex; background: transparent; border: none; }
body.cinema-mode #cinema-exit-btn { display: block; }

body.font-sm .story-text { font-size: 1rem !important; }
body.font-md .story-text { font-size: 1.25rem !important; }
body.font-lg .story-text { font-size: 1.5rem !important; }
body.font-xl .story-text { font-size: 1.8rem !important; }

/* === MOBILE === */
#mobile-toggle { display: none; }
.icon { font-size: 1.2em; display: inline-block; vertical-align: middle; }
.label { display: inline-block; vertical-align: middle; margin-left: 4px; }

@media (max-width: 900px) { 
	:root { --sidebar-width: 100%; } 
	
	#sidebar { position: fixed; top: var(--header-height); bottom: 0; transform: translateX(-100%); width:100%; transition: transform 0.3s ease; } 
	#sidebar.open { transform: translateX(0); } 
	#mobile-toggle { display: block; } 
	
	.brand-text { display: none; } 
	.brand-arrow { font-size: 1.5em; }
	.label { display: none; } 
	
	.control-btn { padding: 8px; }
	.control-select { max-width: 100px; font-size: 11px; } 
	
	.story-title { font-size: 2rem; } 
	.hero-section { min-height: 50vh; height: auto; } 
	
	#audio-dock { padding: 0 15px; } 
	.dock-center { margin: 0 10px; }
	
	#mobile-menu-btn { display: flex !important; }
}