/* UV Verwachting - compacte kaart [uv_compact] (startpagina/widget) */

.uvfc {
	--uvfc-bg: #ffffff;
	--uvfc-border: #e3e3e3;
	--uvfc-text: #222222;
	--uvfc-muted: #666666;
	--uvfc-faint: #8a8f94;
	--uvfc-sep: #eceff1;
	--uvfc-inner: #f0f1f3;
	--uvfc-inner-hover: #e4e6e9;

	/* Smalle kaart (standaard 360px). De hoogte volgt de inhoud: ingeklapt een
	   compacte kaart, uitgeschoven de volledige kaart. Breder of smaller maken
	   kan via Extra CSS, bv.:  :root { --uvfc-width: 320px; } */
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: var(--uvfc-width, 360px);
	margin: 0 auto;
	padding: 16px 18px 14px;
	position: relative;
	background: var(--uvfc-bg);
	color: var(--uvfc-text);
	border: 1px solid var(--uvfc-border);
	border-radius: 10px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 14px;
	line-height: 1.4;
	text-align: left;
}
.uvfc *,
.uvfc *::before,
.uvfc *::after {
	box-sizing: border-box;
}

.uvfc--dark {
	--uvfc-bg: #1a1b1d;
	--uvfc-border: #2c2e31;
	--uvfc-text: #e6e6e6;
	--uvfc-muted: #a6a9ad;
	--uvfc-faint: #8e9195;
	--uvfc-sep: rgba(255, 255, 255, 0.09);
	--uvfc-inner: rgba(255, 255, 255, 0.07);
	--uvfc-inner-hover: rgba(255, 255, 255, 0.13);
}
.uvfc--darkblue {
	--uvfc-bg: #0d1b2a;
	--uvfc-border: #1d3247;
	--uvfc-text: #eaf2fa;
	--uvfc-muted: #a9c2d9;
	--uvfc-faint: #8aa5bd;
	--uvfc-sep: rgba(255, 255, 255, 0.09);
	--uvfc-inner: rgba(255, 255, 255, 0.07);
	--uvfc-inner-hover: rgba(255, 255, 255, 0.13);
}

.uvfc-error {
	padding: 8px 0;
	font-size: 14px;
	color: #a94442;
}
.uvfc--dark .uvfc-error,
.uvfc--darkblue .uvfc-error {
	color: #f08a86;
}

/* --- Titel + "?" --- */
.uvfc-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 12px;
}
.uvfc-title {
	font-size: 14px;
	color: var(--uvfc-muted);
}
.uvfc-title strong {
	color: var(--uvfc-text);
	font-weight: 700;
}

/* Het uitlegvenster is verankerd aan de hele kaart (niet aan het kleine
   icoontje), zodat het ook in een smalle kaart volledig zichtbaar blijft. */
.uvfc-help-wrap {
	display: inline-block;
	flex-shrink: 0;
}
.uvfc-help {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	border: 1px solid var(--uvfc-border);
	background: var(--uvfc-inner);
	color: var(--uvfc-muted);
	font-size: 13px;
	font-weight: 700;
	line-height: 1;
	cursor: help;
	user-select: none;
}
.uvfc-help:hover,
.uvfc-help:focus {
	background: var(--uvfc-inner-hover);
	outline: none;
}
.uvfc-help:focus-visible {
	outline: 2px solid var(--uvfc-muted);
	outline-offset: 2px;
}
.uvfc-legend {
	display: none;
	position: absolute;
	top: 46px;
	left: 12px;
	right: 12px;
	z-index: 30;
	padding: 12px 14px;
	background: var(--uvfc-bg);
	color: var(--uvfc-text);
	border: 1px solid var(--uvfc-border);
	border-radius: 8px;
	box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
	font-size: 12.5px;
}
.uvfc-help-wrap:hover .uvfc-legend,
.uvfc-help-wrap:focus-within .uvfc-legend {
	display: block;
}
.uvfc-legend-title {
	margin-bottom: 8px;
	font-size: 13px;
	font-weight: 700;
}
.uvfc-legend-row {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 4px 0;
}
.uvfc-legend-swatch {
	flex: none;
	min-width: 42px;
	padding: 2px 6px;
	border-radius: 6px;
	font-size: 11.5px;
	font-weight: 700;
	text-align: center;
	line-height: 1.5;
}
.uvfc-legend-text {
	color: var(--uvfc-muted);
}
.uvfc-legend-text strong {
	color: var(--uvfc-text);
}

