/* Zrak nad Grosupljem — svetel modri vremenski portal.
   Ledeno-modro ozadje z mehkimi organskimi liki, bele zaobljene kartice z
   nežnimi sencami, ena nebesno modra za poudarke, jasna a harmonizirana
   semantika (dobro/zmerno/slabo), geometrijska pisava, zračni razmiki.
   Prijazna ilustracija vremenske postaje ob naslovu. */

:root {
  /* Ozadje / liki */
  --bg:        #e8f0f8;
  --blob-1:    #cfe6f5;
  --blob-2:    #dbeaf7;
  --blob-3:    #eaf3fb;

  /* Površine */
  --card:      #ffffff;
  --tint:      #eff3f9;   /* mehka podkartica */
  --tint-2:    #f0f5ff;
  --line:      #e3e9f1;

  /* Besedilo */
  --ink:       #141516;
  --ink-2:     #45474f;
  --ink-3:     #616873;   /* drobno besedilo, preverjen kontrast */

  /* Nebesno modra — naslovi, poudarki, aktivna stanja */
  --blue:      #409ac7;
  --blue-deep: #2c6f96;   /* modra za drobno besedilo/povezave */
  --blue-soft: #7cc0e0;

  /* Semantika — osnovna barva + temnejša za besedilo na svetli podlagi */
  --good:          #33a76b;  --good-ink:     #1f7a4a;
  --moderate:      #e8a13a;  --moderate-ink: #916210;
  --bad:           #e2574e;  --bad-ink:      #b23a32;
  --unknown:       #a7b4bc;

  /* Seriji grafov (CVD-preverjeno na svetli podlagi) */
  --pm10-line: #409ac7;
  --pm25-line: #e8663d;
  /* Temperatura na urnem grafu — topla nevtralna, namerno podrejena PM
     črtama (tanka, črtkana, desna os). Prehod normalni-vid ΔE 16,3 do PM2.5;
     bližina pri barvni slepoti pokrita s sekundarnim kodiranjem (črtkano +
     ločena os + legenda). */
  --temp-line: #8a7355;

  /* app.js bere te aliase iz CSS */
  --surface:   #ffffff;
  --border:    #e3e9f1;

  --font-sans: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "SFMono-Regular", Consolas, Menlo, monospace;

  --r:     16px;
  --r-lg:  26px;
  --shadow:    0 20px 44px -22px rgba(28, 68, 96, 0.40);
  --shadow-sm: 0 10px 24px -16px rgba(28, 68, 96, 0.35);
  --shadow-hover: 0 22px 40px -20px rgba(28, 68, 96, 0.45);
  --maxw: 940px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  overflow-x: hidden;
}

