/* Forum — extends landing.css */

.ld-nav__link--active {
	color: var(--ld-text);
	border-color: var(--ld-accent);
	background: rgba(201, 162, 39, 0.1);
}

.ld-main--forum {
	display: block;
	width: min(1180px, 100%);
	padding-top: clamp(16px, 3vw, 32px);
	padding-bottom: clamp(24px, 4vw, 48px);
}

.fm-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 280px;
	gap: 24px;
	align-items: start;
}

.fm-layout--single {
	grid-template-columns: minmax(0, 1fr);
}

.fm-panel {
	padding: clamp(18px, 3vw, 28px);
	border-radius: var(--ld-radius);
	background: var(--ld-panel);
	border: 1px solid var(--ld-panel-border);
	box-shadow: var(--ld-shadow);
	backdrop-filter: blur(8px);
}

.fm-head {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 24px;
}

.fm-head__title {
	margin: 0;
	font-family: var(--ld-font-display);
	font-size: clamp(26px, 4vw, 34px);
	font-weight: 700;
	color: var(--ld-accent-bright);
	line-height: 1.15;
}

.fm-breadcrumb {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin: 0 0 20px;
	padding: 0;
	list-style: none;
	font-size: 14px;
	color: var(--ld-muted);
}

.fm-breadcrumb a {
	color: var(--ld-accent-bright);
	text-decoration: none;
}

.fm-breadcrumb a:hover {
	text-decoration: underline;
}

.fm-breadcrumb__sep {
	opacity: 0.45;
}

.fm-alert {
	margin-bottom: 20px;
	padding: 12px 14px;
	border-radius: var(--ld-radius-sm);
	font-size: 14px;
	line-height: 1.45;
}

.fm-alert--error {
	color: #ffd4d4;
	background: var(--ld-danger-bg);
	border: 1px solid rgba(212, 90, 90, 0.45);
}

.fm-alert--info {
	color: #dce8ff;
	background: rgba(90, 130, 212, 0.12);
	border: 1px solid rgba(90, 130, 212, 0.35);
}

.fm-alert--warn {
	color: #ffe8c4;
	background: rgba(201, 162, 39, 0.12);
	border: 1px solid rgba(201, 162, 39, 0.35);
}

.fm-alert a {
	color: var(--ld-accent-bright);
}

.fm-toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-bottom: 20px;
}

.fm-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 11px 18px;
	border: 0;
	border-radius: var(--ld-radius-sm);
	font: inherit;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
	text-decoration: none;
	transition: filter 0.15s, transform 0.15s;
}

.fm-btn--primary {
	color: #1a1410;
	background: linear-gradient(180deg, var(--ld-accent-bright) 0%, var(--ld-accent) 100%);
	box-shadow: 0 6px 18px rgba(201, 162, 39, 0.22);
}

.fm-btn--primary:hover {
	filter: brightness(1.05);
}

.fm-btn--ghost {
	color: var(--ld-text);
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(74, 59, 47, 0.85);
}

.fm-btn--ghost:hover {
	border-color: var(--ld-accent);
}

.fm-group {
	margin-bottom: 28px;
}

.fm-group:last-child {
	margin-bottom: 0;
}

.fm-group__title {
	margin: 0 0 14px;
	padding-bottom: 10px;
	border-bottom: 1px solid rgba(74, 59, 47, 0.65);
	font-family: var(--ld-font-display);
	font-size: 20px;
	font-weight: 700;
	color: var(--ld-accent-bright);
}

.fm-cats {
	display: grid;
	gap: 10px;
}

.fm-cat {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 14px 16px;
	border-radius: var(--ld-radius-sm);
	text-decoration: none;
	color: inherit;
	background: rgba(255, 255, 255, 0.03);
	border: 1px solid rgba(74, 59, 47, 0.65);
	transition: border-color 0.2s, background 0.2s, transform 0.15s;
}

.fm-cat:hover {
	border-color: var(--ld-accent);
	background: rgba(201, 162, 39, 0.06);
	transform: translateY(-1px);
}

