/* ══════════════════════════════════════════
   LALMEK Hotspots — Frontend
   ══════════════════════════════════════════ */

.lhs {
	--lhs-color: #0055A4;
	--lhs-size: 32px;
	--lhs-bp: 768px;
	margin-bottom: 2.5rem;
}

.lhs__title {
	font-size: 1.3rem;
	font-weight: 700;
	margin-bottom: 1rem;
}

/* ── Bildcontainer ─────────────────── */
.lhs__container {
	position: relative;
	display: inline-block;
	width: 100%;
	border-radius: 10px;
	overflow: hidden;
	background: #f8f9fb;
	border: 1px solid #d5dce6;
}

.lhs__image {
	display: block;
	width: 100%;
	height: auto;
}

/* ── Markör ─────────────────────────── */
.lhs__marker {
	position: absolute;
	transform: translate(-50%, -50%);
	width: var(--lhs-size);
	height: var(--lhs-size);
	border-radius: 50%;
	border: 2px solid #fff;
	background: var(--lhs-color);
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	box-shadow: 0 2px 8px rgba(0, 34, 66, 0.25);
	transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
	z-index: 5;
	font-size: calc(var(--lhs-size) * 0.375);
	font-weight: 700;
	line-height: 1;
}

.lhs__marker:hover,
.lhs__marker.is-active {
	background: #002242;
	color: #fff;
	transform: translate(-50%, -50%) scale(1.15);
	box-shadow: 0 4px 16px rgba(0, 34, 66, 0.35);
}

.lhs__marker:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
	box-shadow: 0 0 0 4px var(--lhs-color);
}

/* Pulseffekt (valfri via inställningar) */
.lhs--pulse .lhs__marker::after {
	content: "";
	position: absolute;
	inset: -4px;
	border-radius: 50%;
	border: 2px solid var(--lhs-color);
	opacity: 0;
	transition: opacity 0.2s;
	pointer-events: none;
}

.lhs--pulse .lhs__marker:hover::after,
.lhs--pulse .lhs__marker.is-active::after {
	opacity: 0.4;
	animation: lhs-pulse 1.5s ease-out infinite;
}

@keyframes lhs-pulse {
	0%   { transform: scale(1); opacity: 0.6; }
	100% { transform: scale(1.6); opacity: 0; }
}

/* ── Tooltip (desktop) ──────────────── */
.lhs__tip {
	position: absolute;
	transform: translate(-50%, 0);
	margin-top: calc(var(--lhs-size) / 2 + 8px);
	z-index: 10;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.15s ease;
}

.lhs__tip.is-visible {
	pointer-events: auto;
	opacity: 1;
}

.lhs__tip-inner {
	position: relative;
	background: #fff;
	border: 1px solid #d5dce6;
	border-radius: 10px;
	padding: 14px 16px;
	min-width: 200px;
	max-width: 280px;
	box-shadow: 0 8px 24px rgba(0, 34, 66, 0.12);
}

.lhs__tip-inner::before {
	content: "";
	position: absolute;
	top: -7px;
	left: 50%;
	transform: translateX(-50%) rotate(45deg);
	width: 12px;
	height: 12px;
	background: #fff;
	border-left: 1px solid #d5dce6;
	border-top: 1px solid #d5dce6;
}

.lhs__tip-num {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: var(--lhs-color);
	color: #fff;
	font-size: 0.6875rem;
	font-weight: 700;
	margin-right: 8px;
	vertical-align: middle;
}

.lhs__tip-title {
	font-size: 0.875rem;
	font-weight: 700;
	color: #002242;
	vertical-align: middle;
}

.lhs__tip-desc {
	font-size: 0.8125rem;
	color: #4a5168;
	line-height: 1.5;
	margin: 6px 0 0;
}

/* Länk i tooltip */
.lhs__tip-title.lhs__link {
	color: #002242;
	text-decoration: none;
	font-weight: 700;
	font-size: 0.875rem;
	vertical-align: middle;
}

.lhs__tip-title.lhs__link:hover {
	text-decoration: underline;
}

.lhs__tip-link {
	display: inline-block;
	margin-top: 8px;
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--lhs-color);
	text-decoration: none;
}