/* Organski liki v ozadju */
.blobs { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.blobs svg { position: absolute; display: block; }
.blob-1 { top: -14%; left: -12%; width: 55vw; }
.blob-2 { bottom: -20%; right: -14%; width: 62vw; }
.blob-3 { top: 46%; left: -6%; width: 26vw; }

/* Kartica strani */
main {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: clamp(0.75rem, 3vw, 2.25rem) auto;
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding: clamp(1.25rem, 4vw, 2.75rem);
}

/* ---------- Zgornja vrstica ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.75rem 1rem; flex-wrap: wrap;
  margin-bottom: clamp(1rem, 3vw, 1.75rem);
}
.brand {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-weight: 700; font-size: 1.02rem; letter-spacing: -0.01em; color: var(--blue-deep);
}
.brand-mark {
  width: 22px; height: 22px; flex: none; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--blue-soft), var(--blue) 72%);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.6);
}
.meta-pill {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.02em;
  color: var(--ink-2); background: var(--tint); border-radius: 999px; padding: 0.4rem 0.85rem;
}
.nav { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.nav-link {
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.01em;
  color: var(--blue-deep); text-decoration: none;
  background: var(--tint); border-radius: 999px; padding: 0.42rem 0.95rem;
  transition: background 200ms var(--ease), color 200ms var(--ease), transform 200ms var(--ease);
}
.nav-link:hover { background: var(--tint-2); color: var(--blue); transform: translateY(-1px); }
.nav-link[aria-current="page"] { background: var(--blue); color: #fff; }

/* ---------- Hero ---------- */
.hero {
  display: grid; grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(1rem, 4vw, 2.25rem); align-items: center;
  margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
}
.eyebrow {
  margin: 0 0 0.6rem; font-size: 0.75rem; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--blue-deep);
}
.hero h1 {
  margin: 0; font-size: clamp(2.3rem, 7.5vw, 3.7rem); font-weight: 700;
  line-height: 1.0; letter-spacing: -0.025em; color: var(--ink);
}
.hero h1 .accent { color: var(--blue); }
.lede {
  margin: 0.9rem 0 0; max-width: 42ch;
  font-size: clamp(1rem, 2.4vw, 1.15rem); color: var(--ink-2);
}
.hero-meta { margin: 1.1rem 0 0; font-size: 0.8rem; font-weight: 600; color: var(--ink-3); }
.hero-art { display: flex; justify-content: center; }
.hero-art svg {
  width: 100%; max-width: 400px; height: auto; display: block;
  animation: bob 6s ease-in-out infinite;
}
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* Notranje animacije SVG ilustracije (mirne, počasne) */
.anemo-cups { transform-box: fill-box; transform-origin: center; animation: spin 5s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.radar-ring { transform-box: fill-box; transform-origin: center; animation: pulse 3.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 0.55; transform: scale(0.9); } 50% { opacity: 0; transform: scale(1.5); } }
.sun-core { transform-box: fill-box; transform-origin: center; animation: sunbeat 5s ease-in-out infinite; }
@keyframes sunbeat { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.cloud-a { animation: drift 9s ease-in-out infinite; }
@keyframes drift { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(10px); } }

/* ---------- Trenutno vreme v naslovu ---------- */
.wx-now {
  display: inline-flex; align-items: center; gap: 0.85rem;
  margin: 1.2rem 0 0; padding: 0.65rem 1.15rem 0.65rem 0.75rem;
  background: var(--tint-2); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow-sm);
}
.wx-now[hidden] { display: none; }
.wx-now-icon { width: 48px; height: 48px; flex: none; }
.wx-now-icon svg { width: 100%; height: 100%; display: block; }
.wx-now-body { display: inline-flex; flex-direction: column; }
.wx-now-temp { display: inline-flex; align-items: baseline; gap: 0.12rem; font-variant-numeric: tabular-nums; }
.wx-now-val { font-size: clamp(1.9rem, 6vw, 2.2rem); font-weight: 700; line-height: 1; letter-spacing: -0.025em; color: var(--ink); }
.wx-now-deg { font-size: 1rem; font-weight: 600; color: var(--ink-3); }
.wx-now-cond { margin-top: 0.2rem; font-size: 0.85rem; font-weight: 600; color: var(--ink-2); text-transform: capitalize; }
.wx-now-cond:empty { display: none; }

/* Mirna počasna animacija ikone (le fokusna ikona ob naslovu) */
.wx-now-icon .i-sun { transform-box: fill-box; transform-origin: center; animation: spin 26s linear infinite; }
.wx-now-icon .i-cloud { animation: drift 9s ease-in-out infinite; }

