/* Hoja de estilos ligera y autonoma para las paginas SEO (parada/linea).
   No depende de app.css ni del JS de la app. */
:root {
  color-scheme: light dark;
  --bg: #f2f5f7;
  --card-bg: #ffffff;
  --text: #16202a;
  --muted: #5b6b78;
  --border: #e1e6ea;
  --brand: #006f9e;
  --brand-dark: #00587d;
  --brand-contrast: #ffffff;
  --link: #006f9e;
  --accent-bg: #eaf4f8;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d151d;
    --card-bg: #172230;
    --text: #eef3f7;
    --muted: #9db0bf;
    --border: #29394a;
    --brand: #4bb4e6;
    --brand-dark: #6cc3ec;
    --brand-contrast: #06222f;
    --link: #4bb4e6;
    --accent-bg: #172a35;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.seo-shell {
  max-width: 640px;
  margin: 0 auto;
  padding: 14px 16px 40px;
}

.seo-breadcrumbs {
  font-size: 12.5px;
  color: var(--muted);
  margin: 0 0 14px;
  overflow-wrap: anywhere;
}
.seo-breadcrumbs a { color: var(--muted); text-decoration: underline; }

/* Cabecera: numero de parada como insignia grande + nombre */
.seo-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
.stop-id-badge {
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--brand);
  color: var(--brand-contrast);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.02em;
}
.seo-header h1 { font-size: 21px; line-height: 1.25; margin: 0; }
.seo-sub { color: var(--muted); margin: 2px 0 0; font-size: 14px; }

/* Insignias de linea */
.seo-linenav { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; }
.line-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 30px;
  padding: 0 11px;
  border-radius: 15px;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
}
.line-badge-lg { min-width: 40px; height: 36px; font-size: 16px; border-radius: 12px; }
.line-badge-sm { min-width: 22px; height: 20px; padding: 0 6px; font-size: 11px; border-radius: 8px; }

.seo-intro { color: var(--muted); font-size: 14.5px; margin: 0 0 16px; }

.seo-cta {
  display: block;
  text-align: center;
  background: var(--brand);
  color: var(--brand-contrast);
  font-weight: 700;
  font-size: 17px;
  padding: 15px 20px;
  border-radius: 14px;
  text-decoration: none;
  margin: 0 0 22px;
  box-shadow: 0 6px 16px -6px rgba(0, 111, 158, 0.55);
}
.seo-cta:visited { color: var(--brand-contrast); }
.seo-cta-secondary { margin: 8px 0 20px; box-shadow: none; opacity: 0.95; }

.seo-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin: 0 0 14px;
}

/* Tarjeta de linea */
.line-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16.5px;
  margin: 0 0 14px;
  scroll-margin-top: 12px;
}

