/* Naba Weather – alert card and map */

.nw {
	--nw-alert: #f4f8fa;
	--nw-ink: #15303b;
	--nw-mute: #5d7480;
	--nw-line: #d8e2e7;
	--nw-paper: #ffffff;
	--nw-wash: #f2f6f8;
	position: relative;
	box-sizing: border-box;
	margin: 0 0 1.75em;
	border: 1px solid var(--nw-line);
	border-top: 5px solid var(--nw-alert);
	border-radius: 6px;
	background: var(--nw-paper);
	color: var(--nw-ink);
	font-family: inherit;
	font-size: 15px;
	line-height: 1.8;
	overflow: hidden;
}
.nw.nw--white { border-top-color: #9fb3bd; }
.nw *, .nw *::before, .nw *::after { box-sizing: border-box; }

.nw-fallback { padding: 16px 18px; }
.nw[data-nw-ready] .nw-fallback { display: none; }

/* ---------- header ---------- */
.nw-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px 16px;
	padding: 12px 18px;
	border-bottom: 1px solid var(--nw-line);
}
.nw-badge {
	display: inline-block;
	padding: 1px 14px;
	border-radius: 4px;
	font-weight: 700;
	font-size: 1.05em;
	line-height: 1.7;
}
.nw-badge--white { background: #eef3f5; color: #1c2b33; box-shadow: inset 0 0 0 1px #aebfc8; }
.nw-badge--yellow { background: #f2c230; color: #2b2100; }
.nw-badge--orange { background: #ef8a2b; color: #2b1300; }
.nw-badge--red { background: #d8392f; color: #fff; }
.nw-state { color: var(--nw-mute); font-size: 0.93em; }
.nw[data-state="active"] .nw-state { color: var(--nw-ink); font-weight: 600; }
.nw[data-state="active"] .nw-state::before {
	content: "";
	display: inline-block;
	width: 8px;
	height: 8px;
	margin-inline-end: 8px;
	border-radius: 50%;
	background: #d8392f;
	animation: nw-pulse 1.6s ease-out infinite;
}

/* ---------- layout ---------- */
.nw-body {
	display: grid;
	grid-template-columns: minmax(250px, 340px) minmax(0, 1fr);
}
.nw-panel { padding: 16px 20px 20px; min-width: 0; }

/* ---------- stage (the map) ---------- */
.nw-stage {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 280px;
	background:
		radial-gradient(120% 70% at 50% 0%, #15546c 0%, rgba(21, 84, 108, 0) 70%),
		linear-gradient(180deg, #0d3347 0%, #08202f 100%);
}
.nw-svg {
	display: block;
	width: 100%;
	height: auto;
	max-height: min(78vh, 780px);
}

.nw-grid line { stroke: rgba(190, 228, 238, 0.1); stroke-width: 1; }
.nw-grid .nw-grid-eq { stroke: rgba(190, 228, 238, 0.28); stroke-dasharray: 4 5; }
.nw-grid-label { fill: rgba(190, 228, 238, 0.45); font-size: 9px; }

.nw-lagoon { fill: #2b8f93; fill-opacity: 0.38; }
.nw-reef { fill: none; stroke: #9fdcd3; stroke-opacity: 0.7; stroke-width: 1.5; stroke-linejoin: round; }
.nw-isle { fill: #f6ebc9; }
.nw-atoll { transition: opacity 0.2s; }
.nw-atoll.is-alert .nw-lagoon { fill: #43b7b0; fill-opacity: 0.55; }
.nw-atoll.is-alert .nw-reef { stroke: #d6f3ee; stroke-opacity: 0.95; stroke-width: 1.8; }
.nw-atoll.is-hot .nw-lagoon { fill-opacity: 0.8; }
.nw-atoll.is-hot .nw-reef { stroke: #ffffff; stroke-opacity: 1; }

.nw-male path { fill: #ffd66b; stroke: #0a2a39; stroke-width: 1; }

.nw-ring {
	fill: none;
	stroke: var(--nw-alert);
	stroke-width: 1.8;
	stroke-opacity: 0.95;
	stroke-dasharray: 6 4;
	filter: drop-shadow(0 0 3px var(--nw-alert));
}

.nw-label { fill: #cfe7ee; fill-opacity: 0.78; font-size: 11px; pointer-events: none; paint-order: stroke; stroke: #08202f; stroke-width: 3px; stroke-linejoin: round; }
.nw[lang="dv"] .nw-label { font-size: 13px; }
.nw-label.is-alert { fill: #ffffff; fill-opacity: 1; font-weight: 700; }
.nw-label--male { font-size: 10px; fill: #ffe39a; fill-opacity: 0.85; }

.nw-hit { fill: transparent; stroke: none; cursor: pointer; outline: none; }
.nw-hit:focus-visible { stroke: #ffffff; stroke-width: 2; stroke-dasharray: 3 3; }

.nw-caption {
	position: absolute;
	inset-inline: 12px;
	bottom: 12px;
	padding: 5px 12px;
	border-radius: 4px;
	background: rgba(5, 22, 31, 0.86);
	color: #eaf7f9;
	font-size: 0.9em;
	line-height: 1.6;
	text-align: center;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.18s;
}
.nw-caption.is-on { opacity: 1; }

.nw-view {
	position: absolute;
	top: 10px;
	inset-inline-start: 10px;
	display: flex;
	gap: 4px;
}
.nw-view-btn {
	padding: 1px 10px;
	border: 1px solid rgba(214, 239, 233, 0.35);
	border-radius: 4px;
	background: rgba(5, 22, 31, 0.55);
	color: #d6efe9;
	font-size: 0.82em;
	line-height: 1.7;
	cursor: pointer;
}
.nw-view-btn.is-on { background: #d6efe9; color: #08202f; border-color: #d6efe9; }
.nw-view-btn:focus-visible, .nw-layer-btn:focus-visible { outline: 2px solid #1b7f99; outline-offset: 2px; }

/* ---------- weather layers ---------- */
.nw-layer { transition: opacity 0.35s; }
.nw-layer.is-off { opacity: 0; visibility: hidden; transition: opacity 0.35s, visibility 0s 0.35s; }
.nw-gloom { fill: #06121b; }

.nw-rain { animation: nw-rain var(--dur, 1s) linear infinite; }
@keyframes nw-rain { from { transform: translateY(0); } to { transform: translateY(var(--len, 52px)); } }

.nw-cloud { animation: nw-drift var(--dur, 10s) ease-in-out var(--del, 0s) infinite alternate; }
@keyframes nw-drift { from { transform: translateX(calc(var(--dx, 8px) * -1)); } to { transform: translateX(var(--dx, 8px)); } }

.nw-windline {
	fill: none;
	stroke: #ffffff;
	stroke-width: 1.5;
	stroke-linecap: round;
	stroke-opacity: 0.6;
	stroke-dasharray: 34 130;
	animation: nw-wind var(--dur, 3s) linear var(--del, 0s) infinite;
}
@keyframes nw-wind { from { stroke-dashoffset: 164; } to { stroke-dashoffset: 0; } }

.nw-wave {
	fill: none;
	stroke: #c4ecf3;
	stroke-width: 1.3;
	stroke-linecap: round;
	animation: nw-shimmer var(--dur, 3s) ease-in-out var(--del, 0s) infinite alternate;
}
@keyframes nw-shimmer { from { stroke-opacity: 0.15; } to { stroke-opacity: 0.85; } }

.nw-bolt { opacity: 0; animation: nw-flash var(--dur, 6s) linear var(--del, 0s) infinite; }
@keyframes nw-flash {
	0%, 86%, 100% { opacity: 0; }
	88% { opacity: 1; }
	90% { opacity: 0.15; }
	92% { opacity: 1; }
	96% { opacity: 0; }
}

.nw--ended .nw-weather { filter: grayscale(1); opacity: 0.4; }
.nw--ended .nw-weather * { animation-play-state: paused; }

@keyframes nw-pulse {
	0% { box-shadow: 0 0 0 0 rgba(216, 57, 47, 0.55); }
	100% { box-shadow: 0 0 0 9px rgba(216, 57, 47, 0); }
}

/* ---------- panel ---------- */
.nw-facts { margin: 0 0 14px; }
.nw-fact { margin: 0 0 12px; }
.nw-fact dt { margin: 0; color: var(--nw-mute); font-size: 0.85em; line-height: 1.6; }
.nw-fact dd { margin: 0; }
.nw-range { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 10px; }
.nw-range-k { min-width: 5.2em; color: var(--nw-mute); font-size: 0.88em; }
.nw-num { font-variant-numeric: tabular-nums; }
.nw-tz { display: block; margin-top: 2px; color: var(--nw-mute); font-size: 0.82em; }

.nw-layers { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.nw-layer-btn {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 2px 13px 2px 11px;
	border: 1px solid #c3d1d8;
	border-radius: 999px;
	background: var(--nw-paper);
	color: var(--nw-mute);
	font: inherit;
	font-size: 0.92em;
	line-height: 1.7;
	cursor: pointer;
	transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.nw-layer-btn.is-on { background: #e4f1f4; border-color: #7db4c2; color: #0b3a4a; }
.nw-layer-btn svg { flex: none; }

.nw-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; padding: 0; list-style: none; }
.nw-chip {
	margin: 0;
	padding: 0 10px;
	border: 1px solid var(--nw-line);
	border-radius: 4px;
	background: var(--nw-wash);
	font-size: 0.86em;
	line-height: 1.8;
	cursor: default;
	transition: background 0.15s, border-color 0.15s;
}
.nw-chip.is-hot { background: #dff0f3; border-color: #5fa8b8; }

.nw-msg { padding-top: 12px; border-top: 1px solid var(--nw-line); }
.nw-msg h4 { margin: 0 0 4px; color: var(--nw-mute); font-size: 0.85em; font-weight: 600; }
.nw-msg p { margin: 0 0 8px; white-space: pre-line; }
.nw-msg .nw-src { margin: 0; color: var(--nw-mute); font-size: 0.84em; white-space: normal; }
.nw-msg a { color: #135f79; text-decoration: underline; text-underline-offset: 2px; }

/* ---------- small screens ---------- */
@media (max-width: 720px) {
	.nw-body { grid-template-columns: minmax(0, 1fr); }
	.nw-stage { min-height: 240px; }
	.nw-svg { max-height: 66vh; }
	.nw-panel { padding: 14px 16px 18px; }
	.nw-head { padding: 10px 16px; }
}

@media (prefers-reduced-motion: reduce) {
	.nw *, .nw *::before { animation: none !important; transition: none !important; }
	.nw-bolt { opacity: 0.85; }
}