/* ---------- Napoved (vremenske kartice) ---------- */
.forecast {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(94px, 1fr));
  gap: clamp(0.5rem, 2vw, 0.9rem);
}
.fc-card {
  display: flex; flex-direction: column; align-items: center; gap: 0.4rem;
  text-align: center; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); padding: 0.85rem 0.5rem 0.95rem; box-shadow: var(--shadow-sm);
  transition: transform 220ms var(--ease), box-shadow 220ms var(--ease);
  animation: rise 460ms var(--ease) both;
}
.fc-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.fc-card:nth-child(1) { animation-delay: 60ms; }
.fc-card:nth-child(2) { animation-delay: 110ms; }
.fc-card:nth-child(3) { animation-delay: 160ms; }
.fc-card:nth-child(4) { animation-delay: 210ms; }
.fc-card:nth-child(5) { animation-delay: 260ms; }
.fc-day { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--blue-deep); }
.fc-icon { width: 42px; height: 42px; }
.fc-icon svg { width: 100%; height: 100%; display: block; }
.fc-temp { font-size: 0.9rem; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.fc-temp b { color: var(--ink); font-weight: 700; }
.fc-precip { font-size: 0.72rem; font-weight: 600; color: var(--blue-deep); font-variant-numeric: tabular-nums; }

/* ---------- Sekcije ---------- */
.section { margin-top: clamp(1.75rem, 5vw, 2.75rem); }
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.6rem 1rem; flex-wrap: wrap; margin-bottom: 1rem;
}
.section-head h2 {
  margin: 0; font-size: clamp(1.3rem, 3.6vw, 1.6rem);
  font-weight: 700; letter-spacing: -0.015em; color: var(--ink);
}
.section-note {
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.03em;
  color: var(--blue-deep); background: var(--tint); border-radius: 999px; padding: 0.35rem 0.8rem;
}

/* ---------- Trenutno stanje ---------- */
.panels {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: clamp(0.75rem, 2.5vw, 1.15rem);
}
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: clamp(1rem, 3vw, 1.4rem);
  box-shadow: var(--shadow-sm);
  transition: transform 220ms var(--ease), box-shadow 220ms var(--ease);
}
.panel:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.panel-top { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.metric { font-size: 0.9rem; font-weight: 700; letter-spacing: 0.04em; color: var(--ink-2); }
.status {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.78rem; font-weight: 600;
  padding: 0.28rem 0.7rem 0.28rem 0.6rem; border-radius: 999px;
  background: rgba(167, 180, 188, 0.22); color: var(--ink-2);
}
.status::before {
  content: ""; width: 0.55rem; height: 0.55rem; border-radius: 50%;
  background: var(--unknown); flex: none;
}
.panel.good .status     { background: rgba(51, 167, 107, 0.16); color: var(--good-ink); }
.panel.good .status::before     { background: var(--good); }
.panel.moderate .status { background: rgba(232, 161, 58, 0.22); color: var(--moderate-ink); }
.panel.moderate .status::before { background: var(--moderate); }
.panel.bad .status      { background: rgba(226, 87, 78, 0.18); color: var(--bad-ink); }
.panel.bad .status::before      { background: var(--bad); }

.reading { display: flex; align-items: baseline; gap: 0.4rem; margin: 0.75rem 0 0.95rem; }
.value {
  font-variant-numeric: tabular-nums;
  font-size: clamp(2.6rem, 11vw, 3.4rem); font-weight: 700;
  line-height: 0.9; letter-spacing: -0.03em; color: var(--ink);
}
.unit { font-size: 0.85rem; font-weight: 600; color: var(--ink-3); }
.panel.unknown .value { color: var(--ink-3); }

/* Zaobljena merilna lestvica z belim gumbom */
.gauge {
  position: relative; height: 10px; border-radius: 999px;
  background: linear-gradient(90deg,
    var(--good) 0%, var(--good) 30%,
    var(--moderate) 40%, var(--moderate) 58%,
    var(--bad) 70%, var(--bad) 100%);
}
.gauge-track { display: none; }
.gauge-limit {
  position: absolute; top: -3px; bottom: -3px; left: 66.6%;
  width: 2px; border-radius: 2px; background: rgba(255, 255, 255, 0.9);
}
.gauge-needle {
  position: absolute; top: 50%; left: 0;
  width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%;
  background: #fff; border: 3px solid var(--unknown);
  box-shadow: 0 2px 6px rgba(28, 68, 96, 0.35);
  transition: left 900ms var(--ease);
}
.panel.good .gauge-needle     { border-color: var(--good); }
.panel.moderate .gauge-needle { border-color: var(--moderate); }
.panel.bad .gauge-needle      { border-color: var(--bad); }
.panel.unknown .gauge { filter: grayscale(0.7) opacity(0.5); }
.panel.unknown .gauge-needle { display: none; }
.gauge-scale {
  display: flex; justify-content: space-between; margin-top: 0.75rem;
  font-size: 0.7rem; font-weight: 600; color: var(--ink-3);
}

/* Dodatna onesnaževala */
.extra {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.7rem; margin-top: 0.9rem;
}
.extra-tile {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 0.75rem 0.9rem 0.85rem; box-shadow: var(--shadow-sm);
  transition: transform 220ms var(--ease), box-shadow 220ms var(--ease);
}
.extra-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.extra-label { display: block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; color: var(--ink-2); }
.extra-reading { display: flex; align-items: baseline; gap: 0.3rem; margin-top: 0.3rem; }
.extra-val {
  font-variant-numeric: tabular-nums; font-size: 1.5rem; font-weight: 700;
  line-height: 1; letter-spacing: -0.02em; color: var(--ink);
}
.extra-unit { font-size: 0.72rem; font-weight: 600; color: var(--ink-3); }

.meta { margin: 1rem 0 0; font-size: 0.85rem; color: var(--ink-2); }

/* ---------- Grafi ---------- */
.chart-wrap {
  position: relative; height: clamp(210px, 42vw, 270px);
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow-sm); padding: 0.9rem 0.9rem 0.5rem;
  transition: box-shadow 220ms var(--ease);
}
.chart-wrap:hover { box-shadow: var(--shadow-hover); }
.chart-wrap canvas { width: 100% !important; }
.chart-empty {
  display: none; position: absolute; inset: 0;
  align-items: center; justify-content: center; padding: 1rem; text-align: center;
  font-size: 0.95rem; font-weight: 600; color: var(--ink-3);
}
.chart-wrap.is-empty canvas { visibility: hidden; }
.chart-wrap.is-empty .chart-empty { display: flex; }
.chart-note { margin: 0.65rem 0 0; font-size: 0.82rem; color: var(--ink-3); }

