/* Páginas das ruas (/ruas e /ruas/{slug}). Carregado só nelas; usa as cores e componentes do site.css. */

.street-head .lead { max-width: 70ch; }
.street-call { font-size: 1.2rem; font-weight: 600; color: var(--green-dark); margin: 6px 0 10px; max-width: 46rem; }
.street-intro { margin: 0 0 14px; max-width: 46rem; line-height: 1.6; }
.street-intro-auto { font-size: .95rem; }
.street-know { display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; margin: 0 0 12px; padding: 8px 12px; max-width: 46rem; font-size: .88rem; line-height: 1.5;
  color: var(--muted); background: var(--green-soft); border-left: 3px solid var(--green-line); border-radius: 0 8px 8px 0; }
.street-know strong { color: var(--green-dark); }
.street-know-src { font-size: .8rem; }
.street-totals { margin: 4px 0 0; }
.street-stats { list-style: none; margin: 0 0 4px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; color: var(--muted); }
.street-stats strong { color: var(--green-dark); font-size: 1.25rem; }

/* Índice de ruas */
.street-index { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.street-index-card { display: flex; flex-direction: column; gap: 2px; padding: 16px; background: #fff; border: 1px solid var(--green-line); border-radius: var(--radius);
  box-shadow: var(--shadow); text-decoration: none; color: var(--ink); height: 100%; }
.street-index-card:hover { border-color: var(--green); background: var(--green-soft); }
.street-index-name { font-weight: 700; color: var(--green-dark); }
.street-index-count { color: var(--muted); font-size: .92rem; }
.street-index-count strong { color: var(--ink); }
.street-index-sm { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

/* Página da rua: celular em coluna (segmentos, mapa, lista); em telas largas, o mapa fica ao lado e acompanha a rolagem */
.street-layout { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); padding-top: 24px; padding-bottom: 12px;
  grid-template-areas: "seg" "map" "list"; }   /* celular: segmentos, mapa e lista; o mapa fica à vista ao escolher um segmento */
.street-segments { grid-area: seg; }
.street-jump { margin: 8px 0 0; }
@media (min-width: 900px) { .street-jump { display: none; } }
.street-map-col { grid-area: map; }
.street-list { grid-area: list; }
@media (min-width: 900px) {
  /* mapa com metade da largura, acompanhando a rolagem */
  .street-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px 28px; grid-template-areas: "seg map" "list map"; align-items: start; }
  .street-map-col { position: sticky; top: 12px; }
}
.street-segments h2, .street-list h2, .street-map-col h2 { color: var(--green-dark); margin-bottom: 4px; }
.street-map-col h2 { margin-bottom: 8px; }
.street-segments p, .street-list p { margin: 0 0 10px; }

/* Distribuição por segmento (também é o filtro) */
.seg-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.seg-row { --seg: var(--green); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; padding: 7px 12px 7px 14px; height: 100%;
  border: 1px solid var(--line); border-left: 5px solid var(--seg); border-radius: 10px; background: #fff; text-decoration: none; color: var(--ink); }
.seg-row:hover { border-color: var(--seg); box-shadow: 0 1px 6px rgba(0, 0, 0, .08); }
.seg-row.active { border-color: var(--seg); border-width: 2px 2px 2px 5px; padding: 6px 11px 6px 13px; box-shadow: 0 0 0 3px color-mix(in srgb, var(--seg) 18%, transparent); }
.seg-name { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.seg-row.active .seg-name { font-weight: 800; }
.seg-n { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink); }
.seg-bar { grid-column: 1 / -1; height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; }
.seg-bar i { display: block; height: 100%; background: var(--seg); border-radius: 3px; }
.seg-row:focus-visible, .street-locate:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }

