/* Velorino Routes – Kurvio-style layout */

@font-face {
  font-family: "Safiro";
  src: url("/assets/fonts/Safiro-Medium.otf") format("opentype");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --font-sans: "Safiro", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --color-bg: #fff;
  --color-text: #000;
  --color-text-muted: #aaa;
  --color-text-on-dark: #fff;
  --color-text-muted-on-dark: #aaa;
  --color-accent: #e178b8;
  --color-accent-lightest: #f8dcef;
  --color-accent-light: #eeb0d8;
  --color-accent-dark: #c14f8f;
  --color-card: #2d312e;
  --color-card-inner: #3a3f3c;
  --max-width: 1200px;
  --frame: clamp(1.5rem, 4vw, 3rem);
  --nav-top: clamp(0.75rem, 2vw, 1.25rem);
  --pill-bg: #ececec;
  --pill-radius: 999px;
  --card-width: 300px;
  --card-radius: 20px;
}

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

html {
  font-size: 16px;
  line-height: 1.4;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: none;
}

body {
  font-family: var(--font-sans);
  font-weight: 500;
  font-synthesis: none;
  color: var(--color-text);
  margin: 0;
  min-height: 100vh;
  background: var(--color-bg);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
}

/* Desktop header */
.page-header {
  padding: clamp(1.25rem, 3vw, 2rem) var(--frame) clamp(0.5rem, 1.5vw, 0.75rem);
  text-align: center;
}

.page-header__brand {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--color-text);
}

.page-header__brand:hover {
  opacity: 0.65;
}

/* Mobile top bar */
.mobile-bar {
  display: none;
}

.mobile-bar__brand {
  font-size: 1.125rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--color-text);
}

.mobile-bar__brand:hover {
  opacity: 0.65;
}

/* Tour nav – mobile pill + dropdown */
.tour-nav {
  position: relative;
  font-family: var(--font-sans);
}

.tour-nav__trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.45rem 0.85rem;
  border: none;
  border-radius: var(--pill-radius);
  background: var(--pill-bg);
  color: var(--color-text);
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
}

.tour-nav__trigger span {
  font-size: 0.75rem;
  line-height: 1;
}

.tour-nav__panel {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  z-index: 20;
  min-width: 11rem;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  background: var(--pill-bg);
}

.tour-nav__panel[hidden] {
  display: none;
}

.tour-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tour-nav__item {
  margin: 0;
  padding: 0.22rem 0;
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.tour-nav__item a,
.tour-nav__label {
  color: var(--color-text-muted);
  font-weight: 500;
}

.tour-nav__item--active a {
  color: var(--color-text);
}

.tour-nav__item a:hover {
  color: var(--color-text);
}

.tour-nav__item--inactive {
  position: relative;
}

.tour-nav__item--inactive:hover .tour-nav__label,
.tour-nav__item--inactive:focus-within .tour-nav__label {
  color: var(--color-text);
}

.tour-nav__badge {
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  margin-left: 0.45rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--pill-radius);
  background: var(--color-accent);
  color: var(--color-text-on-dark);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.2;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
  pointer-events: none;
  z-index: 1;
}

.tour-nav__item--inactive:hover .tour-nav__badge,
.tour-nav__item--inactive:focus-within .tour-nav__badge {
  opacity: 1;
  visibility: visible;
}

/* Desktop nav – simple text list */
.desktop-nav {
  position: fixed;
  top: var(--nav-top);
  left: var(--frame);
  z-index: 5;
  font-family: var(--font-sans);
}

.desktop-nav__heading {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.35;
  color: var(--color-text);
}

.desktop-nav__heading span {
  font-size: 0.75rem;
}

