/**
 * Aktualizované Safety Radar – frontend.
 *
 * Farebná škála ratingu prichádza z PHP (inline style), tu sa rieši
 * rozloženie a chrome okolo mapy.
 */

.asr-radar {
	--asr-map-height: 620px;
	--asr-surface: #ffffff;
	--asr-ink: #111827;
	--asr-ink-soft: #6b7280;
	--asr-line: #e5e7eb;
	--asr-accent: #dc2626;
	--asr-radius: 8px;

	max-width: 1280px;
	margin: 0 auto;
	color: var(--asr-ink);
	font-size: 15px;
	line-height: 1.5;
}

.asr-radar *,
.asr-radar *::before,
.asr-radar *::after {
	box-sizing: border-box;
}

.asr-radar .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

/* Stránka radaru */

.asr-page-header {
	max-width: 1280px;
	margin: 0 auto;
	padding: 32px 16px 20px;
}

.asr-page-eyebrow {
	margin: 0;
	color: var(--asr-accent, #dc2626);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.08em;
}

.asr-page-header h1 {
	margin: 2px 0 6px;
	font-size: clamp(28px, 4vw, 40px);
	line-height: 1.1;
}

.asr-page-lead {
	margin: 0;
	max-width: 60ch;
	color: #4b5563;
}

/* Panel nástrojov */

.asr-toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: center;
	justify-content: space-between;
	padding: 0 16px 12px;
}

.asr-ranges {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	border: 1px solid var(--asr-line);
	border-radius: var(--asr-radius);
	padding: 3px;
	background: #f9fafb;
}

.asr-range {
	appearance: none;
	border: 0;
	background: transparent;
	color: var(--asr-ink-soft);
	padding: 7px 13px;
	border-radius: 6px;
	font: inherit;
	font-size: 14px;
	cursor: pointer;
}

.asr-range:hover {
	color: var(--asr-ink);
}

.asr-range.is-active {
	background: var(--asr-accent);
	color: #fff;
	font-weight: 600;
}

.asr-range:focus-visible,
.asr-radar select:focus-visible,
.asr-radar input:focus-visible,
.asr-panel-close:focus-visible {
	outline: 2px solid var(--asr-accent);
	outline-offset: 2px;
}