/* --- Groot cijferblok + status --- */
.uvfc-main {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 14px;
}
.uvfc-badge {
	flex: none;
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 54px;
	height: 54px;
	padding: 0 6px;
	border-radius: 10px;
	font-size: 24px;
	font-weight: 700;
	line-height: 1;
	font-variant-numeric: tabular-nums;
}
.uvfc-status {
	min-width: 0;
}
.uvfc-category {
	font-size: 21px;
	font-weight: 700;
	line-height: 1.2;
}
.uvfc-tone {
	color: var(--uvfc-ct, var(--uvfc-text));
}
.uvfc--dark .uvfc-tone,
.uvfc--darkblue .uvfc-tone {
	color: var(--uvfc-c, var(--uvfc-text));
}
.uvfc-desc {
	margin-top: 2px;
	font-size: 13px;
	color: var(--uvfc-muted);
}
.uvfc-now {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-top: 4px;
	font-size: 12px;
	color: var(--uvfc-faint);
}
/* Live-indicator: pulserend bolletje zolang de waarde van het weerstation komt. */
.uvfc-dot {
	display: none;
	flex: none;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #2e9e4f;
	box-shadow: 0 0 0 0 rgba(46, 158, 79, 0.5);
	animation: uvfc-pulse 2s ease-out infinite;
}
.uvfc.is-measured .uvfc-dot {
	display: inline-block;
}
.uvfc.is-stale .uvfc-dot {
	background: var(--uvfc-faint);
	animation: none;
}
.uvfc.is-stale .uvfc-badge {
	opacity: 0.6;
}
@keyframes uvfc-pulse {
	0%   { box-shadow: 0 0 0 0 rgba(46, 158, 79, 0.5); }
	70%  { box-shadow: 0 0 0 6px rgba(46, 158, 79, 0); }
	100% { box-shadow: 0 0 0 0 rgba(46, 158, 79, 0); }
}
@media (prefers-reduced-motion: reduce) {
	.uvfc-dot {
		animation: none;
	}
}