/* Preklopni gumbi razpona — pilule */
.range { display: flex; gap: 0.4rem; }
.range button {
  font-family: inherit; font-size: 0.78rem; font-weight: 600; color: var(--ink-2);
  background: var(--tint); border: 1px solid transparent; border-radius: 999px;
  padding: 0.4rem 0.85rem; cursor: pointer;
  transition: background 200ms var(--ease), color 200ms var(--ease), transform 200ms var(--ease);
}
.range button:hover { background: var(--tint-2); color: var(--ink); transform: translateY(-1px); }
.range button.active { background: var(--blue); color: #fff; }

/* ---------- Rekordi ---------- */
.records {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: clamp(0.7rem, 2vw, 1rem);
}
.rec-tile {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 1rem 1.1rem 1.05rem; box-shadow: var(--shadow-sm);
  transition: transform 220ms var(--ease), box-shadow 220ms var(--ease);
}
.rec-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.rec-label {
  display: block; margin-bottom: 0.5rem; font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.05em; text-transform: uppercase; color: var(--blue-deep);
}
.rec-row { display: grid; grid-template-columns: 3.4rem 1fr; column-gap: 0.5rem; padding: 0.45rem 0; align-items: baseline; }
.rec-row + .rec-row { border-top: 1px solid var(--line); }
.rec-key { grid-column: 1; grid-row: 1 / span 2; align-self: center; font-size: 0.74rem; font-weight: 600; color: var(--ink-2); }
.rec-figure { grid-column: 2; grid-row: 1; }
.rec-val { font-variant-numeric: tabular-nums; font-size: 1.3rem; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); }
.rec-val--alert { color: var(--bad-ink); }
.rec-unit { margin-left: 0.2rem; font-size: 0.68rem; font-weight: 600; color: var(--ink-3); }
.rec-sub { grid-column: 2; grid-row: 2; font-size: 0.68rem; font-weight: 600; color: var(--ink-3); }
.records-empty {
  margin: 0; padding: 1.15rem 1.3rem; background: var(--tint); border-radius: var(--r);
  font-size: 0.95rem; font-weight: 600; color: var(--ink-3);
}