.asr-toolbar-right {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.asr-radar select,
.asr-radar input[type="search"] {
	border: 1px solid var(--asr-line);
	border-radius: var(--asr-radius);
	padding: 8px 12px;
	font: inherit;
	font-size: 14px;
	background: #fff;
	color: var(--asr-ink);
	min-height: 40px;
}

/* Mapa */

.asr-stage {
	position: relative;
	margin: 0 16px;
	border-radius: var(--asr-radius);
	overflow: hidden;
	background: #0b1220;
}

.asr-map {
	width: 100%;
	height: var(--asr-map-height);
}

.asr-layers,
.asr-legend {
	position: absolute;
	background: rgba(255, 255, 255, 0.96);
	border-radius: var(--asr-radius);
	padding: 12px 14px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
	font-size: 13px;
	max-width: 210px;
}

.asr-layers {
	top: 12px;
	left: 12px;
}

.asr-legend {
	top: 12px;
	right: 12px;
}

.asr-layers h3,
.asr-legend h3 {
	margin: 0 0 8px;
	font-size: 13px;
	font-weight: 700;
}

.asr-layers label {
	display: flex;
	align-items: center;
	gap: 7px;
	padding: 3px 0;
	cursor: pointer;
}

.asr-legend ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.asr-legend li {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 2px 0;
}

.asr-swatch {
	width: 13px;
	height: 13px;
	border-radius: 3px;
	flex: none;
}

.asr-legend-range {
	font-variant-numeric: tabular-nums;
	color: var(--asr-ink-soft);
	min-width: 44px;
}

/* Panel krajiny */

.asr-panel {
	position: absolute;
	top: 12px;
	right: 12px;
	bottom: 12px;
	width: 330px;
	max-width: calc(100% - 24px);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: var(--asr-surface);
	border-radius: var(--asr-radius);
	padding: 18px 20px 22px;
	box-shadow: 0 6px 26px rgba(0, 0, 0, 0.35);
	z-index: 3;
}

/* Zoznam článkov si berie zvyšnú výšku a roluje sa sám. */

.asr-panel-scroll {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
}

.asr-panel-close {
	position: absolute;
	top: 10px;
	right: 12px;
	appearance: none;
	border: 0;
	background: transparent;
	font-size: 24px;
	line-height: 1;
	color: var(--asr-ink-soft);
	cursor: pointer;
	padding: 2px 6px;
}

.asr-panel-title {
	flex: none;
	margin: 0 28px 10px 0;
	font-size: 20px;
	line-height: 1.2;
}

.asr-panel-score {
	display: flex;
	align-items: baseline;
	gap: 6px;
	flex-wrap: wrap;
	margin-bottom: 6px;
}

.asr-score-number {
	font-size: 40px;
	font-weight: 700;
	line-height: 1;
	font-variant-numeric: tabular-nums;
}

.asr-score-total {
	color: var(--asr-ink-soft);
}

.asr-score-level {
	margin-left: 4px;
	padding: 4px 9px;
	border-radius: 5px;
	color: #fff;
	font-size: 12px;
	font-weight: 700;
}

.asr-panel-note,
.asr-panel-updated {
	margin: 4px 0;
	color: var(--asr-ink-soft);
	font-size: 12px;
}

.asr-panel-trend {
	margin: 6px 0 4px;
	font-size: 13px;
	color: var(--asr-ink-soft);
}

.asr-up {
	color: #15803d;
}

.asr-down {
	color: var(--asr-accent);
}

.asr-panel-heading {
	margin: 18px 0 8px;
	font-size: 13px;
	font-weight: 700;
}

.asr-risks {
	list-style: none;
	margin: 0;
	padding: 0;
	font-size: 13px;
}

.asr-risks li {
	display: flex;
	justify-content: space-between;
	gap: 10px;
	padding: 5px 0;
	border-bottom: 1px solid var(--asr-line);
}

.asr-risk-value {
	font-weight: 600;
	color: var(--asr-ink-soft);
}

.asr-risk-value[data-level="3"] {
	color: #b45309;
}

.asr-risk-value[data-level="4"],
.asr-risk-value[data-level="5"] {
	color: var(--asr-accent);
}

.asr-panel-editorial {
	margin: 0;
	font-size: 13px;
	color: #374151;
}

.asr-panel-articles {
	list-style: none;
	margin: 0;
	padding: 0;
	font-size: 13px;
}

.asr-panel-articles li {
	padding: 9px 0;
	border-bottom: 1px solid var(--asr-line);
}

.asr-panel-articles li:last-child {
	border-bottom: 0;
}

.asr-panel-articles a {
	display: block;
	color: var(--asr-ink);
	text-decoration: none;
	font-weight: 600;
}

.asr-panel-articles a:hover {
	text-decoration: underline;
}

.asr-panel-articles span {
	color: var(--asr-ink-soft);
	font-size: 12px;
}

/* Stav a prázdne stavy */

.asr-status {
	position: absolute;
	left: 12px;
	bottom: 12px;
	margin: 0;
	padding: 7px 12px;
	background: rgba(17, 24, 39, 0.9);
	color: #fff;
	border-radius: var(--asr-radius);
	font-size: 13px;
	z-index: 2;
}

.asr-status[hidden] {
	display: none;
}

.asr-empty {
	color: var(--asr-ink-soft);
	font-size: 14px;
}

/* Bublina článku */

.asr-popup {
	font-size: 13px;
}

.asr-popup-image {
	display: block;
	width: 100%;
	height: 110px;
	object-fit: cover;
	border-radius: 5px 5px 0 0;
}

.asr-popup-body {
	padding: 9px 10px 4px;
}

.asr-popup-tag,
.asr-event-tag {
	display: inline-block;
	margin-bottom: 5px;
	padding: 2px 7px;
	border-radius: 3px;
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.03em;
}

.asr-popup-title {
	display: block;
	color: #111827;
	font-weight: 700;
	line-height: 1.3;
	text-decoration: none;
}

.asr-popup-title:hover {
	text-decoration: underline;
}

.asr-popup-meta {
	margin: 5px 0 0;
	color: #6b7280;
	font-size: 12px;
}

/* Zoznam udalostí */

.asr-events {
	padding: 22px 16px 0;
}

.asr-events h2 {
	margin: 0 0 12px;
	font-size: 18px;
}

.asr-events-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
	gap: 14px;
}

.asr-event {
	border: 1px solid var(--asr-line);
	border-radius: var(--asr-radius);
	overflow: hidden;
	background: #fff;
	cursor: pointer;
}

.asr-event-image {
	display: block;
	width: 100%;
	height: 118px;
	object-fit: cover;
}

.asr-event-image--empty {
	background: #f3f4f6;
}

.asr-event-body {
	padding: 10px 12px 12px;
}

.asr-event-title {
	margin: 0 0 5px;
	font-size: 14px;
	line-height: 1.35;
}

.asr-event-title a {
	color: var(--asr-ink);
	text-decoration: none;
}