.desktop-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.desktop-nav__item {
  margin: 0;
  padding: 0.15rem 0;
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.desktop-nav__item a,
.desktop-nav__label {
  color: var(--color-text-muted);
  font-weight: 500;
}

.desktop-nav__item--active a {
  color: var(--color-text);
}

.desktop-nav__item a:hover {
  color: var(--color-text);
}

.desktop-nav__item--inactive {
  position: relative;
}

.desktop-nav__item--inactive:hover .desktop-nav__label,
.desktop-nav__item--inactive:focus-within .desktop-nav__label {
  color: var(--color-text);
}

.desktop-nav__badge {
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  margin-left: 0.45rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--pill-radius);
  background: var(--color-accent);
  color: var(--color-text-on-dark);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.2;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
  pointer-events: none;
  z-index: 1;
}

.desktop-nav__item--inactive:hover .desktop-nav__badge,
.desktop-nav__item--inactive:focus-within .desktop-nav__badge {
  opacity: 1;
  visibility: visible;
}

/* Main content */
.page-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: auto;
  padding: clamp(0.75rem, 2vw, 1.25rem) var(--frame) clamp(6rem, 12vw, 10rem);
}

/* Text pages */
.content-page {
  width: min(100%, 38rem);
  margin: 0 auto;
  padding: clamp(0.5rem, 2vw, 1.5rem) 0;
}

.content-page h1 {
  margin: 0 0 1rem;
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.content-page h2 {
  margin: 2rem 0 0.65rem;
  font-size: 1.125rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.content-page p {
  margin: 0 0 0.85rem;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--color-text);
}

.content-page ul {
  margin: 0 0 0.85rem;
  padding-left: 1.25rem;
  font-size: 0.9375rem;
  line-height: 1.55;
}

.content-page li {
  margin-bottom: 0.35rem;
}

.content-page a {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.content-page a:hover {
  opacity: 0.65;
}

.app-store-badge {
  display: inline-block;
  margin: 0.25rem 0 1.25rem;
  transition: opacity 0.2s;
}

.app-store-badge:hover {
  opacity: 0.75;
}

.app-store-badge img {
  height: 40px;
  width: auto;
}

/* Route grid */
.state-section {
  margin: 0;
  width: 100%;
  display: none;
  justify-content: center;
}

.state-section.is-active {
  display: flex;
}

.route-grid {
  display: grid;
  grid-template-columns: repeat(2, var(--card-width));
  gap: 1.25rem;
  justify-content: center;
  align-content: center;
}

.route-grid__empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 2rem 0;
  text-align: center;
  color: var(--color-text-muted);
}

.route-card[hidden] {
  display: none;
}

/* Route cards */
.route-card {
  display: flex;
  flex-direction: column;
  width: var(--card-width);
  background: var(--color-card);
  color: var(--color-text-on-dark);
  border-radius: var(--card-radius);
  padding: 1.25rem 1.25rem 1.5rem;
}

.route-card__title {
  margin: 0 0 0.75rem;
  font-size: 1.375rem;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.route-card__summary {
  margin: 0 0 1.25rem;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--color-text-on-dark);
  opacity: 0.72;
}

.route-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1rem;
  margin: 0 0 1rem;
  padding: 0;
}

.route-stats__item {
  margin: 0;
}

.route-stats dt {
  margin: 0 0 0.2rem;
  font-size: 0.75rem;
  color: var(--color-text-muted-on-dark);
}

.route-stats dd {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
}

/* Elevation preview */
.route-elevation--preview {
  margin: 0 0 1rem;
  padding: 0;
  border: none;
  background: transparent;
}

.route-elevation--preview .route-elevation__plot {
  display: block;
}

.route-elevation--preview .route-elevation__plot-main {
  width: 100%;
}

.route-elevation--preview .route-elevation__chart-area {
  height: 88px;
  overflow: hidden;
}

.route-elevation--preview .route-elevation__chart {
  display: block;
  width: 100%;
  height: 100%;
}

/* Map (legacy – kept for error class reuse) */
.route-map__canvas--error {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  font-size: 0.8125rem;
  color: var(--color-text-muted-on-dark);
  text-align: center;
}

/* Actions */
.route-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-top: auto;
}

