:root {
  color-scheme: light dark;
  --bg: #fdfcf9;
  --bg-card: #fff;
  --fg: #1a1a1a;
  --muted: #55524b;
  --border: #d8d3c8;
  --accent: #3b6ef5;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14120f;
    --bg-card: #1b1914;
    --fg: #ece7de;
    --muted: #a89f8f;
    --border: #332e28;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  padding: 0 1.25rem 3rem;
}

header {
  max-width: 60rem;
  margin: 0 auto;
  padding: 3rem 0 1.5rem;
}

.home-link {
  color: inherit;
  text-decoration: none;
}

header h1 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 400;
}

.tagline {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-style: italic;
}

main {
  max-width: 60rem;
  margin: 0 auto;
}

.breadcrumb {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 1.25rem;
}

.breadcrumb a {
  color: var(--muted);
}

.breadcrumb a:hover {
  color: var(--accent);
}

.page-title {
  font-weight: 400;
  margin: 0 0 0.3rem;
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.all-routes-link {
  margin: 0 0 1.5rem;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.9rem;
}

.collection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 1.5rem;
}

.controls-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.85rem;
  color: var(--muted);
}

#laji-filter {
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.3rem 0.5rem;
  font-family: inherit;
  font-size: 0.85rem;
}

.collection-card {
  display: block;
  color: inherit;
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-card);
}

.collection-card:hover h2 {
  color: var(--accent);
}

.collection-cover {
  display: block;
  width: 100%;
  height: 10rem;
  object-fit: cover;
}

.collection-card-body {
  padding: 1rem 1.1rem 1.2rem;
}

.collection-card-body h2 {
  margin: 0 0 0.3rem;
  font-size: 1.1rem;
  font-weight: 400;
}

.route-hero {
  display: block;
  width: 100%;
  max-height: 26rem;
  object-fit: cover;
  border-radius: 4px;
  margin: 1rem 0;
}

.route-map {
  width: 100%;
  height: 24rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  margin: 1rem 0;
}

#elevation-div {
  width: 100%;
  margin: 0 0 1rem;
}

@media (max-width: 40rem) {
  .route-map {
    height: 16rem;
  }
}

.route-card-link {
  display: flex;
  gap: 1.25rem;
  justify-content: space-between;
  align-items: flex-start;
  color: inherit;
  text-decoration: none;
}

.route-card-text {
  flex: 1 1 auto;
  min-width: 0;
}

.route-card-thumb {
  flex: 0 0 auto;
  width: 5.5rem;
  height: 5.5rem;
  object-fit: cover;
  border-radius: 6px;
}

@media (max-width: 30rem) {
  .route-card-thumb {
    width: 4rem;
    height: 4rem;
  }
}

.route-description p {
  margin: 0 0 0.9rem;
}

.route-extra {
  margin: 1rem 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.9rem;
}

.route-extra dt {
  color: var(--muted);
  font-weight: 600;
  margin-top: 0.4rem;
}

.route-extra dd {
  margin: 0;
}

.photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr));
  gap: 0.5rem;
  margin: 1rem 0;
}

.photo-gallery img {
  width: 100%;
  height: 8rem;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.download-link {
  display: inline-block;
  margin-top: 0.5rem;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.9rem;
  color: var(--fg);
  border-bottom: 1px solid var(--border);
  text-decoration: none;
}

.download-link:hover {
  border-bottom-color: var(--accent);
  color: var(--accent);
}

.route-cards {
  list-style: none;
  margin: 0 0 0.5rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.route-card {
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.route-cards li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.route-card-link:hover h3 {
  color: var(--accent);
}

.route-card h3 {
  font-size: 1.05rem;
  font-weight: 400;
  margin: 0 0 0.3rem;
}

.route-sport {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.route-meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0.2rem 0 0.4rem;
}

.route-desc {
  color: var(--muted);
  margin: 0 0 0.6rem;
  font-size: 0.95rem;
}

.empty-state {
  color: var(--muted);
  font-style: italic;
}
