*, *::before, *::after { box-sizing: border-box; }

body {
	margin: 0;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	color: #1c2733;
	background: #f6f8fa;
	line-height: 1.5;
}

a { color: #0b67c2; }

/* --- hlavička --- */
.site-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: .7rem 1.2rem;
	background: #0b3d66;
	color: #fff;
}

.brand {
	color: #fff;
	text-decoration: none;
	font-weight: 700;
	font-size: 1.25rem;
	letter-spacing: .02em;
}

.controls { display: flex; align-items: center; gap: 1rem; }
.controls .nav-link { color: rgba(255, 255, 255, .85); text-decoration: none; font-size: .95rem; }
.controls .nav-link:hover { color: #fff; text-decoration: underline; }
.site-footer a { color: #7a8894; }

.breadcrumb { font-size: .85rem; color: #7a8894; margin: 0 0 .6rem; }
.breadcrumb a { color: #5b6874; text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

.summary { max-width: 70ch; color: #3b4854; line-height: 1.6; }
.station-header .summary { margin: .4rem 0 1rem; }

.country-grid { list-style: none; padding: 0; margin: 1.2rem 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .6rem 1.2rem; }
.country-grid a { text-decoration: none; }
.country-grid small { display: block; color: #7a8894; }

.station-table { width: 100%; border-collapse: collapse; margin-top: 1.2rem; background: #fff; border: 1px solid #e2e8ee; border-radius: 10px; overflow: hidden; }
.station-table th, .station-table td { padding: .45rem .7rem; text-align: left; border-bottom: 1px solid #eef2f5; font-variant-numeric: tabular-nums; }
.station-table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: #7a8894; background: #f6f8fa; }
.station-table .num { text-align: right; }
.station-table .hot { color: #c62815; }
.station-table .cold { color: #0b67c2; }
.station-table a { text-decoration: none; font-weight: 600; }
.station-table small { color: #7a8894; margin-left: .3rem; }

.records-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; margin-top: 1.2rem; }
@media (max-width: 800px) { .records-grid { grid-template-columns: 1fr; } }
.record-list { background: #fff; border: 1px solid #e2e8ee; border-radius: 10px; padding: 1rem 1.2rem; }
.record-list h2 { margin: 0 0 .6rem; font-size: 1.1rem; }
.record-list.hot h2 { color: #c62815; }
.record-list.cold h2 { color: #0b67c2; }
.record-list ol { margin: 0; padding: 0; list-style: none; counter-reset: rank; }
.record-list li { display: flex; gap: .8rem; padding: .2rem .4rem; font-variant-numeric: tabular-nums; align-items: baseline; }
.record-list li::before { counter-increment: rank; content: counter(rank) '.'; min-width: 2.2rem; text-align: right; color: #7a8894; font-size: .85em; }
.record-list li:nth-child(odd) { background: #f6f8fa; }
.record-list .name { flex: 1; min-width: 0; }
.record-list .name a { text-decoration: none; font-weight: 600; }
.record-list .name small { color: #7a8894; margin-left: .3rem; }
.record-list .date { color: #5b6874; white-space: nowrap; }
.record-list .temp { font-weight: 600; min-width: 5.5rem; text-align: right; }
.record-list.hot .temp { color: #c62815; }
.record-list.cold .temp { color: #0b67c2; }
.record-list.warm .temp { color: #c62815; }

.nearby { margin-top: 2rem; }
.nearby ul { list-style: none; padding: 0; margin: .6rem 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .5rem 1.2rem; }
.nearby a { text-decoration: none; font-weight: 600; }
.nearby small { display: block; color: #7a8894; }

.button { display: inline-block; padding: .5rem 1rem; background: #0b3d66; color: #fff; border-radius: 6px; text-decoration: none; }

#unit-toggle {
	background: rgba(255, 255, 255, .12);
	color: #fff;
	border: 1px solid rgba(255, 255, 255, .35);
	border-radius: 4px;
	padding: .2rem .6rem;
	font: inherit;
	cursor: pointer;
}

main { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1.2rem 3rem; }

.site-footer {
	text-align: center;
	padding: 1rem;
	color: #7a8894;
	font-size: .85rem;
}

/* --- úvodná stránka --- */
.hero { text-align: center; margin: 2.5rem 0 1.5rem; }
.hero h1 { font-size: 2rem; margin-bottom: .3rem; }
.hero p { color: #5b6874; margin-top: 0; }

.search-box { position: relative; max-width: 480px; margin: 1.5rem auto 0; }

.station-search {
	width: 100%;
	padding: .75rem 1rem;
	font-size: 1.05rem;
	border: 1px solid #c4ced7;
	border-radius: 8px;
}

.search-results {
	position: absolute;
	inset-inline: 0;
	top: calc(100% + 4px);
	background: #fff;
	border: 1px solid #c4ced7;
	border-radius: 8px;
	box-shadow: 0 8px 24px rgba(9, 30, 51, .12);
	overflow: hidden;
	z-index: 1000;
	text-align: left;
}

.search-results a {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	padding: .55rem .9rem;
	text-decoration: none;
	color: inherit;
}

.search-results a:hover, .search-results a.focus { background: #eef4fa; }
.search-results .meta { color: #7a8894; font-size: .85rem; white-space: nowrap; }
.search-results .empty { padding: .55rem .9rem; color: #7a8894; }

/* vyhľadávanie v hlavičke (všetky stránky okrem úvodnej) */
.site-header { flex-wrap: wrap; gap: .6rem 1rem; }
.header-search { flex: 1 1 220px; max-width: 320px; margin: 0; }
.header-search .station-search { padding: .4rem .7rem; font-size: .9rem; border-radius: 6px; }
.header-search .search-results { color: #1d2b36; }
@media (max-width: 640px) {
	.header-search { order: 3; flex-basis: 100%; max-width: none; }
}

#map.map-small { height: 340px; margin: 1rem 0 1.5rem; }
.records-countries { margin-top: 2.5rem; }
.records-countries .hint { margin-top: 0; }

.map-hint { text-align: center; color: #5b6874; margin: 1.2rem 0 .6rem; }

#map { height: 460px; border-radius: 10px; }

.longest-records { margin-top: 2.5rem; }
.longest-records h2 { margin-bottom: .2rem; }
.longest-records .hint { color: #5b6874; margin-top: 0; }

.longest-records ol {
	margin: 0;
	padding: .6rem 1.2rem;
	list-style: none;
	counter-reset: rank;
	background: #fff;
	border: 1px solid #e2e8ee;
	border-radius: 10px;
}

.longest-records li {
	display: flex;
	gap: 1rem;
	align-items: baseline;
	padding: .3rem .4rem;
	font-variant-numeric: tabular-nums;
}

.longest-records li:nth-child(odd) { background: #f6f8fa; }

.longest-records li::before {
	counter-increment: rank;
	content: counter(rank) '.';
	min-width: 2.2rem;
	text-align: right;
	color: #7a8894;
	font-size: .85em;
}

.longest-records .name { flex: 1; }
.longest-records .name a { text-decoration: none; font-weight: 600; }
.longest-records .name a:hover { text-decoration: underline; }
.longest-records .name small { color: #7a8894; margin-left: .3rem; }
.longest-records .period { color: #5b6874; }
.longest-records .days { min-width: 7.5rem; text-align: right; font-weight: 600; }

@media (max-width: 600px) {
	.longest-records li { flex-wrap: wrap; }
	.longest-records .days { min-width: 0; }
}

/* --- detail stanice --- */
.station-header h1 { margin-bottom: .5rem; }
.station-header .country { color: #7a8894; font-size: .7em; font-weight: 400; }

.station-facts {
	display: flex;
	flex-wrap: wrap;
	gap: .8rem 2.2rem;
	margin: 0 0 1.5rem;
	padding: 1rem 1.2rem;
	background: #fff;
	border: 1px solid #e2e8ee;
	border-radius: 10px;
}

.station-facts dt { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: #7a8894; }
.station-facts dd { margin: 0; font-size: 1.15rem; font-weight: 600; }
.station-facts dd small { font-weight: 400; color: #7a8894; margin-left: .3rem; }
.record.hot span { color: #c62815; }
.record.cold span { color: #0b67c2; }

.station-facts dd.record small time { white-space: nowrap; }
.station-facts dd.period-dates { font-size: 1rem; }
.station-facts dd.period-dates time { white-space: nowrap; }

/* --- teplotné pruhy --- */
.stripes-wrap { margin-top: 1.2rem; }
.stripes {
	display: flex;
	height: 64px;
	border-radius: 6px;
	overflow: hidden;
}
.stripes span { flex: 1 1 0; min-width: 1px; }
.stripes-wrap .hint { font-size: .85rem; color: #5b6874; margin: .4rem 0 0; }

.chart-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
	gap: 1.2rem;
}
.chart-grid h3 { margin: 0 0 .4rem; font-size: 1rem; color: #1c2733; }
.chart.chart-small { height: 280px; }

.count-toggle button[data-var] { text-transform: lowercase; }

.chart-section { margin-top: 2rem; }

.chart-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

.count-toggle { display: flex; border: 1px solid #c4ced7; border-radius: 6px; overflow: hidden; }

.count-toggle button {
	border: 0;
	background: #fff;
	padding: .3rem .7rem;
	font: inherit;
	cursor: pointer;
	color: #5b6874;
}

.count-toggle button + button { border-left: 1px solid #c4ced7; }
.count-toggle button.active { background: #0b3d66; color: #fff; }
.chart-section .hint { color: #5b6874; margin-top: -.4rem; }
.chart { height: 420px; background: #fff; border: 1px solid #e2e8ee; border-radius: 10px; }

.top-lists {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1.2rem;
	margin-top: 1.2rem;
}

@media (max-width: 640px) {
	.top-lists { grid-template-columns: 1fr; }
}

.top-list {
	background: #fff;
	border: 1px solid #e2e8ee;
	border-radius: 10px;
	padding: 1rem 1.2rem;
}

.top-list h3 { margin: 0 0 .6rem; font-size: 1rem; }
.top-list.hot h3 { color: #c62815; }
.top-list.cold h3 { color: #0b67c2; }

.top-list ol {
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: rank;
}

.top-list .show-more {
	display: block;
	width: 100%;
	margin-top: .6rem;
	padding: .4rem;
	border: 1px solid #c4ced7;
	border-radius: 6px;
	background: #f6f8fa;
	font: inherit;
	font-size: .9rem;
	color: #0b67c2;
	cursor: pointer;
}

.top-list .show-more:hover { background: #eef4fa; }

.top-list li {
	display: flex;
	gap: 1rem;
	padding: .15rem .4rem;
	font-variant-numeric: tabular-nums;
}

.top-list li::before {
	counter-increment: rank;
	content: counter(rank) '.';
	min-width: 2.2rem;
	text-align: right;
	color: #7a8894;
	font-size: .85em;
	line-height: inherit;
}

.top-list .date { flex: 1; }
.top-list li[hidden] { display: none; }
.top-list li:nth-child(odd) { background: #f6f8fa; }
.top-list .temp { font-weight: 600; }
.top-list.hot .temp { color: #c62815; }
.top-list.cold .temp { color: #0b67c2; }

.notice {
	padding: .8rem 1.2rem;
	background: #fff8e6;
	border: 1px solid #eadfb0;
	border-radius: 8px;
}

.flash { max-width: 1100px; margin: .8rem auto 0; padding: .6rem 1.2rem; border-radius: 8px; background: #e7f2ff; }
.flash.updating { background: #fff4d6; border: 1px solid #f0d58c; color: #5a4300; text-align: center; }

/* --- statické stránky --- */
.page { max-width: 72ch; }
.page .lead { font-size: 1.1rem; color: #3b4854; line-height: 1.6; }
.page h2 { margin-top: 1.8rem; font-size: 1.2rem; }
.page ul.plain { padding-left: 1.2rem; line-height: 1.6; }
.page code { background: #eef2f5; padding: .1rem .3rem; border-radius: 3px; }

/* --- cookie lišta --- */
.consent {
	position: fixed;
	inset-inline: 0;
	bottom: 0;
	z-index: 2000;
	background: #fff;
	border-top: 1px solid #c4ced7;
	box-shadow: 0 -4px 20px rgba(0, 0, 0, .12);
	padding: 1rem 1.2rem;
}
.consent[hidden] { display: none; }
.consent-body { max-width: 1100px; margin: 0 auto; }
.consent p { margin: 0 0 .6rem; line-height: 1.5; }
.consent-actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.button.secondary { background: #eef2f5; color: #0b3d66; border: 1px solid #c4ced7; }
.consent .button { font: inherit; cursor: pointer; border: 0; }
.consent .link { background: none; border: 0; color: #0b67c2; font: inherit; cursor: pointer; text-decoration: underline; }