.route-actions__primary {
  display: block;
  width: 100%;
  padding: 0.85rem 1rem;
  background: #fff;
  color: var(--color-text);
  border: none;
  border-radius: 10px;
  font-size: 0.9375rem;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.route-actions__primary:hover {
  opacity: 0.88;
}

.route-actions__view {
  padding: 0;
  background: none;
  border: none;
  color: var(--color-text-on-dark);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  opacity: 0.85;
  transition: opacity 0.15s ease;
}

.route-actions__view:hover {
  opacity: 1;
}

/* Route detail modal */
body.route-modal-open {
  overflow: hidden;
}

.route-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(1rem, 3vw, 2rem);
  overflow-y: auto;
}

.route-modal[hidden] {
  display: none;
}

.route-modal__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.route-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  margin: auto 0;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.18);
}

.route-modal__close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: #f2f2f2;
  color: var(--color-text);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease;
}

.route-modal__close:hover {
  background: #e6e6e6;
}

.route-modal__content {
  padding: clamp(1.25rem, 3vw, 1.75rem);
}

.route-modal__header {
  padding-right: 2.5rem;
  margin-bottom: 1.25rem;
}

.route-modal__eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-muted);
}

.route-modal__title {
  margin: 0 0 0.65rem;
  font-size: clamp(1.5rem, 4vw, 1.875rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.route-modal__summary {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--color-text);
  opacity: 0.78;
}

.route-modal__quick-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem 1rem;
  margin: 0 0 1.25rem;
  padding: 0;
}

@media (min-width: 520px) {
  .route-modal__quick-stats {
    grid-template-columns: repeat(4, 1fr);
  }
}

.route-modal__quick-stats div {
  margin: 0;
}

.route-modal__quick-stats dt {
  margin: 0 0 0.15rem;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.route-modal__quick-stats dd {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
}

.route-modal__map {
  margin: 0 0 1.25rem;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #ececec;
}

.route-modal__map-canvas {
  width: 100%;
  height: clamp(220px, 40vw, 300px);
  background: #f4f4f4;
}

.route-modal__map-canvas--error {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  text-align: center;
}

.route-modal__elevation {
  margin: 0 0 1.25rem;
  padding: 1rem;
  border: 1px solid var(--color-accent-lightest);
  border-radius: 12px;
  background: #fdf6fa;
}

.route-modal__actions {
  display: flex;
  justify-content: center;
}

.route-modal__download {
  max-width: 320px;
  background: var(--color-accent);
  color: var(--color-text-on-dark);
}

.route-modal__download:hover {
  opacity: 0.88;
}

.route-modal__disclaimer {
  margin: 0.75rem 0 0;
  text-align: center;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--color-text-muted);
}

/* Detailed elevation profile (modal) */
.route-modal .route-elevation__title {
  margin: 0 0 0.35rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text);
}

.route-modal .route-elevation__hint {
  margin: 0 0 0.85rem;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  line-height: 1.45;
}

.route-modal .route-elevation__plot {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.route-modal .route-elevation__y-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 0 0 3rem;
  height: 160px;
  font-size: 0.6875rem;
  line-height: 1.2;
  color: var(--color-text-muted);
  text-align: right;
  padding: 0.15rem 0;
}

.route-modal .route-elevation__plot-main {
  flex: 1;
  min-width: 0;
}

.route-modal .route-elevation__chart-area {
  position: relative;
  height: 160px;
}

.route-modal .route-elevation__chart {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 6px;
  overflow: hidden;
}

.route-modal .route-elevation__select-overlay {
  position: absolute;
  inset: 0;
  cursor: crosshair;
  touch-action: none;
  border-radius: 6px;
}

.route-modal .route-elevation__selection {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(225, 120, 184, 0.12);
  border-left: 2px solid var(--color-accent);
  border-right: 2px solid var(--color-accent);
  pointer-events: none;
}

.route-modal .route-elevation__axis {
  display: flex;
  justify-content: space-between;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.route-modal .route-elevation__range {
  margin: 0.5rem 0 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-accent);
  line-height: 1.3;
}

