/**
 * Full-page community chat — room layout (widget styles stay in flock.css).
 */

/* Hide duplicate WordPress page title when shortcode owns the header */
body.hlp-has-community-chat .entry-header,
body.hlp-has-community-chat .page-header {
	display: none !important;
}

body.hlp-has-community-chat .wp-site-blocks main.wp-block-group {
	margin-top: clamp(0.5rem, 1.5vw, 1rem) !important;
}

body.hlp-has-community-chat .wp-site-blocks main.wp-block-group > .wp-block-group.alignfull:first-child {
	padding-top: clamp(0.35rem, 1vw, 0.75rem) !important;
	padding-bottom: clamp(1rem, 3vw, 2rem) !important;
}

body.hlp-has-community-chat .wp-block-post-content,
body.hlp-has-community-chat .entry-content {
	max-width: none;
	margin: 0;
	padding-left: clamp(0.5rem, 2vw, 1rem);
	padding-right: clamp(0.5rem, 2vw, 1rem);
}

/* Page shell */
.hlp-chat-page {
	--hlp-chat-max: min(56rem, 100%);
	--hlp-chat-bg: rgba(8, 8, 10, 0.92);
	--hlp-chat-surface: rgba(18, 18, 22, 0.98);
	--hlp-chat-border: rgba(212, 175, 55, 0.22);
	--hlp-chat-gold: var(--flock-gold, #d4af37);
	--hlp-chat-gold-bright: var(--flock-gold-bright, #e8c547);
	--hlp-chat-ink: var(--flock-ink, #e8e0d0);
	--hlp-chat-muted: rgba(232, 224, 208, 0.55);
	--hlp-chat-bubble: rgba(255, 255, 255, 0.06);
	--hlp-chat-bubble-own: rgba(212, 175, 55, 0.14);
	max-width: var(--hlp-chat-max);
	margin: 0 auto;
	font-family: "DM Sans", var(--flock-body, system-ui, sans-serif);
}

.hlp-community-chat--full {
	display: flex;
	flex-direction: column;
	min-height: min(calc(100dvh - 10rem), 820px);
	background: var(--hlp-chat-bg);
	border: 1px solid var(--hlp-chat-border);
	border-radius: 16px;
	overflow: hidden;
	box-shadow:
		0 0 0 1px rgba(0, 0, 0, 0.4),
		0 20px 50px rgba(0, 0, 0, 0.55);
}

/* Toolbar */
.hlp-chat-toolbar {
	display: grid;
	grid-template-columns: auto 1fr auto;
	align-items: center;
	gap: 0.75rem 1rem;
	padding: 0.85rem 1.1rem;
	background: linear-gradient(180deg, rgba(212, 175, 55, 0.1), rgba(212, 175, 55, 0.03));
	border-bottom: 1px solid var(--hlp-chat-border);
	flex-shrink: 0;
}

.hlp-chat-toolbar__back {
	font-size: 0.8rem;
	font-weight: 600;
	color: var(--hlp-chat-gold-bright);
	text-decoration: none;
	white-space: nowrap;
}

.hlp-chat-toolbar__back:hover {
	text-decoration: underline;
	color: var(--hlp-chat-gold);
}

.hlp-chat-toolbar__center {
	min-width: 0;
	text-align: center;
}

.hlp-chat-toolbar__title {
	margin: 0;
	font-family: var(--flock-display, "Orbitron", system-ui, sans-serif);
	font-size: clamp(0.95rem, 2.8vw, 1.15rem);
	font-weight: 700;
	letter-spacing: 0.06em;
	color: var(--hlp-chat-gold-bright);
	text-transform: none;
}

.hlp-chat-toolbar__sub {
	margin: 0.2rem 0 0;
	font-size: 0.75rem;
	color: var(--hlp-chat-muted);
	letter-spacing: 0.02em;
}

.hlp-chat-toolbar__live {
	font-size: 0.65rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: #1a1208;
	background: linear-gradient(180deg, var(--hlp-chat-gold-bright), var(--hlp-chat-gold));
	padding: 0.3rem 0.55rem;
	border-radius: 999px;
	line-height: 1;
}

/* Room */
.hlp-chat-room {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-height: 0;
	background: var(--hlp-chat-surface);
}

.hlp-chat-history {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-height: 0;
}

.hlp-chat-history__top {
	flex-shrink: 0;
	padding: 0.65rem 1rem 0.25rem;
	text-align: center;
}

.hlp-chat-load-more {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.4rem 0.9rem;
	font-family: inherit;
	font-size: 0.78rem;
	font-weight: 600;
	color: var(--hlp-chat-gold-bright);
	background: transparent;
	border: 1px solid rgba(212, 175, 55, 0.3);
	border-radius: 999px;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease;
}

.hlp-chat-load-more:hover:not(:disabled) {
	background: rgba(212, 175, 55, 0.1);
	border-color: rgba(212, 175, 55, 0.5);
}

.hlp-chat-load-more:disabled {
	opacity: 0.5;
	cursor: wait;
}

.hlp-chat-feed__start {
	margin: 0.25rem 0 0;
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--hlp-chat-muted);
}

.hlp-chat-feed__start::before,
.hlp-chat-feed__start::after {
	content: "";
	display: inline-block;
	vertical-align: middle;
	width: 2.5rem;
	height: 1px;
	background: rgba(212, 175, 55, 0.25);
	margin: 0 0.5rem;
}

/* Message feed — full page overrides */
.hlp-community-chat--full .hlp-chat-feed {
	flex: 1 1 auto;
	min-height: 240px;
	max-height: none;
	overflow-y: auto;
	padding: 0.5rem 1rem 1rem;
	display: flex;
	flex-direction: column;
	gap: 0.65rem;
	scroll-behavior: smooth;
}

.hlp-community-chat--full .flock-chat__msg {
	display: flex;
	gap: 0.6rem;
	align-items: flex-start;
	max-width: 92%;
}

.hlp-community-chat--full .flock-chat__msg--own {
	flex-direction: row-reverse;
	margin-left: auto;
	max-width: 88%;
}

.hlp-community-chat--full .flock-chat__avatar {
	width: 2.25rem;
	height: 2.25rem;
	font-size: 0.8rem;
	border: 2px solid rgba(212, 175, 55, 0.35);
}

.hlp-community-chat--full .flock-chat__msg--own .flock-chat__avatar {
	background: linear-gradient(135deg, var(--hlp-chat-gold), var(--hlp-chat-gold-bright));
}

.hlp-community-chat--full .flock-chat__body {
	flex: 1;
	min-width: 0;
	background: var(--hlp-chat-bubble);
	border: 1px solid rgba(255, 255, 255, 0.06);
	border-radius: 12px 12px 12px 4px;
	padding: 0.5rem 0.75rem 0.6rem;
}

.hlp-community-chat--full .flock-chat__msg--own .flock-chat__body {
	background: var(--hlp-chat-bubble-own);
	border-color: rgba(212, 175, 55, 0.2);
	border-radius: 12px 12px 4px 12px;
}

.hlp-community-chat--full .flock-chat__meta {
	flex-wrap: wrap;
	gap: 0.35rem 0.5rem;
	margin-bottom: 0.2rem;
}

.hlp-community-chat--full .flock-chat__msg--own .flock-chat__meta {
	flex-direction: row-reverse;
}

.hlp-community-chat--full .flock-chat__meta strong {
	font-size: 0.8rem;
	font-weight: 600;
	color: var(--hlp-chat-gold-bright);
}

.hlp-community-chat--full .flock-chat__meta time {
	font-size: 0.68rem;
	color: var(--hlp-chat-muted);
}

.hlp-community-chat--full .flock-chat__body p {
	margin: 0;
	font-size: 0.9rem;
	line-height: 1.5;
	color: rgba(232, 224, 208, 0.92);
	word-break: break-word;
}

.hlp-community-chat--full .flock-chat__status {
	padding: 2rem 1rem;
	color: var(--hlp-chat-muted);
}

/* Composer */
.hlp-chat-composer-bar {
	flex-shrink: 0;
	padding: 0.65rem 1rem 0.85rem;
	border-top: 1px solid var(--hlp-chat-border);
	background: rgba(0, 0, 0, 0.35);
}

.hlp-chat-composer-bar__hint {
	margin: 0 0 0.5rem;
	font-size: 0.78rem;
	text-align: center;
	color: var(--hlp-chat-muted);
}

.hlp-chat-composer-bar__hint a {
	color: var(--hlp-chat-gold-bright);
	font-weight: 600;
}

.hlp-community-chat--full .flock-chat__composer {
	padding: 0;
	border: none;
	gap: 0.55rem;
}

.hlp-community-chat--full .flock-chat__composer input,
.hlp-community-chat--full .hlp-chat-input {
	flex: 1;
	min-height: 2.75rem;
	padding: 0.65rem 1rem;
	font-size: 0.9rem;
	background: rgba(0, 0, 0, 0.5);
	border: 1px solid var(--hlp-chat-border);
	border-radius: 12px;
	color: var(--hlp-chat-ink);
}

.hlp-community-chat--full .flock-chat__composer input:focus,
.hlp-community-chat--full .hlp-chat-input:focus {
	outline: none;
	border-color: rgba(212, 175, 55, 0.55);
	box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.15);
}

.hlp-community-chat--full .hlp-chat-send {
	width: 2.75rem;
	height: 2.75rem;
	border-radius: 12px;
	flex-shrink: 0;
}

.hlp-community-chat--full .hlp-chat-send__icon {
	display: block;
	line-height: 1;
}

@media (max-width: 767px) {
	.hlp-chat-page {
		--hlp-chat-max: 100%;
	}

	body.hlp-has-community-chat .wp-block-post-content,
	body.hlp-has-community-chat .entry-content {
		padding-left: 0;
		padding-right: 0;
	}

	.hlp-community-chat--full {
		min-height: calc(100dvh - 7.5rem);
		border-radius: 0;
		border-left: none;
		border-right: none;
	}

	.hlp-chat-toolbar {
		padding: 0.75rem 0.85rem;
	}

	.hlp-community-chat--full .flock-chat__msg,
	.hlp-community-chat--full .flock-chat__msg--own {
		max-width: 96%;
	}
}