.asr-event-title a:hover {
	text-decoration: underline;
}

.asr-event-meta {
	margin: 0;
	color: var(--asr-ink-soft);
	font-size: 12px;
}

.asr-disclaimer {
	max-width: 70ch;
	margin: 22px auto 30px;
	padding: 0 16px;
	color: var(--asr-ink-soft);
	font-size: 12px;
	text-align: center;
}

/* Mobil */

/* Prekrytie mapy na dotykových zariadeniach */

.asr-touch-shield {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	padding-bottom: 22px;
	border: 0;
	background: rgba(11, 18, 32, 0.15);
	color: #fff;
	font: 600 14px/1.3 inherit;
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
	cursor: pointer;
}

.asr-legend-toggle {
	display: none;
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 3;
	appearance: none;
	border: 0;
	border-radius: var(--asr-radius);
	padding: 9px 14px;
	background: rgba(255, 255, 255, 0.96);
	color: var(--asr-ink);
	font: 600 13px/1 inherit;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
	cursor: pointer;
	min-height: 40px;
}

@media (max-width: 782px) {
	.asr-radar {
		/* dvh rešpektuje lištu prehliadača na mobile. */
		--asr-map-height: min(58dvh, 460px);
	}

	.asr-legend-toggle {
		display: block;
	}

	.asr-toolbar {
		gap: 8px;
	}

	.asr-toolbar-right {
		width: 100%;
	}

	.asr-toolbar-right .asr-field,
	.asr-toolbar-right select,
	.asr-toolbar-right input[type="search"] {
		width: 100%;
	}

	.asr-legend {
		display: none;
		top: 60px;
		right: 12px;
		max-width: calc(100% - 24px);
	}

	.asr-legend.is-open {
		display: block;
	}

	.asr-legend li {
		padding: 5px 0;
	}

	.asr-layers {
		top: auto;
		bottom: 12px;
		left: 12px;
		padding: 9px 11px;
		font-size: 12px;
	}

	.asr-panel {
		top: auto;
		left: 0;
		right: 0;
		bottom: 0;
		width: 100%;
		max-width: none;
		max-height: 70%;
		border-radius: var(--asr-radius) var(--asr-radius) 0 0;
	}

	.asr-status {
		bottom: auto;
		top: 12px;
	}
}

@media (max-width: 782px) {
	/* Dotykové ciele majú mať aspoň 44 px. */
	.asr-range {
		min-height: 42px;
		padding: 10px 15px;
	}

	.asr-layers label {
		min-height: 34px;
	}

	.asr-panel-close {
		font-size: 30px;
		padding: 6px 12px;
	}

	.asr-events-list {
		grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
		gap: 10px;
	}

	.asr-rankings {
		grid-template-columns: 1fr;
	}
}

@media (prefers-reduced-motion: reduce) {
	.asr-radar * {
		animation-duration: 0.01ms !important;
		transition-duration: 0.01ms !important;
	}
}

/* Popisky zhlukov (DOM markery namiesto textovej vrstvy MapLibre) */

