/* SHoRTeST Path Tourist — site styles (2026 rebuild) */

:root {
  --brand: #0047ab;
  --brand-soft: #e8f0fb;
  --ink: #1c2330;
  --ink-muted: #5b6472;
  --bg: #ffffff;
  --bg-soft: #f6f8fb;
  --card: #ffffff;
  --border: #e2e7ee;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.08), 0 8px 24px rgba(16, 24, 40, 0.06);
  --max-width: 1180px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand: #5b8def;
    --brand-soft: #17263d;
    --ink: #e8ebf0;
    --ink-muted: #9aa3b2;
    --bg: #10151d;
    --bg-soft: #151b26;
    --card: #171e2a;
    --border: #28303f;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.3);
  }
}

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

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

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
}

img,
svg {
  vertical-align: middle;
}

a {
  color: var(--brand);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.wrap {
  width: min(var(--max-width), 100% - 2rem);
  margin-inline: auto;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 900; /* above Leaflet panes */
  background: var(--card);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.65rem;
  flex-wrap: wrap;
}

.brand {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--ink);
}
.brand em {
  font-style: normal;
  color: var(--brand);
}
.brand:hover {
  text-decoration: none;
}
.brand small {
  display: block;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.city-picker {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.city-picker select {
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.45rem 0.75rem;
  max-width: min(60vw, 320px);
}
.city-picker select:focus-visible,
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

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

.hero {
  padding: 2.5rem 0 0.5rem;
}
.hero h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.75rem, 4vw, 2.6rem);
  line-height: 1.15;
}
.hero h1 em {
  font-style: normal;
  color: var(--brand);
}
.hero p {
  margin: 0;
  color: var(--ink-muted);
  max-width: 60ch;
}

.page-title {
  padding: 1.5rem 0 0.25rem;
}
.page-title h1 {
  margin: 0;
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
}
.page-title p {
  margin: 0.25rem 0 0;
  color: var(--ink-muted);
}

/* ---------- Map ---------- */

.map-shell {
  margin: 1.25rem 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

#map {
  width: 100%;
  height: clamp(380px, 55vh, 620px);
  background: var(--bg-soft);
}

.marker-num {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50% 50% 50% 4px;
  background: var(--brand);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}
.marker-num.is-nearest {
  background: #d64545;
}

.leaflet-popup-content a {
  font-weight: 600;
}

/* ---------- Content layout ---------- */

.content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 1.75rem;
  padding-bottom: 3rem;
  align-items: start;
}

@media (max-width: 900px) {
  .content {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.5rem;
}

.card h2 {
  margin-top: 0;
  font-size: 1.2rem;
}

.hint {
  color: var(--ink-muted);
  font-size: 0.95rem;
}

/* ---------- Sights list ---------- */

.sights {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.6rem;
}

.sights li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.sights li:hover {
  border-color: var(--brand);
}
.sights li:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
.sights li.is-active {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 0 0 1px var(--brand);
}

.sights .num {
  flex: none;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 0.8rem;
  font-weight: 700;
}

.sights a {
  color: var(--ink);
  font-weight: 550;
}
.sights a::after {
  content: "↗";
  margin-left: 0.3em;
  font-size: 0.8em;
  color: var(--ink-muted);
}
.sights a:hover {
  color: var(--brand);
}

/* ---------- Stats aside ---------- */

.stats {
  display: grid;
  gap: 0.9rem;
  position: sticky;
  top: 76px;
}

.stat {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding-block: 0.35rem;
  border-bottom: 1px dashed var(--border);
}
.stat:last-child {
  border-bottom: 0;
}
.stat b {
  font-size: 1.1rem;
  white-space: nowrap;
}
.stat span {
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.btn {
  display: inline-block;
  width: 100%;
  font: inherit;
  font-weight: 600;
  text-align: center;
  color: #fff;
  background: var(--brand);
  border: 0;
  border-radius: 10px;
  padding: 0.65rem 1rem;
  cursor: pointer;
}
.btn:hover {
  filter: brightness(1.08);
}
.btn[disabled] {
  opacity: 0.6;
  cursor: progress;
}

.btn-outline {
  background: transparent;
  color: var(--brand);
  border: 1px solid var(--brand);
}
.btn-outline:hover {
  background: var(--brand-soft);
  filter: none;
}

a.btn,
a.btn:hover {
  text-decoration: none;
}

.nearest-result {
  margin: 0;
  font-size: 0.95rem;
}

/* ---------- Index page ---------- */

.toolbar {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin: 1.5rem 0;
  flex-wrap: wrap;
}

.toolbar input[type="search"] {
  flex: 1 1 320px;
  font: inherit;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem 1rem;
}

.toolbar .btn {
  width: auto;
}

.city-grid {
  list-style: none;
  margin: 0 0 3rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 0.9rem;
}

.city-grid a {
  display: block;
  height: 100%;
  padding: 1rem 1.1rem;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.city-grid a:hover {
  text-decoration: none;
  border-color: var(--brand);
  transform: translateY(-2px);
}
.city-grid b {
  display: block;
  font-size: 1.05rem;
  margin-bottom: 0.15rem;
}
.city-grid span {
  color: var(--ink-muted);
  font-size: 0.88rem;
}

.no-results {
  display: none;
  color: var(--ink-muted);
  padding-bottom: 3rem;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--ink-muted);
  font-size: 0.9rem;
}
.site-footer .wrap {
  padding-block: 1.5rem;
  display: grid;
  gap: 0.4rem;
}
.site-footer p {
  margin: 0;
}

@media (max-width: 560px) {
  .brand small {
    display: none;
  }
  .city-picker select {
    max-width: 48vw;
  }
}

@media print {
  .site-header, .toolbar, .btn {
    display: none;
  }
}
