/* Screen reader only - accessible but visually hidden */
.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}

/* Header Search Block */
.wp-block-latelier-header-search-simple {
	position: relative;
	display: inline-block;
}

.header-search {
	position: relative;
	font-family: inherit;
}

.header-search__trigger {
	background: none;
	border: 1px solid black;
	color: inherit;
	cursor: pointer;
	font-size: inherit;
	font-family: inherit;
	padding: 8px 16px;
	border-radius: 20px;
	transition: all 0.2s ease;
	display: flex;
	align-items: center;
	gap: 8px;
}

.header-search__trigger:hover {
	background-color: rgba(0, 0, 0, 0.05);
	border-color: #999;
}

.header-search__trigger:focus {
	outline: 2px solid #007cba;
	outline-offset: 2px;
}

.header-search__trigger svg {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
}

.header-search__trigger span {
	white-space: nowrap;
}

/* Dropdown */
.header-search__dropdown {
	position: absolute;
	top: 100%;
	right: 0; /* Aligné à droite du trigger */
	min-width: 400px;
	max-width: 500px;
	background: #eff1e3;
	border: 1px solid #ddd;
	border-radius: 8px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	z-index: 1000;
	opacity: 0;
	visibility: hidden;
	transform: translateY(-10px);
	transition: all 0.2s ease;
	margin-top: 8px;
}

.header-search__dropdown.is-open {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

/* Form */
.header-search__form {
	padding: 16px;
	border-bottom: 1px solid #eee;
	display: flex;
	align-items: center;
	gap: 8px;
}

.header-search__form svg {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
	color: #666;
}

.header-search__input {
	background: #eff1e3;
	flex: 1;
	padding: 8px 12px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 14px;
	font-family: inherit;
}

.header-search__input:focus {
	outline: none;
	border-color: #007cba;
	box-shadow: 0 0 0 1px #007cba;
}

/* Results */
.header-search__results-container {
	max-height: 400px;
	overflow-y: auto;
}

.header-search__results {
	min-height: 60px;
}

.header-search__post-type {
	padding: 16px;
	border-bottom: 1px solid #f0f0f0;
}

.header-search__post-type:last-child {
	border-bottom: none;
}

.header-search__post-type h4 {
	margin: 0 0 8px 0;
	font-size: 12px;
	font-weight: 600;
	color: #666;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.header-search__post-type ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.header-search__post-type li {
	margin: 0;
	padding: 0;
}

.header-search__post-type a {
	display: block;
	padding: 6px 0;
	color: #333;
	text-decoration: none;
	font-size: 14px;
	transition: all 0.2s ease;
}

.header-search__post-type a:hover {
	color: #000;
	background-color: #ffed00;
	padding-left: 8px;
	margin-left: -8px;
	padding-right: 8px;
	margin-right: -8px;
	border-radius: 4px;
}

/* View All Button */
.header-search__view-all {
	display: none; /* Caché par défaut, affiché par JS après recherche */
	width: 100%;
	padding: 14px 16px;
	background: #ffed00;
	border: none;
	border-top: 1px solid #ddd;
	border-radius: 0 0 8px 8px;
	color: #000;
	font-size: 14px;
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
	transition: all 0.2s ease;
	text-align: center;
}

.header-search__view-all:hover {
	background: #e6d600;
	transform: translateY(-1px);
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header-search__view-all:focus {
	outline: 2px solid #ffed00;
	outline-offset: -2px;
}

/* Loading & No Results */
.header-search__loading,
.header-search__no-results {
	padding: 20px;
	text-align: center;
	color: #666;
	font-size: 14px;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
	.header-search__dropdown {
		min-width: 90vw;
		max-width: 90vw;
		left: 50%;
		right: auto;
		transform: translateX(-50%) translateY(-10px);
	}
	
	.header-search__dropdown.is-open {
        transform: translateX(0px) translateY(0px);
        right: 0;
        left: auto;
	}
	
	.header-search__results-container {
		max-height: 250px;
	}
}

/* Editor specific styles */
.editor-styles-wrapper .wp-block-latelier-header-search-simple .header-search__dropdown {
	opacity: 0;
	visibility: hidden;
	position: absolute;
}

.editor-styles-wrapper .wp-block-latelier-header-search-simple .header-search__trigger {
	pointer-events: none;
}