/* Mapa */
.street-map { height: 300px; border: 1px solid var(--green-line); border-radius: var(--radius); background: var(--green-soft); overflow: hidden; position: relative; z-index: 0; }
@media (min-width: 900px) { .street-map { height: min(620px, calc(100vh - 80px)); min-height: 420px; } .street-map-expand, .street-map-expand[hidden] { display: none; }
@media (max-width: 899px) { .street-map-expand:not([hidden]) + a::before { content: '· '; } } }
/* celular: largura total; "Ampliar o mapa" deixa o mapa quase da altura da tela para navegar melhor */
.street-map-expand { font: inherit; font-size: .875rem; background: none; border: 0; padding: 0; color: var(--green); text-decoration: underline; cursor: pointer; }
.street-map-expand[hidden] { display: none; }
.street-map.is-big { height: 78vh; min-height: 420px; }
.street-map-fallback { margin: 0; padding: 16px; }
.street-map-note { margin: 6px 2px 0; }
.street-map .leaflet-container { width: 100%; height: 100%; font: inherit; background: var(--green-soft); }
.street-map .leaflet-popup-content { margin: 10px 12px; font-size: .92rem; line-height: 1.35; }
.map-pop-name { display: block; font-weight: 700; margin-bottom: 2px; }
.map-pop-meta { margin: 0 0 8px; color: var(--muted); }
.map-pop .act { cursor: pointer; font: inherit; font-size: .82rem; font-weight: 600; }

/* Lista */
.street-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.street-row { --seg: var(--green); display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 12px 10px 14px; background: #fff;
  border: 1px solid var(--line); border-left: 5px solid var(--seg); border-radius: 10px; scroll-margin-top: 80px; }
.street-row:target, .street-row.flash { border-color: var(--seg); box-shadow: 0 0 0 3px color-mix(in srgb, var(--seg) 18%, transparent); }
.street-row[hidden] { display: none; }
.street-row-main { min-width: 0; }
.street-row-name { font-weight: 700; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.street-row-name:hover { color: var(--green); text-decoration: underline; }
.street-row-meta { margin: 2px 0 0; font-size: .88rem; color: var(--muted); }
.street-num { display: block; font-size: .7rem; line-height: 1.3; font-variant-numeric: tabular-nums; color: var(--muted); }
.street-row-cat { display: inline-block; margin-top: 1px; }
.street-row-cat { color: var(--green); text-decoration: none; }
.street-row-cat:hover { text-decoration: underline; }
.street-row-actions { display: flex; gap: 6px; flex: none; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.street-locate { font: inherit; font-size: .82rem; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; padding: 6px 10px; border-radius: 6px; cursor: pointer;
  background: #fff; color: var(--green-dark); border: 1px solid var(--green-line); }
.street-locate:hover { background: var(--green-soft); border-color: var(--green); }
.street-locate[hidden] { display: none; }
.street-locate .ico { width: 15px; height: 15px; color: var(--green); }
.street-row .act-route, .map-pop .act-route { background: var(--orange); border-color: var(--orange); color: #fff; }
.street-row .act-route:hover, .map-pop .act-route:hover { background: var(--orange-dark); border-color: var(--orange-dark); }
.street-row .act-route.on, .map-pop .act-route.on { background: #fff; color: var(--orange); }
.street-row .act-route.on .ico, .map-pop .act-route.on .ico { color: var(--orange); }
@media (max-width: 520px) {
  .street-row { flex-direction: column; align-items: stretch; }
  .street-row-actions { justify-content: flex-start; }
}

/* Segmentos compactos: 3 por linha, fonte menor e sem negrito (celular e desktop) */
.seg-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.seg-row { gap: 1px 6px; padding: 5px 7px 6px 9px; font-size: .74rem; line-height: 1.25; border-left-width: 4px; }
.seg-row.active { padding: 4px 6px 5px 8px; border-width: 2px 2px 2px 4px; }
.seg-name, .seg-row.active .seg-name, .seg-n { font-weight: 400; }
.seg-bar { height: 4px; }

/* Títulos das seções e botões menores */
.street-segments h2, .street-list h2, .street-map-col h2 { font-size: 1.05rem; }
.street-list h2 small { font-size: .85em; font-weight: 400; }
.street-locate { font-size: .74rem; font-weight: 600; padding: 4px 8px; }
.street-locate .ico { width: 13px; height: 13px; }
.street-row .act, .map-pop .act { font-size: .74rem; padding: 4px 9px; gap: 4px; }
.street-row .act .ico { width: 13px; height: 13px; }
.street-map-col { scroll-margin-top: 72px; }

.street-list .roteiro-tip { margin: 0 0 14px; font-size: .86rem; }
.street-index-pop { color: var(--muted); font-size: .85rem; }
.ruas-mapa-call { margin-top: 6px; }

