/* ==========================================================================
   Napoved neviht — public viewer styles (block / shortcode)
   ========================================================================== */

.nn-viewer {
	position: relative;
	width: 100%;
	max-width: 1700px;
	aspect-ratio: 1700 / 1200;
	background: #f3f3f3;
	border: none;
	border-radius: 0;
	overflow: hidden;
	font-family: "Nunito Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	color: #333333;
}
.nn-viewer, .nn-viewer * , .nn-viewer .leaflet-container,
.nn-stage, .nn-stage * , .nn-stage .leaflet-container {
	font-family: "Nunito Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}
.nn-viewer.is-archive { border-color: #b58fd9; }

/* Remove Leaflet's default control margins so title/legend can touch edges. */
.nn-viewer .leaflet-top.leaflet-left .leaflet-control {
	margin-top: 0 !important;
	margin-left: 0 !important;
}
.nn-viewer .leaflet-bottom.leaflet-right .leaflet-control {
	margin-bottom: 0 !important;
	margin-right: 0 !important;
}

.nn-stage {
	position: absolute;
	top: 0;
	left: 0;
	width: 1700px;
	height: 1200px;
	transform: scale(var(--nn-scale, 1));
	transform-origin: top left;
}

.nn-map {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

/* ---------- Title card (top-left) ---------- */
/* Scaled +30% over the original v0.1.137 values. Logo now spans the full
 * inner height of the card (top to bottom) instead of a fixed pixel height. */
.nn-title-card {
	background: rgba(255,255,255,0.20);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	box-shadow: 0 2px 8px rgba(0,0,0,0.08);
	padding: 34px 43px;
	border-radius: 0;
	min-width: 707px;
	max-width: 1170px;   /* prevent "Velja ... do" wrapping */
	font-size: 31px;
	line-height: 1.3;
	color: #333333;
	position: relative;
	/* Logo layout: keep gap between logo and text. */
	--nn-logo-gap-left: 0px;
	--nn-logo-gap-right: 23px;
	/* Reserved slot for the logo image (aspect 1024/575 ≈ 1.78). */
	--nn-logo-w: 245px;
}
.nn-title-row { position: relative; display: flex; align-items: stretch; gap: 16px; min-height: 130px; }
/* Logo stretches from top to bottom of the row (i.e. the inner edges of the card). */
.nn-logo {
	position: absolute;
	left: var(--nn-logo-gap-left);
	top: 0;
	bottom: 0;
	height: 100%;
	width: auto;
	max-width: var(--nn-logo-w);
	aspect-ratio: 1024 / 575;
	object-fit: contain;
}
.nn-title-text {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	justify-content: center;
	/* left gap + reserved logo width + gap to text */
	padding-left: calc(var(--nn-logo-w) + var(--nn-logo-gap-left) + var(--nn-logo-gap-right));
}
.nn-title-h1 {
	font-size: 43px;
	font-weight: 800;
	letter-spacing: 0.04em;
	line-height: 1.05;
	color: #333333;
	margin: 0 0 5px 0;
}
.nn-title-meta { font-size: 29px; color: #333333; }
.nn-title-meta > div { white-space: nowrap; } /* keep "Velja ... do" on one line */
.nn-title-meta strong { font-weight: 600; }
.nn-title-empty { opacity: 0.95; font-weight: 700; }
.nn-archive-badge {
	background: #fbb006;
	color: #000;
	font-weight: 700;
	padding: 6px 14px;
	border-radius: 0;
	font-size: 18px;
	letter-spacing: 0.08em;
	align-self: center;   /* prevent vertical stretch in the flex row */
	flex: 0 0 auto;
}

/* ---------- Legend card (bottom-right) ---------- */
/* Uniformly +10% over the previous values (v0.1.140 baseline). The fixed info
 * popup above the legend follows the legend's offsetWidth (computed in JS),
 * so widening the legend automatically widens the popup as well. */
.nn-legend-card {
	background: rgba(255,255,255,0.20);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	box-shadow: 0 2px 8px rgba(0,0,0,0.08);
	padding: 22px 26px 15px;
	border-radius: 0;
	max-width: 628px;
	font-size: 20px;
	color: #333333;
	line-height: 1.35;
}
/* NOTE: avoid flexbox `gap` here — html-to-image/foreignObject can mis-handle it,
   causing seemingly random early line wraps in PNG exports. Use margins instead. */
.nn-legend-rows { display: flex; flex-direction: column; }
.nn-legend-row { display: flex; align-items: center; margin-bottom: 0; }
.nn-legend-row:last-child { margin-bottom: 0; }
.nn-legend-row { flex-wrap: nowrap; }
.nn-legend-text {
	display: inline-block;
	white-space: nowrap;
	word-break: keep-all;
}
.nn-swatch {
	display: inline-block;
	width: 45px; height: 29px;
	border-radius: 0;
	border: none;
	flex: 0 0 auto;
	margin-right: 9px;
}
.nn-legend-name { font-weight: 700; color: #333333; }
.nn-legend-desc { color: #333333; opacity: 0.85; }
.nn-legend-disclaimer {
	margin-top: 9px;
	font-size: 15px;
	color: #333333;
	opacity: 0.85;
	border-top: none;
	padding-top: 7px;
}
.nn-legend-attribution {
	margin-top: 11px;
	font-size: 13px;
	color: #333333;
	opacity: 0.85;
	font-style: normal;
}
.nn-legend-attribution a,
.nn-legend-attribution a:visited,
.nn-legend-attribution a:hover,
.nn-legend-attribution a:active {
	color: inherit;
	text-decoration: none;
}

/* ---------- Polygons ---------- */
.nn-poly { transition: filter 0.15s; cursor: pointer; }
.nn-poly { stroke-linecap: round; stroke-linejoin: round; }
.nn-poly:hover { filter: opacity(0.75); }
.nn-poly.is-selected {
	stroke: #14213d !important;
	stroke-width: 2 !important;
	stroke-opacity: 0.85 !important;
}

/* ---------- Empty state ---------- */
.nn-empty-state {
	position: absolute;
	inset: 0;
	display: none;            /* shown by JS when no active forecast */
	align-items: center;
	justify-content: center;
	pointer-events: none;
	z-index: 700;
}
.nn-empty-state-inner {
	background: rgba(255,255,255,0.20);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	border-radius: 8px;
	padding: 22px 34px;
	box-shadow: 0 2px 10px rgba(0,0,0,0.1);
	font-size: 26px;
	color: #333333;
	font-weight: 600;
}

/* ---------- Action bar ---------- */
.nn-actions {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 750;
	display: flex;
	gap: 8px;
}
.nn-zoom {
	background: rgba(255,255,255,0.20);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	color: #333333;
	border: 1px solid rgba(20,33,61,0.22);
	width: 52px;
	height: 52px;
	padding: 0;
	border-radius: 0;
	font-size: 30px;
	font-weight: 700;
	cursor: pointer;
	box-shadow: 0 2px 6px rgba(0,0,0,0.10);
	display: inline-flex;
	align-items: center;
	justify-content: center;
}
.nn-zoom .nn-icon svg {
	width: 26px;
	height: 26px;
	display: block;
}
.nn-zoom .nn-icon svg path {
	fill: currentColor;
}
.nn-zoom:hover { filter: brightness(0.98); }

.nn-zoom .nn-icon-zoom-out { display: none; }
.nn-viewer.is-lightbox .nn-zoom .nn-icon-zoom-in { display: none; }
.nn-viewer.is-lightbox .nn-zoom .nn-icon-zoom-out { display: inline; }

.nn-export-png .nn-action-text { display: inline; }
.nn-export-png .nn-action-text { text-transform: lowercase; }
.nn-export-png {
	background: rgba(255,255,255,0.20);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	color: #333333;
	border: 1px solid rgba(20,33,61,0.22);
	height: 52px;
	padding: 0 18px;
	border-radius: 0;
	font-size: 20px;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 2px 6px rgba(0,0,0,0.15);
	display: inline-flex;
	align-items: center;
}
.nn-export-png:hover { filter: brightness(0.98); }

/* Hide Leaflet attribution (we render a fixed one inside legend). */
.nn-viewer .leaflet-control-attribution { display: none !important; }

/* Hide MapTiler/MapLibre watermark logo (attribution is rendered in legend). */
.nn-viewer a.maplibregl-ctrl-logo { display: none !important; }

/* Popup should match card style too. */
.leaflet-popup.nn-popup .leaflet-popup-content-wrapper {
	background: rgba(255,255,255,0.20);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
}
.leaflet-popup.nn-popup .leaflet-popup-content { color: #333333; }

/* ---------- Lightbox (image-like zoom) ---------- */
.nn-lightbox {
	position: fixed;
	inset: 0;
	z-index: 999999;
	background: rgba(0,0,0,0.55);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}
.nn-lightbox-frame {
	width: min(95vw, 1700px);
	aspect-ratio: 1700 / 1200;
}
.nn-lightbox .nn-viewer {
	max-width: none;
	width: 100%;
	height: 100%;
	border-radius: 0;
	box-shadow: 0 12px 50px rgba(0,0,0,0.35);
}

/* ---------- Popup ---------- */
.nn-viewer .leaflet-control { z-index: 1000 !important; }
.nn-viewer .leaflet-control-container { z-index: 1000 !important; }
/* Make popups win against theme CSS and our overlays. */
.nn-viewer .leaflet-popup-pane { z-index: 15000 !important; }
.nn-viewer .leaflet-popup { z-index: 15001 !important; }
.nn-viewer .leaflet-tooltip-pane { z-index: 4900 !important; }
.leaflet-marker-pane { z-index: 600; }
.leaflet-shadow-pane { z-index: 500; }
.leaflet-popup.nn-popup .leaflet-popup-content {
	font-size: 13px;
	line-height: 1.45;
	color: #14213d;
	text-align: justify;
	text-justify: inter-word;
}
.leaflet-popup.nn-popup .leaflet-popup-content-wrapper {
	max-height: 320px;
	overflow: hidden;
	border-radius: 0;
}
.leaflet-popup.nn-popup .leaflet-popup-content {
	max-height: 280px;
	overflow: auto;
	margin: 10px 12px;
	width: 100%;
}

/* Remove the small "speech bubble" arrow for our popups. */
.leaflet-popup.nn-popup .leaflet-popup-tip-container,
.leaflet-popup.nn-popup .leaflet-popup-tip {
	display: none;
}

/* ---------- Fixed info popup (above legend) ---------- */
.nn-fixed-popup {
	position: absolute;
	z-index: 20000;
	background: rgba(255,255,255,0.20);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	border: none;
	/* No shadow bleeding into the legend below. */
	box-shadow: 0 -2px 8px rgba(0,0,0,0.08);
	padding: 0;
	overflow: hidden;
	color: #14213d;
	box-sizing: border-box; /* match legend width precisely */
	pointer-events: auto;
}
.nn-fixed-popup-head {
	position: relative;
	height: 42px; /* fixed non-scroll header (+10%) */
	background: transparent;
}
.nn-fixed-popup-body {
	/* Deterministic scrolling region (works across browsers). */
	height: calc(100% - 42px - 13px);
	overflow-y: auto;
	overflow-x: hidden;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
	touch-action: pan-y;
	text-align: justify;
	text-justify: inter-word;
	font-size: 1.1em;            /* +10% versus 1em baseline */
	padding: 0 40px 13px 15px;   /* +10% scrollbar gutter / bottom pad */
	scrollbar-width: thin;
	scrollbar-color: rgba(20,33,61,0.35) rgba(255,255,255,0.08);
}
.nn-fixed-popup-foot {
	height: 13px; /* non-scrollable bottom padding (+10%) */
	flex: 0 0 auto;
}
.nn-fixed-popup-body::-webkit-scrollbar { width: 11px; height: 11px; }
.nn-fixed-popup-body::-webkit-scrollbar-track { background: rgba(255,255,255,0.08); }
.nn-fixed-popup-body::-webkit-scrollbar-thumb { background: rgba(20,33,61,0.30); }
.nn-fixed-popup-body::-webkit-scrollbar-thumb:hover { background: rgba(20,33,61,0.45); }
.nn-fixed-popup-body::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
.nn-fixed-popup-close {
	position: absolute;
	top: 9px;
	right: 18px;
	background: transparent;
	border: none;
	color: #333333;
	font-size: 20px;
	font-weight: 700;
	cursor: pointer;
	line-height: 1;
	padding: 0;
	z-index: 3;
}

/* ---------- Archive grid ---------- */
.nn-archive {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 16px;
}
.nn-archive-item {
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 6px;
	padding: 12px 14px;
	font-size: 14px;
}
.nn-archive-item h3 {
	margin: 0 0 6px 0;
	font-size: 15px;
	color: #14213d;
}
.nn-archive-item .nn-archive-meta {
	color: #4a5568;
	font-size: 12px;
	margin-bottom: 8px;
}
.nn-archive-pagination {
	margin-top: 16px;
	display: flex;
	gap: 8px;
	justify-content: center;
}
.nn-archive-pagination a, .nn-archive-pagination span {
	padding: 6px 10px;
	border-radius: 4px;
	text-decoration: none;
	color: #14213d;
	background: #f3f4f7;
}
.nn-archive-pagination .current {
	background: #14213d;
	color: #fff;
}

/* --- Forecast Text label ---------------------------------------------- */
/* Render the "Povzetek napovedi:" label inline with the first paragraph
 * of the summary text instead of dropping the body to the next line. */
.nn-forecast-text__label {
	display: inline;
	font-size: inherit;
	margin: 0;
	padding: 0;
}
.nn-forecast-text__label::after { content: ' '; }
.nn-forecast-text__label strong { font-weight: 700; }
.nn-forecast-text__label + p { display: inline; margin: 0; }

/* --- Forecast Dates block --------------------------------------------- */
/* Applied only to the inner .nn-forecast-dates so the archive wrapper
   (.nn-archive-dates contains .nn-forecast-dates) does not compound em. */
.nn-forecast-dates {
	font-size: 1.5em;
	font-weight: 700;
	line-height: 1.3;
}
.nn-forecast-dates div,
.nn-forecast-dates strong {
	font-weight: 700;
}
/* Reset any inherited cascade on the archive wrapper itself. */
.nn-archive-dates {
	font-size: 1em;
	font-weight: 400;
}

/* --- Archive Browser -------------------------------------------------- */
.nn-archive-browser {
	font-family: 'Nunito Sans', sans-serif;
	margin-bottom: 20px;
	background: #4d4d4d;
	padding: 16px;
	border-radius: 0;
}
.nn-archive-browser__filters {
	display: flex;
	flex-wrap: nowrap;
	gap: 16px;
	align-items: flex-end;
}
.nn-archive-browser__label {
	display: flex;
	flex-direction: column;
	gap: 6px;
	font-size: 15px;
	font-weight: 700;
	color: #f2f2f2;
	flex: 0 1 auto;
}
.nn-archive-browser__label select {
	font-family: 'Nunito Sans', sans-serif;
	font-size: 14px;
	padding: 8px 12px;
	border: 1px solid #808080;
	border-radius: 0;
	background: #4d4d4d;
	color: #f2f2f2;
	cursor: pointer;
	width: auto;
	min-width: 0;
}
/* Per-control widths: year is the narrowest, forecast a bit wider. */
.nn-archive-browser__label--year select {
	width: 110px;
}
.nn-archive-browser__label--level select {
	width: 260px;
}
.nn-archive-browser__label--forecast select {
	width: 220px;
}
.nn-archive-browser__label select option {
	background: #4d4d4d;
	color: #f2f2f2;
}
.nn-archive-browser__label select:focus,
.nn-archive-browser__label select:focus-visible,
.nn-archive-browser__label select:active {
	border-color: #fbb006;
	outline: none;
	box-shadow: 0 0 0 1px #fbb006;
}
@media (max-width: 600px) {
	.nn-archive-browser__filters {
		flex-wrap: wrap;
	}
	.nn-archive-browser__label--year select,
	.nn-archive-browser__label--level select,
	.nn-archive-browser__label--forecast select {
		width: 100%;
	}
	.nn-archive-browser__label {
		flex: 1 1 100%;
	}
}