.ld { padding: 12px 0; border-top: 1px solid var(--border); }
.ld:first-of-type { padding-top: 0; border-top: none; }
.ld-dest { font-weight: 700; font-size: 14.5px; margin: 0 0 10px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ld-badge {
  font-weight: 600;
  font-size: 11px;
  color: var(--muted);
  background: var(--accent-bg);
  border-radius: 8px;
  padding: 2px 8px;
}
.ld-seasonal { opacity: 0.85; }

/* Diagrama vertical de paradas: linea de color + puntos */
.ld-diagram {
  list-style: none;
  margin: 0 0 12px;
  padding: 0 0 0 4px;
  position: relative;
}
.ld-diagram::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 10px;
  bottom: 10px;
  width: 3px;
  background: var(--lc, var(--brand));
  border-radius: 2px;
  opacity: 0.35;
}
.ld-diagram li {
  position: relative;
  padding: 6px 0 6px 26px;
  font-size: 14px;
  min-height: 20px;
  display: flex;
  align-items: center;
}
.ld-diagram a {
  color: var(--text);
  text-decoration: none;
}
.ld-diagram a:hover { text-decoration: underline; }
.ld-dot {
  position: absolute;
  left: 4px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--card-bg);
  border: 3px solid var(--lc, var(--brand));
}
.ld-here {
  font-weight: 700;
  background: var(--accent-bg);
  border-radius: 10px;
  margin: 2px 0;
}
.ld-here .ld-dot {
  width: 15px;
  height: 15px;
  left: 2px;
  background: var(--lc, var(--brand));
  border-color: var(--lc, var(--brand));
  box-shadow: 0 0 0 3px var(--card-bg);
}
.ld-here small {
  font-weight: 600;
  color: var(--brand);
  margin-left: 8px;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.ld-more { color: var(--muted); font-size: 16px; padding-top: 0; padding-bottom: 0; }
.ld-end { color: var(--muted); font-size: 12px; font-style: italic; }

/* Frecuencias, sin cifras de relleno */
.ld-freq { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.ld-freq li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13.5px;
  color: var(--muted);
  padding: 3px 8px;
  border-radius: 8px;
}
.ld-freq li.is-today {
  color: var(--text);
  background: var(--accent-bg);
  font-weight: 600;
}
.ld-freq-day { flex: none; }
.ld-freq-time { text-align: right; }

.seo-note {
  font-size: 12.5px;
  color: var(--muted);
  margin: 4px 0 0;
}

.seo-card h2 { font-size: 17px; margin: 0 0 10px; }

.seo-nearby { list-style: none; margin: 0; padding: 0; }
.seo-nearby li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.seo-nearby li:last-child { border-bottom: none; }
.seo-nearby a {
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}
.seo-nearby a:hover .nearby-name { text-decoration: underline; }
.nearby-name { font-weight: 600; color: var(--link); }
.nearby-lines { display: flex; gap: 4px; flex-wrap: wrap; }
.dist { color: var(--muted); font-size: 12.5px; white-space: nowrap; flex: none; }

.seo-map-link { color: var(--link); text-decoration: none; font-size: 14px; font-weight: 600; }
.seo-map-link:hover { text-decoration: underline; }

.seo-footer {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}
.seo-footer a { color: var(--link); }

.ld-more-link { margin: 14px 0 0; font-size: 13.5px; }
.ld-more-link a { color: var(--link); text-decoration: none; font-weight: 600; }
.ld-more-link a:hover { text-decoration: underline; }

/* Horario completo desplegable (linea.php), sin JS: <details>/<summary> */
.ld-full {
  margin: 4px 0 0;
  font-size: 13px;
}
.ld-full summary {
  cursor: pointer;
  color: var(--link);
  font-weight: 600;
  padding: 4px 0;
  list-style: none;
}
.ld-full summary::-webkit-details-marker { display: none; }
.ld-full summary::before { content: "▸ "; }
.ld-full[open] summary::before { content: "▾ "; }
.tt-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 4px;
}
.tt-chip {
  background: var(--accent-bg);
  color: var(--text);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

/* Indices /paradas y /lineas */
.index-group { margin: 0 0 18px; }
.index-group h2 { font-size: 15px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; margin: 0 0 10px; }
.index-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.index-list li { border-bottom: 1px solid var(--border); }
.index-list li:last-child { border-bottom: none; }
.index-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 2px;
  color: var(--text);
  text-decoration: none;
  font-size: 14.5px;
}
.index-list a:hover .index-name { text-decoration: underline; }
.index-list .index-id { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; flex: none; width: 2.6em; }
.index-name { font-weight: 600; flex: 1 1 auto; min-width: 0; }
.index-lines { display: flex; gap: 4px; flex-wrap: wrap; flex: none; }

.line-index-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  margin: 0 0 10px;
}
.line-index-card:hover { border-color: var(--brand); }
.line-index-text { display: flex; flex-direction: column; gap: 2px; }
.line-index-name { font-weight: 600; font-size: 14.5px; }
.line-index-sub { color: var(--muted); font-size: 12.5px; }
