/* Romkert Házirend FAQ – frontend */

:root {
	--rhf-accent: #d4a94e;
	--rhf-z: 99990;
}

.rhf-widget,
.rhf-widget * {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

.rhf-widget {
	position: fixed;
	bottom: 24px;
	z-index: var(--rhf-z);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 15px;
	line-height: 1.5;
}

.rhf-pos-right { right: 24px; }
.rhf-pos-left  { left: 24px; }

/* ---------- Launcher button ---------- */

.rhf-launcher {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 13px 20px 13px 16px;
	border: 1px solid rgba(255, 255, 255, 0.14);
	border-radius: 999px;
	background: #14151a;
	color: #f5f0e6;
	font-size: 14.5px;
	font-weight: 600;
	letter-spacing: 0.02em;
	cursor: pointer;
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
	transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.rhf-launcher:hover,
.rhf-launcher:focus-visible {
	transform: translateY(-2px);
	border-color: var(--rhf-accent);
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

.rhf-launcher:focus-visible {
	outline: 2px solid var(--rhf-accent);
	outline-offset: 3px;
}

.rhf-launcher-icon {
	display: inline-flex;
	color: var(--rhf-accent);
}

/* ---------- Panel ---------- */

.rhf-panel {
	position: absolute;
	bottom: calc(100% + 14px);
	width: 380px;
	max-width: calc(100vw - 32px);
	max-height: min(70vh, 640px);
	display: flex;
	flex-direction: column;
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
	opacity: 0;
	transform: translateY(8px) scale(0.98);
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.rhf-pos-right .rhf-panel { right: 0; }
.rhf-pos-left .rhf-panel  { left: 0; }

.rhf-panel.is-open {
	opacity: 1;
	transform: translateY(0) scale(1);
}

@media (prefers-reduced-motion: reduce) {
	.rhf-panel,
	.rhf-launcher,
	.rhf-answer-inner {
		transition: none !important;
	}
}

/* Dark theme (default) */
.rhf-dark .rhf-panel {
	background: linear-gradient(175deg, #1b1c22 0%, #121317 100%);
	color: #ece7db;
	border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Light theme */
.rhf-light .rhf-panel {
	background: #ffffff;
	color: #23242a;
	border: 1px solid rgba(0, 0, 0, 0.08);
}

/* ---------- Header ---------- */

.rhf-panel-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	padding: 20px 20px 14px;
	border-bottom: 1px solid rgba(128, 128, 128, 0.18);
}

.rhf-title {
	font-size: 18px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--rhf-accent);
}

.rhf-subtitle {
	margin-top: 4px;
	font-size: 13px;
	opacity: 0.75;
}

.rhf-close {
	flex: none;
	width: 32px;
	height: 32px;
	border: none;
	border-radius: 50%;
	background: rgba(128, 128, 128, 0.15);
	color: inherit;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	transition: background 0.15s ease;
}

.rhf-close:hover,
.rhf-close:focus-visible {
	background: rgba(128, 128, 128, 0.3);
}

.rhf-close:focus-visible {
	outline: 2px solid var(--rhf-accent);
	outline-offset: 2px;
}

/* ---------- Search ---------- */

.rhf-search-wrap {
	padding: 12px 20px 0;
}

.rhf-search {
	width: 100%;
	padding: 9px 14px;
	border-radius: 10px;
	border: 1px solid rgba(128, 128, 128, 0.3);
	background: rgba(128, 128, 128, 0.08);
	color: inherit;
	font-size: 14px;
}

.rhf-search:focus {
	outline: none;
	border-color: var(--rhf-accent);
}

/* ---------- Topic pills ---------- */

.rhf-topics {
	display: flex;
	gap: 8px;
	padding: 14px 20px 10px;
	overflow-x: auto;
	scrollbar-width: thin;
}

.rhf-topic-pill {
	flex: none;
	padding: 7px 14px;
	border-radius: 999px;
	border: 1px solid rgba(128, 128, 128, 0.35);
	background: transparent;
	color: inherit;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	white-space: nowrap;
	transition: all 0.15s ease;
}

.rhf-topic-pill:hover {
	border-color: var(--rhf-accent);
}

.rhf-topic-pill.is-active {
	background: var(--rhf-accent);
	border-color: var(--rhf-accent);
	color: #16130a;
}

.rhf-topic-pill:focus-visible {
	outline: 2px solid var(--rhf-accent);
	outline-offset: 2px;
}

/* ---------- Q&A list ---------- */

.rhf-body {
	flex: 1;
	overflow-y: auto;
	padding: 6px 20px 16px;
	overscroll-behavior: contain;
}

.rhf-topic-group { display: none; }
.rhf-topic-group.is-active { display: block; }

/* During search we show everything that matches, across topics */
.rhf-widget.is-searching .rhf-topic-group { display: block; }
.rhf-widget.is-searching .rhf-item.rhf-hidden { display: none; }

.rhf-item {
	border-bottom: 1px solid rgba(128, 128, 128, 0.16);
}

.rhf-item:last-child { border-bottom: none; }

.rhf-question {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
	padding: 14px 2px;
	border: none;
	background: transparent;
	color: inherit;
	font-size: 14.5px;
	font-weight: 600;
	text-align: left;
	cursor: pointer;
}

.rhf-question:hover span:first-child {
	color: var(--rhf-accent);
}

.rhf-question:focus-visible {
	outline: 2px solid var(--rhf-accent);
	outline-offset: 2px;
	border-radius: 6px;
}

.rhf-chevron {
	flex: none;
	display: inline-flex;
	opacity: 0.6;
	transition: transform 0.2s ease;
}

.rhf-question[aria-expanded="true"] .rhf-chevron {
	transform: rotate(180deg);
	color: var(--rhf-accent);
	opacity: 1;
}

.rhf-answer-inner {
	padding: 0 2px 16px;
	font-size: 14px;
	line-height: 1.65;
	opacity: 0.88;
}

.rhf-answer-inner p + p { margin-top: 8px; }

.rhf-no-results {
	padding: 24px 0;
	text-align: center;
	opacity: 0.6;
	font-size: 14px;
}

/* ---------- Footer ---------- */

.rhf-footer {
	padding: 12px 20px 16px;
	border-top: 1px solid rgba(128, 128, 128, 0.18);
	font-size: 12.5px;
	opacity: 0.85;
}

.rhf-footer a {
	display: inline-block;
	margin-top: 6px;
	color: var(--rhf-accent);
	font-weight: 600;
	text-decoration: none;
}

.rhf-footer a:hover { text-decoration: underline; }

/* ---------- Mobile ---------- */

@media (max-width: 480px) {
	.rhf-widget { bottom: 16px; }
	.rhf-pos-right { right: 16px; }
	.rhf-pos-left  { left: 16px; }

	.rhf-panel {
		position: fixed;
		left: 16px !important;
		right: 16px !important;
		bottom: 84px;
		width: auto;
		max-height: calc(100vh - 120px);
	}

	/* Icon-only circular button when the panel is closed */
	.rhf-launcher {
		width: 56px;
		height: 56px;
		padding: 0;
		justify-content: center;
		border-radius: 50%;
	}

	.rhf-launcher-label {
		display: none;
	}

	.rhf-launcher-icon svg {
		width: 26px;
		height: 26px;
	}

	/* When the panel is open, expand back to the labelled pill */
	.rhf-widget.is-open .rhf-launcher {
		width: auto;
		height: auto;
		padding: 13px 20px 13px 16px;
		border-radius: 999px;
	}

	.rhf-widget.is-open .rhf-launcher-label {
		display: inline;
		max-width: 180px;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	.rhf-widget.is-open .rhf-launcher-icon svg {
		width: 22px;
		height: 22px;
	}
}