.asr-cluster-label {
	display: block;
	color: #fff;
	font: 700 13px/1 system-ui, -apple-system, "Segoe UI", sans-serif;
	font-variant-numeric: tabular-nums;
	text-align: center;
	pointer-events: none;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

/* Rebríčky a svetový priemer */

.asr-rankings {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: 16px;
	padding: 24px 16px 0;
}

.asr-rank-card {
	border: 1px solid var(--asr-line, #e5e7eb);
	border-radius: var(--asr-radius, 8px);
	padding: 16px 18px 18px;
	background: #fff;
}

.asr-rank-card h2 {
	margin: 0 0 10px;
	font-size: 15px;
	font-weight: 700;
}

.asr-rank-list {
	margin: 0;
	padding-left: 20px;
	font-size: 14px;
}

.asr-rank-list li {
	display: flex;
	align-items: baseline;
	gap: 8px;
	padding: 5px 0;
	border-bottom: 1px solid var(--asr-line, #e5e7eb);
}

.asr-rank-list li:last-child {
	border-bottom: 0;
}

.asr-rank-list a {
	flex: 1;
	color: var(--asr-ink, #111827);
	text-decoration: none;
}

.asr-rank-list a:hover {
	text-decoration: underline;
}

.asr-rank-score,
.asr-rank-change {
	font-variant-numeric: tabular-nums;
	font-weight: 600;
	white-space: nowrap;
}

.asr-rank-change {
	min-width: 32px;
	text-align: right;
}

.asr-world-average {
	display: flex;
	align-items: baseline;
	gap: 6px;
	flex-wrap: wrap;
	margin: 0 0 6px;
}

.asr-world-number {
	font-size: 34px;
	font-weight: 700;
	line-height: 1;
	font-variant-numeric: tabular-nums;
}

.asr-world-total {
	color: var(--asr-ink-soft, #6b7280);
}

.asr-world-level {
	margin-left: 4px;
	font-size: 13px;
	font-weight: 700;
}

.asr-world-change {
	margin: 6px 0 0;
	font-size: 13px;
	color: var(--asr-ink-soft, #6b7280);
}

.asr-sparkline {
	display: block;
	width: 100%;
	max-width: 100%;
	height: auto;
	margin: 6px 0 0;
	overflow: visible;
}

.asr-panel-chart {
	margin: 10px 0 4px;
}

.asr-panel-more {
	flex: none;
	margin: 10px 0 0;
	padding-top: 10px;
	border-top: 1px solid var(--asr-line);
	font-size: 13px;
}

.asr-panel-more a {
	color: var(--asr-accent);
	font-weight: 600;
	text-decoration: none;
}

.asr-panel-more a:hover {
	text-decoration: underline;
}

/* Tlačidlo */

.asr-button {
	display: inline-block;
	padding: 9px 16px;
	border-radius: var(--asr-radius, 8px);
	background: var(--asr-accent, #dc2626);
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
}

.asr-button:hover,
.asr-button:focus {
	background: #b91c1c;
	color: #fff;
}

/* Detail krajiny */

.asr-country-page {
	max-width: 900px;
	padding: 0 16px 40px;
}

.asr-breadcrumb {
	padding: 24px 0 8px;
	font-size: 13px;
	color: var(--asr-ink-soft, #6b7280);
}

.asr-breadcrumb a {
	color: inherit;
}

.asr-breadcrumb span {
	margin: 0 6px 0 2px;
}

.asr-country-header h1 {
	margin: 0 0 12px;
	font-size: clamp(28px, 4vw, 40px);
	line-height: 1.1;
}

.asr-country-score {
	display: flex;
	align-items: baseline;
	gap: 8px;
	flex-wrap: wrap;
	margin-bottom: 6px;
}

.asr-country-trend,
.asr-country-unrated {
	margin: 4px 0 0;
	color: var(--asr-ink-soft, #6b7280);
	font-size: 14px;
}

.asr-country-actions {
	margin: 16px 0 0;
}

.asr-country-chart,
.asr-country-risks,
.asr-country-note,
.asr-country-articles {
	margin-top: 34px;
}

.asr-country-page h2 {
	margin: 0 0 12px;
	font-size: 18px;
}

.asr-country-page .asr-risks {
	max-width: 520px;
}

.asr-country-note p {
	margin: 0;
	max-width: 65ch;
}

/* Bublina s bezpečnostným prehľadom krajiny */

.asr-popup--country {
	padding: 12px 14px 14px;
	min-width: 220px;
}

.asr-popup-country {
	margin: 0 0 8px;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.2;
}

.asr-popup-score {
	display: flex;
	align-items: baseline;
	gap: 5px;
	flex-wrap: wrap;
	margin-bottom: 4px;
}

.asr-popup-number {
	font-size: 30px;
	font-weight: 700;
	line-height: 1;
	font-variant-numeric: tabular-nums;
}

.asr-popup-total {
	color: #6b7280;
	font-size: 13px;
}

.asr-popup-level {
	margin-left: 4px;
	padding: 3px 8px;
	border-radius: 4px;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
}

.asr-popup-heading {
	margin: 12px 0 5px;
	font-size: 12px;
	font-weight: 700;
	color: #374151;
}

.asr-popup-risks {
	list-style: none;
	margin: 0;
	padding: 0;
	font-size: 12px;
}

.asr-popup-risks li {
	display: flex;
	justify-content: space-between;
	gap: 10px;
	padding: 3px 0;
	border-bottom: 1px solid #f0f0f1;
}

.asr-popup-risks li:last-child {
	border-bottom: 0;
}

.asr-popup-button {
	display: block;
	width: 100%;
	margin-top: 12px;
	padding: 9px 12px;
	border: 0;
	border-radius: 6px;
	background: var(--asr-accent, #dc2626);
	color: #fff;
	font: 600 13px/1 inherit;
	cursor: pointer;
	min-height: 38px;
}

.asr-popup-button:hover,
.asr-popup-button:focus {
	background: #b91c1c;
}

/* Články sú v paneli hore, preto prvý nadpis nemá horný odstup */

.asr-panel-heading--first {
	margin-top: 4px;
}
