/* ==========================================================================
   Vremenska postaja Lendavske Gorice – nova podoba
   Privzeta je temna tema, svetla se vklopi z gumbom v zgornjem levem kotu.
   ========================================================================== */

:root {
	color-scheme: dark;

	--bg: #171923;
	--surface: #262936;
	--surface-2: #2e3243;
	--header-bg: rgba(23, 25, 35, .85);
	--border: rgba(255, 255, 255, .08);
	--text: #e9ebf3;
	--muted: #9ba1b8;
	--accent: #35a9e1;
	--accent-soft: rgba(53, 169, 225, .16);
	--link: #7cc4ff;
	--shadow: 0 10px 30px rgba(0, 0, 0, .35);
	--icon-filter: none;
	--radius: 16px;
}

:root[data-theme="light"] {
	color-scheme: light;

	--bg: #f1f3f9;
	--surface: #ffffff;
	--surface-2: #eceff7;
	--header-bg: rgba(255, 255, 255, .88);
	--border: rgba(25, 30, 60, .1);
	--text: #1c2033;
	--muted: #5b627a;
	--accent: #1479b0;
	--accent-soft: rgba(20, 121, 176, .1);
	--link: #1760a8;
	--shadow: 0 8px 24px rgba(30, 40, 80, .12);
	--icon-filter: invert(1);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	font-family: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
	font-size: 16px;
	line-height: 1.5;
	color: var(--text);
	background: var(--bg);
	transition: background-color .25s, color .25s;
}

img { max-width: 100%; height: auto; }
a { color: var(--link); }
a:hover { text-decoration: none; }

.container {
	width: min(1120px, 100% - 32px);
	margin-inline: auto;
}

:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

/* ---------- Glava ---------- */

.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: var(--header-bg);
	-webkit-backdrop-filter: blur(12px);
	backdrop-filter: blur(12px);
	border-bottom: 1px solid var(--border);
}

.header-inner {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 10px 0;
	position: relative;
}

.theme-toggle,
.menu-toggle {
	flex: none;
	display: inline-grid;
	place-items: center;
	width: 42px;
	height: 42px;
	padding: 0;
	color: var(--text);
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 50%;
	cursor: pointer;
	transition: background-color .2s, border-color .2s;
}
.theme-toggle:hover,
.menu-toggle:hover { border-color: var(--accent); }

/* v temni temi pokaži sonce (klik → svetla), v svetli luno (klik → temna) */
.theme-toggle .icon-moon { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }

.branding {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-right: auto;
	min-width: 0;
	color: inherit;
	text-decoration: none;
}
.logo { height: 44px; width: auto; flex: none; }
.logo-type { display: flex; flex-direction: column; min-width: 0; }
.site-title { font-size: 1.25rem; font-weight: 700; line-height: 1.2; letter-spacing: .01em; }
.site-description { color: var(--muted); font-size: .8rem; }

.menu-toggle { display: none; }
.menu {
	display: flex;
	gap: 4px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.menu a {
	display: block;
	padding: 8px 16px;
	color: var(--text);
	text-decoration: none;
	border-radius: 999px;
	transition: background-color .2s;
}
.menu a:hover { background: var(--surface-2); }
.menu a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 500; }

/* ---------- Hero ---------- */

.hero {
	position: relative;
	height: clamp(200px, 34vw, 360px);
	background-size: cover;
	background-position: center;
	background-color: var(--surface);
}
.hero::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(to bottom, rgba(0, 0, 0, .1) 0%, var(--bg) 100%);
}
:root[data-theme="light"] .hero::after {
	background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, var(--bg) 100%);
}

/* ---------- Trenutno vreme + napoved ---------- */

.forecast-table {
	position: relative;
	z-index: 1;
	margin-top: -110px;
}

.forecast-container {
	display: grid;
	grid-template-columns: minmax(260px, 1.3fr) repeat(var(--n, 4), minmax(0, 1fr));
	gap: 12px;
}

.forecast {
	display: flex;
	flex-direction: column;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	overflow: hidden;
}

