/* TO Obras 1.1: carrusel, listado con filtros y cobertura */
.tos-obra { background: #fff; border: 1px solid #e5e5e5; border-top: 4px solid #e05206; border-radius: 4px; height: 100%; display: flex; flex-direction: column; }
.tos-obra__imagen img { aspect-ratio: 3 / 2; object-fit: cover; width: 100%; height: auto; display: block; }
.tos-obra__texto { padding: 1rem 1.25rem 1.25rem; }
.tos-obra__sector { color: #c74905; font-size: .85rem; font-weight: 600; letter-spacing: .04em; margin: 0 0 .25rem; text-transform: uppercase; }
.tos-obra__titulo { font-size: 1.1rem; margin: 0 0 .75rem; }
.tos-obra__datos { display: grid; gap: .3rem; margin: 0; font-size: .95rem; }
.tos-obra__datos div { display: flex; gap: .5rem; }
.tos-obra__datos dt { color: #666; min-width: 6rem; }
.tos-obra__datos dd { margin: 0; }

.tos-carrusel { margin: 1.5rem 0 2.5rem; }
.tos-carrusel__controles { display: flex; gap: .5rem; justify-content: flex-end; margin-bottom: .75rem; }
.tos-carrusel__boton { background: #fff; border: 2px solid #003478; border-radius: 4px; color: #003478; cursor: pointer; font: inherit; font-weight: 600; padding: .4rem .9rem; }
.tos-carrusel__boton:hover:not([disabled]) { background: #003478; color: #fff; }
.tos-carrusel__boton[disabled] { opacity: .45; cursor: default; }
.tos-carrusel__pista { display: grid; grid-auto-columns: minmax(260px, calc((100% - 2rem) / 3)); grid-auto-flow: column; gap: 1rem; list-style: none; margin: 0; overflow-x: auto; padding: 0 0 .75rem; scroll-snap-type: x mandatory; scroll-behavior: smooth; }
.tos-carrusel__item { scroll-snap-align: start; }
@media (max-width: 781px) { .tos-carrusel__pista { grid-auto-columns: 85%; } }
@media (prefers-reduced-motion: reduce) { .tos-carrusel__pista { scroll-behavior: auto; } }

/* Filtros */
.tos-filtros { background: #f2f2f2; border-radius: 4px; display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; padding: 1rem; margin: 1rem 0; }
.tos-filtros__campo { display: flex; flex-direction: column; gap: .3rem; min-width: 160px; flex: 1 1 160px; }
.tos-filtros__campo--ancho { flex: 2 1 260px; }
.tos-filtros label { font-weight: 600; font-size: .9rem; }
.tos-filtros input, .tos-filtros select { border: 1px solid #767676; border-radius: 4px; font: inherit; padding: .5rem .6rem; background: #fff; color: #222; }
.tos-filtros__acciones { display: flex; gap: 1rem; align-items: center; }
.tos-obras__conteo { color: #666; margin: 0 0 .5rem; }

/* Tabla de obras: en celular cada fila se muestra como tarjeta */
.tos-tabla-obras { overflow-x: auto; }
.tos-tabla-obras table { border-collapse: collapse; width: 100%; }
.tos-tabla-obras th, .tos-tabla-obras td { border-bottom: 1px solid #e5e5e5; padding: .6rem .5rem; text-align: left; vertical-align: top; }
.tos-tabla-obras thead th { color: #666; font-size: .9rem; font-weight: 600; white-space: nowrap; }
.tos-tabla-obras tbody th { color: #003478; font-weight: 600; }
.tos-tabla-obras tbody tr:nth-child(even) { background: #fafafa; }
@media (max-width: 781px) {
	.tos-tabla-obras thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
	.tos-tabla-obras tr { display: block; border: 1px solid #e5e5e5; border-top: 4px solid #e05206; border-radius: 4px; margin-bottom: .75rem; padding: .5rem .75rem; background: #fff !important; }
	.tos-tabla-obras th, .tos-tabla-obras td { display: flex; gap: .5rem; border: 0; padding: .2rem 0; }
	.tos-tabla-obras td::before { content: attr(data-etiqueta); color: #666; min-width: 6rem; }
	.tos-tabla-obras tbody th { font-size: 1.05rem; }
}

.tos-paginacion ul { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; margin: 1.5rem 0 0; padding: 0; }
.tos-paginacion a { border: 1px solid #003478; border-radius: 4px; color: #003478; display: inline-block; min-width: 2.5rem; padding: .35rem .6rem; text-align: center; text-decoration: none; }
.tos-paginacion a[aria-current="page"] { background: #003478; color: #fff; }
.tos-paginacion__salto { align-self: center; color: #666; }

.tos-resumen { display: flex; flex-wrap: wrap; gap: 2.5rem; list-style: none; margin: 1rem 0 0; padding: 0; font-size: 1.1rem; }
.tos-resumen strong { color: #003478; display: block; font-size: 2.2rem; line-height: 1.1; }

/* Cobertura */
.tos-cobertura { overflow-x: auto; }
.tos-cobertura table { border-collapse: collapse; width: 100%; min-width: 460px; }
.tos-cobertura caption { font-weight: 600; text-align: left; margin-bottom: .5rem; }
.tos-cobertura th, .tos-cobertura td { border-bottom: 1px solid #e5e5e5; padding: .55rem .5rem; text-align: left; vertical-align: middle; }
.tos-cobertura thead th { color: #666; font-weight: 600; }
.tos-cobertura td:nth-child(2) { min-width: 220px; }
.tos-cobertura__barra { background: #003478; border-radius: 2px; display: inline-block; height: .8rem; margin-right: .6rem; vertical-align: middle; width: calc(var(--ancho) * 1.5px); }
.tos-cobertura__vacia th, .tos-cobertura__vacia td { color: #767676; }
.tos-cobertura__nota { background: #fff4e5; border-left: 4px solid #c74905; padding: .5rem .75rem; }

/* ---------- Recorrido norte–sur (1.2.0) ---------- */
.tos-recorrido { margin: 1.5rem 0 2.5rem; }
.tos-recorrido__ejes { color: #555; display: flex; font-size: .9rem; font-weight: 600; justify-content: space-between; margin: 0 0 .25rem; }
.tos-recorrido__ayuda { color: #555; font-size: .95rem; margin: 0 0 .75rem; }
.tos-recorrido__regiones { display: grid; gap: 6px; grid-template-columns: repeat(16, minmax(0, 1fr)); list-style: none; margin: 0; padding: 0; }
.tos-recorrido__region { align-items: center; border-radius: 4px; color: #222; display: flex; flex-direction: column; gap: 4px; padding: 4px 2px; text-decoration: none; }
a.tos-recorrido__region:hover { background: #f2f2f2; }
a.tos-recorrido__region:focus-visible { outline: 3px solid #003478; outline-offset: 2px; }
.tos-recorrido__valor { font-size: .9rem; font-weight: 600; }
.tos-recorrido__pista { align-items: flex-end; display: flex; height: 160px; width: 70%; }
.tos-recorrido__barra { background: #003478; border-radius: 3px 3px 0 0; height: calc(var(--alto) * 1%); min-height: 3px; width: 100%; }
.tos-recorrido__region--vacia .tos-recorrido__barra { background: #767676; }
.tos-recorrido__region[aria-current="true"] { background: #fff4ec; }
.tos-recorrido__region[aria-current="true"] .tos-recorrido__barra { background: #c74905; } /* 3:1 mínimo para gráficos (WCAG 1.4.11) */
.tos-recorrido__planta { color: #c74905; height: 16px; width: 16px; }
.tos-recorrido__sigla { color: #555; font-size: .8rem; font-weight: 600; }
.tos-recorrido__nombre { display: none; }
.tos-recorrido__leyenda { align-items: center; color: #555; display: flex; font-size: .9rem; gap: .4rem; margin: .75rem 0; }
.tos-recorrido__leyenda svg { color: #c74905; }
.tos-recorrido__detalle { background: #f2f2f2; border-top: 4px solid #e05206; padding: 1rem 1.25rem; }
.tos-recorrido__d-etq { color: #555; font-size: .85rem; margin: 0; }
.tos-recorrido__d-nombre { font-size: 1.35rem; font-weight: 600; margin: 0 0 .5rem; }
.tos-recorrido__d-datos { display: grid; gap: .75rem 1.5rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 0; }
.tos-recorrido__d-datos dt { color: #555; font-size: .85rem; }
.tos-recorrido__d-datos dd { font-size: 1.1rem; font-weight: 600; margin: 0; }
.tos-recorrido__d-enlace { margin: .9rem 0 0; }
.tos-recorrido__d-enlace a { font-weight: 600; }

/* Celular: el recorrido se vuelve vertical (norte arriba) con barras horizontales */
@media (max-width: 781px) {
	.tos-recorrido__ejes { display: none; }
	.tos-recorrido__regiones { gap: 2px; grid-template-columns: 1fr; }
	.tos-recorrido__region { align-items: center; display: grid; flex-direction: row; gap: .5rem; grid-template-columns: 8.5rem 16px minmax(0, 1fr) 2.5rem; padding: 6px 4px; }
	.tos-recorrido__nombre { display: block; font-size: .95rem; grid-column: 1; grid-row: 1; }
	.tos-recorrido__planta { grid-column: 2; grid-row: 1; }
	.tos-recorrido__pista { grid-column: 3; grid-row: 1; height: 14px; width: 100%; }
	.tos-recorrido__barra { border-radius: 0 3px 3px 0; height: 100%; width: calc(var(--alto) * 1%); }
	.tos-recorrido__valor { grid-column: 4; grid-row: 1; text-align: right; }
	.tos-recorrido__sigla { display: none; }
}
@media (prefers-reduced-motion: no-preference) {
	.tos-recorrido__barra { transition: background-color .2s ease; }
}

/* ---------- Mapa de obras (1.3.0) ---------- */
.tos-mapa-obras { margin: 1.5rem 0 2.5rem; }
.tos-mapa-obras__marco { background: #eef2f5; border: 1px solid #d6dde3; border-radius: 4px; overflow: hidden; }
.tos-mapa-obras__inicio { align-items: center; display: flex; flex-direction: column; gap: .5rem; justify-content: center; min-height: 380px; padding: 2rem; text-align: center; }
.tos-mapa-obras__cifra { color: #003478; font-size: 1.6rem; font-weight: 700; margin: 0; }
.tos-mapa-obras__inicio p { margin: 0; max-width: 34rem; }
.tos-mapa-obras__mapa { height: min(620px, 75vh); width: 100%; }
.tos-mapa-obras__mapa:focus-visible { outline: 3px solid #003478; outline-offset: -3px; }
.tos-mapa-obras__leyendas { display: flex; flex-wrap: wrap; gap: 1rem 2.5rem; margin-top: 1rem; }
.tos-mapa-obras__leyendas ul { display: flex; flex-wrap: wrap; gap: .4rem 1rem; list-style: none; margin: 0; padding: 0; }
.tos-mapa-obras__leyendas li { align-items: center; display: flex; gap: .4rem; font-size: .9rem; }
.tos-mapa-obras__ley-titulo { font-size: .85rem; font-weight: 600; margin: 0 0 .3rem; color: #555; }
.tos-mapa-obras__punto { border-radius: 50%; display: inline-block; height: 12px; width: 12px; }
.tos-mapa-obras__tam { background: #8a8a8a; border: 1px solid #fff; border-radius: 50%; display: inline-block; }
.tos-mapa-obras__tam--1 { height: 10px; width: 10px; }
.tos-mapa-obras__tam--2 { height: 16px; width: 16px; }
.tos-mapa-obras__tam--3 { height: 24px; width: 24px; }
.tos-mapa-obras__tam--4 { height: 34px; width: 34px; }
.tos-mapa-obras__nota { color: #555; font-size: .9rem; margin: .75rem 0 0; }
.tos-mapa-obras__ficha p { margin: 0 0 .2rem; }
.tos-mapa-obras__f-sector { color: #c74905; font-size: .8rem; font-weight: 700; text-transform: uppercase; }
.tos-mapa-obras__f-nombre { color: #003478; font-size: 1rem; font-weight: 700; }
.tos-mapa-obras__f-nota { color: #555; font-size: .85rem; font-style: italic; }
.tos-mapa-obras__planta { background: none; border: 0; }

/* 1.3.1: el atributo hidden debe ocultar aunque el bloque tenga display propio (el aviso seguía visible después del clic) */
.tos-mapa-obras [hidden] { display: none !important; }
