/* ==========================================================================
   CULTURA TRINACIONAL — Página Mapa
   ========================================================================== */

.map-wrapper {
  position: relative;
  margin: 4px 0 24px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
}

#map-canvas {
  width: 100%;
  height: 460px;
  background: var(--bg-card);
}

#map-fallback {
  height: 460px;
  align-items: center;
  justify-content: center;
}

.map-count {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: rgba(5,7,15,0.75);
  backdrop-filter: blur(6px);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

@media (min-width: 900px) {
  #map-canvas, #map-fallback { height: 560px; }
}

/* Lista de paradas do roteiro quando o Google Maps não carrega */
#map-fallback.map-route-list { text-align: left; padding: 56px 16px 16px; overflow-y: auto; }
.map-route-list > strong { display: block; margin-bottom: 12px; font-size: 1.1rem; color: var(--text-primary); }
.map-route-list ol { margin: 0; padding: 0; list-style: none; counter-reset: route-stop; display: flex; flex-direction: column; gap: 10px; }
.map-route-list li { counter-increment: route-stop; display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--border-subtle); border-radius: 12px; background: rgba(255,255,255,0.03); }
.map-route-list li::before { content: counter(route-stop); flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #1688ec; color: #fff; font-weight: 800; }
.map-route-list a { color: var(--text-primary); font-weight: 700; text-decoration: none; line-height: 1.3; }

/* ==========================================================================
   Modal ao clicar num pin de evento
   ========================================================================== */

.event-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(5,7,15,0.7);
  backdrop-filter: blur(4px);
  display: none;
  align-items: flex-end;
  justify-content: center;
}
.event-modal-backdrop.open { display: flex; }

.event-modal {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 82vh;
  overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 20px;
  box-shadow: 0 -10px 40px rgba(0,0,0,0.5);
}

@media (min-width: 640px) {
  .event-modal-backdrop { align-items: center; }
  .event-modal { border-radius: var(--radius-lg); }
}

.event-modal-close {
  position: absolute;
  top: 12px; right: 12px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  font-size: 20px;
  line-height: 1;
  color: var(--text-secondary);
  display: grid; place-items: center;
}

.map-modal-cover {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: var(--radius-md);
  margin-bottom: 14px;
  background: var(--bg-card);
}

.map-modal-title { font-size: 18px; font-weight: 800; margin-bottom: 8px; }

.map-modal-meta {
  display: flex; flex-direction: column; gap: 5px;
  font-size: 13.5px; color: var(--text-secondary);
  margin-bottom: 14px;
}

.map-modal-actions { display: flex; gap: 8px; }
.map-modal-actions .btn { flex: 1; justify-content: center; padding: 11px; font-size: 13.5px; }

/* Etiqueta de contagem só aparece quando tem texto */
.map-count:empty { display: none; }

/* Mais respiro no topo do mapa */
.page-hero h1 { margin-bottom: 8px; }
.page-hero .subtitle { margin-bottom: 8px; }
.page-hero .slogan { margin-bottom: 14px; }

/* Cartão do evento no mapa: rota em destaque (28/09/2026) */
.map-modal-actions { flex-direction: column; }
.map-modal-actions .map-route-btn { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; padding: 13px; }
.map-route-hint { margin: 8px 0 0; font-size: 12.5px; color: var(--text-secondary); text-align: center; }

/* Legenda do mapa (28/09/2026) */
.map-legend { display:flex; flex-wrap:wrap; gap:8px 18px; margin:10px 2px 18px; font-size:12.5px; color:var(--text-secondary); }
.map-legend > span { display:inline-flex; align-items:center; gap:6px; }
.map-legend__dot { width:12px; height:12px; border-radius:50%; background:#38bdf8; border:2px solid #fff; box-shadow:0 0 0 1px rgba(0,0,0,.2); display:inline-block; }


/* ==========================================================================
   EXPERIÊNCIA NO COMPUTADOR — Mapa (tela de 1100px ou mais)
   Celular e tablet não mudam.
   ========================================================================== */
@media (min-width: 1100px) {
  #map-canvas, #map-fallback { height: clamp(480px, calc(100vh - 400px), 760px); }
}

/* ===== PC: cabeçalho do Mapa centralizado e maior ===== */
@media (min-width: 1100px) {
  .page-hero { text-align: center; padding-top: 8px; }
  .page-hero h1 { font-size: clamp(46px, 3.8vw, 64px); line-height: 1.05; margin-bottom: 14px; }
  .page-hero .subtitle {
    font-size: clamp(19px, 1.5vw, 24px); line-height: 1.4; max-width: 760px;
    margin: 0 auto 12px;
  }
  .page-hero .slogan { font-size: clamp(19px, 1.5vw, 24px); margin: 0 0 18px; }
  .page-hero .country-bar { margin: 0 auto 26px; width: 300px; height: 6px; }
}