/* ---------- Razlaga vrednosti ---------- */
.explain { display: grid; gap: 1.5rem 2.4rem; }
@media (min-width: 680px) { .explain { grid-template-columns: 1fr 1fr; align-items: start; } }
.explain-block h3 { margin: 0 0 0.5rem; font-size: 1.1rem; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); }
.explain-block p { margin: 0; max-width: 62ch; color: var(--ink-2); font-size: 0.96rem; }
.explain-block ul { margin: 0; padding-left: 1.2rem; max-width: 62ch; color: var(--ink-2); font-size: 0.96rem; }
.explain-block li { margin: 0.35rem 0; }
.explain-block li::marker { color: var(--blue); }

.thresholds {
  width: 100%; border-collapse: separate; border-spacing: 0; margin-top: 0.85rem;
  font-size: 0.86rem; border-radius: 14px; overflow: hidden; box-shadow: 0 0 0 1px var(--line);
}
.thresholds th, .thresholds td { text-align: left; padding: 0.5rem 0.7rem; }
.thresholds thead th {
  font-weight: 700; font-size: 0.66rem; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--ink-3); background: var(--tint);
}
.thresholds tbody th { font-weight: 700; color: var(--ink); white-space: nowrap; }
.thresholds tbody td { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.thresholds tbody tr:not(:last-child) th,
.thresholds tbody tr:not(:last-child) td { border-bottom: 1px solid var(--line); }
.swatch { display: inline-block; width: 0.7rem; height: 0.7rem; border-radius: 50%; margin-right: 0.5rem; vertical-align: baseline; }
.swatch.good { background: var(--good); }
.swatch.moderate { background: var(--moderate); }
.swatch.bad { background: var(--bad); }
.explain-block .thresholds-unit { margin: 0.6rem 0 0; font-size: 0.8rem; color: var(--ink-3); }

/* ---------- Noga ---------- */
footer {
  margin-top: clamp(2rem, 5vw, 3rem); padding-top: 1.2rem;
  border-top: 1px solid var(--line); color: var(--ink-3); font-size: 0.84rem;
}
footer p { margin: 0 0 0.4rem; }
footer a { color: var(--blue-deep); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
footer a:hover { color: var(--blue); }

/* ---------- Fokus ---------- */
:focus-visible { outline: 3px solid var(--blue-soft); outline-offset: 2px; border-radius: 6px; }

/* ---------- Odzivnost ---------- */
@media (max-width: 720px) {
  .hero { grid-template-columns: 1fr; }
  .hero-art { order: -1; }
  .hero-art svg { max-width: 300px; }
}
@media (max-width: 520px) { .panels { grid-template-columns: 1fr; } }

/* ---------- Vstopna animacija (staggered) ---------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.topbar, .hero, .section, footer { animation: rise 460ms var(--ease) both; }
.hero { animation-delay: 60ms; }
.section:nth-of-type(1) { animation-delay: 120ms; }
.section:nth-of-type(2) { animation-delay: 165ms; }
.section:nth-of-type(3) { animation-delay: 210ms; }
.section:nth-of-type(4) { animation-delay: 255ms; }
.section:nth-of-type(5) { animation-delay: 300ms; }
.section:nth-of-type(6) { animation-delay: 345ms; }
footer { animation-delay: 385ms; }

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