.fm-cat__icon {
	flex-shrink: 0;
	width: 42px;
	height: 42px;
	display: grid;
	place-items: center;
	border-radius: 10px;
	font-size: 18px;
	background: rgba(201, 162, 39, 0.12);
	border: 1px solid rgba(201, 162, 39, 0.22);
}

.fm-cat__title {
	font-size: 16px;
	font-weight: 700;
	color: var(--ld-text);
}

.fm-empty {
	padding: 32px 20px;
	text-align: center;
	border-radius: var(--ld-radius-sm);
	color: var(--ld-muted);
	background: rgba(255, 255, 255, 0.02);
	border: 1px dashed rgba(74, 59, 47, 0.75);
}

.fm-topics {
	display: grid;
	gap: 10px;
}

.fm-topic {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 12px 16px;
	padding: 16px 18px;
	border-radius: var(--ld-radius-sm);
	background: rgba(255, 255, 255, 0.03);
	border: 1px solid rgba(74, 59, 47, 0.65);
	transition: border-color 0.2s;
}

.fm-topic:hover {
	border-color: rgba(201, 162, 39, 0.45);
}

.fm-topic__main {
	min-width: 0;
}

.fm-topic__badges {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 8px;
}

.fm-badge {
	display: inline-flex;
	align-items: center;
	padding: 3px 8px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.fm-badge--pin {
	color: #ffe8a3;
	background: rgba(201, 162, 39, 0.18);
	border: 1px solid rgba(201, 162, 39, 0.35);
}

.fm-badge--lock {
	color: #ffc9c9;
	background: rgba(212, 90, 90, 0.14);
	border: 1px solid rgba(212, 90, 90, 0.35);
}

.fm-topic__title {
	display: inline-block;
	margin: 0 0 8px;
	font-size: 17px;
	font-weight: 700;
	line-height: 1.35;
	color: var(--ld-accent-bright);
	text-decoration: none;
}

.fm-topic__title:hover {
	color: var(--ld-text);
	text-decoration: underline;
}

.fm-topic__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 16px;
	font-size: 13px;
	color: var(--ld-muted);
}

.fm-topic__meta b {
	color: var(--ld-text);
	font-weight: 600;
}

.fm-topic__stat {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	justify-content: center;
	gap: 4px;
	min-width: 72px;
	text-align: right;
}

.fm-topic__count {
	font-family: var(--ld-font-display);
	font-size: 22px;
	font-weight: 700;
	color: var(--ld-accent-bright);
	line-height: 1;
}

.fm-topic__count-label {
	font-size: 11px;
	color: var(--ld-muted);
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.fm-posts {
	display: grid;
	gap: 14px;
	margin-bottom: 24px;
}

.fm-post {
	display: grid;
	grid-template-columns: 160px minmax(0, 1fr);
	gap: 0;
	border-radius: var(--ld-radius-sm);
	overflow: hidden;
	border: 1px solid rgba(74, 59, 47, 0.75);
	background: rgba(255, 255, 255, 0.02);
}

.fm-post--starter {
	border-color: rgba(201, 162, 39, 0.35);
}

.fm-post__side {
	padding: 18px 14px;
	background: rgba(0, 0, 0, 0.22);
	border-right: 1px solid rgba(74, 59, 47, 0.55);
	text-align: center;
}

.fm-avatar {
	width: 56px;
	height: 56px;
	margin: 0 auto 10px;
	display: grid;
	place-items: center;
	border-radius: 50%;
	font-family: var(--ld-font-display);
	font-size: 24px;
	font-weight: 700;
	color: #1a1410;
	background: linear-gradient(180deg, var(--ld-accent-bright), var(--ld-accent));
	box-shadow: 0 4px 14px rgba(201, 162, 39, 0.25);
}

.fm-post__nick {
	font-size: 14px;
	font-weight: 700;
	color: var(--ld-text);
	word-break: break-word;
}

.fm-post__level {
	margin-top: 4px;
	font-size: 12px;
	color: var(--ld-muted);
}

.fm-post__body {
	padding: 18px 20px;
	min-width: 0;
}

.fm-post__date {
	margin-bottom: 12px;
	font-size: 12px;
	color: var(--ld-muted);
}

.fm-post__text {
	font-size: 15px;
	line-height: 1.65;
	color: var(--ld-text);
	word-wrap: break-word;
}

.fm-post__text img {
	max-width: 100%;
	height: auto;
}

.fm-form {
	margin-top: 24px;
	padding: 22px;
	border-radius: var(--ld-radius-sm);
	background: rgba(0, 0, 0, 0.18);
	border: 1px solid rgba(74, 59, 47, 0.75);
}

.fm-form[hidden] {
	display: none;
}

.fm-form__title {
	margin: 0 0 18px;
	font-family: var(--ld-font-display);
	font-size: 20px;
	color: var(--ld-accent-bright);
}

.fm-field {
	margin-bottom: 16px;
}

.fm-field label {
	display: block;
	margin-bottom: 8px;
	font-size: 13px;
	font-weight: 600;
	color: var(--ld-muted);
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.fm-input,
.fm-textarea {
	width: 100%;
	padding: 12px 14px;
	border-radius: var(--ld-radius-sm);
	border: 1px solid rgba(74, 59, 47, 0.95);
	background: rgba(15, 12, 10, 0.75);
	color: var(--ld-text);
	font: inherit;
}

.fm-textarea {
	min-height: 140px;
	resize: vertical;
}

.fm-input:focus,
.fm-textarea:focus {
	outline: none;
	border-color: var(--ld-accent);
	box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.18);
}

.fm-form__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.fm-sidebar {
	position: sticky;
	top: calc(var(--ld-header-h) + 16px);
}

.fm-sidebar__title {
	margin: 0 0 14px;
	font-size: 13px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--ld-muted);
}

