/* TabanoBike — identidad: monte vasco (helecho + pizarra), acento brezo. El perfil de desnivel es la firma. */
:root {
  --pizarra: #1F2B2C;
  --pizarra-2: #2C3B3C;
  --niebla: #E8EDEB;
  --niebla-2: #F4F7F5;
  --helecho: #2E5C4F;
  --helecho-claro: #6E9483;
  --brezo: #A23E6B;
  --brezo-osc: #82305A;
  --roca: #86908C;
  --blanco: #FFFFFF;
  --tabano: #F3B124;
  --carretera: #3E5F7A;

  --p0: #8CB79A; --p1: #D9C25B; --p2: #E38B3A; --p3: #CC4A3B; --p4: #7C1F3E; --pb: #9FB4BF;

  --f-titulo: "Barlow Condensed", "Arial Narrow", sans-serif;
  --f-texto: "Barlow", system-ui, sans-serif;

  --ancho: 1240px;
  --margen: clamp(1rem, 4vw, 2.5rem);
  --r: 6px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body { margin: 0; background: var(--niebla); color: var(--pizarra); font: 400 1.0625rem/1.6 var(--f-texto); }
img, svg { display: block; max-width: 100%; }
a { color: var(--helecho); text-underline-offset: .18em; }
a:hover { color: var(--brezo); }
:focus-visible { outline: 3px solid var(--brezo); outline-offset: 2px; border-radius: 2px; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.saltar { position: absolute; left: -999px; top: 0; background: var(--pizarra); color: #fff; padding: .6rem 1rem; z-index: 100; }
.saltar:focus { left: 0; }
.envoltorio { width: min(100% - 2 * var(--margen), var(--ancho)); margin-inline: auto; }

/* ---------- Cabecera ---------- */
.cab { position: sticky; top: 0; z-index: 50; background: rgba(232, 237, 235, .94); backdrop-filter: blur(8px); border-bottom: 1px solid rgba(31, 43, 44, .08); }
.cab__in { width: min(100% - 2 * var(--margen), var(--ancho)); margin-inline: auto; display: flex; align-items: center; justify-content: space-between; min-height: 68px; gap: 1rem; }
.cab__logo img { height: 54px; width: auto; margin-left: -6px; }
.logo-oscuro { display: none !important; }
.cab__nav { display: flex; align-items: center; gap: .25rem; font: 600 1.15rem/1 var(--f-titulo); letter-spacing: .01em; }
.cab__nav > a, .cab__regiones > summary { color: var(--pizarra); text-decoration: none; padding: .6rem .7rem; border-radius: var(--r); cursor: pointer; }
.cab__nav > a:hover, .cab__regiones > summary:hover { background: rgba(46, 92, 79, .1); color: var(--helecho); }
.cab__regiones { position: relative; }
.cab__regiones > summary { list-style: none; }
.cab__regiones > summary::-webkit-details-marker { display: none; }
.cab__regiones > summary::after { content: ""; display: inline-block; margin-left: .35em; border: 4px solid transparent; border-top-color: currentColor; transform: translateY(2px); }
.cab__desplegable { position: absolute; top: calc(100% + .4rem); left: 0; min-width: 220px; background: var(--blanco); border-radius: var(--r); box-shadow: 0 12px 32px rgba(31, 43, 44, .18); padding: .4rem; display: grid; }
.cab__desplegable a { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem .7rem; color: var(--pizarra); text-decoration: none; border-radius: 4px; font-weight: 500; }
.cab__desplegable a:hover { background: var(--niebla); }
.cab__desplegable small { color: var(--roca); font-family: var(--f-texto); font-size: .85rem; }
.cab__idioma { margin-left: .5rem; border: 1.5px solid currentColor; padding: .45rem .7rem !important; }
.cab__menu { display: none; }
.cab__in { position: relative; }
.cab__buscar-btn { order: 3; display: grid; place-items: center; width: 42px; height: 42px; border: 0; border-radius: var(--r); background: transparent; color: var(--pizarra); cursor: pointer; }
.cab__buscar-btn:hover { background: rgba(46, 92, 79, .1); color: var(--helecho); }
.cab__buscar { display: none; position: absolute; right: 0; top: calc(100% + 6px); width: min(420px, 100%); z-index: 60; }
.cab__buscar.abierto { display: block; }
.cab__buscar input { width: 100%; font: inherit; padding: .8rem 1rem; border-radius: var(--r); border: 1.5px solid var(--pizarra); background: var(--blanco); color: var(--pizarra); box-shadow: 0 12px 32px rgba(31, 43, 44, .18); }
.cab__nav { order: 2; margin-left: auto; }
.cab__menu { order: 4; }
.filtros__buscar { flex: 1 1 260px; max-width: 420px; }
.filtros__buscar input { width: 100%; font: inherit; font-size: 1rem; padding: .6rem 1rem .6rem 2.4rem; border-radius: 99px; border: 1.5px solid rgba(31, 43, 44, .25); background: var(--blanco) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5' fill='none' stroke='%2386908C' stroke-width='2.2'/%3E%3Cpath d='M15.5 15.5 21 21' stroke='%2386908C' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E") .85rem 50% / 1.1rem no-repeat; color: var(--pizarra); }
.filtros__buscar input:focus { outline: none; border-color: var(--helecho); box-shadow: 0 0 0 3px rgba(46, 92, 79, .18); }

@media (max-width: 860px) {
  .cab__menu { display: grid; place-items: center; width: 44px; height: 44px; border: 0; background: transparent; cursor: pointer; }
  .cab__menu span:first-child, .cab__menu span:first-child::before, .cab__menu span:first-child::after { display: block; width: 22px; height: 2px; background: var(--pizarra); position: relative; content: ""; transition: transform .2s; }
  .cab__menu span:first-child::before { position: absolute; top: -7px; }
  .cab__menu span:first-child::after { position: absolute; top: 7px; }
  .cab__menu[aria-expanded="true"] span:first-child { background: transparent; }
  .cab__menu[aria-expanded="true"] span:first-child::before { transform: translateY(7px) rotate(45deg); }
  .cab__menu[aria-expanded="true"] span:first-child::after { transform: translateY(-7px) rotate(-45deg); }
  .cab__nav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; background: var(--niebla); padding: .5rem var(--margen) 1.25rem; border-bottom: 1px solid rgba(31, 43, 44, .1); font-size: 1.4rem; }
  .cab__nav.abierto { display: flex; }
  .cab__desplegable { position: static; box-shadow: none; background: transparent; padding: 0 0 0 .8rem; }
  .cab__idioma { margin: .5rem 0 0; text-align: center; }
}

/* ---------- Tipos ---------- */
.titulo-pagina, .titulo-seccion, .hero__titulo, .ficha__titulo { font-family: var(--f-titulo); font-weight: 700; line-height: .95; letter-spacing: -.005em; margin: 0; }
.titulo-pagina { font-size: clamp(2.6rem, 7vw, 4.6rem); }
.titulo-seccion { font-size: clamp(1.9rem, 4vw, 2.6rem); margin-bottom: 1.25rem; }
.texto { max-width: 68ch; }
.texto p { margin: 0 0 1em; }
.boton { display: inline-flex; align-items: center; gap: .5rem; font: 600 1.15rem/1 var(--f-titulo); letter-spacing: .02em; padding: .85rem 1.3rem; border-radius: var(--r); background: var(--helecho); color: var(--blanco); text-decoration: none; border: 0; cursor: pointer; }
.boton:hover { background: var(--pizarra); color: var(--blanco); }
.boton--claro { background: var(--blanco); color: var(--pizarra); }
.boton--claro:hover { background: var(--brezo); color: var(--blanco); }
.boton--gpx { background: var(--brezo); }
.boton--gpx::before { content: ""; width: 1em; height: 1em; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M11 3h2v10.6l3.3-3.3 1.4 1.4L12 17.4l-5.7-5.7 1.4-1.4 3.3 3.3zM4 19h16v2H4z'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M11 3h2v10.6l3.3-3.3 1.4 1.4L12 17.4l-5.7-5.7 1.4-1.4 3.3 3.3zM4 19h16v2H4z'/%3E%3C/svg%3E") center/contain no-repeat; }
.boton--gpx:hover { background: var(--brezo-osc); }
.boton--peq { font-size: 1rem; padding: .55rem .9rem; }
.enlace-mas { font: 600 1.15rem/1 var(--f-titulo); text-decoration: none; }
.enlace-mas:hover { text-decoration: underline; }

/* ---------- Hero (portada) ---------- */
.hero { position: relative; min-height: min(86vh, 820px); display: flex; align-items: flex-end; color: #fff; background: #1F2B2C; overflow: hidden; isolation: isolate; }
.hero__foto { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.hero__video { position: absolute; inset: 0; z-index: -2; overflow: hidden; opacity: 0; transition: opacity 1.2s ease; pointer-events: none; }
.hero__video.listo { opacity: 1; }
.hero__video iframe { position: absolute; top: 50%; left: 50%; width: max(100%, 177.78vh); height: max(100%, 56.25vw); min-height: 100%; transform: translate(-50%, -50%) scale(1.15); border: 0; }
.hero__velo { position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(20, 29, 30, .78) 0%, rgba(20, 29, 30, .45) 42%, rgba(20, 29, 30, 0) 70%), linear-gradient(0deg, rgba(20, 29, 30, .55) 0%, rgba(20, 29, 30, 0) 40%); }
.hero__in { display: flex; justify-content: space-between; align-items: flex-end; gap: 2rem; padding-block: clamp(2.5rem, 8vh, 5rem); flex-wrap: wrap; }
.hero__texto { max-width: 34rem; }
.hero__titulo { font-size: clamp(2.8rem, 6.2vw, 5.2rem); line-height: .95; text-wrap: balance; }
.hero__intro { font-size: clamp(1.05rem, 1.4vw, 1.2rem); line-height: 1.55; margin: 1.1rem 0 1.6rem; color: rgba(255, 255, 255, .88); max-width: 40ch; }
.hero__acciones { display: flex; flex-wrap: wrap; gap: .6rem; margin: 0; }
.hero__destacada { display: grid; gap: .3rem; color: #fff; text-decoration: none; padding: 1rem 1.2rem; border-left: 3px solid var(--brezo); background: rgba(20, 29, 30, .42); backdrop-filter: blur(6px); border-radius: 0 var(--r) var(--r) 0; max-width: 22rem; transition: background .2s; }
.hero__destacada:hover { background: rgba(20, 29, 30, .7); color: #fff; }
.hero__destacada-tit { font: 700 1.6rem/1.05 var(--f-titulo); }
.hero__destacada-dat { font: 500 1.05rem/1 var(--f-titulo); color: rgba(255, 255, 255, .8); }
.sep { display: inline-block; width: 4px; height: 4px; border-radius: 50%; background: currentColor; vertical-align: middle; margin: 0 .45rem; opacity: .7; }
.boton--borde { background: transparent; color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .75); }
.boton--borde:hover { background: #fff; color: #1F2B2C; }
@media (max-width: 640px) { .hero { min-height: 78vh; } .hero__velo { background: linear-gradient(0deg, rgba(20, 29, 30, .85) 0%, rgba(20, 29, 30, .35) 60%, rgba(20, 29, 30, .1) 100%); } .hero__destacada { max-width: none; width: 100%; } }

/* ---------- Bloques ---------- */
.bloque { padding-block: clamp(2.5rem, 7vw, 5rem); }
.bloque__cab { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }

/* ---------- Tarjetas ---------- */
.rejilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: clamp(1.5rem, 3vw, 2.25rem) clamp(1rem, 2.5vw, 1.75rem); }
.rejilla--portada { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.tarjeta__enlace { display: block; color: inherit; text-decoration: none; height: 100%; }
.tarjeta__foto { position: relative; aspect-ratio: 3 / 2; border-radius: var(--r); overflow: hidden; background: var(--pizarra-2); }
.tarjeta__foto img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
.tarjeta__enlace:hover .tarjeta__foto img { transform: scale(1.035); }
.tarjeta__etapas { position: absolute; top: .7rem; left: .7rem; background: rgba(20, 29, 30, .8); color: #fff; font: 600 .95rem/1 var(--f-titulo); padding: .35rem .55rem; border-radius: 4px; }
.tarjeta__cuerpo { padding-top: .85rem; }
.tarjeta__lugar { margin: 0 0 .35rem; font-size: .9rem; color: var(--roca); display: flex; flex-wrap: wrap; gap: .2rem .9rem; }
.tarjeta__mod { color: var(--helecho); font-weight: 600; }
.tarjeta--carretera .tarjeta__mod { color: var(--carretera); }
.tarjeta__titulo { font: 700 1.55rem/1.05 var(--f-titulo); margin: 0; transition: color .2s; }
.tarjeta__enlace:hover .tarjeta__titulo { color: var(--brezo); }
.tarjeta__cifras { margin: .55rem 0 0; display: flex; gap: 1.1rem; font: 500 1rem/1 var(--f-titulo); color: var(--roca); }
.tarjeta__cifras b { font-size: 1.3rem; color: var(--pizarra); font-weight: 600; margin-right: .12em; }

/* ---------- Banda de serie ---------- */
.serie-banda { background: #1F2B2C; color: #E8EDEB; padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.serie-banda__in { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 4rem); align-items: center; }
.serie-banda__foto { display: block; border-radius: var(--r); overflow: hidden; aspect-ratio: 4 / 3; }
.serie-banda__foto img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.serie-banda__foto:hover img { transform: scale(1.03); }
.serie-banda__tipo { margin: 0; color: #9FC0B2; font: 600 1.15rem/1 var(--f-titulo); }
.serie-banda__titulo { font: 700 clamp(2.4rem, 5vw, 3.6rem)/.95 var(--f-titulo); margin: .45rem 0 .9rem; }
.serie-banda__titulo a { color: #fff; text-decoration: none; }
.serie-banda__titulo a:hover { color: #E7B9CE; }
.serie-banda__desc { color: #BFCBC6; margin: 0 0 1.25rem; max-width: 46ch; }
.serie-banda__etapas { margin: 0; padding: 0 0 0 1.4rem; columns: 2; column-gap: 2rem; font: 500 1.08rem/1.25 var(--f-titulo); }
.serie-banda__etapas li { padding: .3rem 0; break-inside: avoid; color: #8FA19A; }
.serie-banda__etapas a { color: #E8EDEB; text-decoration: none; }
.serie-banda__etapas a:hover { color: #E7B9CE; text-decoration: underline; }
@media (max-width: 760px) { .serie-banda__in { grid-template-columns: 1fr; } .serie-banda__etapas { columns: 1; } }

/* ---------- Regiones ---------- */
.regiones { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); border-top: 2px solid var(--pizarra); }
.regiones a { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid rgba(31, 43, 44, .18); color: var(--pizarra); text-decoration: none; margin-right: 2rem; }
.regiones__nombre { font: 700 2rem/1 var(--f-titulo); }
.regiones__n { color: var(--roca); font-size: .95rem; }
.regiones a:hover .regiones__nombre { color: var(--brezo); }
.totales { margin-top: 2rem; color: var(--roca); }

/* ---------- Listados ---------- */
.cabecera-listado { padding-block: clamp(2rem, 6vw, 4rem) 1.25rem; }
.cabecera-listado__n { color: var(--roca); margin: .5rem 0 0; font: 500 1.25rem/1 var(--f-titulo); }
.filtros { display: flex; flex-wrap: wrap; gap: .6rem 1.25rem; align-items: center; margin-bottom: 1.75rem; padding-bottom: 1.25rem; border-bottom: 1px solid rgba(31, 43, 44, .15); }
.filtros fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-block; padding: .45rem .85rem; border-radius: 99px; border: 1.5px solid rgba(31, 43, 44, .25); font-weight: 500; font-size: .95rem; cursor: pointer; user-select: none; }
.chip input:checked + span { background: var(--pizarra); border-color: var(--pizarra); color: var(--blanco); }
.chip input:focus-visible + span { outline: 3px solid var(--brezo); outline-offset: 2px; }
.chip--montana input:checked + span { background: var(--helecho); border-color: var(--helecho); }
.chip--carretera input:checked + span { background: var(--carretera); border-color: var(--carretera); }
.filtros__select select { font: inherit; font-size: .95rem; padding: .45rem 2rem .45rem .85rem; border-radius: 99px; border: 1.5px solid rgba(31, 43, 44, .25); background: transparent; color: inherit; }
.vacio { padding: 3rem 0; color: var(--roca); }
[hidden] { display: none !important; }

/* ---------- Ficha de ruta ---------- */
.ficha__cab { position: relative; min-height: clamp(360px, 62vh, 640px); display: flex; align-items: flex-end; background: var(--pizarra); color: var(--blanco); isolation: isolate; overflow: hidden; }
.ficha__portada { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.ficha__velo { position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, rgba(31, 43, 44, .85) 0%, rgba(31, 43, 44, .1) 55%); }
.ficha__titular { padding-bottom: clamp(1.5rem, 4vw, 2.75rem); }
.ficha__titulo { font-size: clamp(2.6rem, 7.5vw, 6rem); max-width: 18ch; text-wrap: balance; }
.ficha__miga { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 .8rem; }
.ficha__miga a, .ficha__miga span { color: var(--blanco); text-decoration: none; font: 600 1rem/1 var(--f-titulo); padding: .35rem .6rem; border: 1.5px solid rgba(255, 255, 255, .55); border-radius: 4px; }
.ficha__miga a:hover { background: var(--blanco); color: var(--pizarra); }

.cifras { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem 2rem; padding-block: 1.25rem; border-bottom: 1px solid rgba(31, 43, 44, .15); }
.cifras dl { display: flex; flex-wrap: wrap; gap: 1rem clamp(1.5rem, 4vw, 3rem); margin: 0; }
.cifras dt { font-size: .9rem; color: var(--roca); }
.cifras dd { margin: 0; font: 700 clamp(2rem, 4vw, 2.8rem)/1 var(--f-titulo); }
.cifras dd small { font-size: .5em; font-weight: 600; margin-left: .15em; color: var(--roca); }
.cifras__salida dd { font: 600 1.35rem/1.2 var(--f-titulo); max-width: 22ch; padding-top: .3rem; }

.ficha__cuerpo { padding-block: clamp(1.75rem, 4vw, 3rem); display: grid; gap: clamp(1.75rem, 4vw, 3rem); }
.aviso-traduccion { display: inline-block; font-size: .9rem; background: rgba(162, 62, 107, .1); color: var(--brezo-osc); padding: .3rem .65rem; border-radius: 4px; }

/* ---------- Mapa + perfil ---------- */
.mapa-perfil { background: var(--blanco); border-radius: var(--r); overflow: hidden; box-shadow: 0 1px 0 rgba(31, 43, 44, .08); }
.mapa-perfil__mapa { height: clamp(320px, 55vh, 560px); background: #dfe6e3; }
.mapa-perfil__perfil { position: relative; padding: .75rem 1rem 1rem; }
.mapa-perfil__svg { width: 100%; height: 170px; overflow: visible; touch-action: pan-y; cursor: crosshair; }
.mapa-perfil__lectura { font: 600 1.15rem/1 var(--f-titulo); min-height: 1.4rem; margin-bottom: .4rem; }
.mapa-perfil__lectura span { color: var(--pizarra); }
.mapa-perfil__lectura { color: var(--roca); }
.mapa-perfil__lectura .lect-sep { display: inline-block; width: 1.4rem; }
.mapa-perfil__lectura span[data-l-km], .mapa-perfil__lectura span[data-l-alt], .mapa-perfil__lectura span[data-l-pend] { font-size: 1.5rem; }
.leyenda-pendiente { list-style: none; display: flex; flex-wrap: wrap; gap: .3rem 1rem; margin: .6rem 0 0; padding: 0; font-size: .82rem; color: var(--roca); }
.leyenda-pendiente li::before { content: ""; display: inline-block; width: .9rem; height: .55rem; margin-right: .35rem; border-radius: 2px; vertical-align: middle; background: var(--c); }
.leyenda-pendiente .p0 { --c: var(--p0); } .leyenda-pendiente .p1 { --c: var(--p1); } .leyenda-pendiente .p2 { --c: var(--p2); } .leyenda-pendiente .p3 { --c: var(--p3); } .leyenda-pendiente .p4 { --c: var(--p4); }
.perfil-eje { font: 500 11px/1 var(--f-texto); fill: var(--roca); }
.perfil-rejilla { stroke: rgba(31, 43, 44, .08); stroke-width: 1; }
.perfil-cursor { stroke: var(--pizarra); stroke-width: 1.5; }
.mapa-perfil__mapa, .mapa-serie, .mapa-general { position: relative; }
.maplibregl-map { font: inherit; }
.mapa-capas { position: absolute; top: 10px; right: 10px; z-index: 2; display: flex; background: #fff; border-radius: 6px; box-shadow: 0 1px 6px rgba(0, 0, 0, .22); overflow: hidden; }
.mapa-capas button { font: 600 .92rem/1 var(--f-titulo); border: 0; background: transparent; padding: .55rem .75rem; cursor: pointer; color: #1F2B2C; }
.mapa-capas button + button { border-left: 1px solid #E3E8E6; }
.mapa-capas button[aria-pressed="true"] { background: #1F2B2C; color: #fff; }
.mapa-capas__3d { font-weight: 700 !important; letter-spacing: .03em; }
@media (max-width: 520px) { .mapa-capas button { padding: .5rem .55rem; font-size: .85rem; } }
.etapa-num { width: 24px; height: 24px; border-radius: 50%; color: #fff; font: 700 .85rem/24px var(--f-titulo); text-align: center; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .35); }
.maplibregl-popup-content { border-radius: 6px; padding: .6rem .7rem; font: 500 .95rem/1.3 var(--f-texto); color: #1F2B2C; }
.maplibregl-ctrl-group { border-radius: 6px !important; }
.marcador-pos { width: 16px; height: 16px; border-radius: 50%; background: var(--brezo); border: 3px solid #fff; box-shadow: 0 0 0 2px var(--brezo); }
.marcador-ini, .marcador-fin { width: 14px; height: 14px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .4); }
.marcador-ini { background: var(--helecho); }
.marcador-fin { background: var(--pizarra); }

.subidas { list-style: none; margin: -1.5rem 0 0; padding: 0; display: grid; gap: 1px; background: rgba(31, 43, 44, .12); border-radius: var(--r); overflow: hidden; }
.subidas li { display: grid; grid-template-columns: 1fr repeat(4, auto); gap: 1.25rem; align-items: baseline; background: var(--blanco); padding: .7rem 1rem; font: 500 1.05rem/1 var(--f-titulo); color: var(--roca); }
.subidas__nombre { font-size: 1.25rem; font-weight: 700; color: var(--pizarra); }
.subidas__cima::before { content: "▲ "; font-size: .7em; }
@media (max-width: 560px) { .subidas li { grid-template-columns: 1fr 1fr; gap: .4rem 1rem; } .subidas__nombre { grid-column: 1 / -1; } }

/* ---------- Vídeo y galería ---------- */
.video__lanzar { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; padding: 0; background: #000; border-radius: var(--r); overflow: hidden; cursor: pointer; }
.video__lanzar img { width: 100%; height: 100%; object-fit: cover; opacity: .85; transition: opacity .2s; }
.video__lanzar:hover img { opacity: 1; }
.video__play { position: absolute; inset: 0; margin: auto; width: 84px; height: 84px; border-radius: 50%; background: var(--brezo); }
.video__play::after { content: ""; position: absolute; left: 34px; top: 26px; border-left: 24px solid #fff; border-top: 16px solid transparent; border-bottom: 16px solid transparent; }
.videos { display: grid; gap: 1rem; }
.video video { width: 100%; max-height: 80vh; background: #000; border-radius: var(--r); display: block; }
.video iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: var(--r); }
.galeria { columns: 3 240px; column-gap: .6rem; }
.galeria a { display: block; margin-bottom: .6rem; border-radius: 4px; overflow: hidden; break-inside: avoid; }
.galeria img { width: 100%; height: auto; transition: transform .4s; }
.galeria a:hover img { transform: scale(1.03); }
.visor { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; }
.visor::backdrop { background: rgba(15, 20, 20, .94); }
.visor[open] { display: grid; place-items: center; }
.visor img { max-width: 94vw; max-height: 88vh; object-fit: contain; }
.visor button { position: fixed; border: 0; background: rgba(255, 255, 255, .12); color: #fff; font-size: 2.2rem; width: 52px; height: 52px; border-radius: 50%; cursor: pointer; line-height: 1; }
.visor button:hover { background: var(--brezo); }
.visor__cerrar { top: 1rem; right: 1rem; }
.visor__ant { left: 1rem; top: 50%; }
.visor__sig { right: 1rem; top: 50%; }

/* ---------- Etapas / series ---------- */
.etapa { border-top: 2px solid var(--pizarra); padding-top: 1.25rem; display: grid; gap: 1.25rem; }
.etapa__titulo { font: 700 clamp(1.8rem, 4vw, 2.6rem)/1 var(--f-titulo); margin: 0; }
.etapa__titulo span { color: var(--brezo); margin-right: .3em; }
.etapa__cifras { margin: 0; display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; font: 500 1.1rem/1 var(--f-titulo); color: var(--roca); }
.etapa__cifras b { font-size: 1.5rem; color: var(--pizarra); }
.serie-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.serie-nav a { display: block; padding: 1rem 1.25rem; background: var(--blanco); border-radius: var(--r); text-decoration: none; color: var(--pizarra); font: 700 1.35rem/1.1 var(--f-titulo); }
.serie-nav small { display: block; font: 500 .9rem/1.4 var(--f-texto); color: var(--roca); }
.serie-nav__sig { text-align: right; grid-column: 2; }
.serie-nav a:hover { background: var(--pizarra); color: var(--blanco); }
.mapa-serie { height: clamp(320px, 55vh, 560px); border-radius: var(--r); overflow: hidden; background: #dfe6e3; }
.lista-etapas { list-style: none; margin: -0.5rem 0 0; padding: 0; border-top: 2px solid var(--pizarra); }
.lista-etapas a { display: grid; grid-template-columns: 3rem minmax(0, 1fr) 160px 9rem; gap: 1rem; align-items: center; padding: .9rem 0; border-bottom: 1px solid rgba(31, 43, 44, .15); color: var(--pizarra); text-decoration: none; }
.lista-etapas__n { font: 700 2.2rem/1 var(--f-titulo); color: var(--brezo); }
.lista-etapas__t { font: 700 1.4rem/1.1 var(--f-titulo); }
.lista-etapas svg { width: 160px; height: 40px; fill: var(--helecho-claro); }
.lista-etapas__c { font: 500 1rem/1 var(--f-titulo); color: var(--roca); text-align: right; }
.lista-etapas__c b { font-size: 1.25rem; color: var(--pizarra); }
.lista-etapas a:hover .lista-etapas__t { color: var(--brezo); }
.lista-etapas a:hover svg { fill: var(--brezo); }
@media (max-width: 700px) { .lista-etapas a { grid-template-columns: 2.4rem 1fr; } .lista-etapas svg { display: none; } .lista-etapas__c { grid-column: 2; text-align: left; } }

/* ---------- Mapa general ---------- */
.pag-mapa .pie { display: none; }
.mapa-general { height: calc(100vh - 69px); height: calc(100dvh - 69px); }
.popup-ruta { width: 220px; }
.popup-ruta img { width: 100%; height: 120px; object-fit: cover; border-radius: 4px; margin-bottom: .4rem; }
.popup-ruta a { font: 700 1.2rem/1.1 var(--f-titulo); color: var(--pizarra); text-decoration: none; }
.popup-ruta p { margin: .25rem 0 0 !important; color: var(--roca); font-size: .9rem; }
.punto-ruta { width: 14px; height: 14px; border-radius: 50%; background: var(--helecho); border: 2.5px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .35); }
.punto-ruta--carretera { background: var(--carretera); }

/* ---------- 404 y pie ---------- */
.error404 { padding-block: 5rem; }
.pie { background: var(--pizarra); color: #B9C4C0; margin-top: clamp(2rem, 6vw, 4rem); }
.pie__in { width: min(100% - 2 * var(--margen), var(--ancho)); margin-inline: auto; padding-block: 2.5rem; display: grid; grid-template-columns: auto 1fr; gap: 1.5rem 3rem; align-items: center; }
.pie__enlaces { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: flex-end; }
.pie a { color: var(--niebla); text-decoration: none; }
.pie a:hover { color: var(--tabano); }
.pie__legal { grid-column: 1 / -1; margin: 0; font-size: .85rem; border-top: 1px solid var(--pizarra-2); padding-top: 1rem; }
@media (max-width: 640px) { .pie__in { grid-template-columns: 1fr; } .pie__enlaces { justify-content: flex-start; } }

/* ---------- Modo oscuro automático ---------- */
@media (prefers-color-scheme: dark) {
  :root { --niebla: #182122; --niebla-2: #1E2829; --pizarra: #E3E9E6; --pizarra-2: #2C3B3C; --blanco: #222D2E; --roca: #95A29D; --helecho: #7FB09D; }
  body { background: var(--niebla); }
  .cab { background: rgba(24, 33, 34, .94); border-color: rgba(255, 255, 255, .06); }
  .logo-claro { display: none !important; }
  .logo-oscuro { display: block !important; }
  .hero, .ficha__cab, .serie-banda, .pie { background: #0F1616; }
  .serie-banda { color: #C9D3CF; }
  .boton { color: #fff; background: #2E5C4F; }
  .boton--claro { background: #fff; color: #1F2B2C; }
  .boton--gpx { background: var(--brezo); }
  .chip input:checked + span { color: #182122; }
  .cab__desplegable { background: #222D2E; }
  .serie-nav a:hover { color: #182122; }
  .cab__menu span:first-child, .cab__menu span:first-child::before, .cab__menu span:first-child::after { background: var(--pizarra); }
}

/* Lista de rutas que salen del mismo sitio (mapa general) */
.lista-salida { display: grid; gap: .35rem; max-height: 320px; overflow-y: auto; }
.lista-salida__tit { margin: 0 0 .2rem; font: 600 1.05rem/1.2 var(--f-titulo); color: #1F2B2C; }
.lista-salida__item { display: grid; grid-template-columns: 64px 1fr; gap: .6rem; align-items: center; text-decoration: none; color: #1F2B2C; padding: .3rem; border-radius: 6px; }
.lista-salida__item:hover { background: #EEF2F0; color: #1F2B2C; }
.lista-salida__item img, .lista-salida__item > span:first-child { width: 64px; height: 46px; object-fit: cover; border-radius: 4px; background: #DDE3E1; }
.lista-salida__item b { display: block; font: 700 1.02rem/1.15 var(--f-titulo); }
.lista-salida__item small { color: #6B7774; font-size: .82rem; }
