/* ------------------------------------------------------------ the Goa map (js/screens/map.js)
   Everything the IFFI map needs is here, so it doesn't depend on DIFF's campus-map rules in app.css. */
html[data-tab="map"] body { overflow: hidden; }
#p-map { padding: 0; }
.mapscreen { position: fixed; inset: 0; }
#map { position: absolute; inset: 0; background: var(--bg); }
#map > .empty { position: absolute; inset: 0; padding-top: calc(var(--safe-t) + 140px); }

.map-top { position: absolute; top: calc(var(--safe-t) + 10px); left: 12px; right: 12px; display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; pointer-events: none; z-index: 3; }
.map-top > * { pointer-events: auto; }
.goa .map-title { padding: 4px; border-radius: 16px; }
.goa .map-title .seg { background: none; display: flex; }
.goa .map-title .seg button { padding: 0 11px; height: 36px; font-size: 14.5px; border-radius: 12px; }
.goa .map-ctrls { display: flex; flex-direction: row; border-radius: 22px; overflow: hidden; }
.goa .map-ctrls button { width: 42px; height: 44px; display: grid; place-items: center; color: var(--ink); }
.goa .map-ctrls button + button { box-shadow: inset .5px 0 0 var(--line); }
.map-ctrls button[aria-pressed="true"] { color: var(--accent); }