.fm-sidegroup {
	margin-bottom: 18px;
}

.fm-sidegroup:last-child {
	margin-bottom: 0;
}

.fm-sidegroup__name {
	margin: 0 0 8px;
	font-size: 14px;
	font-weight: 700;
	color: var(--ld-accent-bright);
}

.fm-sidelink {
	display: block;
	padding: 8px 10px;
	margin-bottom: 4px;
	border-radius: 8px;
	font-size: 14px;
	color: var(--ld-muted);
	text-decoration: none;
	transition: background 0.15s, color 0.15s;
}

.fm-sidelink:hover {
	color: var(--ld-text);
	background: rgba(255, 255, 255, 0.04);
}

.fm-sidelink--active {
	color: var(--ld-text);
	background: rgba(201, 162, 39, 0.12);
	border: 1px solid rgba(201, 162, 39, 0.25);
}

.fm-mobile-nav {
	display: none;
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 30;
	grid-template-columns: repeat(4, 1fr);
	padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
	background: rgba(15, 12, 10, 0.94);
	backdrop-filter: blur(10px);
	border-top: 1px solid rgba(74, 59, 47, 0.75);
}

.fm-mobile-nav a {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	padding: 8px 4px;
	border-radius: 10px;
	font-size: 11px;
	font-weight: 600;
	color: var(--ld-muted);
	text-decoration: none;
}

.fm-mobile-nav a.is-active {
	color: var(--ld-accent-bright);
	background: rgba(201, 162, 39, 0.1);
}

.fm-mobile-nav__icon {
	font-size: 18px;
	line-height: 1;
}

@media (max-width: 960px) {
	.fm-layout {
		grid-template-columns: 1fr;
	}

	.fm-sidebar {
		position: static;
		order: -1;
	}

	.fm-post {
		grid-template-columns: 1fr;
	}

	.fm-post__side {
		display: flex;
		align-items: center;
		gap: 12px;
		text-align: left;
		border-right: 0;
		border-bottom: 1px solid rgba(74, 59, 47, 0.55);
	}

	.fm-avatar {
		width: 44px;
		height: 44px;
		margin: 0;
		font-size: 18px;
	}

	.fm-topic {
		grid-template-columns: 1fr;
	}

	.fm-topic__stat {
		flex-direction: row;
		align-items: center;
		justify-content: flex-start;
		gap: 8px;
	}

	.fm-mobile-nav {
		display: grid;
	}

	body.ld-body {
		padding-bottom: 72px;
	}
}

@media (max-width: 520px) {
	.fm-head {
		flex-direction: column;
		align-items: stretch;
	}

	.fm-toolbar .fm-btn {
		width: 100%;
	}
}
