/* ─── Form layout ────────────────────────────── */

.wp-block-fusio-nesc-publications-search {
	max-width: 1200px;
	margin: 0 auto;
}

.nesc-pub-search__form {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 0.75rem;
	padding: 1.25rem 1.5rem;
	background: #01819c;
	border-radius: 0.75rem;
	transition: box-shadow 0.2s ease;
}

.nesc-pub-search__form[style*="position: fixed"] {
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	border-radius: 0 0 0.75rem 0.75rem;
}

.nesc-pub-search__field {
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
	flex: 1 1 0%;
	min-width: 140px;
}

.nesc-pub-search__field--keyword {
	flex: 1.4 1 0%;
	min-width: 180px;
}

.nesc-pub-search__field label {
	font-family: "Figtree", sans-serif;
	font-size: 18px;
	font-weight: 600;
	color: #fff;
	letter-spacing: 0.03em;
}

.nesc-pub-search__field input,
.nesc-pub-search__field select {
	font-family: "Roboto", sans-serif;
	font-size: 0.95rem;
	height: 42px;
	padding: 0 0.75rem;
	border: 1px solid #c8cfd6;
	border-radius: 0.4rem;
	background: #fff;
	color: #333;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
	width: 100%;
	box-sizing: border-box;
}

.nesc-pub-search__field input:focus,
.nesc-pub-search__field select:focus {
	outline: none;
	border-color: #19bade;
	box-shadow: 0 0 0 2px rgba(25, 186, 222, 0.2);
}

/* ─── Buttons ────────────────────────────────── */

.nesc-pub-search__actions {
	display: flex;
	gap: 0.5rem;
	align-items: flex-end;
	flex-shrink: 0;
}

.nesc-pub-search__btn {
	font-family: "Roboto", sans-serif;
	font-size: 0.9rem;
	font-weight: 600;
	height: 42px;
	padding: 0 1.4rem;
	border: none;
	border-radius: 0.4rem;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
	white-space: nowrap;
}

.nesc-pub-search__btn--search {
	background: #19bade;
	color: #fff;
}

.nesc-pub-search__btn--search:hover,
.nesc-pub-search__btn--search:focus {
	background: #012155;
	color: #fff;
}

.nesc-pub-search__btn--clear {
	background: transparent;
	color: #fff;
	border: 1px solid #fff;
}

.nesc-pub-search__btn--clear:hover,
.nesc-pub-search__btn--clear:focus {
	background: rgba(255, 255, 255, 0.15);
	color: #fff;
}

/* ─── Loading spinner ────────────────────────── */

.nesc-pub-search__spinner {
	width: 36px;
	height: 36px;
	margin: 2rem auto;
	border: 3px solid #e0e0e0;
	border-top-color: #19bade;
	border-radius: 50%;
	animation: nescPubSpin 0.7s linear infinite;
}

@keyframes nescPubSpin {
	to { transform: rotate( 360deg ); }
}

/* ─── Results list ───────────────────────────── */

.nesc-pub-search__results {
	margin-top: 1.5rem;
}

.nesc-pub-search__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.nesc-pub-search__item {
	margin: 0;
	padding: 0;
}

