:root {
  /* the same light look as Prijavi problem: system grey page, white cards, Adriatic blue bar */
  --bg: #f2f2f7;
  --surface: #ffffff;
  --text: #1c1c1e;
  --muted: #636366;
  --border: #e5e5ea;
  --primary: #0066cc;
  --header: #0b5d87;
  --radius: 14px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", system-ui, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  background: var(--bg);
  color: var(--text);
}
a { color: var(--primary); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.bar {
  position: sticky; top: 0; z-index: 1000;
  display: flex; align-items: center; gap: 0.75rem;
  padding: calc(0.6rem + env(safe-area-inset-top)) 1rem 0.6rem;
  background: var(--header); color: #fff;
}
.bar h1 { flex: 1; margin: 0; font-size: 1.15rem; font-weight: 700; letter-spacing: -0.01em; }
.lang select {
  appearance: none; -webkit-appearance: none;
  min-height: 40px; padding: 0.3rem 0.7rem; border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.45); background: rgba(255, 255, 255, 0.12); color: #fff;
  font: inherit; font-size: 0.9rem;
}
.lang select option { color: var(--text); }

main { max-width: 760px; margin: 0 auto; padding: 0.75rem 1rem 2rem; }
.intro { margin: 0.25rem 0 1rem; color: var(--muted); }

/* "Sve / Danas / Ovaj vikend / Idućih 30 dana" */
.when { display: flex; gap: 0.4rem; overflow-x: auto; margin: 0 -1rem 0.6rem; padding: 0 1rem; scrollbar-width: none; }
.when::-webkit-scrollbar, .towns::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 0.4rem;
  min-height: 40px; padding: 0.35rem 0.85rem; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: inherit; font-size: 0.92rem; cursor: pointer; white-space: nowrap;
}
.chip[aria-pressed="true"] { background: var(--header); border-color: var(--header); color: #fff; }
.chip .count { min-width: 1.4rem; padding: 0 0.35rem; border-radius: 999px; background: var(--bg); color: var(--text); font-size: 0.8rem; font-weight: 600; text-align: center; }
.chip[aria-pressed="true"] .count { background: rgba(255, 255, 255, 0.25); color: #fff; }
.chip .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.chip.soon { color: var(--muted); }
.chip.soon small { font-size: 0.75rem; }

/* the općine, one row that scrolls sideways on a phone */
.towns { display: flex; gap: 0.4rem; overflow-x: auto; margin: 0 -1rem 0.9rem; padding: 0 1rem; scrollbar-width: none; }

.map { height: 300px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: #dfe9ef; }
.pin {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  color: #fff; font: 700 13px/1 -apple-system, system-ui, sans-serif;
}
.pin.soon { width: 14px; height: 14px; background: #aeaeb2; }
.pin.selected { outline: 3px solid rgba(11, 93, 135, 0.45); }
.leaflet-tooltip.town-name { font-size: 0.8rem; padding: 2px 6px; }

/* the list, by day */
.day { margin: 1.4rem 0 0.5rem; font-size: 1rem; font-weight: 700; }
.day small { font-weight: 400; color: var(--muted); }
.event {
  display: grid; grid-template-columns: 3.4rem 1fr; gap: 0.2rem 0.75rem;
  padding: 0.85rem 1rem; margin-bottom: 0.5rem;
  background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border);
}
.event .time { grid-row: span 4; font-weight: 700; font-variant-numeric: tabular-nums; }
.event h3 { margin: 0; font-size: 1.02rem; line-height: 1.3; }
.event .where { display: flex; flex-wrap: wrap; align-items: center; gap: 0.15rem 0.5rem; font-size: 0.88rem; color: var(--muted); }
.event .where .dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 0.3rem; }
.event .town { color: var(--text); font-weight: 600; }
.event p { margin: 0.2rem 0 0; font-size: 0.93rem; overflow-wrap: anywhere; }
.event .more { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; align-items: center; margin-top: 0.35rem; font-size: 0.88rem; }
.event .more a { font-weight: 600; text-decoration: none; }
.event .more .going { color: var(--muted); }

.note { margin: 1.2rem 0; padding: 1rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); color: var(--muted); text-align: center; }
.note.error { color: #b42318; }

footer { max-width: 760px; margin: 0 auto; padding: 0 1rem 2rem; font-size: 0.82rem; color: var(--muted); }

@media (min-width: 700px) {
  .map { height: 380px; }
  .when, .towns { flex-wrap: wrap; overflow: visible; margin-left: 0; margin-right: 0; padding: 0; }
}