.map-card { position: absolute; left: 12px; right: 12px; bottom: var(--tabbar-space); max-width: 540px; margin: 0 auto; border-radius: 28px; padding: 12px; z-index: 3;
  max-height: calc(100dvh - var(--tabbar-space) - var(--safe-t) - 150px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
.map-card::-webkit-scrollbar { display: none; }
.map-card .chips { margin: 0 -12px; padding: 0 12px 2px; }
.map-card .chip { height: 30px; font-size: 14px; padding: 0 12px; }

/* The trip card: From, To and how long it takes. */
.rc-fields { position: relative; background: var(--fill); border-radius: 18px; }
.rc-field { display: flex; align-items: center; gap: 12px; padding: 5px 50px 5px 14px; width: 100%; text-align: left; }
.rc-field + .rc-field { box-shadow: inset 0 .5px 0 var(--line); }
.rc-field small { display: block; font-size: 12px; color: var(--ink3); font-weight: 600; }
.rc-field b { display: block; font-weight: 600; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-field span { min-width: 0; }
.rc-dot { width: 11px; height: 11px; border-radius: 50%; flex: none; }
.rc-dot.from { box-shadow: inset 0 0 0 3px var(--accent); }
.rc-dot.to { background: var(--accent); }
.rc-swap { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--card); color: var(--ink); box-shadow: 0 1px 4px rgba(0, 0, 0, .15); }
/* From and To side by side, the swap button between them. */
.gm-fields { display: flex; align-items: stretch; }
.gm-fields .rc-field { flex: 1; min-width: 0; padding: 7px 12px; gap: 0; }
.gm-fields .rc-field + .rc-field { box-shadow: none; }
.gm-fields .rc-field:last-child { padding-left: 6px; }
.gm-fields .rc-field small { display: flex; align-items: center; gap: 6px; }
.gm-fields .rc-dot { width: 9px; height: 9px; }
.gm-fields .rc-field b { font-size: 15px; }
.gm-fields .rc-swap { position: static; transform: rotate(90deg); align-self: center; flex: none; width: 32px; height: 32px; margin: 0 2px; }
.rc-res { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 10px; padding: 9px 4px 5px; }
.rc-res b { font: 700 26px/1 var(--display); letter-spacing: -.03em; flex: none; }
.rc-res span { color: var(--ink2); font-size: 14.5px; }
.rc-sum { display: none; font-weight: 600; color: var(--ink) !important; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gm-gap { font-size: 13px; color: var(--ink2); padding: 0 4px 8px; line-height: 1.35; }
.gm-gap .ico { margin-right: 2px; }
.gm-buses { margin-top: 4px !important; }
.gm-bus small { opacity: .7; font-weight: 500; }
.gm-bus[aria-pressed="true"] { background: var(--c); color: #fff; }
.gm-bus[aria-pressed="true"] .sw { background: #fff; }
.gm-route { padding: 8px 4px 2px; }
.gm-route p { font-size: 13.5px; line-height: 1.4; font-weight: 550; }
.gm-route small { display: block; margin-top: 4px; font-size: 12.5px; color: var(--ink2); line-height: 1.35; }

/* Panning shrinks the card to one line; a tap brings it back. */
.map-card.mini { padding: 12px 16px 10px; cursor: pointer; overflow: hidden; }
.map-card.mini .rc-fields, .map-card.mini .chips, .map-card.mini .gm-gap, .map-card.mini .gm-route, .map-card.mini .rc-res > span:not(.rc-sum),
.map-card.mini .pc-film, .map-card.mini .pc .btn-row, .map-card.mini .pc-head p, .map-card.mini .gm-screens, .map-card.mini .gm-trip,
.map-card.mini .gm-nearby, .map-card.mini .gm-near, .map-card.mini .gm-hours, .map-card.mini .pc-queue, .map-card.mini .page-share, .map-card.mini .pc > .muted { display: none; }
.map-card.mini .rc-sum { display: block; }
.map-card.mini .rc-res { padding: 4px 2px 0; flex-wrap: nowrap; }
.map-card.mini::before { content: ''; position: absolute; top: 5px; left: 50%; width: 32px; height: 4px; margin-left: -16px; border-radius: 2px; background: var(--line2); }

/* The place card. */
.pc-head { display: flex; gap: 12px; align-items: flex-start; padding: 4px 2px 6px; }
.pc-head > div { flex: 1; min-width: 0; }
.pc-head h3 { font: 650 20px/1.15 var(--display); }
.pc-head p { color: var(--ink2); font-size: 13.5px; margin-top: 2px; line-height: 1.3; }
.pc-x { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--fill); flex: none; }
.pc-ic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--fill2); color: var(--ink); flex: none; }
.pc-ic.gm-k-hub, .pc-ic.gm-k-other { background: var(--gc, #3b56b5); color: #fff; }
.pc-ic.gm-k-stand { background: #f2c230; color: #2a2208; }
.pc-ic.gm-k-bus { background: #2f62d0; color: #fff; }
.pc-ic.gm-k-info { background: #2f4fb8; color: #fff; }
.pc-ic.gm-k-me { background: #2f7be0; color: #fff; }
.gm-approx { display: inline-block; font-size: 12px; font-weight: 600; color: var(--ink3); }
.gm-screens { display: flex; flex-wrap: wrap; gap: 4px; margin: 2px 0 0; }
.gm-screens span { padding: 2px 8px; border-radius: 9px; background: var(--fill); font-size: 12px; font-weight: 600; color: var(--ink2); }
.gm-screens span.on { background: var(--ink); color: var(--bg); }
.pc-film { display: flex; gap: 10px; align-items: center; width: 100%; padding: 7px 12px; background: var(--fill); border-radius: 14px; margin-top: 6px; text-align: left; }
.pc-film small { display: block; font-size: 12.5px; color: var(--ink2); }
.pc-film b { display: block; font-weight: 600; }
.pc-film.live small { color: var(--live); font-weight: 600; }
.pc-queue { margin-top: 10px; }
.pc-queue .qchip { width: 100%; }
.gm-hours { margin-top: 6px; padding: 0 2px; }
.gm-trip { display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 10px; padding: 9px 12px; border-radius: 16px; background: color-mix(in srgb, var(--accent) 10%, transparent); text-align: left; }
.gm-trip span { flex: 1; min-width: 0; }
.gm-trip small { display: block; font-size: 12.5px; color: var(--ink2); }
.gm-trip b { display: block; font-weight: 650; color: var(--accent); }
.gm-trip > .ico, .gm-near > .ico:last-child { color: var(--ink3); flex: none; }
.gm-nearby { margin-top: 8px; border-radius: 16px; background: var(--fill); overflow: hidden; }
.gm-nearby .gm-near + .gm-near { box-shadow: inset 0 .5px 0 var(--line); }
.gm-near { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 12px; text-align: left; font-size: 13.5px; color: var(--ink2); line-height: 1.35; }
.pc > .gm-near { margin-top: 8px; border-radius: 16px; background: var(--fill); color: var(--ink); font-weight: 600; }
.gm-near span { flex: 1; min-width: 0; }
.gm-near b { color: var(--ink); font-weight: 650; margin-right: 2px; }
.pc .btn-row { margin-top: 10px; }
.pc .btn-row .btn { height: 42px; font-size: 15px; }
.pc .page-share { margin: 10px 0 0; }

/* Pins: a dot per building, its name beside it. No backdrop blur: they move with every frame of a pan. */
.gm { display: block; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.gm-off { display: none !important; }
.gm-dot { position: relative; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--gc, #3b56b5); color: #fff; border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .3); transition: transform .25s var(--spring), box-shadow .2s; }
.gm-dot .ico.xs { width: 14px; height: 14px; vertical-align: 0; }
.gm-i-film { --gc: #3b56b5; } .gm-i-sun { --gc: #13979c; } .gm-i-star { --gc: #c98f0c; } .gm-i-mic { --gc: #8e4fc0; } .gm-i-bag { --gc: #b8327c; } .gm-i-parking { --gc: #2f62d0; }
.gm-label { position: absolute; top: 50%; left: calc(100% + 4px); transform: translateY(-50%); white-space: nowrap; padding: 3px 8px; border-radius: 10px;
  background: color-mix(in srgb, var(--card) 92%, transparent); color: var(--ink); font: 650 12.5px/1.2 var(--display); letter-spacing: .01em; box-shadow: 0 1px 4px rgba(0, 0, 0, .18); }
.side-l .gm-label { left: auto; right: calc(100% + 4px); }
.side-t .gm-label { left: 50%; top: auto; bottom: calc(100% + 3px); transform: translateX(-50%); }
#map.z-goa .gm-hub .gm-label { display: none; }
#map.z-goa .gm-dot { width: 20px; height: 20px; border-width: 1.5px; }
#map.z-goa .gm-dot .ico.xs { width: 11px; height: 11px; }
.gm.sel .gm-dot { transform: scale(1.25); box-shadow: 0 0 0 3px var(--accent), 0 2px 8px rgba(0, 0, 0, .3); }
.gm.trip .gm-dot { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 55%, transparent), 0 2px 8px rgba(0, 0, 0, .3); }
.gm.sel, .gm.trip { z-index: 2; }
.gm-live { position: absolute; top: -4px; right: -4px; width: 11px; height: 11px; border-radius: 50%; background: var(--live); border: 2px solid #fff; display: none; animation: pulse 1.8s ease-out infinite; }
.gm.live .gm-live { display: block; }
.gm-stand .gm-dot { width: 20px; height: 20px; background: #f2c230; color: #2a2208; border-width: 1.5px; }
.gm-stand .gm-dot .ico.xs { width: 12px; height: 12px; }
.gm-parking .gm-dot { width: 18px; height: 18px; border-radius: 5px; background: #2f62d0; border-width: 1.5px; font: 800 11px/1 var(--sans); }

/* Town and water names. */
.gm-town { font: 700 12px/1 var(--display); letter-spacing: .14em; text-transform: uppercase; color: color-mix(in srgb, var(--ink) 62%, transparent); white-space: nowrap; pointer-events: none;
  text-shadow: 0 0 3px var(--bg), 0 0 3px var(--bg), 0 0 6px var(--bg); }
.gm-town.venue span { display: block; transform: translateY(-22px); }
.gm-town.venue.side-r span { transform: translateX(calc(50% + 14px)); }
.gm-town.minor { font-size: 10.5px; letter-spacing: .1em; color: color-mix(in srgb, var(--ink) 50%, transparent); }
.gm-town.water { font-style: italic; font-weight: 600; text-transform: none; letter-spacing: .06em; font-size: 12.5px; color: #4f87a3; text-shadow: none; }
:root.dark .gm-town.water { color: #5d8ea6; }

/* Arrows for the venues off screen, in a row above the card. */
.map-edges { position: absolute; left: 12px; right: 12px; bottom: 300px; display: flex; justify-content: center; gap: 6px; pointer-events: none; z-index: 2; }
.map-edges[hidden], .map-edge[hidden] { display: none; }
.map-edges.tight small { display: none; }
.map-edges.tight .map-edge { padding-right: 8px; }
.map-edge { display: inline-flex; flex: none; align-items: center; gap: 5px; height: 28px; padding: 0 10px 0 5px; border-radius: 14px; pointer-events: auto; font: 600 12.5px var(--sans); color: var(--ink); white-space: nowrap; }
.map-edge { background: color-mix(in srgb, var(--card) 94%, transparent); box-shadow: 0 1px 6px rgba(0, 0, 0, .2); }
.map-edge i { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--ink); color: var(--bg); }
.map-edge i .ico.xs { width: 13px; height: 13px; stroke-width: 2.6; vertical-align: 0; }
.map-edge small { color: var(--ink2); font-weight: 500; margin-left: 2px; }

.me { width: 18px; height: 18px; border-radius: 50%; background: #2f7be0; border: 3px solid #fff; box-shadow: 0 0 0 0 rgba(47, 123, 224, .5); animation: gm-me 2s ease-out infinite; }
@keyframes gm-me { 0% { box-shadow: 0 0 0 0 rgba(47, 123, 224, .5); } 100% { box-shadow: 0 0 0 18px rgba(47, 123, 224, 0); } }
.goa .maplibregl-ctrl-top-left { top: calc(var(--safe-t) + 58px) !important; }
.goa .maplibregl-ctrl-attrib { font-size: 10px; background: var(--glass) !important; color: var(--ink2); }
.goa .maplibregl-ctrl-attrib a { color: var(--ink2) !important; }
:root.dark .goa .maplibregl-ctrl-attrib-button { filter: invert(1); }