.route-modal .route-elevation--selection .route-elevation__stats {
  background: rgba(225, 120, 184, 0.06);
  margin-left: -0.5rem;
  margin-right: -0.5rem;
  margin-top: 0.5rem;
  padding: 0.35rem 0.5rem 0.65rem;
  border-radius: 6px;
}

.route-modal .route-elevation__stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem 1rem;
  margin: 0.75rem 0 0;
  padding: 0.75rem 0 0;
  border-top: 1px solid var(--color-accent-lightest);
}

@media (min-width: 520px) {
  .route-modal .route-elevation__stats {
    grid-template-columns: repeat(4, 1fr);
  }

  .route-modal .route-elevation--selection .route-elevation__stats {
    grid-template-columns: repeat(5, 1fr);
  }
}

.route-modal .route-elevation__stat {
  margin: 0;
}

.route-modal .route-elevation__stat dt {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.2;
}

.route-modal .route-elevation__stat dd {
  margin: 0.1rem 0 0;
  font-weight: 500;
  font-size: 0.9375rem;
  line-height: 1.2;
}

/* Footer – desktop */
.site-footer--desktop {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 16;
}

.site-footer__nav {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem 1.25rem;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.site-footer__nav a {
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--color-text);
}

.site-footer__nav a:hover {
  opacity: 0.55;
}

/* Mobile mehr menu */
.mobile-more {
  display: none;
  position: fixed;
  right: var(--frame);
  bottom: var(--frame);
  z-index: 20;
}

.mobile-more__trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.45rem 0.85rem;
  border: none;
  border-radius: var(--pill-radius);
  background: var(--pill-bg);
  color: var(--color-text);
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
}

.mobile-more__trigger span {
  font-size: 0.75rem;
  line-height: 1;
}

.mobile-more__panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.5rem);
  width: max-content;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  background: var(--pill-bg);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
}

.mobile-more__panel[hidden] {
  display: none;
}

.mobile-more__panel a {
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--color-text);
  white-space: nowrap;
}

.mobile-more__panel a:hover {
  opacity: 0.55;
}

/* Marquee banner */
.marquee-banner {
  position: fixed;
  left: -6%;
  bottom: 1.5rem;
  width: 112%;
  z-index: 15;
  pointer-events: none;
  overflow: hidden;
  background: var(--color-accent);
  transform: rotate(-4deg);
  transform-origin: left bottom;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.marquee-banner__strip {
  overflow: hidden;
}

.marquee-banner__track {
  display: flex;
  width: max-content;
  animation: marquee-scroll 45s linear infinite;
}

.marquee-banner__group {
  --marquee-gap: 0.75rem;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  padding: 0.7rem 0;
  padding-right: var(--marquee-gap);
  white-space: nowrap;
  gap: var(--marquee-gap);
}

.marquee-banner__phrase {
  font-size: clamp(0.9375rem, 2.2vw, 1.125rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--color-text);
}

.marquee-banner__dot {
  flex-shrink: 0;
  font-size: 0.7rem;
  line-height: 1;
  color: var(--color-text);
}

@keyframes marquee-scroll {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .marquee-banner__track {
    animation: none;
  }
}

/* Hidden filters (kept for JS compatibility) */
.route-filters[hidden] {
  display: none;
}

/* Responsive */
@media (max-width: 900px) {
  .page-header {
    display: none;
  }

  .desktop-nav {
    display: none;
  }

  .site-footer--desktop {
    display: none;
  }

  .mobile-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 15;
    padding: 0.85rem var(--frame);
    background: var(--color-bg);
  }

  .mobile-more {
    display: block;
  }

  .page-main {
    padding-top: 0.75rem;
    padding-bottom: clamp(5rem, 14vw, 7rem);
  }

  .route-grid {
    grid-template-columns: minmax(0, var(--card-width));
    justify-content: center;
  }

  .tour-nav__badge {
    left: 0;
    top: 100%;
    transform: none;
    margin-left: 0;
    margin-top: 0.1rem;
  }
}

@media (max-width: 360px) {
  :root {
    --card-width: 100%;
  }

  .route-card {
    width: 100%;
  }
}