.lhs__tip-link:hover {
	text-decoration: underline;
}

.lhs__tip-close {
	position: absolute;
	top: 6px;
	right: 8px;
	background: none;
	border: none;
	font-size: 1.125rem;
	color: #767676;
	cursor: pointer;
	padding: 8px 10px;
	min-width: 44px;
	min-height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	border-radius: 4px;
}

.lhs__tip-close:hover {
	color: #002242;
	background: #f0f3f7;
}

.lhs__tip-close:focus-visible {
	outline: 2px solid var(--lhs-color);
	outline-offset: 1px;
}

/* ── Bottom sheet (mobil) ───────────── */
.lhs__sheet {
	display: none;
}

.lhs__sheet.is-open {
	display: block;
}

.lhs__sheet-bg {
	position: fixed;
	inset: 0;
	background: rgba(0, 22, 44, 0.4);
	z-index: 9998;
	animation: lhs-fade 0.2s ease;
}

.lhs__sheet-panel {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	z-index: 9999;
	background: #fff;
	border-radius: 16px 16px 0 0;
	padding: 0 20px 28px;
	box-shadow: 0 -8px 32px rgba(0, 22, 44, 0.15);
	animation: lhs-slide 0.25s ease;
	max-height: 60vh;
	overflow-y: auto;
}

.lhs__sheet-handle {
	display: flex;
	justify-content: center;
	padding: 12px 0 16px;
}

.lhs__sheet-handle span {
	width: 36px;
	height: 4px;
	border-radius: 2px;
	background: #d1d5db;
}

.lhs__sheet-body {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
}

.lhs__sheet-num {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: var(--lhs-color);
	color: #fff;
	font-size: 0.8125rem;
	font-weight: 700;
	flex-shrink: 0;
}

.lhs__sheet-title {
	font-size: 1.05rem;
	font-weight: 700;
	color: #002242;
}

.lhs__sheet-desc {
	width: 100%;
	font-size: 0.9rem;
	color: #4a5168;
	line-height: 1.6;
	margin: 4px 0 0;
}

/* Länk i bottom sheet */
.lhs__sheet-link {
	display: inline-block;
	width: 100%;
	margin-top: 12px;
	padding: 10px 0;
	font-size: 0.9rem;
	font-weight: 600;
	color: var(--lhs-color);
	text-decoration: none;
	text-align: center;
	border-top: 1px solid #edf0f4;
}

.lhs__sheet-link:hover {
	text-decoration: underline;
}

.lhs__sheet-close {
	position: absolute;
	top: 10px;
	right: 16px;
	background: none;
	border: none;
	font-size: 1.5rem;
	color: #767676;
	cursor: pointer;
	padding: 8px 12px;
	min-width: 44px;
	min-height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	border-radius: 6px;
}

.lhs__sheet-close:hover {
	color: #002242;
	background: #f0f3f7;
}

.lhs__sheet-close:focus-visible {
	outline: 2px solid var(--lhs-color);
	outline-offset: 2px;
}

@keyframes lhs-slide {
	from { transform: translateY(100%); }
	to   { transform: translateY(0); }
}

@keyframes lhs-fade {
	from { opacity: 0; }
	to   { opacity: 1; }
}

/* ══════════════════════════════════════════
   Side-layout — bild + kompakt accordion
   ══════════════════════════════════════════ */
.lhs--side .lhs__body {
	display: grid;
	grid-template-columns: 3fr 2fr;
	gap: 0;
	align-items: start;
}

.lhs--side .lhs__container {
	border-radius: 10px 0 0 10px;
	border-right: none;
}

/* Side-layout: dölj tooltip — accordion-listan tar över */
.lhs--side .lhs__tip {
	display: none !important;
}

/* ── Sidopanelens wrapper ── */
.lhs__side-list {
	border: 1px solid #d5dce6;
	border-left: none;
	border-radius: 0 10px 10px 0;
	background: #fff;
	overflow-y: auto;
	overflow-x: hidden;
	display: flex;
	flex-direction: column;
}