/* --- Kerncijfers van vandaag --- */
.uvfc-stats {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 6px;
	padding: 10px 0 12px;
	border-top: 1px solid var(--uvfc-sep);
	text-align: center;
}
.uvfc-stat {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}
.uvfc-stat + .uvfc-stat {
	border-left: 1px solid var(--uvfc-sep);
}
.uvfc-stat-label {
	font-size: 11px;
	color: var(--uvfc-faint);
}
.uvfc-stat-value {
	font-size: 13.5px;
	font-weight: 700;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

/* --- Secties (uurgrafiek, komende dagen) --- */
.uvfc-section {
	padding: 10px 0 0;
	border-top: 1px solid var(--uvfc-sep);
}
.uvfc-section + .uvfc-section {
	margin-top: 10px;
}
.uvfc-section-title {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 6px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var(--uvfc-faint);
}

/* Uurbalkjes */
.uvfc-bars {
	position: relative;
	display: flex;
	align-items: flex-end;
	gap: 2px;
	height: 58px;
}
.uvfc-col {
	position: relative;
	flex: 1 1 0;
	min-width: 0;
	height: 100%;
	display: flex;
	align-items: flex-end;
	border-radius: 3px 3px 0 0;
}
.uvfc-bar {
	display: block;
	width: 100%;
	min-height: 0;
	border-radius: 3px 3px 0 0;
}
.uvfc-col.is-past .uvfc-bar {
	opacity: 0.45;
}
/* Het huidige uur: lichte achtergrondband achter het balkje. */
.uvfc-col.is-now {
	background: rgba(120, 130, 140, 0.18);
	box-shadow: 0 0 0 1px rgba(120, 130, 140, 0.35);
}
.uvfc-threshold {
	position: absolute;
	left: 0;
	right: 0;
	z-index: 2;
	height: 0;
	border-top: 1px dashed var(--uvfc-faint);
	pointer-events: none;
}
.uvfc-axis {
	display: flex;
	gap: 2px;
	margin-top: 3px;
}
.uvfc-tick {
	position: relative;
	flex: 1 1 0;
	min-width: 0;
	height: 13px;
}
.uvfc-tick > span {
	position: absolute;
	left: 50%;
	top: 0;
	transform: translateX(-50%);
	font-size: 10px;
	line-height: 13px;
	color: var(--uvfc-faint);
	white-space: nowrap;
}
.uvfc-key {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 10.5px;
	font-weight: 400;
	letter-spacing: 0;
	text-transform: none;
}
.uvfc-dash {
	display: inline-block;
	width: 16px;
	height: 0;
	border-top: 1px dashed var(--uvfc-faint);
}

/* Komende dagen */
.uvfc-days {
	display: flex;
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.uvfc-day {
	flex: 1 1 0;
	min-width: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	margin: 0;
	padding: 0;
}
.uvfc-day-name {
	font-size: 11.5px;
	font-weight: 600;
	color: var(--uvfc-muted);
	white-space: nowrap;
}
.uvfc-day-pill {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	max-width: 64px;
	padding: 5px 0;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.2;
	font-variant-numeric: tabular-nums;
}

.uvfc-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* --- "Toon meer"-knop en het uitschuifbare deel --- */
.uvfc-more {
	display: block;
}
.uvfc-toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin: 2px 0 0;
	padding: 9px 16px;
	border-radius: 999px;
	background: var(--uvfc-inner);
	color: var(--uvfc-text);
	font-size: 13px;
	font-weight: 500;
	line-height: 1.2;
	list-style: none;
	cursor: pointer;
	user-select: none;
	transition: background 0.15s ease;
}
.uvfc-toggle::-webkit-details-marker {
	display: none;
}
.uvfc-toggle::marker {
	content: '';
}
.uvfc-toggle:hover {
	background: var(--uvfc-inner-hover);
}
.uvfc-toggle:focus-visible {
	outline: 2px solid var(--uvfc-muted);
	outline-offset: 2px;
}
.uvfc-toggle-less {
	display: none;
}
.uvfc-more[open] .uvfc-toggle-more {
	display: none;
}
.uvfc-more[open] .uvfc-toggle-less {
	display: inline;
}
.uvfc-chev {
	flex: none;
	width: 7px;
	height: 7px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg) translateY(-2px);
	transition: transform 0.2s ease;
}
.uvfc-more[open] .uvfc-chev {
	transform: rotate(-135deg) translateY(-2px);
}
.uvfc-more-body {
	padding-top: 12px;
}
/* Eerste sectie sluit direct aan op de knop: geen extra scheidingslijn. */
.uvfc-more-body > .uvfc-section:first-child {
	border-top: 0;
	padding-top: 0;
}
@media (prefers-reduced-motion: reduce) {
	.uvfc-chev {
		transition: none;
	}
}

/* --- Knop naar de volledige pagina + bronregel --- */
.uvfc a.uvfc-btn {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.6em;
	margin: 14px 0 0;
	padding: 10px 16px;
	border-radius: 999px;
	background: var(--uvfc-inner);
	color: var(--uvfc-text);
	font-size: 13px;
	font-weight: 500;
	line-height: 1.2;
	text-decoration: none;
	transition: background 0.15s ease;
}
.uvfc a.uvfc-btn:hover,
.uvfc a.uvfc-btn:focus-visible {
	background: var(--uvfc-inner-hover);
	color: var(--uvfc-text);
	text-decoration: none;
}
.uvfc-foot {
	margin-top: 12px;
	font-size: 11px;
	line-height: 1.5;
	text-align: center;
	color: var(--uvfc-faint);
}
.uvfc-foot a {
	color: inherit;
	text-decoration: underline;
	text-decoration-color: rgba(138, 143, 148, 0.5);
}
.uvfc-foot a:hover,
.uvfc-foot a:focus {
	color: var(--uvfc-text);
}

@media (max-width: 380px) {
	.uvfc {
		padding: 14px 14px 12px;
	}
	.uvfc-badge {
		min-width: 48px;
		height: 48px;
		font-size: 21px;
	}
	.uvfc-category {
		font-size: 19px;
	}
	.uvfc-stat-value {
		font-size: 12.5px;
	}
}
