/* History Map v2 */
.hmap {
	position: relative;
	width: 100%;
	max-width: 1250px;
	margin: 0 auto;
}
.hmap__map {
	max-width: 1000px;
	margin: 0 auto;
}
.hmap__map svg {
	display: block;
	width: 100%;
	height: auto;
}
.hmap svg text {
	font-family: 'Roboto', Arial, sans-serif;
	font-weight: 900;
	pointer-events: none;
}

/* ---------- Pins ---------- */
.hmap-point {
	cursor: pointer;
	outline: none;
	transform-box: fill-box;
	animation: hmap-bob 1.5s ease-in-out infinite;
}
.hmap-point > g:first-child {
	filter: drop-shadow(0 6px 5px rgba(0, 0, 0, .28));
	transition: filter .2s;
}
.hmap-point:hover > g:first-child,
.hmap-point:focus-visible > g:first-child,
.hmap-point.is-active > g:first-child {
	filter: drop-shadow(0 8px 8px rgba(0, 0, 0, .4)) brightness(1.08);
}
.hmap-point:focus-visible path:first-child {
	stroke: #111;
	stroke-width: 3;
}
@keyframes hmap-bob {
	0%, 100% { transform: translateY(0); }
	50%      { transform: translateY(-5px); }
}
@media (prefers-reduced-motion: reduce) {
	.hmap-point { animation: none; }
}

/* ---------- Panel (desktop: beside the pin) ---------- */
.hmap__panel {
	--hmap-arrow-y: 50%;
	position: absolute;
	z-index: 50;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	width: min(560px, 46%);
	padding: 20px 8px 14px 22px;
	background: var(--hmap-bg);
	color: var(--hmap-fg);
	border-radius: 10px;
	box-shadow: 0 12px 32px rgba(0, 0, 0, .2);
	opacity: 0;
	transform: translateY(8px);
	transition: opacity .25s ease, transform .25s ease;
}
.hmap__panel[hidden] { display: none; }
.hmap__body {
	min-height: 0;
	padding-right: 36px;
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
}
.hmap__panel.is-open {
	opacity: 1;
	transform: none;
}
.hmap__panel::before {
	content: "";
	position: absolute;
	top: var(--hmap-arrow-y);
	width: 0;
	height: 0;
	border: 16px solid transparent;
	transform: translateY(-50%);
}
.hmap__panel[data-side="left"]::before {
	left: 100%;
	border-left-color: var(--hmap-bg);
}
.hmap__panel[data-side="right"]::before {
	right: 100%;
	border-right-color: var(--hmap-bg);
}

/* ---------- Panel (mobile: centered modal) ---------- */
.hmap__panel.is-modal {
	position: fixed;
	left: 50%;
	top: 50%;
	z-index: 100000;
	width: min(92vw, 560px);
	max-height: 82vh;
	transform: translate(-50%, -46%);
}
.hmap__panel.is-modal.is-open { transform: translate(-50%, -50%); }
.hmap__panel.is-modal::before { display: none; }

.hmap__backdrop {
	position: fixed;
	inset: 0;
	z-index: 99999;
	background: rgba(0, 0, 0, .5);
}
.hmap__backdrop[hidden] { display: none; }
html.hmap-lock,
html.hmap-lock body { overflow: hidden; }

/* ---------- Close button ---------- */
.hmap__close {
	position: absolute;
	top: 6px;
	right: 8px;
	width: 34px;
	height: 34px;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: inherit;
	font: 400 28px/34px Arial, sans-serif;
	text-align: center;
	cursor: pointer;
	opacity: .75;
	box-shadow: none;
}
.hmap__close:hover,
.hmap__close:focus-visible {
	opacity: 1;
	background: rgba(0, 0, 0, .1);
	color: inherit;
}

/* ---------- List ---------- */
.hmap__list {
	list-style: none;
	margin: 0;
	padding: 0;
}
.hmap__list li {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 0 0 8px;
	padding: 0;
	font-size: 17px;
	line-height: 1.4;
	color: inherit;
}
.hmap__list li::before,
.hmap__list li::marker { content: none; }
.hmap__list li.hmap__year {
	margin-top: 12px;
	color: #fff;
	font-weight: 700;
	font-size: 18px;
	text-shadow: 0 1px 2px rgba(0, 0, 0, .3);
}
.hmap__list li.hmap__year:first-child { margin-top: 0; }
.hmap__list li.hmap__noflag { padding-left: 34px; }
.hmap__list img {
	flex: 0 0 24px;
	width: 24px;
	height: 18px;
	object-fit: cover;
	overflow: hidden;
	font-size: 0;
	color: transparent;
	margin: 3px 0 0;
	border-radius: 2px;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, .12);
}

@media (max-width: 600px) {
	.hmap__list li { font-size: 15px; }
	.hmap__list li.hmap__year { font-size: 16px; }
}