.forecast-header {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 8px;
	padding: 12px 16px;
	background: var(--surface-2);
	border-bottom: 1px solid var(--border);
	font-size: .9rem;
}
.forecast-header .day { font-weight: 500; text-transform: capitalize; }
.forecast-header .date { color: var(--muted); font-variant-numeric: tabular-nums; }

.forecast-content {
	flex: 1;
	padding: 16px;
	text-align: center;
}
/* Vsaka vrstica ima fiksno višino, zato so ikona, temperatura in veter v vseh blokih poravnani */
.forecast:not(.today) .forecast-content {
	display: flex;
	flex-direction: column;
	align-items: center;
}
.forecast-icon {
	display: grid;
	place-items: center;
	width: 56px;
	height: 56px;
	margin-bottom: 6px;
}
.forecast-icon img {
	display: block;
	width: 48px;
	height: 48px;          /* preglasi globalni "height: auto", ki je kvaril poravnavo */
	max-width: none;
	object-fit: contain;
}
.forecast-content .degree { font-size: 1.7rem; font-weight: 300; line-height: 1.2; white-space: nowrap; }
.forecast-min,
.forecast-wind { color: var(--muted); font-size: .85rem; line-height: 1.5; }
.forecast-min { margin-top: 6px; }
.forecast-wind { min-height: 1.5em; }

.forecast.today {
	background: linear-gradient(160deg, var(--surface-2), var(--surface));
	border-color: var(--accent);
}
.forecast.today .forecast-content { text-align: left; }
.forecast.today .location { color: var(--muted); font-size: .95rem; }
/* Velikost pisave je omejena tako, da se tudi "-30,0 °C" skupaj z ikono termometra
   izide v kartico (ta je v mreži široka vsaj 260 px) */
.forecast.today .degree {
	font-size: clamp(2rem, 5vw, 3.25rem);
	font-weight: 500;
	color: var(--accent);
	margin: 2px 0 12px;
	white-space: nowrap;
}
/* Ikona termometra levo od velike temperature (višina sledi velikosti številke) */
.forecast.today .degree { display: flex; align-items: center; gap: .2em; }
.temp-icon { height: .85em; width: auto; max-width: none; flex: none; filter: var(--icon-filter); }

.chips {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px 14px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.chips li { display: flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.chips img { height: 22px; width: auto; filter: var(--icon-filter); }

/* ---------- Kartice s podatki ---------- */

.main-content { padding: 32px 0 24px; }

.cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
	gap: 20px;
}

.card {
	padding: 20px 22px 12px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
}
.card--wide { grid-column: 1 / -1; }

.card-title {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: baseline;
	gap: 4px 16px;
	margin: 0 0 8px;
	font-size: 1.3rem;
	font-weight: 400;
}
.card-title b { color: var(--accent); font-weight: 500; font-variant-numeric: tabular-nums; }

.stats { margin: 0; }
.stat {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 16px;
	padding: 10px 0;
	border-bottom: 1px solid var(--border);
}
.stat:last-child { border-bottom: 0; }
.stat dt { color: var(--muted); }
.stat dd { margin: 0; text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; }

.card--wide .stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
	column-gap: 40px;
}
.card--wide .stat:last-child { border-bottom: 1px solid var(--border); }

/* ---------- Grafi ---------- */

.section-heading { margin: 36px 0 16px; font-size: 1.3rem; font-weight: 400; }

.graphs {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
	gap: 20px;
}
.graph-card {
	display: flex;
	flex-direction: column;
	margin: 0;
	padding: 14px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
}
.graph-card figcaption { margin-bottom: 10px; font-size: .95rem; color: var(--muted); }
/* Slika je v sredini okvirja po širini in višini (kartice so enako visoke) */
.graph-card a {
	flex: 1;
	display: grid;
	place-items: center;
	border-radius: 10px;
	overflow: hidden;
	cursor: zoom-in;
	background: var(--surface-2);
}
.graph-card img { display: block; width: auto; max-width: 100%; height: auto; transition: transform .25s; }
.graph-card a:hover img { transform: scale(1.02); }

