/* Florence Tramvia map - florence-on-line.com
   Mirrors the structure of florence-parking-map.css with tm- prefixes. */

.fol-tram-map {
  border: 1px solid #E2D9CD;
  border-radius: 4px;
  overflow: hidden;
  margin: 20px 0;
  background: #FAF7F2;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.tm-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 16px;
  background: #654236;
  color: #fff;
}
.tm-title {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.15rem;
  font-weight: 700;
}
.tm-title span { font-weight: 400; opacity: 0.85; }
.tm-sub { font-size: 0.78rem; opacity: 0.85; margin-top: 2px; }
.tm-header a { color: #F0D9C0; font-size: 0.8rem; text-decoration: none; }
.tm-header a:hover { text-decoration: underline; }

.tm-layout { display: flex; flex-wrap: wrap; }

.tm-sidebar {
  flex: 0 0 280px;
  max-width: 280px;
  background: #fff;
  border-right: 1px solid #E2D9CD;
  display: flex;
  flex-direction: column;
  max-height: 520px;
}
.tm-sidebar-header { padding: 12px 14px 8px; border-bottom: 1px solid #EFE8DE; }
.tm-sidebar-header h3 {
  font-size: 0.9rem; margin: 0 0 8px; color: #654236;
  font-family: "Playfair Display", Georgia, serif;
}

.tm-lines { display: flex; flex-wrap: wrap; gap: 6px; }
.tm-legend-item {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.74rem; color: #4A4238;
}
.tm-swatch { width: 16px; height: 4px; border-radius: 2px; display: inline-block; }
.tm-swatch-dash {
  background: repeating-linear-gradient(90deg, #da7635 0 5px, transparent 5px 8px);
}

.tm-stop-list { overflow-y: auto; flex: 1; }

.tm-group-head {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 14px 6px;
  font-size: 0.76rem; font-weight: 700; color: #654236;
  background: #F5EFE6; border-bottom: 1px solid #E2D9CD;
  position: sticky; top: 0; z-index: 2;
}
.tm-group-count { margin-left: auto; font-weight: 400; font-size: 0.68rem; color: #7A7060; }
.tm-stop-item-major h4 { font-weight: 700; }
.tm-inter-badge {
  display: inline-block; margin-left: 6px; padding: 1px 5px;
  font-size: 0.58rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.03em; color: #fff; background: #654236; border-radius: 3px;
  vertical-align: middle;
}
.tm-stop-item {
  display: flex; gap: 10px; padding: 9px 14px;
  border-bottom: 1px solid #F2ECE3; cursor: pointer;
}
.tm-stop-item:hover { background: #FAF7F2; }
.tm-stop-item.active { background: #F5EFE6; }
.tm-stop-dot {
  flex: 0 0 10px; width: 10px; height: 10px; border-radius: 50%;
  margin-top: 4px; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,0.15);
}
.tm-stop-info h4 { font-size: 0.82rem; margin: 0 0 2px; color: #2D2D2D; font-weight: 600; }
.tm-stop-note { font-size: 0.7rem; color: #7A7060; line-height: 1.35; }

.tm-sidebar-footer {
  padding: 9px 14px; font-size: 0.68rem; color: #7A7060;
  border-top: 1px solid #EFE8DE; background: #FAF7F2;
}
.tm-sidebar-footer a { color: #2C6E9B; }

#tm-map { flex: 1 1 320px; min-height: 520px; }

/* stop markers */
.tm-stop {
  border-radius: 50%; background: #fff; border-style: solid; border-width: 3px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3); box-sizing: border-box;
}
.tm-stop-major { border-width: 4px; }

/* popups */
.tm-popup-inner { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; }
.tm-popup-head {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 0.92rem; font-weight: 700; color: #654236;
  padding-bottom: 5px; margin-bottom: 6px; border-bottom: 1px solid #EFE8DE;
}
.tm-popup-body { font-size: 0.76rem; color: #4A4238; line-height: 1.45; }
.tm-badge {
  display: inline-block; color: #fff; font-size: 0.62rem; font-weight: 700;
  padding: 1px 6px; border-radius: 3px; margin-left: 4px; vertical-align: middle;
}

@media (max-width: 700px) {
  .tm-sidebar { flex: 1 1 100%; max-width: 100%; max-height: 220px; border-right: none; border-bottom: 1px solid #E2D9CD; }
  #tm-map { min-height: 380px; }
}

/* ---- fullscreen control + expanded state ---- */

.tm-fs-btn {
  width: 34px; height: 34px;
  line-height: 34px; text-align: center;
  background: #fff; color: #654236;
  border-radius: 4px; box-shadow: 0 1px 5px rgba(0,0,0,0.35);
  font-size: 0.95rem; text-decoration: none; display: block;
}
.tm-fs-btn:hover { background: #F5EFE6; color: #654236; }

/* Pinned overlay rather than the native Fullscreen API (iOS-safe) */
.fol-tram-map.tm-fullscreen {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 9999;
  margin: 0;
  border-radius: 0;
  border: none;
  display: flex;
  flex-direction: column;
}
.fol-tram-map.tm-fullscreen .tm-layout {
  flex: 1;
  min-height: 0;
}
.fol-tram-map.tm-fullscreen .tm-sidebar {
  max-height: none;
  height: auto;
}
.fol-tram-map.tm-fullscreen #tm-map {
  height: auto;
  min-height: 0;
}

/* stop the page behind from scrolling while the map is expanded */
body.tm-fs-open { overflow: hidden; }

@media (max-width: 700px) {
  .fol-tram-map.tm-fullscreen .tm-sidebar {
    flex: 0 0 auto;
    max-height: 38%;
  }
  .fol-tram-map.tm-fullscreen #tm-map {
    flex: 1 1 auto;
    min-height: 0;
  }
}
