/* ═══════════════════════════════════════════════════════════════════════════ */
/* Global Publication Search — Modal Overlay                                  */
/* ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Toggle button (in nav) ─── */
.br-pub-gsearch__toggle {
	background: none;
	border: none;
	color: #888;
	cursor: pointer;
	padding: 6px;
	border-radius: 6px;
	transition: color 0.2s, background 0.2s;
	display: inline-flex;
	align-items: center;
	margin-left: auto;
}

.br-pub-gsearch__toggle:hover {
	color: #0e73b9;
	background: rgba(14, 115, 185, 0.08);
}

/* ─── Modal overlay ─── */
.br-pub-gsearch-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding-top: 12vh;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.15s ease, visibility 0.15s;
}

.br-pub-gsearch-modal.is-open {
	opacity: 1;
	visibility: visible;
}

/* Backdrop */
.br-pub-gsearch-modal__backdrop {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.4);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
}

/* ─── Dialog ─── */
.br-pub-gsearch-modal__dialog {
	position: relative;
	width: 680px;
	max-width: calc(100vw - 32px);
	max-height: 70vh;
	background: #fff;
	border-radius: 16px;
	box-shadow:
		0 0 0 1px rgba(0, 0, 0, 0.04),
		0 16px 48px rgba(0, 0, 0, 0.16);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	transform: translateY(8px) scale(0.98);
	transition: transform 0.15s ease;
}

.br-pub-gsearch-modal.is-open .br-pub-gsearch-modal__dialog {
	transform: translateY(0) scale(1);
}

/* ─── Input ─── */
.br-pub-gsearch-modal__input-wrap {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 18px 24px;
	border-bottom: 1px solid #f0f0f0;
	flex-shrink: 0;
}

.br-pub-gsearch-modal__input-wrap svg {
	flex-shrink: 0;
	color: #b0b0b0;
}

.br-pub-gsearch-modal__input {
	flex: 1;
	min-width: 0;
	border: none;
	outline: none;
	font-size: 1.05rem;
	color: #1a1a1a;
	background: none;
	font-weight: 400;
}

.br-pub-gsearch-modal__input::placeholder {
	color: #b0b0b0;
}

.br-pub-gsearch-modal__kbd {
	flex-shrink: 0;
	font-family: inherit;
	font-size: 0.65rem;
	font-weight: 600;
	color: #bbb;
	background: #f5f5f5;
	border: 1px solid #e8e8e8;
	border-radius: 4px;
	padding: 2px 7px;
	line-height: 1.4;
}

/* ─── Sector filter pills ─── */
.br-pub-gsearch-modal__filters {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 12px 24px;
	border-bottom: 1px solid #f0f0f0;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	flex-shrink: 0;
}

.br-pub-gsearch-modal__filters:empty {
	display: none;
}

.br-pub-gsearch-modal__filter {
	background: none;
	border: 1.5px solid #e0e0e0;
	color: #777;
	font-size: 0.72rem;
	font-weight: 600;
	padding: 4px 14px;
	border-radius: 20px;
	cursor: pointer;
	white-space: nowrap;
	transition: all 0.15s;
	letter-spacing: 0.02em;
}

.br-pub-gsearch-modal__filter:hover {
	border-color: #bbb;
	color: #444;
	background: #fafafa;
}

.br-pub-gsearch-modal__filter.is-active {
	background: #0e73b9;
	border-color: #0e73b9;
	color: #fff;
}

/* ─── Results ─── */
.br-pub-gsearch-modal__results {
	flex: 1;
	overflow-y: auto;
	overflow-x: hidden;
}

.br-pub-gsearch-modal__results:empty {
	display: none;
}

.br-pub-gsearch-modal__loading,
.br-pub-gsearch-modal__empty {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 36px 24px;
	color: #aaa;
	font-size: 0.88rem;
}

.br-pub-gsearch-modal__spinner {
	width: 16px;
	height: 16px;
	border: 2px solid #e0e0e0;
	border-top-color: #0e73b9;
	border-radius: 50%;
	animation: br-gsearch-spin 0.6s linear infinite;
}

@keyframes br-gsearch-spin {
	to { transform: rotate(360deg); }
}

/* ─── Result item ─── */
.br-pub-gsearch-modal__item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 14px 24px;
	text-decoration: none;
	color: inherit;
	border-bottom: 1px solid #f5f5f5;
	transition: background 0.1s;
}

.br-pub-gsearch-modal__item:last-child {
	border-bottom: none;
}

.br-pub-gsearch-modal__item:hover,
.br-pub-gsearch-modal__item.is-focused {
	background: #f5f8fc;
}

.br-pub-gsearch-modal__item-title {
	flex: 1;
	min-width: 0;
	font-size: 0.88rem;
	font-weight: 500;
	color: #1a1a1a;
	line-height: 1.35;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.br-pub-gsearch-modal__item:hover .br-pub-gsearch-modal__item-title,
.br-pub-gsearch-modal__item.is-focused .br-pub-gsearch-modal__item-title {
	color: #0e73b9;
}

.br-pub-gsearch-modal__item-meta {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
}

/* ─── Sector badges ─── */
.br-pub-gsearch-modal__badge {
	display: inline-flex;
	align-items: center;
	padding: 2px 8px;
	border-radius: 4px;
	font-size: 0.65rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	white-space: nowrap;
	background: #f0f0f0;
	color: #666;
}

.br-pub-gsearch-modal__badge--itu-r {
    background: rgba(0, 114, 188, 0.1);
    color: #0072bc;
}

.br-pub-gsearch-modal__badge--itu-t {
	background: #e6f2ff;
	color: #1a6fbf;
}

.br-pub-gsearch-modal__badge--itu-d {
	background: #e8f5e9;
	color: #2e7d32;
}

.br-pub-gsearch-modal__badge--gs {
	background: #f3e8ff;
	color: #7c3aed;
}

.br-pub-gsearch-modal__type {
	font-size: 0.75rem;
	color: #999;
	white-space: nowrap;
}

.br-pub-gsearch-modal__date {
	font-size: 0.75rem;
	color: #bbb;
	white-space: nowrap;
}

/* ─── Footer (keyboard hints) ─── */
.br-pub-gsearch-modal__footer {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 10px 24px;
	border-top: 1px solid #f0f0f0;
	background: #fafafa;
	font-size: 0.7rem;
	color: #bbb;
	flex-shrink: 0;
}

.br-pub-gsearch-modal__footer kbd {
	display: inline-block;
	font-family: inherit;
	font-size: 0.62rem;
	font-weight: 600;
	color: #aaa;
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 3px;
	padding: 1px 5px;
	margin-right: 2px;
	line-height: 1.4;
}

/* ─── Responsive ─── */
@media (max-width: 720px) {
	.br-pub-gsearch-modal {
		padding-top: 5vh;
	}

	.br-pub-gsearch-modal__dialog {
		max-height: 85vh;
		border-radius: 12px;
	}

	.br-pub-gsearch-modal__item {
		flex-direction: column;
		align-items: flex-start;
		gap: 6px;
	}

	.br-pub-gsearch-modal__item-title {
		white-space: normal;
	}

	.br-pub-gsearch-modal__footer {
		display: none;
	}
}