/* ==========================================================================
   4L Périgord — Forum
   ========================================================================== */

.flp-forum-archive,
.flp-forum-single {
	width: min(1100px, calc(100% - 2rem));
	margin: 0 auto;
	padding: 2rem 0 3rem;
	color: var(--flp-text, #1a1a1a);
}

.flp-forum-header,
.flp-forum-topic__header {
	margin-bottom: 1.5rem;
}

.flp-forum-header {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 1.5rem;
}

.flp-forum-header__content {
	min-width: 0;
}

.flp-forum-header__actions {
	flex: 0 0 auto;
}

.flp-forum-cta,
.flp-forum-filters .flp-btn,
.flp-forum-form .flp-btn {
	width: auto;
}

.flp-forum-title,
.flp-forum-topic__header h1 {
	margin: 0 0 0.45rem;
	font-size: clamp(1.8rem, 2.8vw, 2.6rem);
	line-height: 1.15;
}

.flp-forum-intro,
.flp-forum-topic__meta,
.flp-forum-topic-row__meta,
.flp-forum-reply time {
	color: #5f6b7a;
}

.flp-forum-notice {
	padding: 0.9rem 1rem;
	margin: 0 0 1rem;
	border-radius: 6px;
	font-weight: 700;
}

.flp-forum-notice--success {
	background: #e5f7e8;
	color: #1a7a1a;
}

.flp-forum-notice--error {
	background: #fde8e8;
	color: #c0000e;
}

.flp-forum-filters,
.flp-forum-form {
	display: grid;
	gap: 0.85rem;
}

.flp-forum-filters {
	grid-template-columns: minmax(180px, 1fr) minmax(160px, 260px) auto auto;
	align-items: center;
	margin-bottom: 1.5rem;
	padding: 0.8rem;
	border: 1px solid var(--flp-border, #cdd4e0);
	border-radius: 8px;
	background: #fff;
}

.flp-forum-filters input,
.flp-forum-filters select,
.flp-forum-form input[type="text"],
.flp-forum-form select {
	width: 100%;
	min-height: 42px;
	padding: 0.65rem 0.75rem;
	border: 1px solid var(--flp-border, #cdd4e0);
	border-radius: 6px;
	background: #fff;
	color: var(--flp-text, #1a1a1a);
}

.flp-forum-panel {
	padding: 1.2rem;
	margin: 0 0 1.5rem;
	border: 1px solid var(--flp-border, #cdd4e0);
	border-radius: 8px;
	background: #fff;
}

.flp-forum-panel h2,
.flp-forum-replies h2 {
	margin: 0 0 1rem;
	font-size: 1.25rem;
	line-height: 1.25;
}

.flp-forum-section-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 0.2rem;
}

.flp-forum-section-head h2 {
	margin: 0;
	font-size: 1.25rem;
	line-height: 1.25;
}

.flp-forum-section-head span {
	color: #5f6b7a;
	font-size: 0.92rem;
	font-weight: 800;
}

.flp-forum-form p {
	margin: 0;
}

.flp-forum-form label,
.flp-forum-editor label {
	display: block;
	margin-bottom: 0.4rem;
	font-weight: 800;
}

.flp-forum-editor .wp-editor-wrap {
	border: 1px solid var(--flp-border, #cdd4e0);
	border-radius: 6px;
	overflow: hidden;
}

.flp-forum-topic-list {
	display: grid;
	gap: 0.85rem;
}

.flp-forum-topic-row {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	gap: 1rem;
	align-items: center;
	padding: 1rem;
	border: 1px solid var(--flp-border, #cdd4e0);
	border-radius: 8px;
	background: #fff;
}

.flp-forum-topic-row__avatar {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	align-self: start;
	text-decoration: none;
}

.flp-forum-topic-row--pinned {
	border-color: var(--flp-primary, #1a56c4);
	box-shadow: inset 4px 0 0 var(--flp-primary, #1a56c4);
}

.flp-forum-topic-row__badges {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin-bottom: 0.35rem;
}

.flp-forum-badge {
	display: inline-flex;
	align-items: center;
	min-height: 1.55rem;
	padding: 0.15rem 0.45rem;
	border-radius: 999px;
	background: #e8effd;
	color: var(--flp-primary-dark, #1240a0);
	font-size: 0.8rem;
	font-weight: 800;
	text-decoration: none;
}

.flp-forum-badge--muted {
	background: #eef1f5;
	color: #4d5a68;
}

.flp-forum-badge--cat {
	background: #f4f6fb;
	color: #334155;
}

.flp-forum-topic-row__title {
	margin: 0;
	font-size: 1.15rem;
	line-height: 1.3;
}

.flp-forum-topic-row__title a {
	color: inherit;
	text-decoration: none;
}

.flp-forum-topic-row__title a:hover,
.flp-forum-reset:hover,
.flp-forum-back a:hover,
.flp-forum-actions a:hover {
	text-decoration: underline;
}

.flp-forum-topic-row__excerpt {
	margin: 0.35rem 0 0;
	color: #334155;
	line-height: 1.45;
}

.flp-forum-topic-row__meta {
	margin: 0.3rem 0 0;
	font-size: 0.92rem;
}

.flp-forum-topic-row__stats {
	display: grid;
	justify-items: end;
	min-width: 96px;
	color: #4d5a68;
	font-size: 0.88rem;
}

.flp-forum-topic-row__stats strong {
	color: var(--flp-text, #1a1a1a);
	font-size: 1.4rem;
	line-height: 1;
}

.flp-forum-topic-row__stats small {
	margin-top: 0.25rem;
	font-size: 0.78rem;
}

.flp-forum-pagination {
	margin-top: 1rem;
}

.flp-forum-topic,
.flp-forum-reply {
	padding: 1.2rem;
	margin-bottom: 1rem;
	border: 1px solid var(--flp-border, #cdd4e0);
	border-radius: 8px;
	background: #fff;
}

.flp-forum-topic__header {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	gap: 1rem;
	align-items: start;
}

.flp-forum-topic__heading {
	min-width: 0;
}

.flp-forum-topic__content,
.flp-forum-reply__content {
	line-height: 1.65;
}

.flp-forum-topic__content > :first-child,
.flp-forum-reply__content > :first-child {
	margin-top: 0;
}

.flp-forum-topic__content > :last-child,
.flp-forum-reply__content > :last-child {
	margin-bottom: 0;
}

.flp-forum-replies {
	margin-top: 1.5rem;
}

.flp-forum-reply__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 0.8rem;
}

.flp-forum-reply__author {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	min-width: 0;
}

.flp-forum-avatar {
	width: 48px;
	height: 48px;
	border-radius: 999px;
}

.flp-forum-avatar--topic {
	width: 44px;
	height: 44px;
}

.flp-forum-avatar--topic-single {
	width: 56px;
	height: 56px;
}

.flp-forum-actions,
.flp-forum-back {
	margin: 0.9rem 0 0;
}

.flp-forum-actions a,
.flp-forum-back a,
.flp-forum-reset {
	color: var(--flp-primary-dark, #1240a0);
	font-weight: 800;
	text-decoration: none;
}

.flp-forum-login,
.flp-forum-empty {
	margin: 0;
	padding: 0.9rem 1rem;
	border-radius: 6px;
	background: #f4f6fb;
	color: #334155;
}

.flp-forum-login a {
	color: var(--flp-primary-dark, #1240a0);
	font-weight: 800;
}

@media (max-width: 760px) {
	.flp-forum-header,
	.flp-forum-filters,
	.flp-forum-topic-row {
		grid-template-columns: 1fr;
	}

	.flp-forum-header {
		align-items: stretch;
		flex-direction: column;
	}

	.flp-forum-header__actions,
	.flp-forum-cta {
		width: 100%;
	}

	.flp-forum-topic-row__stats {
		justify-items: start;
	}

	.flp-forum-topic__header {
		grid-template-columns: 1fr;
	}

	.flp-forum-reply__header {
		align-items: flex-start;
		flex-direction: column;
	}
}
