/* Luchtkwaliteit Kempen - widget styles */

.lkk-widget {
	--lkk-border: #e3e3e3;
	--lkk-text: #222;
	--lkk-muted: #666;
	max-width: 560px;
	border: 1px solid var(--lkk-border);
	border-radius: 10px;
	padding: 16px 18px 14px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: var(--lkk-text);
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
	position: relative;
	box-sizing: border-box;
}
.lkk-widget * {
	box-sizing: border-box;
}

.lkk-error {
	color: #a94442;
	font-size: 14px;
	padding: 8px 0;
}

.lkk-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 12px;
}
.lkk-title {
	font-size: 14px;
	color: var(--lkk-muted);
}
.lkk-info-btn {
	width: 22px;
	height: 22px;
	line-height: 20px;
	border-radius: 50%;
	border: 1px solid #bbb;
	background: #f7f7f7;
	color: #555;
	font-size: 13px;
	font-weight: bold;
	cursor: pointer;
	padding: 0;
	flex-shrink: 0;
}
.lkk-info-btn:hover {
	background: #eee;
}

.lkk-info-wrap {
	position: relative;
	display: inline-block;
	line-height: 0;
}

/* The legend is a floating popover anchored to the "?" button: shown on
   hover (mouse) and on focus/`.is-open` (keyboard + touch, via script.js). */
.lkk-legend {
	display: none;
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	width: 480px;
	max-width: min(480px, calc(100vw - 32px));
	background: #fff;
	border: 1px solid var(--lkk-border);
	border-radius: 8px;
	box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
	padding: 14px 16px;
	z-index: 30;
	text-align: left;
	line-height: 1.4;
}
.lkk-info-wrap:hover .lkk-legend,
.lkk-info-wrap:focus-within .lkk-legend,
.lkk-info-wrap.is-open .lkk-legend {
	display: block;
}
/* Small arrow pointing up at the button. */
.lkk-legend::before {
	content: "";
	position: absolute;
	top: -6px;
	right: 8px;
	width: 12px;
	height: 12px;
	background: #fff;
	border-left: 1px solid var(--lkk-border);
	border-top: 1px solid var(--lkk-border);
	transform: rotate(45deg);
}

.lkk-main {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-bottom: 18px;
}
.lkk-badge {
	flex-shrink: 0;
	width: 72px;
	height: 72px;
	border-radius: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	font-size: 32px;
	font-weight: 700;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}
.lkk-category {
	font-size: 21px;
	font-weight: 700;
	line-height: 1.2;
}
.lkk-desc {
	font-size: 13px;
	color: var(--lkk-muted);
	margin-top: 2px;
}
.lkk-updated {
	font-size: 12px;
	color: #999;
	margin-top: 4px;
}

.lkk-history {
	border-top: 1px solid var(--lkk-border);
	padding-top: 12px;
}
.lkk-row {
	margin-bottom: 10px;
}
.lkk-row-label {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	font-size: 13px;
	margin-bottom: 4px;
}
.lkk-row-name {
	font-weight: 600;
	color: var(--lkk-muted);
}
.lkk-row-current {
	font-weight: 700;
	color: var(--lkk-text);
}
.lkk-row-current small {
	font-weight: 400;
	color: var(--lkk-muted);
}
.lkk-axis {
	display: flex;
	gap: 1px;
	padding: 0 2px;
	margin-bottom: 2px;
}
.lkk-tick {
	flex: 1 1 auto;
	min-width: 2px;
	font-size: 10px;
	line-height: 1.4;
	color: #999;
	text-align: center;
	white-space: nowrap;
}
.lkk-tick.is-day {
	font-weight: 700;
	color: var(--lkk-muted);
}

.lkk-bars {
	display: flex;
	align-items: stretch;
	gap: 1px;
	height: 40px;
	background: #fafafa;
	border-radius: 4px;
	padding: 2px;
}
.lkk-col {
	flex: 1 1 auto;
	min-width: 2px;
	display: flex;
	align-items: flex-end;
	border-left: 1px solid transparent;
}
.lkk-col.is-tick {
	border-left-color: rgba(0, 0, 0, 0.08);
}
.lkk-col.is-today {
	background: rgba(255, 196, 0, 0.14);
	border-radius: 1px;
}
.lkk-bar {
	width: 100%;
	min-height: 1px;
	border-radius: 1px 1px 0 0;
	transition: height 0.2s ease;
}
.lkk-legend-dot {
	display: inline-block;
	width: 9px;
	height: 9px;
	border-radius: 2px;
	vertical-align: middle;
	margin-right: 2px;
}
.lkk-legend-dot.is-today {
	background: rgba(255, 196, 0, 0.5);
}
.lkk-row-minmax {
	display: flex;
	justify-content: flex-end;
	gap: 12px;
	font-size: 11px;
	color: #999;
	margin-top: 2px;
}
.lkk-history-footnote {
	font-size: 11px;
	color: #aaa;
	text-align: right;
	margin-top: 4px;
}
.lkk-copyright {
	font-size: 11px;
	color: #bbb;
	text-align: center;
	margin-top: 12px;
	padding-top: 8px;
	border-top: 1px solid var(--lkk-border);
}

.lkk-legend-title {
	font-size: 13px;
	font-weight: 700;
	margin-bottom: 8px;
}
.lkk-legend-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	grid-auto-flow: column;
	grid-template-rows: repeat(5, auto);
	column-gap: 14px;
	row-gap: 8px;
}
.lkk-legend-row {
	display: flex;
	align-items: flex-start;
	gap: 6px;
	font-size: 11.5px;
	line-height: 1.35;
}
.lkk-legend-swatch {
	flex-shrink: 0;
	width: 22px;
	height: 22px;
	border-radius: 5px;
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 11px;
	text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25);
}
.lkk-legend-text {
	color: var(--lkk-muted);
}
.lkk-legend-source {
	font-size: 11px;
	color: #aaa;
	margin-top: 4px;
}

@media (max-width: 420px) {
	.lkk-badge {
		width: 58px;
		height: 58px;
		font-size: 26px;
	}
	.lkk-category {
		font-size: 18px;
	}
	/* Two columns get too cramped on very small screens; stack instead. */
	.lkk-legend-grid {
		grid-template-columns: 1fr;
		grid-auto-flow: row;
		grid-template-rows: none;
	}
}

/* Dark-theme friendly override for themes using prefers-color-scheme */
@media (prefers-color-scheme: dark) {
	.lkk-widget {
		background: #1e1e1e;
		border-color: #333;
		color: #eee;
	}
	.lkk-bars {
		background: #2a2a2a;
	}
	.lkk-col.is-tick {
		border-left-color: rgba(255, 255, 255, 0.12);
	}
	.lkk-col.is-today {
		background: rgba(255, 196, 0, 0.1);
	}
	.lkk-info-btn {
		background: #2a2a2a;
		border-color: #555;
		color: #ddd;
	}
	.lkk-legend {
		background: #262626;
		border-color: #444;
	}
	.lkk-legend::before {
		background: #262626;
		border-color: #444;
	}
}
