/*
Theme Name: PromptVault
Theme URI: https://imaginewithrashid.com
Author: Rashid
Description: A dark, gallery-first WordPress theme for AI prompt libraries. Masonry image grid, fixed sidebar navigation, and a split single-post view with a copyable prompt panel.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: promptvault
Tags: dark, grid, portfolio, custom-menu, featured-images, translation-ready
*/

/* ---------------------------------------------------------------
   1. Tokens
--------------------------------------------------------------- */
:root {
	--pv-bg: #0a0a0a;
	--pv-bg-rail: #0d0d0d;
	--pv-surface: #141414;
	--pv-surface-2: #1b1b1b;
	--pv-hover: rgba(255, 255, 255, .06);
	--pv-line: rgba(255, 255, 255, .09);
	--pv-line-strong: rgba(255, 255, 255, .16);
	--pv-text: #f2f2f2;
	--pv-text-dim: #9a9a9a;
	--pv-text-faint: #6b6b6b;
	--pv-accent: #8b5cf6;
	--pv-accent-soft: rgba(139, 92, 246, .16);
	--pv-verified: #3b9bf7;
	--pv-danger: #f43f5e;

	--pv-rail: 272px;
	--pv-radius: 14px;
	--pv-radius-sm: 10px;
	--pv-radius-pill: 999px;
	--pv-gap: 14px;
	--pv-shadow: 0 18px 40px rgba(0, 0, 0, .45);
	--pv-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--pv-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
	--pv-ease: cubic-bezier(.4, 0, .2, 1);
}

html[data-theme="light"] {
	--pv-bg: #f7f7f8;
	--pv-bg-rail: #ffffff;
	--pv-surface: #ffffff;
	--pv-surface-2: #f1f1f3;
	--pv-hover: rgba(0, 0, 0, .05);
	--pv-line: rgba(0, 0, 0, .09);
	--pv-line-strong: rgba(0, 0, 0, .16);
	--pv-text: #131316;
	--pv-text-dim: #5f5f68;
	--pv-text-faint: #8b8b94;
	--pv-shadow: 0 18px 40px rgba(0, 0, 0, .1);
}

/* ---------------------------------------------------------------
   2. Base
--------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	background: var(--pv-bg);
	color: var(--pv-text);
	font-family: var(--pv-font);
	font-size: 15px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

img, svg, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }

:focus-visible {
	outline: 2px solid var(--pv-accent);
	outline-offset: 2px;
	border-radius: 6px;
}

.pv-sr {
	position: absolute !important;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0 0 0 0);
	white-space: nowrap; border: 0;
}

.pv-skip {
	position: absolute; left: -9999px; top: 0; z-index: 200;
	background: var(--pv-accent); color: #fff;
	padding: 10px 16px; border-radius: 0 0 var(--pv-radius-sm) 0;
}
.pv-skip:focus { left: 0; }

/* ---------------------------------------------------------------
   3. Shell
--------------------------------------------------------------- */
.pv-shell { min-height: 100vh; }

.pv-main {
	margin-left: var(--pv-rail);
	padding: 18px 22px 90px;
	min-height: 100vh;
}

/* ---------------------------------------------------------------
   4. Sidebar rail
--------------------------------------------------------------- */
.pv-rail {
	position: fixed;
	inset: 0 auto 0 0;
	width: var(--pv-rail);
	background: var(--pv-bg-rail);
	border-right: 1px solid var(--pv-line);
	display: flex;
	flex-direction: column;
	z-index: 60;
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-width: thin;
}

.pv-brand {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 22px 22px 18px;
	font-size: 23px;
	font-weight: 700;
	letter-spacing: -.03em;
}
.pv-brand img { width: auto; max-height: 32px; }
.pv-brand-mark { color: var(--pv-accent); flex: none; }

.pv-nav { padding: 0 12px; }

.pv-nav-label {
	padding: 22px 12px 8px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .02em;
	color: var(--pv-text-faint);
}

.pv-nav a,
.pv-nav button.pv-nav-item {
	display: flex;
	align-items: center;
	gap: 14px;
	width: 100%;
	padding: 11px 12px;
	border: 0;
	background: none;
	border-radius: var(--pv-radius-sm);
	color: var(--pv-text-dim);
	font-size: 15px;
	font-weight: 500;
	transition: background .16s var(--pv-ease), color .16s var(--pv-ease);
	text-align: left;
}
.pv-nav a:hover,
.pv-nav button.pv-nav-item:hover { background: var(--pv-hover); color: var(--pv-text); }
.pv-nav .current-menu-item > a,
.pv-nav a[aria-current="page"] { background: var(--pv-hover); color: var(--pv-text); }
.pv-nav svg { flex: none; opacity: .9; }
.pv-nav-chevron { margin-left: auto; opacity: .5; transition: transform .2s var(--pv-ease); }
.pv-nav-item[aria-expanded="true"] .pv-nav-chevron { transform: rotate(90deg); }