/* ---------- Noga ---------- */

.site-footer {
	margin-top: 32px;
	padding: 28px 0 40px;
	background: var(--surface);
	border-top: 1px solid var(--border);
	text-align: center;
	color: var(--muted);
	font-size: .9rem;
}
.social-links { display: flex; justify-content: center; gap: 10px; margin-bottom: 16px; }
.social-links a {
	display: inline-grid;
	place-items: center;
	width: 40px;
	height: 40px;
	color: var(--text);
	background: var(--surface-2);
	border: 1px solid var(--border);
	border-radius: 50%;
	transition: color .2s, border-color .2s;
}
.social-links a:hover { color: var(--accent); border-color: var(--accent); }
.colophon { margin: 0 0 14px; }

/* ---------- Nazaj na vrh ---------- */

.back-to-top {
	position: fixed;
	right: 16px;
	bottom: 16px;
	z-index: 40;
	display: grid;
	place-items: center;
	width: 46px;
	height: 46px;
	padding: 0;
	color: var(--accent);
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 50%;
	box-shadow: var(--shadow);
	cursor: pointer;
	opacity: 0;
	visibility: hidden;
	transform: translateY(10px);
	transition: opacity .25s, transform .25s, visibility .25s, border-color .2s, color .2s;
}
.back-to-top.visible {
	opacity: 1;
	visibility: visible;
	transform: none;
}
.back-to-top:hover { background: var(--accent-soft); border-color: var(--accent); }

/* ---------- Lightbox ---------- */

.lb {
	position: fixed;
	inset: 0;
	z-index: 100;
	display: none;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	padding: 56px 16px 24px;
	background: rgba(8, 10, 16, .92);
}
.lb.open { display: flex; }
.lb img { max-width: 100%; max-height: calc(100vh - 150px); max-height: calc(100dvh - 150px); object-fit: contain; border-radius: 8px; background: #fff; }
.lb-caption { color: #e9ebf3; font-size: .95rem; text-align: center; }
.lb button {
	position: absolute;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	color: #fff;
	font-size: 26px;
	line-height: 1;
	background: rgba(255, 255, 255, .12);
	border: 0;
	border-radius: 50%;
	cursor: pointer;
}
.lb button:hover { background: rgba(255, 255, 255, .25); }
.lb-close { top: 10px; right: 10px; }
.lb-prev, .lb-next { top: 50%; transform: translateY(-50%); }
.lb-prev { left: 10px; }
.lb-next { right: 10px; }
body.lb-open { overflow: hidden; }

/* ---------- Odzivnost ---------- */

@media (max-width: 1000px) {
	.forecast-container { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
	.forecast.today { grid-column: 1 / -1; }
	.forecast.today .forecast-content { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; }
	.forecast.today .degree { margin: 0; }
	.forecast.today .chips { grid-template-columns: repeat(4, auto); gap: 8px 20px; }
	.forecast-table { margin-top: -90px; }
}

@media (max-width: 720px) {
	.menu-toggle { display: inline-grid; }

	.menu {
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		display: none;
		flex-direction: column;
		gap: 2px;
		padding: 8px;
		background: var(--surface);
		border: 1px solid var(--border);
		border-radius: 0 0 var(--radius) var(--radius);
		box-shadow: var(--shadow);
	}
	.menu.open { display: flex; }
	.menu a { padding: 12px 16px; border-radius: 10px; }

	.site-description { display: none; }
	.logo { height: 38px; }
	.site-title { font-size: 1.1rem; }

	.main-content { padding-top: 24px; }
	.card { padding: 16px 16px 8px; }
	.card--wide .stat:last-child { border-bottom: 0; }

	.forecast.today .forecast-content { display: block; }
	.forecast.today .degree {
		margin-bottom: 12px;
		font-size: clamp(2.8rem, 14vw, 3.75rem);
	}
	.forecast.today .chips { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 380px) {
	.stat { flex-direction: column; gap: 2px; }
	.stat dd { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
	* { transition: none !important; }
}