/* Rubrik/räknare ovanför accordion-listan */
.lhs__side-header {
	padding: 10px 14px;
	border-bottom: 1px solid #edf0f4;
	background: #f8f9fb;
	border-radius: 0 10px 0 0;
	position: sticky;
	top: 0;
	z-index: 2;
}

.lhs__side-count {
	font-size: 0.6875rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #5a6275;
}

/* ── Accordion-lista ── */
.lhs__list.lhs__list--accordion {
	margin: 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
	font-size: 0.8125rem;
	color: #3a3f4b;
	line-height: 1.5;
	flex: 1;
}

/* ── Accordion-item (en rad per komponent) ── */
.lhs__list--accordion .lhs__acc-item {
	display: block !important;
	border-bottom: 1px solid #edf0f4;
	cursor: pointer;
	transition: background 0.15s;
	list-style: none;
	padding: 0;
	gap: 0;
}

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

/* Kompakt huvudrad: nummer + titel + chevron */
.lhs__acc-row {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 7px 10px;
	min-height: 36px;
}

.lhs__acc-item .lhs__list-num {
	width: 22px;
	height: 22px;
	min-width: 22px;
	font-size: 0.625rem;
}

.lhs__acc-title {
	flex: 1;
	min-width: 0;
	font-weight: 600;
	color: #002242;
	font-size: 0.8125rem;
	line-height: 1.35;
}

.lhs__acc-title span,
.lhs__acc-title a {
	display: block;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.lhs__acc-title a {
	color: #002242;
	text-decoration: none;
}

.lhs__acc-title a:hover {
	color: var(--lhs-color);
	text-decoration: underline;
}

/* Chevron-ikon */
.lhs__acc-chevron {
	flex-shrink: 0;
	width: 16px;
	height: 16px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #9ca3af;
	transition: transform 0.2s ease, color 0.15s;
}

.lhs__acc-item.is-expanded .lhs__acc-chevron {
	transform: rotate(180deg);
	color: var(--lhs-color);
}

/* ── Expanderbar beskrivningspanel ── */
.lhs__acc-panel {
	max-height: 0;
	overflow: hidden;
	transition: max-height 0.25s ease;
	background: #f8fafc;
	border-top: 1px solid transparent;
}

.lhs__acc-item.is-expanded .lhs__acc-panel {
	border-top-color: #edf0f4;
}

.lhs__acc-desc {
	margin: 0;
	padding: 8px 10px 6px 40px;
	font-size: 0.75rem;
	line-height: 1.55;
	color: #4a5168;
}

.lhs__acc-link {
	display: inline-block;
	padding: 2px 10px 10px 40px;
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--lhs-color);
	text-decoration: none;
}

.lhs__acc-link:hover {
	text-decoration: underline;
}

/* ── Accordion: hover/aktiv-states ── */
.lhs__acc-item:hover,
.lhs__acc-item.is-hover {
	background: #f0f5ff;
}

.lhs__acc-item.is-expanded {
	background: #e8f0fe;
}

.lhs__acc-item.is-expanded:hover {
	background: #dce8fb;
}

/* Nummerbadge färgändring vid expanderad */
.lhs__acc-item.is-expanded .lhs__list-num {
	background: #002242;
}

/* ══════════════════════════════════════════
   Komponentlista (below-layout, oförändrad)
   ══════════════════════════════════════════ */
.lhs__list {
	margin: 1.25rem 0 0;
	padding: 0;
	list-style: none;
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 0;
	font-size: 0.8125rem;
	color: #3a3f4b;
	line-height: 1.5;
}

.lhs__list li {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 10px 12px;
	border-bottom: 1px solid #edf0f4;
	cursor: pointer;
	transition: background 0.15s;
}

.lhs__list li:last-child {
	border-bottom: none;
}

.lhs__list li:hover,
.lhs__list li.is-hover {
	background: #f0f5ff;
}

/* Nummerbadge i listan */
.lhs__list-num {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	min-width: 24px;
	border-radius: 50%;
	background: var(--lhs-color);
	color: #fff;
	font-size: 0.6875rem;
	font-weight: 700;
	flex-shrink: 0;
	margin-top: 1px;
}