.pv-tag-list {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding: 4px 12px 6px;
}
.pv-tag-list a {
	display: inline-block;
	width: auto;
	padding: 5px 11px;
	font-size: 13px;
	background: var(--pv-surface);
	border: 1px solid var(--pv-line);
	border-radius: var(--pv-radius-pill);
}

.pv-cta {
	display: block;
	margin: 14px 12px 4px;
	padding: 15px 16px;
	border: 1px solid var(--pv-accent);
	border-radius: var(--pv-radius);
	background: linear-gradient(180deg, var(--pv-accent-soft), transparent);
	position: relative;
	transition: background .2s var(--pv-ease);
}
.pv-cta:hover { background: var(--pv-accent-soft); }
.pv-cta strong { display: block; font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.pv-cta span { font-size: 13px; color: var(--pv-text-dim); }
.pv-cta .pv-cta-icon {
	position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
	color: var(--pv-accent);
}

.pv-rail-foot {
	margin-top: auto;
	padding: 16px 12px 18px;
	display: flex;
	align-items: center;
}

.pv-icon-btn {
	display: grid;
	place-items: center;
	width: 42px; height: 42px;
	flex: none;
	border: 1px solid var(--pv-line);
	background: var(--pv-surface);
	border-radius: var(--pv-radius-sm);
	color: var(--pv-text-dim);
	transition: color .16s var(--pv-ease), border-color .16s var(--pv-ease);
}
.pv-icon-btn:hover { color: var(--pv-text); border-color: var(--pv-line-strong); }

/* ---------------------------------------------------------------
   5. Buttons
--------------------------------------------------------------- */
.pv-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	padding: 12px 18px;
	border: 1px solid var(--pv-line);
	background: var(--pv-surface);
	border-radius: var(--pv-radius-sm);
	font-size: 15px;
	font-weight: 500;
	color: var(--pv-text);
	transition: background .16s var(--pv-ease), border-color .16s var(--pv-ease), transform .12s var(--pv-ease);
}
.pv-btn:hover { background: var(--pv-surface-2); border-color: var(--pv-line-strong); }
.pv-btn:active { transform: scale(.985); }
.pv-btn.is-done { color: #34d399; border-color: rgba(52, 211, 153, .4); }
.pv-btn.is-saved { color: var(--pv-accent); border-color: var(--pv-accent); }

/* ---------------------------------------------------------------
   6. Top bar (mobile) + search
--------------------------------------------------------------- */
.pv-topbar {
	display: none;
	position: sticky;
	top: 0;
	z-index: 50;
	align-items: center;
	gap: 12px;
	margin: -18px -22px 16px;
	padding: 12px 16px;
	background: color-mix(in srgb, var(--pv-bg) 88%, transparent);
	backdrop-filter: blur(14px);
	border-bottom: 1px solid var(--pv-line);
}
.pv-topbar .pv-brand { padding: 0; font-size: 19px; }

.pv-search {
	display: flex;
	align-items: center;
	gap: 10px;
	max-width: 520px;
	padding: 0 14px;
	background: var(--pv-surface);
	border: 1px solid var(--pv-line);
	border-radius: var(--pv-radius-pill);
}
.pv-search svg { color: var(--pv-text-faint); flex: none; }
.pv-search input {
	flex: 1;
	padding: 11px 0;
	border: 0;
	background: none;
	color: var(--pv-text);
	font: inherit;
}
.pv-search input:focus { outline: none; }
.pv-search input::placeholder { color: var(--pv-text-faint); }

/* ---------------------------------------------------------------
   7. Page head
--------------------------------------------------------------- */
.pv-head { margin: 4px 0 20px; }
.pv-head h1 {
	margin: 0 0 6px;
	font-size: 28px;
	font-weight: 700;
	letter-spacing: -.03em;
}
.pv-head p { margin: 0; color: var(--pv-text-dim); }

/* ---------------------------------------------------------------
   8. Masonry grid
--------------------------------------------------------------- */
.pv-grid {
	column-count: 4;
	column-gap: var(--pv-gap);
}
@media (max-width: 1560px) { .pv-grid { column-count: 3; } }
@media (max-width: 1080px)  { .pv-grid { column-count: 2; } }
@media (max-width: 520px)   { .pv-grid { column-count: 1; } }

.pv-card {
	break-inside: avoid;
	margin: 0 0 var(--pv-gap);
	position: relative;
	border-radius: var(--pv-radius);
	overflow: hidden;
	background: var(--pv-surface);
	display: block;
	transform: translateZ(0);
}
.pv-card img {
	width: 100%;
	height: auto;
	object-fit: cover;
	transition: transform .5s var(--pv-ease);
}
.pv-card:hover img { transform: scale(1.035); }

.pv-card-overlay {
	position: absolute;
	inset: auto 0 0 0;
	padding: 44px 14px 13px;
	background: linear-gradient(to top, rgba(0, 0, 0, .88), rgba(0, 0, 0, .35) 55%, transparent);
	opacity: 0;
	transform: translateY(6px);
	transition: opacity .22s var(--pv-ease), transform .22s var(--pv-ease);
	color: #fff;
}
.pv-card:hover .pv-card-overlay,
.pv-card:focus-within .pv-card-overlay { opacity: 1; transform: none; }
.pv-card-overlay h2 {
	margin: 0;
	font-size: 15px;
	font-weight: 600;
	letter-spacing: -.01em;
	line-height: 1.35;
}
.pv-card-meta {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-top: 7px;
	font-size: 12.5px;
	color: rgba(255, 255, 255, .72);
}
.pv-card-meta span { display: inline-flex; align-items: center; gap: 5px; }

.pv-card-badge {
	position: absolute;
	top: 11px; left: 11px;
	padding: 5px 10px;
	font-size: 11.5px;
	font-weight: 500;
	color: #fff;
	background: rgba(10, 10, 10, .62);
	backdrop-filter: blur(8px);
	border: 1px solid rgba(255, 255, 255, .14);
	border-radius: var(--pv-radius-pill);
	opacity: 0;
	transition: opacity .22s var(--pv-ease);
}
.pv-card:hover .pv-card-badge { opacity: 1; }

/* Card without a featured image falls back to prompt text */
.pv-card-text {
	padding: 20px 18px 22px;
	border: 1px solid var(--pv-line);
	border-radius: var(--pv-radius);
}
.pv-card-text h2 { margin: 0 0 10px; font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
.pv-card-text p { margin: 0; color: var(--pv-text-dim); font-size: 14px; }

/* ---------------------------------------------------------------
   9. Single post
--------------------------------------------------------------- */
.pv-single {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 500px;
	align-items: stretch;
	margin: -18px -22px 0;
	border-bottom: 1px solid var(--pv-line);
}

.pv-stage {
	position: relative;
	display: grid;
	place-items: center;
	padding: 30px;
	min-width: 0;
}
.pv-stage-inner { max-width: 100%; }
.pv-stage img {
	max-height: 78vh;
	width: auto;
	border-radius: var(--pv-radius);
	box-shadow: var(--pv-shadow);
}

.pv-back {
	position: absolute;
	top: 22px; left: 22px;
	z-index: 20;
	width: 44px; height: 44px;
	display: grid; place-items: center;
	border-radius: 50%;
	background: var(--pv-surface-2);
	border: 1px solid var(--pv-line);
	color: var(--pv-text);
	transition: background .16s var(--pv-ease);
}
.pv-back:hover { background: var(--pv-hover); }

.pv-panel {
	border-left: 1px solid var(--pv-line);
	padding: 30px 32px 34px;
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.pv-meta {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
}
.pv-date {
	margin-left: auto;
	font-size: 13.5px;
	color: var(--pv-text-faint);
}

.pv-chip {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 7px 13px;
	font-size: 13.5px;
	font-weight: 500;
	background: var(--pv-surface);
	border: 1px solid var(--pv-line);
	border-radius: var(--pv-radius-sm);
	color: var(--pv-text);
	transition: border-color .16s var(--pv-ease);
}
.pv-chip:hover { border-color: var(--pv-line-strong); }

.pv-title {
	margin: 16px 0 20px;
	font-size: 31px;
	font-weight: 700;
	letter-spacing: -.035em;
	line-height: 1.15;
}

.pv-prompt {
	background: var(--pv-surface);
	border: 1px solid var(--pv-line);
	border-radius: var(--pv-radius);
	padding: 22px 24px;
	max-height: 46vh;
	overflow-y: auto;
	white-space: pre-wrap;
	word-break: break-word;
	font-size: 15px;
	line-height: 1.75;
	color: var(--pv-text);
	scrollbar-width: thin;
}
.pv-prompt::-webkit-scrollbar { width: 8px; }
.pv-prompt::-webkit-scrollbar-thumb { background: var(--pv-line-strong); border-radius: 4px; }

.pv-copy {
	margin-top: 14px;
	width: 100%;
	padding: 15px 18px;
	font-weight: 500;
}

/* Explanation, written in the main editor */
.pv-explain {
	max-width: 760px;
	margin: 46px auto 0;
}

.pv-body { color: var(--pv-text); font-size: 16.5px; line-height: 1.75; }
.pv-body > *:first-child { margin-top: 0; }
.pv-body h2 { font-size: 25px; letter-spacing: -.025em; margin: 38px 0 14px; }
.pv-body h3 { font-size: 20px; letter-spacing: -.02em; margin: 30px 0 12px; }
.pv-body p { margin: 0 0 18px; }
.pv-body ul, .pv-body ol { margin: 0 0 18px; padding-left: 22px; }
.pv-body li { margin-bottom: 8px; }
.pv-body a { color: var(--pv-accent); text-decoration: underline; text-underline-offset: 3px; }
.pv-body img { border-radius: var(--pv-radius); margin: 22px 0; }
.pv-body blockquote {
	margin: 22px 0;
	padding: 4px 0 4px 20px;
	border-left: 2px solid var(--pv-accent);
	color: var(--pv-text-dim);
}
.pv-body code {
	background: var(--pv-surface);
	border: 1px solid var(--pv-line);
	border-radius: 6px;
	padding: 2px 6px;
	font-family: var(--pv-mono);
	font-size: .9em;
}
.pv-body pre {
	background: var(--pv-surface);
	border: 1px solid var(--pv-line);
	border-radius: var(--pv-radius);
	padding: 18px 20px;
	overflow-x: auto;
}
.pv-body pre code { background: none; border: 0; padding: 0; }

.pv-post-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 32px;
	padding-top: 24px;
	border-top: 1px solid var(--pv-line);
}
.pv-post-tags a {
	padding: 6px 13px;
	font-size: 13.5px;
	background: var(--pv-surface);
	border: 1px solid var(--pv-line);
	border-radius: var(--pv-radius-pill);
	color: var(--pv-text-dim);
}
.pv-post-tags a:hover { color: var(--pv-text); border-color: var(--pv-line-strong); }

.pv-related { margin: 56px 0 0; }
.pv-related h2 { font-size: 21px; font-weight: 600; letter-spacing: -.02em; margin: 0 0 16px; }

/* ---------------------------------------------------------------
   10. Install banner
--------------------------------------------------------------- */
.pv-install {
	position: fixed;
	left: calc(50% + (var(--pv-rail) / 2));
	bottom: 22px;
	transform: translateX(-50%);
	z-index: 70;
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 10px 14px 10px 10px;
	background: var(--pv-surface-2);
	border: 1px solid var(--pv-line);
	border-radius: var(--pv-radius-pill);
	box-shadow: var(--pv-shadow);
	max-width: calc(100vw - 40px);
}
.pv-install[hidden] { display: none; }
.pv-install-icon {
	width: 44px; height: 44px;
	display: grid; place-items: center;
	border-radius: 50%;
	background: var(--pv-bg);
	color: var(--pv-text);
	flex: none;
}
.pv-install strong { display: block; font-size: 15px; font-weight: 600; }
.pv-install span { font-size: 13px; color: var(--pv-text-dim); }
.pv-install button.pv-install-close {
	background: none; border: 0; color: var(--pv-text-dim);
	padding: 8px; margin-left: 6px; border-radius: 50%;
}
.pv-install button.pv-install-close:hover { background: var(--pv-hover); color: var(--pv-text); }

/* ---------------------------------------------------------------
   11. Toast
--------------------------------------------------------------- */
.pv-toast {
	position: fixed;
	left: 50%; bottom: 90px;
	transform: translate(-50%, 12px);
	z-index: 90;
	padding: 11px 20px;
	background: var(--pv-surface-2);
	border: 1px solid var(--pv-line);
	border-radius: var(--pv-radius-pill);
	box-shadow: var(--pv-shadow);
	font-size: 14px;
	opacity: 0;
	pointer-events: none;
	transition: opacity .2s var(--pv-ease), transform .2s var(--pv-ease);
}
.pv-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------------------------------------------------------------
   12. Pagination + empty states
--------------------------------------------------------------- */
.pv-pagination {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin: 34px 0 10px;
	flex-wrap: wrap;
}
.pv-pagination .page-numbers {
	min-width: 42px;
	padding: 10px 14px;
	text-align: center;
	border: 1px solid var(--pv-line);
	border-radius: var(--pv-radius-sm);
	color: var(--pv-text-dim);
	transition: background .16s var(--pv-ease), color .16s var(--pv-ease);
}
.pv-pagination .page-numbers:hover { background: var(--pv-hover); color: var(--pv-text); }
.pv-pagination .page-numbers.current {
	background: var(--pv-accent); border-color: var(--pv-accent); color: #fff;
}
.pv-pagination .dots { border-color: transparent; }

.pv-empty {
	max-width: 460px;
	margin: 90px auto;
	text-align: center;
}
.pv-empty h2 { margin: 0 0 8px; font-size: 22px; letter-spacing: -.02em; }
.pv-empty p { margin: 0 0 20px; color: var(--pv-text-dim); }

/* ---------------------------------------------------------------
   13. Static pages
--------------------------------------------------------------- */
.pv-page {
	max-width: 760px;
	margin: 20px auto 0;
}
.pv-page h1 { font-size: 34px; letter-spacing: -.035em; margin: 0 0 20px; }
.pv-page .pv-body { color: var(--pv-text); }
.pv-page .pv-body p { margin: 0 0 16px; }

/* ---------------------------------------------------------------
   14. Responsive
--------------------------------------------------------------- */
@media (max-width: 1100px) {
	.pv-single { grid-template-columns: minmax(0, 1fr) 420px; }
	.pv-panel { padding: 24px 22px 28px; }
	.pv-title { font-size: 26px; }
}

@media (max-width: 900px) {
	.pv-rail {
		transform: translateX(-100%);
		transition: transform .28s var(--pv-ease);
		width: 300px;
		box-shadow: var(--pv-shadow);
	}
	body.pv-rail-open .pv-rail { transform: none; }
	.pv-main { margin-left: 0; padding-bottom: 60px; }
	.pv-topbar { display: flex; }
	.pv-scrim {
		position: fixed; inset: 0; z-index: 55;
		background: rgba(0, 0, 0, .55);
		opacity: 0; pointer-events: none;
		transition: opacity .28s var(--pv-ease);
	}
	body.pv-rail-open { overflow: hidden; }
	body.pv-rail-open .pv-scrim { opacity: 1; pointer-events: auto; }

	.pv-single {
		grid-template-columns: 1fr;
		margin: 0;
		border-bottom: 0;
	}
	.pv-stage { padding: 0 0 20px; }
	.pv-stage img { max-height: 70vh; margin: 0 auto; }
	.pv-back { position: static; margin-bottom: 14px; }
	.pv-panel { border-left: 0; padding: 0; }
	.pv-prompt { max-height: none; }
	.pv-explain { margin-top: 36px; }
	.pv-install { left: 50%; }
}

@media (max-width: 560px) {
	.pv-main { padding: 14px 12px 60px; }
	.pv-topbar { margin: -14px -12px 14px; }
	.pv-title { font-size: 23px; }
	.pv-body { font-size: 16px; }
	.pv-date { margin-left: 0; width: 100%; }
	.pv-install strong { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: .01ms !important;
		transition-duration: .01ms !important;
	}
	.pv-card:hover img { transform: none; }
}

/* ---------------------------------------------------------------
   15. Utility
--------------------------------------------------------------- */
[hidden] { display: none !important; }

.pv-comments { margin-top: 40px; }
.pv-comments h2 { font-size: 20px; letter-spacing: -.02em; }
.pv-comments ol { list-style: none; padding: 0; margin: 0; }
.pv-comments .comment-body {
	padding: 16px 18px;
	margin-bottom: 12px;
	background: var(--pv-surface);
	border: 1px solid var(--pv-line);
	border-radius: var(--pv-radius);
}
.pv-comments .children { padding-left: 22px; }
.pv-comments .comment-meta { font-size: 13px; color: var(--pv-text-dim); margin-bottom: 6px; }
.pv-comments input[type="text"],
.pv-comments input[type="email"],
.pv-comments input[type="url"],
.pv-comments textarea {
	width: 100%;
	padding: 12px 14px;
	background: var(--pv-surface);
	border: 1px solid var(--pv-line);
	border-radius: var(--pv-radius-sm);
	color: var(--pv-text);
	font: inherit;
}
.pv-comments .submit {
	padding: 12px 20px;
	background: var(--pv-accent);
	border: 0;
	border-radius: var(--pv-radius-sm);
	color: #fff;
	font-weight: 500;
}
