/*
 * FAQ content styles – #faq, search results, imgbox/vidbox, spinner
 */

#faq {
	position: relative;
}

#faq h1 {
	font-size: 1.75rem;
	font-weight: 700;
	color: var(--color-text, #3d3730);
	margin: 0 0 1.5rem;
	line-height: 1.3;
}

#faq p {
	margin: 0 0 0.75rem;
}

#faq p:empty::after {
	content: "\00a0";
}

#faq p:last-child {
	margin-bottom: 0;
}

/* Tables (Confluence-style) */
#faq table {
	border-collapse: collapse;
	width: 100%;
	margin: 1rem 0;
	font-size: 0.9375rem;
}

#faq th,
#faq td {
	border: 1px solid var(--color-border, #e5dfd5);
	vertical-align: top;
	padding: 0.5rem 0.75rem;
}

#faq th {
	font-weight: 600;
	background: var(--color-bg-alt, #efeae2);
	color: var(--color-text, #3d3730);
}

#faq td.highlight-grey,
#faq tbody tr:nth-child(even) td {
	background: var(--color-bg-alt, #efeae2);
}

/* Links */
#faq a,
#faq a span {
	color: var(--color-primary, #e6007e) !important;
	text-decoration: none;
}

#faq a:hover {
	text-decoration: underline;
}

/* Search results */
.search-results-wrap {
	margin-top: 0.5rem;
}

