/* Visor público de ruta (/rutas/:id, `api/rutas/[id].js` + `route-viewer.js`).
   Mismos colores y tipografía que la landing (`landing/landing.css`): pizarra
   en claro, acentos naranja/azul y Raleway. Sobre el naranja de relleno solo
   va texto oscuro; el naranja como texto es el #C2410C (≥4,5:1 sobre blanco),
   nunca el #EA580C (3,6:1). */
:root {
  --bg: #ffffff;
  --bg-2: #f8fafc;
  --ink: #0f172a;
  --ink-2: #334155;
  --ink-3: #475569;
  --line: #e2e8f0;
  --accent: #ea580c;
  --accent-fill: #f97316;
  --accent-soft: #ffedd5;
  --accent-text: #c2410c;
  --on-accent: #0f172a;
  --trail: #0284c7;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 12px 32px rgba(15, 23, 42, 0.08);
  --radius: 20px;
  --font: 'Raleway', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color-scheme: light;
}

@font-face { font-family: 'Raleway'; src: url('/assets/fonts/Raleway-Medium.ttf') format('truetype'); font-weight: 400 500; font-display: swap; }
@font-face { font-family: 'Raleway'; src: url('/assets/fonts/Raleway-SemiBold.ttf') format('truetype'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Raleway'; src: url('/assets/fonts/Raleway-Bold.ttf') format('truetype'); font-weight: 700 900; font-display: swap; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg-2);
  color: var(--ink);
  font-family: var(--font);
  font-variant-numeric: lining-nums;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
:focus-visible { outline: 3px solid var(--trail); outline-offset: 2px; border-radius: 6px; }

.rp-wrap { width: min(900px, 100% - 32px); margin: 0 auto; }

.rp-header { background: var(--bg); border-bottom: 1px solid var(--line); }
.rp-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.rp-brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 800; font-size: 20px; letter-spacing: -0.02em; }
.rp-brand sup { font-size: 0.5em; font-weight: 700; }
.rp-header__cta { text-decoration: none; font-weight: 700; font-size: 14px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); }
.rp-header__cta:hover { border-color: var(--accent); }

.route-page { padding: 32px 0 56px; }

.route-eyebrow {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-text);
}

.route-title { margin: 6px 0 4px; font-size: clamp(28px, 5vw, 40px); line-height: 1.15; letter-spacing: -0.02em; }
.route-stats-line { margin: 0 0 16px; color: var(--ink-2); font-weight: 600; }
.route-description { color: var(--ink-2); white-space: pre-line; }

.route-highlights { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; padding: 0; }
.route-highlights li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}

.route-cover { display: block; width: 100%; max-height: 460px; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow); }

.route-summary-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 28px 0; }
.route-summary-card { background: var(--bg); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow); }
.route-summary-card__label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); margin-bottom: 2px; }
.route-summary-card__value { font-size: 22px; font-weight: 800; letter-spacing: -0.01em; font-variant-numeric: lining-nums tabular-nums; }

.route-map-wrap { position: relative; }
.route-map {
  width: 100%;
  height: 440px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.route-map-toggle {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  cursor: pointer;
  box-shadow: var(--shadow);
}
.route-map-toggle[aria-pressed='true'] { background: var(--accent-soft); border-color: var(--accent); }
.route-map-attribution { margin: 8px 0 0; font-size: 12px; color: var(--ink-3); text-align: right; }

.route-map-endpoint {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.35);
}

.route-section-title { margin: 40px 0 12px; font-size: 22px; letter-spacing: -0.01em; }

.route-elevation-chart {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px;
  cursor: crosshair;
  box-shadow: var(--shadow);
  touch-action: pan-y;
}
.route-elevation-chart__svg { display: block; width: 100%; height: 220px; }
.route-elevation-chart__tooltip {
  position: absolute;
  top: 8px;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 8px;
  white-space: nowrap;
  pointer-events: none;
}

.route-weather__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.route-weather__cell { background: var(--bg); border: 1px solid var(--line); border-radius: 16px; padding: 16px; box-shadow: var(--shadow); }
.route-weather__label { margin: 0; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); }
.route-weather__temp { margin: 4px 0; font-size: 34px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: lining-nums tabular-nums; }
.route-weather__line { margin: 2px 0 0; color: var(--ink-2); font-size: 14px; font-variant-numeric: lining-nums tabular-nums; }
.route-weather__note { margin: 10px 0 0; font-size: 12px; color: var(--ink-3); }

.route-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 40px; }
.route-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 24px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
}
.route-button--accent { background: var(--accent-fill); color: var(--on-accent); box-shadow: 0 8px 24px rgba(249, 115, 22, 0.28); }
.route-button--accent:hover { background: var(--accent); }
.route-button--secondary { background: var(--bg); color: var(--ink); border: 1px solid var(--line); }
.route-button--secondary:hover { border-color: var(--accent); }
.route-actions__note { margin: 10px 0 0; text-align: center; font-size: 13px; color: var(--ink-3); }

.rp-footer { border-top: 1px solid var(--line); background: var(--bg); padding: 28px 0 36px; text-align: center; }
.rp-tagline { margin: 0 0 10px; font-size: 18px; font-weight: 600; color: var(--ink-3); letter-spacing: -0.01em; }
.rp-tagline strong { color: var(--accent-text); font-weight: 800; }
.rp-footer nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 18px; font-size: 14px; }
.rp-footer nav a { color: var(--ink-2); text-decoration: none; }
.rp-footer nav a:hover { text-decoration: underline; }

@media (max-width: 560px) {
  .route-map { height: 320px; }
  .route-weather__grid { grid-template-columns: 1fr; }
  .rp-header__cta { display: none; }
}

/* Aviso de defectos de la traza (saltos, huecos de señal…). */
.route-quality-note { margin: -8px 0 24px; padding: 12px 16px; border-radius: 14px; background: #fef3c7; color: var(--ink); font-size: 14px; }
