/* =============================================================
   Sökruta (overlay i headern) — temaversion.
   Klassnamn `msac-` behållna för kompatibilitet med portad JS
   och för att markup ser identisk ut med pluginens version.
   ============================================================= */

/* ── Sökpanel (centrerad, fixed under headern) ───────────────────────── */

.msac-search-form {
	display: none;
	position: absolute;
	left: 0;
	right: 0;
	/* top sätts av JS vid öppning */
	z-index: 9998;
	max-width: 78rem;
	margin-left: auto;
	margin-right: auto;
	margin-top: 0.5rem;
	padding: 2rem;
	background: #fff;
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
}

.msac-search-form.msac-open {
	display: block;
}

.msac-search-wrap {
	position: relative;
	display: flex;
	align-items: center;
	height: 56px;
	padding: 0 0.75rem;
	border: 1px solid #e0e0e0;
	border-radius: 4px;
}

.msac-icon-search {
	display: flex;
	align-items: center;
	padding-right: 0.25rem;
	flex-shrink: 0;
	color: #555;
}

.msac-input {
	flex: 1;
	background-color: transparent;
	border: none;
	height: 100%;
	padding: 0 0.5rem;
	font-family: var(--font-family-text, "PP Neue Machina");
	font-size: var(--font-size-md, 1rem);
	font-style: normal;
	font-weight: var(--font-weight-light, 400);
	line-height: 150%;
	color: inherit;
	min-width: 0;
}

.msac-input::placeholder {
	color: #aaa;
}

.msac-dismiss {
	display: flex;
	align-items: center;
	padding: 0 0.25rem;
	background: none;
	border: none;
	cursor: pointer;
	height: 100%;
	flex-shrink: 0;
	color: #555;
}

.msac-dismiss:hover {
	color: #111;
}

/* ── Resultatpanel ───────────────────────────────────────────────────── */

.msac-search-panel-results {
	padding-top: 2rem;
	padding-bottom: 0.5rem;
	max-height: 70vh;
	overflow-y: auto;
}

/* ── Shortcut-rad ────────────────────────────────────────────────────── */

.msac-panel-item {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding-top: 0.25rem;
	padding-bottom: 0.25rem;
	border-radius: 4px;
	cursor: pointer;
}

.msac-panel-arrow {
	margin-left: auto;
	display: flex;
	align-items: center;
	flex-shrink: 0;
	color: #212121;
}

.msac-panel-item:hover {
	background-color: #f0f5f9;
}

.msac-panel-item.msac-autocomplete-active {
	background-color: #e0ecf5;
	outline: 2px solid #005596;
	outline-offset: -2px;
}

.msac-panel-title {
	font-family: var(--font-family-text, "PP Neue Machina");
	font-size: var(--font-size-md, 1rem);
	font-style: normal;
	font-weight: var(--font-weight-light, 400);
	line-height: 150%;
	color: #212121;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* ── Rubrikrad "Shortcuts" ───────────────────────────────────────────── */

.msac-suggestion-header {
	cursor: default;
	padding: 0.5rem 0 0.25rem;
}

.msac-suggestion-header h5 {
	margin: 0;
	font-family: var(--font-family-heading, "PP Neue Machina");
	font-size: var(--font-size-h5, 1.5rem);
	font-style: normal;
	font-weight: 300;
	line-height: 140%;
	letter-spacing: -0.03rem;
	color: #212121;
}

/* ── Fokusindikatorer (WCAG 2.4.7 / 2.4.11) ─────────────────────────── */

.msac-search-toggle a:focus-visible,
.msac-dismiss:focus-visible {
	outline: 2px solid #005596;
	outline-offset: 2px;
	border-radius: 4px;
}

.msac-search-wrap:focus-within {
	border-color: #212121;
}

.msac-input:focus,
.msac-input:focus-visible {
	outline: none;
}

/* ── Toggle i headern (expanderat utseende) ─────────────────────────── */

.msac-search-toggle a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 9999px;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.msac-search-toggle a[aria-expanded="true"] {
	background-color: #000;
	color: #fff;
}
