/**
 * Theme Name: GeoHubNG Forum Styles
 * Description: Forum-specific styles for thread listings, reply trees,
 * nested threading, moderation controls, and like interactions.
 * Extends main.css custom properties.
 *
 * @package GeoHubNG
 * @version 1.0.0
 */

/* ============================================================
   FORUM LAYOUT
   ============================================================ */

.ghng-forum {
	min-height: calc(100vh - var(--ghng-header-height, 64px));
	padding: var(--ghng-space-6, 1.5rem) 0;
	background: var(--ghng-deep, #0A1628);
}

.ghng-forum-container {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 var(--ghng-space-4, 1rem);
}

/* ============================================================
   FORUM CATEGORY INDEX (page-forum.php)
   ============================================================ */

.ghng-forum-categories {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: var(--ghng-space-4, 1rem);
	margin-bottom: var(--ghng-space-8, 2rem);
}

.ghng-forum-category-card {
	background: var(--ghng-surface, #111E35);
	border: 1px solid var(--ghng-border, #1E2E48);
	border-radius: 12px;
	padding: var(--ghng-space-5, 1.25rem);
	transition: all 0.2s ease;
	text-decoration: none;
	color: inherit;
	display: block;
}

.ghng-forum-category-card:hover {
	border-color: var(--ghng-teal, #00C2A8);
	transform: translateY(-2px);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.ghng-forum-category-icon {
	width: 40px;
	height: 40px;
	border-radius: 10px;
	background: rgba(0, 194, 168, 0.08);
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--ghng-teal, #00C2A8);
	margin-bottom: var(--ghng-space-3, 0.75rem);
}

.ghng-forum-category-name {
	font-family: 'Space Grotesk', sans-serif;
	font-size: 1.0625rem;
	font-weight: 600;
	color: var(--ghng-white, #FFFFFF);
	margin: 0 0 var(--ghng-space-1, 0.25rem);
}

.ghng-forum-category-desc {
	font-size: 0.875rem;
	color: var(--ghng-muted, #7A8FA6);
	margin: 0 0 var(--ghng-space-3, 0.75rem);
	line-height: 1.5;
}

.ghng-forum-category-stats {
	display: flex;
	gap: var(--ghng-space-4, 1rem);
	font-size: 0.8125rem;
	color: var(--ghng-muted, #7A8FA6);
}

/* ============================================================
   THREAD LISTING (archive-ghng_thread.php / page-forum.php)
   ============================================================ */

.ghng-threads-list {
	background: var(--ghng-surface, #111E35);
	border: 1px solid var(--ghng-border, #1E2E48);
	border-radius: 12px;
	overflow: hidden;
}

.ghng-thread-row {
	display: grid;
	grid-template-columns: 48px 1fr 80px;
	align-items: center;
	gap: var(--ghng-space-4, 1rem);
	padding: var(--ghng-space-4, 1rem) var(--ghng-space-5, 1.25rem);
	border-bottom: 1px solid var(--ghng-border, #1E2E48);
	transition: background 0.15s ease;
	position: relative;
}

.ghng-thread-row:last-child {
	border-bottom: none;
}

.ghng-thread-row:hover {
	background: rgba(0, 194, 168, 0.02);
}

.ghng-thread-row-pinned {
	background: rgba(0, 194, 168, 0.04);
	border-left: 3px solid var(--ghng-teal, #00C2A8);
	padding-left: calc(var(--ghng-space-5, 1.25rem) - 3px);
}

.ghng-thread-row-locked {
	opacity: 0.7;
}

.ghng-thread-row-hot .ghng-stat-replies {
	color: var(--ghng-gold, #C9963A);
}

/* Status badges column */
.ghng-thread-status {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--ghng-space-2, 0.5rem);
}

.ghng-thread-badge {
	width: 32px;
	height: 32px;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.ghng-thread-badge-pinned {
	background: rgba(0, 194, 168, 0.12);
	color: var(--ghng-teal, #00C2A8);
}

.ghng-thread-badge-locked {
	background: rgba(122, 143, 166, 0.12);
	color: var(--ghng-muted, #7A8FA6);
}

.ghng-thread-badge-hot {
	background: rgba(201, 150, 58, 0.12);
	color: var(--ghng-gold, #C9963A);
}

.ghng-thread-badge-new {
	background: rgba(0, 194, 168, 0.08);
	color: var(--ghng-teal, #00C2A8);
}

/* Content column */
.ghng-thread-content {
	min-width: 0;
}

.ghng-thread-title {
	font-family: 'Space Grotesk', sans-serif;
	font-size: 1rem;
	font-weight: 500;
	margin: 0 0 var(--ghng-space-2, 0.5rem);
	line-height: 1.4;
}

.ghng-thread-title-link {
	color: var(--ghng-text, #E8EDF4);
	text-decoration: none;
}

.ghng-thread-title-link:hover {
	color: var(--ghng-teal, #00C2A8);
}

.ghng-thread-row-pinned .ghng-thread-title-link {
	font-weight: 600;
	color: var(--ghng-white, #FFFFFF);
}

.ghng-thread-meta {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: var(--ghng-space-2, 0.5rem) var(--ghng-space-3, 0.75rem);
	font-size: 0.8125rem;
	color: var(--ghng-muted, #7A8FA6);
}

.ghng-thread-author {
	display: inline-flex;
	align-items: center;
	gap: var(--ghng-space-2, 0.5rem);
}

.ghng-thread-avatar {
	width: 16px;
	height: 16px;
	border-radius: 50%;
	object-fit: cover;
}

.ghng-thread-author-link {
	color: var(--ghng-text, #E8EDF4);
	text-decoration: none;
	font-weight: 500;
}

.ghng-thread-author-link:hover {
	color: var(--ghng-teal, #00C2A8);
	text-decoration: underline;
}

.ghng-thread-posted,
.ghng-thread-forum {
	white-space: nowrap;
}

.ghng-thread-forum-link {
	color: var(--ghng-muted, #7A8FA6);
	text-decoration: none;
}

.ghng-thread-forum-link:hover {
	color: var(--ghng-teal, #00C2A8);
}

.ghng-thread-last-activity {
	font-size: 0.8125rem;
	color: var(--ghng-muted, #7A8FA6);
	margin-top: var(--ghng-space-1, 0.25rem);
}

.ghng-last-replier {
	color: var(--ghng-text, #E8EDF4);
	font-weight: 500;
}

/* Stats column */
.ghng-thread-stats {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: var(--ghng-space-2, 0.5rem);
}

.ghng-stat-replies,
.ghng-stat-views {
	display: inline-flex;
	align-items: center;
	gap: var(--ghng-space-1, 0.25rem);
	font-size: 0.8125rem;
	color: var(--ghng-muted, #7A8FA6);
}

.ghng-stat-value {
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

/* ============================================================
   SINGLE THREAD (single-ghng_thread.php)
   ============================================================ */

.ghng-thread-single {
	max-width: 900px;
	margin: 0 auto;
}

.ghng-thread-single-header {
	margin-bottom: var(--ghng-space-8, 2rem);
	padding-bottom: var(--ghng-space-6, 1.5rem);
	border-bottom: 1px solid var(--ghng-border, #1E2E48);
}

.ghng-thread-single-title {
	font-family: 'Space Grotesk', sans-serif;
	font-size: 1.75rem;
	font-weight: 600;
	color: var(--ghng-white, #FFFFFF);
	margin: 0 0 var(--ghng-space-4, 1rem);
	line-height: 1.3;
}

.ghng-thread-single-meta {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: var(--ghng-space-3, 0.75rem);
	font-size: 0.9375rem;
	color: var(--ghng-muted, #7A8FA6);
}

/* Thread actions bar */
.ghng-thread-actions-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: var(--ghng-space-6, 1.5rem);
	flex-wrap: wrap;
	gap: var(--ghng-space-3, 0.75rem);
}

.ghng-thread-reply-count {
	font-size: 0.9375rem;
	color: var(--ghng-muted, #7A8FA6);
}

.ghng-thread-reply-count strong {
	color: var(--ghng-text, #E8EDF4);
}

/* Reply form */
.ghng-reply-form-wrap {
	background: var(--ghng-surface, #111E35);
	border: 1px solid var(--ghng-border, #1E2E48);
	border-radius: 12px;
	padding: var(--ghng-space-6, 1.5rem);
	margin-bottom: var(--ghng-space-8, 2rem);
}

.ghng-reply-form-title {
	font-family: 'Space Grotesk', sans-serif;
	font-size: 1.125rem;
	font-weight: 600;
	color: var(--ghng-white, #FFFFFF);
	margin: 0 0 var(--ghng-space-4, 1rem);
}

.ghng-reply-textarea {
	width: 100%;
	min-height: 120px;
	padding: var(--ghng-space-4, 1rem);
	background: var(--ghng-deep, #0A1628);
	border: 1px solid var(--ghng-border, #1E2E48);
	border-radius: 8px;
	color: var(--ghng-white, #FFFFFF);
	font-size: 0.9375rem;
	font-family: 'Inter', sans-serif;
	line-height: 1.6;
	resize: vertical;
}

.ghng-reply-textarea:focus {
	outline: none;
	border-color: var(--ghng-teal, #00C2A8);
	box-shadow: 0 0 0 3px rgba(0, 194, 168, 0.1);
}

.ghng-reply-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-top: var(--ghng-space-3, 0.75rem);
	flex-wrap: wrap;
	gap: var(--ghng-space-3, 0.75rem);
}

.ghng-reply-formatting-help {
	font-size: 0.8125rem;
	color: var(--ghng-muted, #7A8FA6);
}

.ghng-reply-formatting-help code {
	background: var(--ghng-deep, #0A1628);
	padding: 2px 6px;
	border-radius: 4px;
	font-family: 'JetBrains Mono', monospace;
	font-size: 0.75rem;
}

/* ============================================================
   REPLY STYLES (template-parts/reply.php)
   ============================================================ */

.ghng-replies-list {
	display: flex;
	flex-direction: column;
	gap: var(--ghng-space-4, 1rem);
}

.ghng-reply {
	display: grid;
	grid-template-columns: 56px 1fr;
	gap: var(--ghng-space-4, 1rem);
	padding: var(--ghng-space-5, 1.25rem);
	background: var(--ghng-surface, #111E35);
	border: 1px solid var(--ghng-border, #1E2E48);
	border-radius: 12px;
	position: relative;
}

.ghng-reply-author {
	background: rgba(0, 194, 168, 0.04);
	border-color: rgba(0, 194, 168, 0.15);
}

.ghng-reply-deleted {
	opacity: 0.6;
	background: var(--ghng-deep, #0A1628);
}

.ghng-reply-nested {
	margin-left: var(--ghng-space-8, 2rem);
}

.ghng-reply-depth-1 {
	margin-left: var(--ghng-space-8, 2rem);
}

.ghng-reply-depth-2 {
	margin-left: calc(var(--ghng-space-8, 2rem) * 2);
}

.ghng-reply-depth-3 {
	margin-left: calc(var(--ghng-space-8, 2rem) * 3);
}

/* Author column */
.ghng-reply-author-col {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--ghng-space-2, 0.5rem);
}

.ghng-reply-avatar-link {
	display: block;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	overflow: hidden;
	flex-shrink: 0;
}

.ghng-reply-avatar {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.ghng-reply-avatar-placeholder {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: var(--ghng-border, #1E2E48);
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--ghng-muted, #7A8FA6);
}

.ghng-reply-role-badge {
	font-size: 0.625rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	padding: 2px 8px;
	border-radius: 4px;
	background: var(--ghng-gold, #C9963A);
	color: var(--ghng-deep, #0A1628);
}

.ghng-reply-role-moderator {
	background: var(--ghng-teal, #00C2A8);
}

/* Content column */
.ghng-reply-content-col {
	min-width: 0;
}

.ghng-reply-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	margin-bottom: var(--ghng-space-3, 0.75rem);
	gap: var(--ghng-space-3, 0.75rem);
}

.ghng-reply-author-info {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: var(--ghng-space-2, 0.5rem) var(--ghng-space-3, 0.75rem);
}

.ghng-reply-author-name {
	font-weight: 600;
	color: var(--ghng-white, #FFFFFF);
	text-decoration: none;
	font-size: 0.9375rem;
}

.ghng-reply-author-name:hover {
	color: var(--ghng-teal, #00C2A8);
	text-decoration: underline;
}

.ghng-reply-author-deleted {
	color: var(--ghng-muted, #7A8FA6);
	font-style: italic;
}

.ghng-reply-timestamp {
	font-size: 0.8125rem;
	color: var(--ghng-muted, #7A8FA6);
	text-decoration: none;
}

.ghng-reply-timestamp:hover {
	color: var(--ghng-text, #E8EDF4);
	text-decoration: underline;
}

.ghng-reply-edited {
	font-size: 0.75rem;
	color: var(--ghng-muted, #7A8FA6);
	font-style: italic;
}

/* Actions dropdown */
.ghng-reply-actions {
	position: relative;
}

.ghng-reply-actions-toggle {
	width: 32px;
	height: 32px;
	padding: 0;
}

.ghng-reply-actions-menu {
	position: absolute;
	top: 100%;
	right: 0;
	margin-top: var(--ghng-space-1, 0.25rem);
	background: var(--ghng-surface, #111E35);
	border: 1px solid var(--ghng-border, #1E2E48);
	border-radius: 8px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
	min-width: 160px;
	z-index: 100;
	padding: var(--ghng-space-1, 0.25rem);
}

.ghng-reply-actions-menu[hidden] {
	display: none;
}

.ghng-reply-action {
	display: block;
	width: 100%;
	padding: var(--ghng-space-2, 0.5rem) var(--ghng-space-3, 0.75rem);
	background: none;
	border: none;
	color: var(--ghng-text, #E8EDF4);
	font-size: 0.875rem;
	font-family: 'Inter', sans-serif;
	text-align: left;
	border-radius: 6px;
	cursor: pointer;
	transition: background 0.15s ease;
}

.ghng-reply-action:hover {
	background: rgba(0, 194, 168, 0.08);
}

.ghng-reply-action-danger {
	color: #EF4444;
}

.ghng-reply-action-danger:hover {
	background: rgba(239, 68, 68, 0.08);
}

/* Reply body */
.ghng-reply-body {
	font-size: 0.9375rem;
	line-height: 1.7;
	color: var(--ghng-text, #E8EDF4);
}

.ghng-reply-body p {
	margin: 0 0 var(--ghng-space-3, 0.75rem);
}

.ghng-reply-body p:last-child {
	margin-bottom: 0;
}

.ghng-reply-body a {
	color: var(--ghng-teal, #00C2A8);
	text-decoration: none;
}

.ghng-reply-body a:hover {
	text-decoration: underline;
}

.ghng-reply-body code {
	background: var(--ghng-deep, #0A1628);
	padding: 2px 6px;
	border-radius: 4px;
	font-family: 'JetBrains Mono', monospace;
	font-size: 0.875em;
	color: var(--ghng-gold, #C9963A);
}

.ghng-reply-body pre {
	background: var(--ghng-deep, #0A1628);
	padding: var(--ghng-space-4, 1rem);
	border-radius: 8px;
	overflow-x: auto;
	margin: var(--ghng-space-3, 0.75rem) 0;
}

.ghng-reply-body pre code {
	background: none;
	padding: 0;
	color: var(--ghng-text, #E8EDF4);
}

.ghng-reply-body blockquote {
	border-left: 3px solid var(--ghng-teal, #00C2A8);
	padding-left: var(--ghng-space-4, 1rem);
	margin: var(--ghng-space-3, 0.75rem) 0;
	color: var(--ghng-muted, #7A8FA6);
	font-style: italic;
}

.ghng-reply-body ul,
.ghng-reply-body ol {
	margin: var(--ghng-space-3, 0.75rem) 0;
	padding-left: var(--ghng-space-6, 1.5rem);
}

.ghng-reply-body li {
	margin-bottom: var(--ghng-space-1, 0.25rem);
}

.ghng-reply-deleted-note {
	color: var(--ghng-muted, #7A8FA6);
	font-style: italic;
	margin: 0;
}

/* @mention styling */
.ghng-mention {
	background: rgba(0, 194, 168, 0.08);
	padding: 1px 4px;
	border-radius: 4px;
	font-weight: 500;
}

/* Footer interactions */
.ghng-reply-footer {
	margin-top: var(--ghng-space-4, 1rem);
	padding-top: var(--ghng-space-3, 0.75rem);
	border-top: 1px solid var(--ghng-border, #1E2E48);
}

.ghng-reply-interactions {
	display: flex;
	align-items: center;
	gap: var(--ghng-space-2, 0.5rem);
}

.ghng-reply-like,
.ghng-reply-reply {
	color: var(--ghng-muted, #7A8FA6);
}

.ghng-reply-like:hover,
.ghng-reply-reply:hover {
	color: var(--ghng-text, #E8EDF4);
	background: var(--ghng-border, #1E2E48);
}

.ghng-reply-liked {
	color: #EF4444;
}

.ghng-reply-liked:hover {
	color: #F87171;
}

.ghng-like-count {
	font-size: 0.8125rem;
	font-weight: 500;
	margin-left: 2px;
}

/* ============================================================
   PAGINATION (Forum specific)
   ============================================================ */

.ghng-forum-pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: var(--ghng-space-1, 0.25rem);
	margin-top: var(--ghng-space-8, 2rem);
	padding-top: var(--ghng-space-6, 1.5rem);
	border-top: 1px solid var(--ghng-border, #1E2E48);
}

.ghng-forum-pagination a,
.ghng-forum-pagination span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	height: 36px;
	padding: 0 var(--ghng-space-3, 0.75rem);
	font-size: 0.875rem;
	font-weight: 500;
	border-radius: 8px;
	text-decoration: none;
	transition: all 0.15s ease;
}

.ghng-forum-pagination a {
	color: var(--ghng-text, #E8EDF4);
	background: var(--ghng-surface, #111E35);
	border: 1px solid var(--ghng-border, #1E2E48);
}

.ghng-forum-pagination a:hover {
	border-color: var(--ghng-teal, #00C2A8);
	color: var(--ghng-teal, #00C2A8);
}

.ghng-forum-pagination .current {
	background: var(--ghng-teal, #00C2A8);
	color: var(--ghng-deep, #0A1628);
	font-weight: 600;
}

.ghng-forum-pagination .dots {
	color: var(--ghng-muted, #7A8FA6);
}

/* ============================================================
   RATE LIMIT WARNING
   ============================================================ */

.ghng-rate-limit-warning {
	background: rgba(201, 150, 58, 0.08);
	border: 1px solid rgba(201, 150, 58, 0.2);
	border-radius: 8px;
	padding: var(--ghng-space-4, 1rem);
	margin-bottom: var(--ghng-space-4, 1rem);
	display: flex;
	align-items: center;
	gap: var(--ghng-space-3, 0.75rem);
	color: var(--ghng-gold, #C9963A);
	font-size: 0.9375rem;
}

/* ============================================================
   LOCKED THREAD NOTICE
   ============================================================ */

.ghng-thread-locked-notice {
	background: rgba(122, 143, 166, 0.08);
	border: 1px solid rgba(122, 143, 166, 0.2);
	border-radius: 8px;
	padding: var(--ghng-space-4, 1rem);
	margin-bottom: var(--ghng-space-6, 1.5rem);
	display: flex;
	align-items: center;
	gap: var(--ghng-space-3, 0.75rem);
	color: var(--ghng-muted, #7A8FA6);
	font-size: 0.9375rem;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
	.ghng-thread-row {
		grid-template-columns: 36px 1fr 60px;
		gap: var(--ghng-space-3, 0.75rem);
		padding: var(--ghng-space-3, 0.75rem);
	}

	.ghng-reply {
		grid-template-columns: 40px 1fr;
		gap: var(--ghng-space-3, 0.75rem);
		padding: var(--ghng-space-4, 1rem);
	}

	.ghng-reply-avatar-link,
	.ghng-reply-avatar-placeholder {
		width: 40px;
		height: 40px;
	}

	.ghng-reply-nested,
	.ghng-reply-depth-1,
	.ghng-reply-depth-2,
	.ghng-reply-depth-3 {
		margin-left: var(--ghng-space-4, 1rem);
	}

	.ghng-forum-categories {
		grid-template-columns: 1fr;
	}

	.ghng-thread-single-title {
		font-size: 1.375rem;
	}
}

@media (max-width: 480px) {
	.ghng-thread-row {
		grid-template-columns: 1fr;
	}

	.ghng-thread-status {
		flex-direction: row;
		order: 2;
	}

	.ghng-thread-stats {
		flex-direction: row;
		order: 3;
		align-items: center;
		justify-content: flex-start;
	}

	.ghng-reply {
		grid-template-columns: 1fr;
	}

	.ghng-reply-author-col {
		flex-direction: row;
		align-items: center;
	}

	.ghng-reply-role-badge {
		margin-left: auto;
	}
}