/**
 * Vodostaji 2.0 — progressive-enhancement and chart refinements.
 * Loaded after vm-styles.css so this file can remain small and isolated.
 *
 * @version 3.1.0
 */

.vm-vod-root {
	--vm-vod-v2-surface: var(--vm-card-bg, #fff);
	--vm-vod-v2-surface: color-mix(in srgb, var(--vm-card-bg, #fff) 94%, #e0f2fe 6%);
	--vm-vod-v2-muted: var(--vm-bg-secondary, #f1f5f9);
	--vm-vod-v2-muted: color-mix(in srgb, var(--vm-bg-secondary, #f1f5f9) 92%, #dbeafe 8%);
}

.ct-container.vm-vod-pseo-layout {
	display: block;
	width: 100%;
	max-width: 1500px;
	padding-top: 1.25rem;
	padding-bottom: 2rem;
}

.vm-vod-pseo-layout .vm-vod-root {
	width: 100%;
	min-width: 0;
}

.vm-vod-breadcrumb {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem 0.55rem;
	margin: 0 0 1rem;
	color: var(--vm-text-muted, #64748b);
	font-size: 0.82rem;
}

.vm-vod-pseo-hero h1 {
	margin: 0.2rem 0 0.55rem;
	color: var(--vm-text-primary, #0f172a);
	font-size: clamp(1.8rem, 4vw, 2.8rem);
	line-height: 1.12;
}

.vm-vod-pseo .vm-vod-table-wrap {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

/* Server-side status compatibility classes use the hero vocabulary. */
.vm-vod-status-pill--normal { background: #e0f2fe; color: #075985; }
.vm-vod-status-pill--elevated { background: #fef9c3; color: #854d0e; }
.vm-vod-status-pill--warn { background: #ffedd5; color: #9a3412; }
.vm-vod-status-pill--danger { background: #fee2e2; color: #991b1b; }

/* The user-requested level history is the first detailed product block. */
.vm-vod-level-card {
	position: relative;
	contain: layout style;
	min-height: 430px;
}

.vm-vod-chart-card {
	position: relative;
}

/* Reserve the chart box while Chart.js is fetched to prevent layout shift. */
.vm-vod-chart-state:not([hidden]) + .vm-vod-chart-wrap {
	display: block !important;
}

.vm-vod-chart-state:not([hidden]) {
	position: absolute;
	z-index: 3;
	top: 1.1rem;
	right: 1.2rem;
	left: 1.2rem;
	display: grid;
	min-height: 330px;
	place-items: center;
	border: 0;
	background: color-mix(in srgb, var(--vm-card-bg, #fff) 86%, transparent);
	backdrop-filter: blur(3px);
}

.vm-vod-level-card .vm-vod-chart-state:not([hidden]) {
	min-height: 350px;
}

.vm-vod-chart-state.is-empty {
	background: color-mix(in srgb, var(--vm-card-bg, #fff) 94%, transparent);
}

.vm-vod-chart-wrap canvas {
	display: block;
	max-width: 100%;
}

/* Ranges without sufficient daily coverage stay visible but cannot be chosen. */
.vm-vod-periods button.is-locked,
.vm-vod-periods button:disabled {
	position: relative;
	padding-right: 1.55rem;
	color: var(--vm-text-muted, #64748b) !important;
	cursor: not-allowed;
	opacity: 0.55;
}

.vm-vod-periods button.is-locked::after,
.vm-vod-periods button:disabled::after {
	position: absolute;
	top: 50%;
	right: 0.48rem;
	content: "\1F512";
	font-size: 0.62rem;
	transform: translateY(-50%);
}

.vm-vod-periods button:disabled:hover {
	transform: none !important;
}

/* Server-rendered snapshot: crawlable and useful before/no JavaScript. */
.vm-vod-ssr {
	overflow: hidden;
	border: 1px solid var(--vm-vod-border, #cbd5e1);
	border-radius: 16px;
	background: var(--vm-vod-v2-surface);
	box-shadow: 0 7px 22px rgba(15, 23, 42, 0.05);
}

.vm-vod-ssr__note {
	margin: 0 !important;
	padding: 0.75rem 0.9rem;
	border-bottom: 1px solid var(--vm-vod-border, #cbd5e1);
	background: var(--vm-vod-v2-muted);
	color: var(--vm-text-secondary, #475569);
	font-size: 0.74rem;
	line-height: 1.5;
	text-align: left !important;
}

.vm-vod-ssr__table-wrap {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.vm-vod-ssr__table {
	width: 100%;
	min-width: 720px;
	margin: 0 !important;
	border: 0 !important;
	border-collapse: collapse;
	font-size: 0.76rem;
}

.vm-vod-ssr__table caption {
	padding: 0.72rem 0.85rem;
	color: var(--vm-text-primary, #0f172a);
	font-weight: 900;
	text-align: left;
}

.vm-vod-ssr__table th,
.vm-vod-ssr__table td {
	padding: 0.62rem 0.85rem;
	border: 0;
	border-top: 1px solid var(--vm-vod-border, #cbd5e1);
	color: var(--vm-text-secondary, #475569);
	font-variant-numeric: tabular-nums;
	text-align: left;
	white-space: nowrap;
}

.vm-vod-ssr__table thead th,
.vm-vod-ssr__table tbody th {
	color: var(--vm-text-primary, #0f172a);
	font-weight: 850;
}

.vm-vod-stations--ssr-fallback .vm-vod-ssr {
	border-color: #f59e0b;
}

/* Secondary model: collapsed by default and unambiguously labelled as flow. */
.vm-vod-glofas {
	overflow: clip;
	border: 1px solid var(--vm-vod-border, #cbd5e1);
	border-radius: 17px;
	background: var(--vm-vod-v2-surface);
}

.vm-vod-glofas__summary {
	position: relative;
	display: flex;
	min-height: 76px;
	align-items: center;
	justify-content: space-between;
	gap: 0.8rem;
	padding: 1rem 3.25rem 1rem 1.1rem;
	color: var(--vm-text-primary, #0f172a);
	cursor: pointer;
	list-style: none;
}

.vm-vod-glofas__summary::-webkit-details-marker {
	display: none;
}

.vm-vod-glofas__summary::after {
	position: absolute;
	top: 50%;
	right: 1.15rem;
	content: "+";
	color: #7c3aed;
	font-size: 1.45rem;
	font-weight: 500;
	line-height: 1;
	transform: translateY(-50%);
	transition: transform 160ms ease;
}

.vm-vod-glofas[open] .vm-vod-glofas__summary::after {
	transform: translateY(-50%) rotate(45deg);
}

.vm-vod-glofas__heading {
	color: var(--vm-text-primary, #0f172a);
	font-size: 1.05rem;
	font-weight: 900;
}

.vm-vod-glofas__heading small {
	color: #6d28d9;
	font-size: 0.68rem;
	font-weight: 900;
}

.vm-vod-glofas__teaser {
	color: var(--vm-text-muted, #64748b);
	font-size: 0.72rem;
	font-weight: 700;
	text-align: right;
}

.vm-vod-glofas__body {
	padding: 0 1.1rem 1.1rem;
	border-top: 1px solid var(--vm-vod-border, #cbd5e1);
}

.vm-vod-glofas__body > .vm-vod-section__lead {
	margin-top: 1rem !important;
}

/* Fixed pSEO station/river contexts never imply a combined centimetre series. */
.vm-vod-root--station .vm-vod-level-controls .vm-vod-select:disabled {
	opacity: 1;
	cursor: default;
}

.vm-vod-root--station .vm-vod-station-section .vm-vod-filters,
.vm-vod-root--station .vm-vod-station-section .vm-vod-scope,
.vm-vod-root--river .vm-vod-filter-field,
.vm-vod-root--river .vm-vod-scope {
	display: none;
}

.vm-vod-root--station .vm-vod-cards {
	grid-template-columns: minmax(0, 520px);
}

.vm-vod-table-wrap[tabindex]:focus-visible,
.vm-vod-ssr__table-wrap:focus-visible {
	outline: 3px solid rgba(14, 165, 233, 0.42);
	outline-offset: 2px;
}

[data-theme="dark"] .vm-vod-root {
	--vm-vod-v2-surface: rgba(30, 41, 59, 0.84);
	--vm-vod-v2-muted: rgba(15, 23, 42, 0.7);
}

[data-theme="dark"] .vm-vod-chart-state:not([hidden]) {
	background: rgba(15, 23, 42, 0.84);
}

[data-theme="dark"] .vm-vod-ssr__note,
[data-theme="dark"] .vm-vod-ssr__table th,
[data-theme="dark"] .vm-vod-ssr__table td,
[data-theme="dark"] .vm-vod-glofas__teaser {
	color: #cbd5e1;
}

[data-theme="dark"] .vm-vod-ssr__table caption,
[data-theme="dark"] .vm-vod-ssr__table thead th,
[data-theme="dark"] .vm-vod-ssr__table tbody th,
[data-theme="dark"] .vm-vod-glofas__summary,
[data-theme="dark"] .vm-vod-glofas__heading {
	color: #f8fafc;
}

[data-theme="dark"] .vm-vod-glofas__heading small {
	color: #c4b5fd;
}

@media (max-width: 600px) {
	.vm-vod-level-card {
		min-height: 350px;
	}

	.vm-vod-chart-state:not([hidden]),
	.vm-vod-level-card .vm-vod-chart-state:not([hidden]) {
		top: 0.7rem;
		right: 0.7rem;
		left: 0.7rem;
		min-height: 275px;
	}

	.vm-vod-glofas__summary {
		min-height: 84px;
		align-items: flex-start;
		flex-direction: column;
		justify-content: center;
	}

	.vm-vod-glofas__teaser {
		text-align: left;
	}

	.vm-vod-glofas__body {
		padding-right: 0.7rem;
		padding-bottom: 0.7rem;
		padding-left: 0.7rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.vm-vod-glofas__summary::after {
		transition: none;
	}
}

@media print {
	.vm-vod-view-switch,
	.vm-vod-filters,
	.vm-vod-periods,
	.vm-vod-card__open,
	.vm-vod-glofas {
		display: none !important;
	}

	.vm-vod-ssr__table-wrap,
	.vm-vod-table-wrap {
		max-height: none;
		overflow: visible;
	}
}
