/* ═══════════════════════════════════════════════════════════════════════════
   Prophecy — Native Forums (Phase 3)
   Loaded on forums-index.php, forum-single.php, topic-single.php
   (depends on profiles.css for shared pp-* components + forum-editor.css
   for the .pcy-forum-editor composer)
   ═══════════════════════════════════════════════════════════════════════════ */

.fm-page { padding-top: calc(var(--nav-h, 72px) + 40px); }

/* ── Breadcrumbs ──────────────────────────────────────────────────────── */
.fm-crumbs {
	display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
	font-family: var(--font-ui); font-size: .72rem; font-weight: 600;
	letter-spacing: .06em; text-transform: uppercase; margin-bottom: 22px;
}
.fm-crumbs a { color: var(--text3); text-decoration: none; transition: color .15s; }
.fm-crumbs a:hover { color: var(--accent); }
.fm-crumbs span { color: var(--text3); opacity: .5; }
.fm-crumbs strong { color: var(--text2); }

/* ── Index tree ───────────────────────────────────────────────────────── */
.fm-cat { margin-bottom: 26px; }
.fm-cat-head {
	font-family: var(--font-h); font-size: .8rem; font-weight: 700;
	letter-spacing: .14em; text-transform: uppercase; color: var(--accent);
	margin-bottom: 10px; padding-left: 2px;
}
.fm-rows {
	background: var(--bg2); border: 1px solid var(--border);
	border-radius: 13px; overflow: hidden; clip-path: var(--blade-sm);
}
.fm-row, .fm-topic {
	display: flex; align-items: center; gap: 16px;
	padding: 15px 18px; text-decoration: none;
	border-bottom: 1px solid var(--border);
	transition: background .15s;
}
.fm-row:last-child, .fm-topic:last-child { border-bottom: none; }
.fm-row:hover, .fm-topic:hover { background: var(--bg3); }
.fm-icon {
	width: 42px; height: 42px; border-radius: 11px; flex-shrink: 0;
	background: var(--bg3); border: 1px solid var(--border);
	display: flex; align-items: center; justify-content: center;
	font-size: 1.05rem;
}
.fm-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.fm-title {
	font-family: var(--font-ui); font-size: .92rem; font-weight: 700;
	color: var(--text); letter-spacing: .02em; display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
}
.fm-row:hover .fm-title, .fm-topic:hover .fm-title { color: var(--accent); }
.fm-desc {
	font-size: .74rem; color: var(--text3); line-height: 1.5;
	overflow: hidden; text-overflow: ellipsis;
	display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical;
}
.fm-badge {
	font-family: var(--font-ui); font-size: .58rem; font-weight: 700;
	letter-spacing: .1em; text-transform: uppercase;
	background: rgba(255, 243, 0, .08); color: var(--accent);
	border: 1px solid rgba(255, 243, 0, .22);
	padding: 1px 8px; border-radius: 12px;
}
.fm-badge--mut { background: var(--bg3); color: var(--text3); border-color: var(--border); }
.fm-badge--ann { background: rgba(59, 130, 246, .1); color: #60a5fa; border-color: rgba(59, 130, 246, .3); }
.fm-badge--sticky { background: rgba(34, 197, 94, .08); color: #4ade80; border-color: rgba(34, 197, 94, .25); }
.fm-cat-head--main {
	font-size: .92rem; letter-spacing: .16em; margin-top: 6px;
	padding-bottom: 8px; border-bottom: 1px solid rgba(255, 243, 0, .18);
}
.fm-row--sub { padding-left: 34px; background: rgba(255, 255, 255, .012); }
.fm-row--sub .fm-icon { opacity: .7; }
.fm-stats { display: flex; gap: 16px; flex-shrink: 0; }
.fm-stat {
	display: flex; flex-direction: column; align-items: center; gap: 1px;
	font-family: var(--font-ui); font-size: .62rem; color: var(--text3);
	letter-spacing: .08em; text-transform: uppercase; min-width: 52px;
}
.fm-stat strong { font-size: .92rem; color: var(--text); font-weight: 700; letter-spacing: 0; }
.fm-last { display: flex; flex-direction: column; gap: 2px; width: 190px; flex-shrink: 0; }
.fm-last-by { display: flex; align-items: center; gap: 9px; min-width: 0; }
.fm-last-by img.fm-last-av, .fm-last-av {
	width: 32px; height: 32px; border-radius: 50%; object-fit: cover;
	border: 1px solid var(--border); flex-shrink: 0;
}
.fm-last-info { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.fm-last-name {
	font-family: var(--font-ui); font-size: .74rem; font-weight: 700; color: var(--text);
	display: flex; align-items: center; gap: 6px;
	overflow: hidden; white-space: nowrap;
}
.fm-role-chip {
	font-size: .54rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
	color: var(--text3); border: 1px solid var(--border);
	padding: 0 6px; border-radius: 10px; flex-shrink: 0;
}
.fm-last-title {
	font-family: var(--font-ui); font-size: .68rem; font-weight: 600; color: var(--text2);
	overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.fm-last-time { font-family: var(--font-ui); font-size: .62rem; color: var(--text3); }

/* ── Topic list ───────────────────────────────────────────────────────── */
.fm-topics {
	background: var(--bg2); border: 1px solid var(--border);
	border-radius: 13px; overflow: hidden; clip-path: var(--blade-sm);
	margin-top: 8px;
}
.fm-topic--pinned { background: rgba(255, 243, 0, .03); }
.fm-topic-av img { border-radius: 50%; display: block; }
.fm-pin { font-size: .78rem; }
.fm-tag-filter { font-size: .78rem; color: var(--text3); margin-top: 10px; }
.fm-tag-filter a { color: var(--text3); margin-left: 8px; }
.fm-tagchip {
	display: inline-flex; font-family: var(--font-ui); font-size: .66rem;
	font-weight: 700; letter-spacing: .05em;
	background: var(--bg3); border: 1px solid var(--border); border-radius: 14px;
	color: var(--text2); padding: 2px 10px; text-decoration: none;
	transition: color .15s, border-color .15s;
}
a.fm-tagchip:hover { color: var(--accent); border-color: rgba(255, 243, 0, .4); }

/* ── Composer ─────────────────────────────────────────────────────────── */
.fm-composer { margin: 6px 0 26px; }
.fm-composer-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 12px; }

/* ── Topic head ───────────────────────────────────────────────────────── */
.fm-topic-head { margin-bottom: 22px; }
.fm-topic-title {
	font-family: var(--font-h); font-size: clamp(1.25rem, 3vw, 1.8rem);
	font-weight: 900; line-height: 1.25; margin: 0 0 8px;
}
.fm-topic-meta {
	display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
	font-family: var(--font-ui); font-size: .74rem; color: var(--text3); letter-spacing: .04em;
}
.fm-modbar { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 14px; }

/* ── Posts ────────────────────────────────────────────────────────────── */
.fm-posts { display: flex; flex-direction: column; gap: 14px; margin-bottom: 26px; }
.fm-post {
	display: flex; gap: 0;
	background: var(--bg2); border: 1px solid var(--border);
	border-radius: 13px; overflow: hidden; clip-path: var(--blade-sm);
	scroll-margin-top: calc(var(--nav-h, 72px) + 20px);
}
.fm-post--op { border-color: rgba(255, 243, 0, .22); }
.fm-post-author {
	width: 150px; flex-shrink: 0; padding: 18px 14px;
	background: var(--bg3); border-right: 1px solid var(--border);
	display: flex; flex-direction: column; align-items: center; gap: 7px;
	text-align: center;
}
.fm-post-author > a {
	display: flex; flex-direction: column; align-items: center; gap: 7px;
	text-decoration: none;
}
.fm-post-author img { border-radius: 50%; }
.fm-author-name {
	font-family: var(--font-ui); font-size: .82rem; font-weight: 700;
	color: var(--text); letter-spacing: .03em; word-break: break-word;
}
.fm-post-author a:hover .fm-author-name { color: var(--accent); }
.fm-author-tags { display: flex; flex-wrap: wrap; gap: 3px; justify-content: center; }
.fm-author-on { font-family: var(--font-ui); font-size: .6rem; color: #3ddc84; letter-spacing: .08em; }
.fm-post-main { flex: 1; min-width: 0; padding: 15px 20px 14px; display: flex; flex-direction: column; }
.fm-post-head {
	display: flex; align-items: center; justify-content: space-between;
	gap: 12px; margin-bottom: 12px;
}
.fm-post-time { font-family: var(--font-ui); font-size: .68rem; color: var(--text3); letter-spacing: .05em; }
.fm-post-time em { font-style: normal; opacity: .75; }
.fm-post-actions { display: flex; gap: 4px; align-items: center; }
.fm-post-link, .fm-act {
	background: none; border: none; color: var(--text3); cursor: pointer;
	font-size: .82rem; padding: 3px 7px; border-radius: 6px; text-decoration: none;
	transition: color .13s, background .13s;
}
.fm-post-link:hover, .fm-act:hover { color: var(--accent); background: var(--bg3); }
.fm-act--danger:hover { color: #ff5f56; }
.fm-post-content { font-size: .88rem; line-height: 1.75; color: var(--text2); word-wrap: break-word; }
.fm-post-content p { margin: 0 0 10px; }
.fm-post-content blockquote {
	border-left: 3px solid rgba(255, 243, 0, .4);
	background: var(--bg3); border-radius: 0 9px 9px 0;
	margin: 10px 0; padding: 10px 14px; color: var(--text3);
}
.fm-post-content pre {
	background: #0a0a0a; border: 1px solid var(--border); border-radius: 9px;
	padding: 12px 14px; overflow-x: auto; font-size: .8rem; margin: 10px 0;
}
.fm-post-content img { max-width: 100%; border-radius: 9px; }
.fm-post-content a { color: var(--accent); }
.fm-inline-edit .pcy-editor-content {
	background: var(--bg3); border: 1px solid rgba(255, 243, 0, .35);
	border-radius: 10px; padding: 11px 13px; outline: none;
	font-size: .86rem; line-height: 1.7; color: var(--text);
}

/* ── Reactions ────────────────────────────────────────────────────────── */
.fm-reacts { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.fm-react-list { display: flex; gap: 5px; flex-wrap: wrap; }
.fm-react {
	display: inline-flex; align-items: center; gap: 5px;
	background: var(--bg3); border: 1px solid var(--border); border-radius: 16px;
	color: var(--text2); font-size: .78rem; padding: 3px 10px; cursor: pointer;
	transition: border-color .13s, background .13s, transform .13s;
}
.fm-react em { font-style: normal; font-family: var(--font-ui); font-size: .66rem; font-weight: 700; color: var(--text3); }
.fm-react:hover { border-color: rgba(255, 243, 0, .4); transform: translateY(-1px); }
.fm-react.mine { background: rgba(255, 243, 0, .09); border-color: rgba(255, 243, 0, .38); }
.fm-react.mine em { color: var(--accent); }
.fm-react-add-wrap { position: relative; display: inline-flex; }
.fm-react-add { color: var(--text3); }
.fm-react-picker {
	position: absolute; bottom: calc(100% + 6px); left: 0; z-index: 40;
	display: none; gap: 3px; flex-wrap: wrap; width: 196px;
	background: var(--bg2); border: 1px solid var(--borderl, var(--border));
	border-radius: 11px; padding: 8px; box-shadow: 0 14px 40px rgba(0, 0, 0, .5);
}
.fm-react-add-wrap.open .fm-react-picker { display: flex; }
.fm-react-picker button {
	background: none; border: none; font-size: 1.05rem; cursor: pointer;
	padding: 5px 7px; border-radius: 8px; transition: background .12s;
}
.fm-react-picker button:hover { background: var(--bg3); }

/* ── Signature ────────────────────────────────────────────────────────── */
.pcy-signature {
	margin-top: 14px; padding-top: 11px;
	border-top: 1px dashed var(--border);
	font-size: .76rem; line-height: 1.6; color: var(--text3);
	overflow: hidden;
}
.pcy-signature img { max-width: 100%; border-radius: 8px; display: inline-block; }
.pcy-signature a { color: var(--accent); }

/* ── Embeds ───────────────────────────────────────────────────────────── */
.pcy-embed { display: block; margin: 12px 0; }
.pcy-embed--video {
	position: relative; width: 100%; max-width: 640px;
	aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden;
	border: 1px solid var(--border); background: #000;
}
.pcy-embed--video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.pcy-embed--card {
	display: flex; align-items: center; gap: 13px; max-width: 480px;
	background: var(--bg3); border: 1px solid var(--border);
	border-left: 3px solid var(--pe-accent, var(--accent));
	border-radius: 11px; padding: 11px 15px; text-decoration: none;
	transition: border-color .15s, transform .15s;
}
.pcy-embed--card:hover { transform: translateY(-1px); border-color: var(--pe-accent, var(--accent)); }
.pe-icon { font-size: 1.15rem; flex-shrink: 0; }
.pe-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.pe-body strong { font-family: var(--font-ui); font-size: .8rem; color: var(--text); letter-spacing: .03em; }
.pe-body em {
	font-style: normal; font-size: .68rem; color: var(--text3);
	overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pe-arrow { color: var(--text3); flex-shrink: 0; }

.fm-locked-note { text-align: center; color: var(--text3); font-size: .84rem; padding: 18px 0; }
.fm-locked-note a { color: var(--accent); }

/* ── Signature editor (profile modal) ─────────────────────────────────── */
.sig-mode-tabs { display: flex; gap: 6px; margin: 4px 0 12px; }
.sig-preview {
	background: var(--bg3); border: 1px dashed var(--border); border-radius: 10px;
	padding: 12px 14px; margin-top: 12px; min-height: 40px;
}
.sig-img-preview { max-height: 120px; border-radius: 8px; margin-top: 8px; display: block; }

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 820px) {
	.fm-last { display: none; }
	.fm-stats { gap: 10px; }
}
@media (max-width: 640px) {
	.fm-post { flex-direction: column; }
	.fm-post-author {
		width: 100%; flex-direction: row; justify-content: flex-start;
		text-align: left; padding: 11px 15px;
		border-right: none; border-bottom: 1px solid var(--border);
	}
	.fm-post-author > a { flex-direction: row; }
	.fm-author-tags { justify-content: flex-start; }
	.fm-stats { display: none; }
	.fm-icon { width: 36px; height: 36px; }
}