.nesc-pub-search__item-link {
	display: flex;
	align-items: flex-start;
	gap: 1.25rem;
	padding: 1rem 1.25rem;
	background: #d6ecf4;
	border-radius: 0.6rem;
	text-decoration: none;
	color: inherit;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.nesc-pub-search__item-link:hover,
.nesc-pub-search__item-link:focus {
	background-color:#bfe2ef;
	border-color: #19bade;
	box-shadow: 0 2px 10px rgba(0, 30, 60, 0.07);
	text-decoration: none;
	color: inherit;
}

/* ─── Thumbnail ──────────────────────────────── */

.nesc-pub-search__thumb {
	flex: 0 0 120px;
	width: 120px;
	height: 120px;
	border-radius: 0.4rem;
	overflow: hidden;
	background-color: #eef1f4;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
}

.nesc-pub-search__thumb--empty {
	display: flex;
	align-items: center;
	justify-content: center;
	color: #a0aab4;
}

.nesc-pub-search__doc-icon {
	width: 40px;
	height: 40px;
}

/* ─── Meta (date, title, details) ────────────── */

.nesc-pub-search__meta {
	flex: 1 1 0%;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
}

.nesc-pub-search__date {
	font-family: "Roboto", sans-serif;
	font-size: 0.8rem;
	font-weight: 500;
	color: #0299bb;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.nesc-pub-search__title {
	font-family: "Figtree", sans-serif;
    font-size: 1.4rem;
	font-weight: 700;
	color: #012155;
	margin: 0;
	line-height: 1.35;
}

.nesc-pub-search__item-link:hover .nesc-pub-search__title {
	color: #19bade;
}

.nesc-pub-search__details {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem 1.25rem;
	margin: 0.25rem 0 0;
	padding: 0;
}

.nesc-pub-search__detail {
	display: flex;
	gap: 0.35rem;
	align-items: baseline;
}

.nesc-pub-search__details dt {
	font-family: "Roboto", sans-serif;
	font-size: 0.8rem;
	font-weight: 600;
	color: #888;
	text-transform: uppercase;
	letter-spacing: 0.02em;
	margin: 0;
}

.nesc-pub-search__details dd {
	font-family: "Roboto", sans-serif;
	font-size: 0.88rem;
	font-weight: 500;
	color: #333;
	margin: 0;
}

/* ─── No results / error ─────────────────────── */

.nesc-pub-search__no-results,
.nesc-pub-search__error {
	font-family: "Roboto", sans-serif;
	font-size: 0.95rem;
	color: #666;
	text-align: center;
	padding: 2rem 1rem;
}

.nesc-pub-search__error {
	color: #c62828;
}

/* ─── Pagination ─────────────────────────────── */

.nesc-pub-search__pagination {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 0.75rem;
	margin-top: 1.5rem;
	padding-top: 1rem;
	border-top: 1px solid #e6e9ed;
}

.nesc-pub-search__page-info {
	font-family: "Roboto", sans-serif;
	font-size: 0.9rem;
	color: #555;
	white-space: nowrap;
	margin-right: 0.5rem;
}

.nesc-pub-search__page-numbers {
	display: flex;
	align-items: center;
	gap: 0.35rem;
}

.nesc-pub-search__page-num {
	font-family: "Roboto", sans-serif;
	font-size: 0.9rem;
	font-weight: 600;
	width: 38px;
	height: 38px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: none;
	border-radius: 0.3rem;
	background: #e6e9ed;
	color: #012155;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.nesc-pub-search__page-num:hover,
.nesc-pub-search__page-num:focus {
	background: #cdd3da;
	color: #012155;
}

.nesc-pub-search__page-num--active,
.nesc-pub-search__page-num--active:hover {
	background: #012155;
	color: #fff;
	cursor: default;
}

.nesc-pub-search__page-ellipsis {
	font-family: "Roboto", sans-serif;
	font-size: 0.9rem;
	color: #888;
	width: 28px;
	text-align: center;
	user-select: none;
}

.nesc-pub-search__page-btn {
	font-family: "Roboto", sans-serif;
	font-size: 0.9rem;
	font-weight: 600;
	height: 38px;
	padding: 0 1rem;
	border: none;
	border-radius: 0.3rem;
	background: #e6e9ed;
	color: #012155;
	cursor: pointer;
	white-space: nowrap;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.nesc-pub-search__page-btn:hover,
.nesc-pub-search__page-btn:focus {
	background: #cdd3da;
	color: #012155;
}

/* ─── Responsive: stack on mobile ────────────── */

@media ( max-width: 768px ) {
	.nesc-pub-search__form {
		flex-direction: column;
		align-items: stretch;
		padding: 1rem;
	}

	.nesc-pub-search__field {
		min-width: 0;
	}

	.nesc-pub-search__actions {
		justify-content: stretch;
	}

	.nesc-pub-search__actions .nesc-pub-search__btn {
		flex: 1 1 0%;
		text-align: center;
	}

	.nesc-pub-search__thumb {
		flex: 0 0 80px;
		width: 80px;
		height: 80px;
	}

	.nesc-pub-search__item-link {
		gap: 0.75rem;
		padding: 0.75rem;
	}
}

/* ─── Editor preview overrides ───────────────── */

.nesc-pub-search__form--preview {
	pointer-events: none;
	opacity: 0.85;
}
