/**
 * Styles du plugin FAQ Pages.
 *
 * Desactivables via le filtre `afp_enable_default_styles`.
 */

/* --- Formulaire de recherche --- */

.afp-search-form {
	margin-bottom: 1.5em;
}

.afp-search-wrapper {
	position: relative;
	z-index: 9;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5em;
}

.afp-search-input {
	flex: 1 1 auto;
	min-width: 200px;
	padding: 0.75em 1em;
	font-size: 1em;
	line-height: 1.5;
	border: 1px solid #ccc;
	border-radius: 4px;
	background: #fff;
	color: inherit;
	transition: border-color 0.2s;
}

.afp-search-input:focus {
	border-color: #0073aa;
	outline: none;
	box-shadow: 0 0 0 1px #0073aa;
}

.afp-search-submit {
	padding: 0.75em 1.5em;
	font-size: 1em;
	line-height: 1.5;
	border: none;
	border-radius: 4px;
	background: #0073aa;
	color: #fff;
	cursor: pointer;
	transition: background-color 0.2s;
}

.afp-search-submit:hover,
.afp-search-submit:focus {
	background: #005a87;
}

/* --- Dropdown autocompletion --- */

.afp-suggestions {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	z-index: 100;
	background: #fff;
	border: 1px solid #ccc;
	border-top: none;
	border-radius: 0 0 4px 4px;
	max-height: 320px;
	overflow-y: auto;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.afp-suggestion-item {
	display: block;
	padding: 0.75em 1em;
	text-decoration: none;
	color: inherit;
	border-bottom: 1px solid #f0f0f0;
}

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

.afp-suggestion-item:hover,
.afp-suggestion-item:focus,
.afp-suggestion-item[aria-selected="true"] {
	background: #f5f5f5;
	outline: none;
}

.afp-loading,
.afp-no-results,
.afp-error {
	padding: 0.75em 1em;
	color: #666;
	font-style: italic;
}

.afp-error {
	color: #c00;
}

/* --- Top Questions --- */

.afp-top-questions-block > .afp-top-questions {
	margin: 0;
	padding: 0;
}

/* --- Espacement des listes --- */

.afp-related-questions-block > .afp-related-list,
.afp-questions-by-category-block .afp-category-questions {
	margin: 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: var(--afp-list-gap, 8px);
}
