/*
 * FAQ-Akkordeon des Content-Plugins (.ib-faqs-Markup) in Theme-Optik.
 *
 * Wird in inc/enqueue.php unter dem Plugin-Handle "idealbetten-faq"
 * VOR-registriert und ersetzt damit die mitgelieferte Plugin-CSS-Datei
 * komplett (WordPress ignoriert spätere Registrierungen desselben Handles).
 * Deshalb hier VOLLSTÄNDIGE Styles, nicht nur Overrides.
 *
 * Wichtig: das Plugin-JS animiert .ib-faqs-answer über inline max-height —
 * die max-height/overflow-Struktur muss erhalten bleiben.
 */

/* ---- Container (Breite kommt vom Theme-Container drumherum) ---- */
.ib-faqs {
	max-width: none;
	margin: 0;
	padding: 0 0 40px;
}

/* ---- Optionaler Header (titel/untertitel des Shortcodes) ---- */
.ib-faqs-header { padding: 8px 0 28px; }
.ib-faqs-title {
	font-family: var(--font-serif, Georgia, serif);
	font-weight: 500;
	font-size: clamp(28px, 4vw, 40px);
	line-height: 1.15;
	color: var(--ink, #2e2b26);
	margin: 0 0 12px;
}
.ib-faqs-subtitle {
	font-size: 16px;
	line-height: 1.6;
	color: var(--ink-soft, #5c564d);
	max-width: 620px;
	margin: 0;
}

/* ---- Gruppe ---- */
.ib-faqs-group { margin-bottom: 40px; }
.ib-faqs-group-title {
	font-family: var(--font-serif, Georgia, serif);
	font-weight: 500;
	font-size: 22px;
	margin: 0 0 16px;
	padding: 0;
	border: 0;
	color: var(--ink, #2e2b26);
}

/* ---- Item ---- */
.ib-faqs-item {
	background: var(--surface, #fbf9f4);
	border: 1px solid var(--border, #e6dfd0);
	border-radius: 14px;
	margin-bottom: 10px;
	overflow: hidden;
	transition: border-color 0.15s;
}
.ib-faqs-item.is-open { border-color: var(--accent, #6f7f66); }

/* ---- Frage-Button ---- */
.ib-faqs-question,
.ib-faqs-question:visited,
.ib-faqs-question:focus,
.ib-faqs-question:active,
.ib-faqs-question:hover,
.ib-faqs-item.is-open .ib-faqs-question {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	width: 100%;
	padding: 18px 20px;
	background: none;
	border: none;
	box-shadow: none;
	cursor: pointer;
	text-align: left;
	color: var(--ink, #2e2b26);
	white-space: normal;
}
.ib-faqs-question:focus-visible {
	outline: 2px solid var(--accent, #6f7f66);
	outline-offset: -2px;
	border-radius: 14px;
}
.ib-faqs-question-text {
	flex: 1;
	min-width: 0;
	font-weight: 600;
	font-size: 16px;
	line-height: 1.4;
	overflow-wrap: break-word;
}
.ib-faqs-item.is-open .ib-faqs-question-text { color: var(--ink, #2e2b26); }

/* ---- Icon (Plus im Kreis, dreht sich zum X) ---- */
.ib-faqs-icon {
	flex: none;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: var(--accent-soft, #e8ede2);
	color: var(--accent, #6f7f66);
	transition: all 0.2s;
}
.ib-faqs-icon svg { width: 15px; height: 15px; }
.ib-faqs-item.is-open .ib-faqs-icon {
	background: var(--accent, #6f7f66);
	color: #fff;
	transform: rotate(45deg);
}

/* ---- Antwort (max-height wird vom Plugin-JS gesetzt) ---- */
.ib-faqs-answer {
	max-height: 0;
	overflow: hidden;
	transition: max-height 0.25s ease;
}
.ib-faqs-answer-inner {
	padding: 0 20px 20px;
	font-size: 15px;
	line-height: 1.65;
	color: var(--ink-soft, #5c564d);
}
.ib-faqs-answer-inner p { margin: 0 0 12px; }
.ib-faqs-answer-inner p:last-child { margin-bottom: 0; }
.ib-faqs-answer-inner ul,
.ib-faqs-answer-inner ol {
	margin: 0 0 12px;
	padding-left: 20px;
}
.ib-faqs-answer-inner li { margin-bottom: 6px; }
.ib-faqs-answer-inner a {
	color: var(--accent, #6f7f66);
	text-decoration: underline;
	text-underline-offset: 2px;
}
.ib-faqs-answer-inner a:hover { opacity: 0.8; }
.ib-faqs-answer-inner strong { color: var(--ink, #2e2b26); }

/* ---- Leerer Zustand ---- */
.ib-faqs-empty {
	text-align: center;
	padding: 48px 20px;
	color: var(--ink-muted, #8a8378);
	font-size: 16px;
}

/* ---- Mobile ---- */
@media (max-width: 640px) {
	.ib-faqs-question { padding: 15px 16px; }
	.ib-faqs-question-text { font-size: 15px; }
	.ib-faqs-answer-inner { padding: 0 16px 16px; font-size: 14.5px; }
	.ib-faqs-item { border-radius: 12px; }
}