.search-filter {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-items: center;
	margin: 0 0 1.5rem;
	padding: 0.75rem 1rem;
	border: 1px solid var(--color-border, #e8e7e6);
	border-radius: var(--radius, 8px);
	background: var(--color-bg-alt, #f8f6f4);
}

.search-filter-option {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.4rem 0.9rem;
	border-radius: var(--radius-sm, 6px);
	border: 1px solid transparent;
	background: transparent;
	color: var(--color-text-muted, #737270);
	font-size: 0.9375rem;
	font-weight: 400;
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease;
}

.search-filter-option:hover {
	background: var(--color-bg-alt, #f0f0ef);
	color: var(--color-text-secondary, #4a4948);
}

.search-filter-option:has(input:checked) {
	background: var(--color-bg-card, #fff);
	color: var(--color-text, #1f1f1e);
	font-weight: 500;
}

.search-filter-option:has(input:focus-visible) {
	outline: 1px solid var(--color-primary, #e6007e);
	outline-offset: 2px;
}

.search-filter-option input {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.search-results-sections {
	margin-bottom: 1.5rem;
}

.search-results-section {
	margin-bottom: 2rem;
}

.search-results-section:last-of-type {
	margin-bottom: 0;
}

.search-results-section-title {
	font-size: 1rem;
	font-weight: 600;
	color: var(--color-text-muted, #737270);
	margin: 0 0 0.75rem;
	padding-bottom: 0.5rem;
	border-bottom: 1px solid var(--color-border, #e8e7e6);
	letter-spacing: 0.02em;
}

.match {
	padding: 0.75rem 0;
	border-bottom: 1px solid var(--color-border-light, #ebe6dd);
}

.match:last-child {
	border-bottom: none;
}

/* Treffer, bei denen der Suchbegriff im Seitentitel vorkommt */
.match--title-hit {
	padding: 0.75rem 1rem 0.75rem 1rem;
	margin: 0 0 0.5rem 0;
	border-left: 3px solid var(--color-primary, #e6007e);
	background: var(--color-primary-light, rgba(230, 0, 126, 0.06));
	border-radius: 0 var(--radius-sm, 6px) var(--radius-sm, 6px) 0;
	box-sizing: border-box;
}

.match--title-hit:last-child {
	margin-bottom: 0;
}

/* Abstand zwischen Sektion und erstem Treffer konsistent */
.search-results-section .match:first-child,
.search-results-section .match--title-hit:first-child {
	margin-top: 0;
}

/* Keine Suchergebnisse – Hinweis auf Loony */
.search-no-results {
	margin-top: 1rem;
	padding: 1.5rem;
	background: var(--color-bg-alt, #f8f6f4);
	border: 1px solid var(--color-border-light, #ebe6dd);
	border-radius: var(--radius-sm, 6px);
}

.search-no-results p {
	margin: 0 0 0.75rem;
}

.search-no-results p:last-of-type {
	margin-bottom: 1rem;
}

.search-no-results .superchat-trigger {
	margin-top: 0.5rem;
}

.match a {
	font-size: 1.0625rem;
	font-weight: 500;
}

.match .hlight {
	background: rgba(230, 0, 126, 0.15);
	padding: 0.1em 0.2em;
	border-radius: 2px;
}

.match p {
	margin: 0.35rem 0 0;
	font-size: 0.9375rem;
	color: var(--color-text-secondary, #5c5349);
}

/* Imgbox / Vidbox */
#faq .imgbox,
#faq .vidbox {
	display: inline-block;
	position: relative;
	margin: 0.5rem 0.5rem 0.5rem 0;
}

#faq .imgbox-image,
#faq .vidbox-image {
	overflow: hidden;
	border: 1px solid var(--color-border, #e5dfd5);
	border-radius: var(--radius, 8px);
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#faq .imgbox-image:hover,
#faq .vidbox-image:hover {
	border-color: var(--color-primary, #e6007e);
	box-shadow: 0 0 0 2px rgba(230, 0, 126, 0.15);
}

#faq .vidbox-image {
	width: 200px;
	height: 140px;
}

#faq .imgbox-image img {
	width: auto;
	height: auto;
	max-width: 100%;
	display: block;
}

#faq .vidbox-image img {
	width: 200px;
	height: auto;
	display: block;
}

#faq .imgbox-mag,
#faq .vidbox-mag {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.35);
	text-align: center;
	display: none;
	background-image: url("./luppe.png");
	background-repeat: no-repeat;
	background-position: center;
	cursor: pointer;
	border-radius: var(--radius, 8px);
}

#faq .vidbox-mag {
	background-image: none;
}

/* Spinner / Loader */
#loader {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(250, 250, 250, 0.92);
	z-index: 9002;
	display: none;
}

#loader #spinner {
	position: absolute;
	margin: auto;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	width: 48px;
	height: 48px;
	border: 4px solid var(--color-border-light, #ebe6dd);
	border-radius: 50%;
	border-top-color: var(--color-primary, #e6007e);
	animation: faq-spin 0.8s linear infinite;
}

@keyframes faq-spin {
	to {
		transform: rotate(360deg);
	}
}

/* Confluence-style content extras */
#faq ul,
#faq ol {
	margin: 0.5rem 0 1rem;
	padding-left: 1.5rem;
}

#faq li {
	margin-bottom: 0.25rem;
}

#faq h2,
#faq h3,
#faq h4 {
	margin: 1.25rem 0 0.5rem;
	font-weight: 600;
	color: var(--color-text, #3d3730);
}

#faq h2 { font-size: 1.375rem; }
#faq h3 { font-size: 1.125rem; }
#faq h4 { font-size: 1rem; }

#faq blockquote {
	margin: 1rem 0;
	padding: 0.5rem 1rem;
	border-left: 4px solid var(--color-primary, #e6007e);
	background: var(--color-bg-alt, #efeae2);
	border-radius: 0 var(--radius-sm, 6px) var(--radius-sm, 6px) 0;
	color: var(--color-text-secondary, #5c5349);
}

#faq code, #faq pre {
	font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
	font-size: 0.875rem;
}

#faq code {
	background: var(--color-bg-alt, #efeae2);
	padding: 0.15em 0.4em;
	border-radius: 4px;
}

#faq pre {
	overflow-x: auto;
	padding: 1rem;
	background: var(--color-bg-alt, #efeae2);
	border-radius: var(--radius, 8px);
	margin: 1rem 0;
}

#faq pre code {
	background: none;
	padding: 0;
}
