/* Prophecy forum rich-text editor — shared between bbPress forms and
   the profile signature field on BuddyPress pages.
   Loaded via prophecy-forum-editor-style handle in both contexts. */

.pcy-forum-editor {
	border: 1px solid var(--border);
	border-radius: 8px;
	overflow: hidden;
	background: var(--bg2);
	transition: border-color .15s;
}

.pcy-forum-editor:focus-within {
	border-color: var(--accent);
}

.pcy-editor-toolbar {
	display: flex;
	align-items: center;
	gap: 2px;
	padding: 5px 8px;
	background: var(--bg3, #0d0d11);
	border-bottom: 1px solid var(--border);
	flex-wrap: wrap;
}

.pcy-tb-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 28px;
	height: 28px;
	padding: 0 4px;
	border: none;
	border-radius: 5px;
	background: transparent;
	color: var(--text3);
	cursor: pointer;
	font-size: .75rem;
	font-family: var(--font-ui);
	line-height: 1;
	transition: background .12s, color .12s;
	user-select: none;
	-webkit-user-select: none;
}

.pcy-tb-btn:hover {
	background: rgba(255,255,255,.07);
	color: var(--text);
}

.pcy-tb-btn.is-active {
	background: color-mix(in srgb, var(--accent) 18%, transparent);
	color: var(--accent);
}

.pcy-tb-bold   { font-weight: 800; font-family: Georgia, serif; font-size: .9rem; }
.pcy-tb-italic { font-style: italic; font-family: Georgia, serif; font-size: .9rem; }
.pcy-tb-under  { text-decoration: underline; }
.pcy-tb-strike { text-decoration: line-through; }
.pcy-tb-h2     { font-size: .65rem; font-weight: 700; letter-spacing: .04em; }

.pcy-tb-sep {
	width: 1px;
	height: 18px;
	background: var(--border);
	margin: 0 3px;
	flex-shrink: 0;
}

.pcy-editor-content {
	min-height: 130px;
	padding: 12px 14px;
	font-size: .875rem;
	color: var(--text);
	font-family: var(--font-ui);
	line-height: 1.65;
	outline: none;
	word-break: break-word;
}

/* Placeholder via CSS ::before */
.pcy-editor-content.is-empty:not(:focus)::before {
	content: attr(data-placeholder);
	color: var(--text3);
	pointer-events: none;
}

/* Formatted content inside the editor */
.pcy-editor-content h2 {
	font-size: 1.1rem;
	font-weight: 700;
	margin: .5em 0 .2em;
	color: var(--text);
}

.pcy-editor-content blockquote {
	border-left: 3px solid var(--accent);
	margin: .6em 0;
	padding: .3em 0 .3em 1em;
	color: var(--text3);
	font-style: italic;
}

.pcy-editor-content pre {
	background: var(--bg3, #0d0d11);
	border: 1px solid var(--border);
	border-radius: 5px;
	padding: .6em .85em;
	font-family: monospace;
	font-size: .82rem;
	overflow-x: auto;
	margin: .5em 0;
}

.pcy-editor-content code {
	background: var(--bg3, #0d0d11);
	padding: .1em .35em;
	border-radius: 3px;
	font-family: monospace;
	font-size: .85em;
}

.pcy-editor-content a {
	color: var(--accent);
	text-decoration: underline;
}

.pcy-editor-content ul,
.pcy-editor-content ol {
	padding-left: 1.6em;
	margin: .4em 0;
}

.pcy-editor-content ul { list-style: disc; }
.pcy-editor-content ol { list-style: decimal; }

.pcy-editor-content li {
	margin-bottom: .2em;
}

/* The hidden textarea that gets synced on submit */
.pcy-editor-hidden {
	display: none !important;
}

/* Signature variant — shorter height */
.pcy-forum-editor[data-mode="signature"] .pcy-editor-content {
	min-height: 60px;
}

/* Editor inside a bbPress form */
.bbp-form .pcy-forum-editor {
	margin-bottom: 0;
}

/* ── Editor v2 additions ─────────────────────────────────────────────── */
.pcy-editor-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; }
.pcy-tb-sep {
	width: 1px; height: 18px; margin: 0 5px;
	background: var(--border, rgba(255, 255, 255, .12)); flex-shrink: 0;
}
.pcy-tb-sel {
	background: var(--bg3, #161616); border: 1px solid var(--border, rgba(255, 255, 255, .12));
	border-radius: 6px; color: var(--text2, #aaa);
	font-family: var(--font-ui, 'Rajdhani'), sans-serif; font-size: .7rem; font-weight: 600;
	padding: 4px 6px; cursor: pointer; outline: none; max-width: 92px;
}
.pcy-tb-sel:hover { color: var(--text, #fff); }
.pcy-tb-colorwrap { position: relative; overflow: hidden; font-weight: 800; }
.pcy-tb-colorwrap::after {
	content: ''; position: absolute; left: 20%; right: 20%; bottom: 4px; height: 3px;
	border-radius: 2px; background: var(--accent, #FFF300);
}
.pcy-tb-color {
	position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.pcy-editor-source {
	width: 100%; min-height: 140px; resize: vertical;
	background: #0a0a0a; border: 1px solid rgba(255, 243, 0, .35);
	border-radius: 0 0 10px 10px; color: #d8ffd8;
	font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .76rem;
	line-height: 1.6; padding: 12px 14px; outline: none;
}
.pcy-forum-editor.is-source .pcy-tb-btn:not([data-cmd="toggleHtml"]),
.pcy-forum-editor.is-source .pcy-tb-sel { opacity: .35; pointer-events: none; }
.pcy-editor-content h2 { font-size: 1.25em; font-weight: 800; margin: .5em 0 .3em; }
.pcy-editor-content h3 { font-size: 1.1em; font-weight: 700; margin: .5em 0 .3em; }
.pcy-editor-content img { max-width: 100%; border-radius: 8px; }
.pcy-editor-content hr { border: none; border-top: 1px solid var(--border, rgba(255, 255, 255, .12)); margin: 12px 0; }

/* ── Emoji picker panel ──────────────────────────────────────────────── */
#pcyEmojiPanel {
	position: absolute; z-index: 99997; width: 320px;
	background: var(--bg2, #101010); border: 1px solid var(--borderl, rgba(255, 255, 255, .16));
	border-radius: 13px; box-shadow: 0 22px 60px rgba(0, 0, 0, .6);
	display: flex; flex-direction: column; overflow: hidden;
}
.pcy-ep-tabs {
	display: flex; gap: 2px; padding: 8px 9px;
	border-bottom: 1px solid var(--border, rgba(255, 255, 255, .1));
	background: var(--bg3, #161616);
}
.pcy-ep-tab {
	background: none; border: none; font-size: 1.05rem; cursor: pointer;
	padding: 5px 7px; border-radius: 8px; filter: grayscale(1); opacity: .6;
	transition: opacity .12s, background .12s, filter .12s;
}
.pcy-ep-tab:hover, .pcy-ep-tab.on { filter: none; opacity: 1; background: var(--bg2, #101010); }
.pcy-ep-body { height: 300px; overflow-y: auto; padding: 9px; scrollbar-width: thin; }
.pcy-ep-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.pcy-ep-e {
	background: none; border: none; font-size: 1.25rem; line-height: 1;
	padding: 6px 0; border-radius: 8px; cursor: pointer;
	transition: background .1s, transform .1s;
}
.pcy-ep-e:hover { background: var(--bg3, #1a1a1a); transform: scale(1.18); }