.lhs__list-content {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.lhs__list strong {
	color: #002242;
}

.lhs__list-desc {
	color: #5a6275;
	font-size: 0.75rem;
}

.lhs__list-link {
	color: inherit;
	text-decoration: none;
}

.lhs__list-link:hover {
	text-decoration: underline;
	color: var(--lhs-color);
}

/* ── Hover-etikett på markör ── */
.lhs__marker[data-label]::before {
	content: attr(data-label);
	position: absolute;
	bottom: calc(100% + 8px);
	left: 50%;
	transform: translateX(-50%);
	background: #002242;
	color: #fff;
	font-size: 0.6875rem;
	font-weight: 600;
	padding: 5px 12px;
	border-radius: 6px;
	/* Tillåt flerradsetiketter istället för att klippa */
	white-space: normal;
	text-align: center;
	max-width: 200px;
	width: max-content;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.15s;
	box-shadow: 0 2px 8px rgba(0, 22, 44, 0.25);
	z-index: 12;
	line-height: 1.4;
}

.lhs__marker[data-label]:hover::before,
.lhs__marker[data-label]:focus-visible::before {
	opacity: 1;
}

/* Dölj hover-etikett när tooltip är öppen */
.lhs__marker.is-active[data-label]::before {
	opacity: 0 !important;
}

/* Markör hover från lista */
.lhs__marker.is-hover {
	background: #003d7a;
	color: #fff;
	transform: translate(-50%, -50%) scale(1.2);
	box-shadow: 0 0 0 3px rgba(0, 85, 164, 0.3), 0 4px 16px rgba(0, 34, 66, 0.35);
}

/* ── Dold text (a11y) ───────────────── */
.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ══════════════════════════════════════════
   Responsiv
   ══════════════════════════════════════════ */
@media (max-width: 768px) {
	/* Dölj tooltips på mobil — bottom sheet tar över */
	.lhs__tip {
		display: none !important;
	}

	.lhs__marker {
		width: calc(var(--lhs-size) * 0.875);
		height: calc(var(--lhs-size) * 0.875);
	}

	.lhs__list {
		grid-template-columns: 1fr;
	}

	/* Side-layout → stapla vertikalt på mobil */
	.lhs--side .lhs__body {
		grid-template-columns: 1fr;
	}

	.lhs--side .lhs__container {
		border-radius: 10px 10px 0 0;
		border-right: 1px solid #d5dce6;
		border-bottom: none;
	}

	.lhs__side-list {
		border: 1px solid #d5dce6;
		border-top: none;
		border-left: 1px solid #d5dce6;
		border-radius: 0 0 10px 10px;
		max-height: none !important;
	}

	.lhs__side-header {
		border-radius: 0;
	}

	/* Tillåt flerradstitlar på mobil */
	.lhs__acc-title span,
	.lhs__acc-title a {
		white-space: normal;
	}

	/* Lite mer padding i accordion-raden på mobil */
	.lhs__acc-row {
		padding: 10px 12px;
		min-height: 44px;
	}

	.lhs__acc-desc {
		padding: 10px 12px 8px 44px;
	}

	.lhs__acc-link {
		padding: 2px 12px 12px 44px;
	}
}

/* Lista — fokus på tangentbord */
.lhs__list li:focus-visible,
.lhs__acc-item:focus-visible {
	outline: 2px solid var(--lhs-color);
	outline-offset: -2px;
	border-radius: 4px;
}

/* Reducerad rörelse */
@media (prefers-reduced-motion: reduce) {
	.lhs__marker,
	.lhs__tip,
	.lhs__sheet-bg,
	.lhs__sheet-panel,
	.lhs__sheet-close,
	.lhs__tip-close,
	.lhs__acc-panel,
	.lhs__acc-chevron {
		transition: none !important;
		animation: none !important;
	}

	.lhs--pulse .lhs__marker::after {
		animation: none !important;
		opacity: 0 !important;
	}
}

@media (max-width: 480px) {
	.lhs__marker {
		width: calc(var(--lhs-size) * 0.75);
		height: calc(var(--lhs-size) * 0.75);
		border-width: 1.5px;
	}
}
