/* Campus map page (/campus.html) */
:root {
  --paper: #F4F1EA;
  --card: #FFFFFF;
  --ink: #14202E;
  --ink2: #4A5565;
  --mute: #8A919B;
  --rule: #E2DDD2;
  --park: #2D5BD0;
  --jub: #C2861A;
  --city: #C8442F;
  --tram: #2F7D5B;
  --land: #EFEBE2;
  --green: #D9E4C8;
  --water: #BCD3E0;
  --num: "Bricolage Grotesque", "Noto Sans SC", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.6 "Noto Sans SC", system-ui, -apple-system, "PingFang SC", sans-serif;
}
.num { font-family: var(--num); }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }

.cp { max-width: 1240px; margin: 0 auto; padding: 0 32px; }

/* ---- top ---- */
.cp-top {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
  padding: 44px 0 22px;
}
.cp-kicker { margin: 0 0 10px; font-size: 12px; letter-spacing: .18em; color: var(--city); font-weight: 700; }
.cp-head h1 { margin: 0; font-size: clamp(30px, 4.2vw, 52px); line-height: 1.12; font-weight: 900; letter-spacing: -.01em; }
.cp-tabs {
  display: inline-flex; padding: 4px; border-radius: 999px; background: #E8E3D8; gap: 2px; flex-shrink: 0;
}
.cp-tabs button {
  display: inline-flex; align-items: center; gap: 8px;
  border: 0; background: transparent; padding: 9px 16px; border-radius: 999px;
  font-size: 14px; font-weight: 500; color: var(--ink2); white-space: nowrap;
  transition: background .2s, color .2s;
}
.cp-tabs button[aria-selected="true"] { background: var(--ink); color: #fff; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot-park { background: var(--park); }
.dot-jub { background: var(--jub); }

/* ---- stage ---- */
.cp-stage {
  display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start;
}
.cp-map {
  margin: 0; background: var(--land); border-radius: 18px; overflow: hidden;
  border: 1px solid var(--rule); position: relative;
}
#cpMap { display: block; width: 100%; height: auto; }
.cp-legend {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px;
  padding: 12px 18px; border-top: 1px solid var(--rule); background: #F8F6F0; font-size: 13px; color: var(--ink2);
}
.cp-legend span { display: inline-flex; align-items: center; gap: 8px; }
.cp-legend b { font-weight: 500; }
.cp-legend em { margin-left: auto; font-style: normal; color: var(--mute); font-size: 12px; }
.lg { display: inline-block; width: 22px; height: 0; border-top: 4px solid; border-radius: 2px; }
.lg-tram { border-color: var(--tram); }
.lg-bus { border-color: var(--ink); }
.lg-hop { border-top-style: dashed; border-color: var(--jub); border-top-width: 3px; }

/* map layers (dark transit-map style) */
.cp-map { background: #17212D; border-color: #17212D; }
.cp-legend { background: #1E2A38; border-top-color: #2A3747; color: #C6CDD6; }
.cp-legend em { color: #8792A0; }
.lg-bus { border-color: #E9EDF2; }
.mp-land { fill: #17212D; }
.mp-dotgrid { fill: #223040; }
.mp-green { fill: #1D3326; }
.mp-river { fill: none; stroke: #20405A; stroke-width: 24; stroke-linecap: round; }
.mp-canal { fill: none; stroke: #20405A; stroke-width: 4; stroke-linecap: round; }
.mp-road { fill: none; stroke: #2C3A4B; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.mp-tram { fill: none; stroke: #3FB27F; stroke-width: 5; stroke-linecap: round; opacity: .5; }
.mp-stop { fill: #17212D; stroke: #3FB27F; stroke-width: 3; }
.mp-lake { fill: #20405A; }
.mp-lbl { font: 500 16px "Noto Sans SC", sans-serif; fill: #7D8896; }
.mp-lbl-soft { fill: #5E7A63; }
.mp-lbl-water { fill: #4F7894; font-style: italic; }
.mp-lbl-area { fill: #5B6878; font: 700 14px var(--num); letter-spacing: .2em; }

.mp-zone-area { fill: #F4F1EA; fill-opacity: .04; stroke: #F4F1EA; stroke-opacity: .14; stroke-width: 2; stroke-dasharray: 6 6; transition: fill-opacity .35s, stroke-opacity .35s; }
.mp-zone.on .mp-zone-area { fill-opacity: .14; stroke-opacity: .7; }
svg[data-sel="park"] .mp-zone.on .mp-zone-area { fill: #7FA0FF; stroke: #9DB6FF; }
svg[data-sel="jubilee"] .mp-zone.on .mp-zone-area { fill: #F2B94E; stroke: #F2C46A; }
.mp-zone-name { fill: #8C97A6; }
.mp-badge { opacity: 0; transform-box: fill-box; transition: opacity .3s .3s; pointer-events: none; }
.mp-badge.on { opacity: 1; }
.mp-badge circle { fill: #fff; }
.mp-badge-n { font: 700 17px var(--num); fill: var(--ink); }
svg[data-sel="park"] .mp-badge circle { fill: #3D6BE0; }
svg[data-sel="jubilee"] .mp-badge circle { fill: #E0A23A; }
.mp-badge .mp-badge-n { fill: #fff; }

.mp-campus { cursor: pointer; }
.mp-campus .mp-area { transition: fill-opacity .3s; }
.mp-park .mp-area { fill: #3D6BE0; fill-opacity: .85; }
.mp-jub .mp-area { fill: #E0A23A; fill-opacity: .9; }
svg[data-sel="park"] .mp-jub .mp-area,
svg[data-sel="jubilee"] .mp-park .mp-area { fill-opacity: .35; }

.mp-route-line { fill: none; stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1s cubic-bezier(.6,0,.2,1); }
.rt-tram .mp-route-line { stroke: #45C58C; }
.rt-bus .mp-route-line { stroke: #F4F1EA; }
.rt-hop .mp-route-line { stroke: #E0A23A; stroke-width: 4; }
.mp-route.on .mp-route-line { stroke-dashoffset: 0; }
.rt-hop.on .mp-route-line { stroke-dasharray: .025 .02; animation: hop 6s linear infinite; }
@keyframes hop { to { stroke-dashoffset: -.45; } }
.mp-pill { pointer-events: none; }
.mp-pill text { font: 700 17px "Noto Sans SC", sans-serif; }
.mp-pill-route { opacity: 0; transition: opacity .3s .7s; }
.mp-route.on .mp-pill-route { opacity: 1; }
.rt-tram .mp-pill rect { fill: #45C58C; } .rt-tram .mp-pill text { fill: #0E2A1E; }
.rt-bus .mp-pill rect { fill: #F4F1EA; } .rt-bus .mp-pill text { fill: var(--ink); }
.rt-hop .mp-pill rect { fill: #17212D; stroke: #E0A23A; stroke-width: 2; } .rt-hop .mp-pill text { fill: #F2C46A; font-size: 15px; }
.mp-pill-warn rect { fill: #2A3747; } .mp-pill-warn text { fill: #F2C46A; font-size: 15px; font-weight: 500; }
.mp-jub-note { opacity: 0; transition: opacity .3s .5s; }
svg[data-sel="jubilee"] .mp-jub-note { opacity: 1; }

.pin[data-campus] { cursor: pointer; }
.pin-dot { stroke: #17212D; stroke-width: 4; }
.pin-city .pin-dot { fill: #fff; stroke: var(--city); stroke-width: 5; }
.pin-park .pin-dot { fill: #fff; }
.pin-jub .pin-dot { fill: #fff; }
.pin-name { font: 900 23px "Noto Sans SC", sans-serif; fill: #fff; paint-order: stroke; stroke: #17212D; stroke-width: 6px; stroke-linejoin: round; }
.pin-sub { font: 500 15px "Noto Sans SC", sans-serif; fill: #A9B3BF; paint-order: stroke; stroke: #17212D; stroke-width: 5px; }
.pin-small rect { fill: #17212D; stroke: #E9EDF2; stroke-width: 3; }
.pin-small text { font: 500 15px "Noto Sans SC", sans-serif; fill: #C6CDD6; paint-order: stroke; stroke: #17212D; stroke-width: 5px; }
.mp-off text { font: 500 14px "Noto Sans SC", sans-serif; fill: #8792A0; }
.mp-off-arrow { stroke: #8792A0; stroke-width: 2; fill: none; stroke-linecap: round; }

/* where-to-live list in the panel */
.pn-recs { list-style: none; margin: 0 0 14px; padding: 0; }
.pn-recs li { display: grid; grid-template-columns: 26px 1fr; column-gap: 12px; padding: 11px 0; border-top: 1px solid var(--rule); }
.pn-recs li:last-child { border-bottom: 1px solid var(--rule); }
.pn-n { grid-row: span 2; width: 26px; height: 26px; border-radius: 50%; color: #fff; font-size: 14px; font-weight: 700; display: grid; place-items: center; margin-top: 1px; }
.pn-n-park { background: var(--park); }
.pn-n-jub { background: var(--jub); }
.pn-recs b { font-size: 16px; }
.pn-recs small { font-size: 13.5px; color: var(--ink2); }

/* ---- panel ---- */
.cp-panel {
  background: var(--card); border-radius: 18px; border: 1px solid var(--rule);
  padding: 22px; position: sticky; top: 84px; min-height: 420px;
  animation: pnIn .35s ease;
}
@keyframes pnIn { from { opacity: .3; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.cp-panel h2 { margin: 0 0 16px; font-size: 24px; line-height: 1.25; font-weight: 900; }
.pn-kick { margin: 0 0 6px; font-size: 12px; letter-spacing: .16em; color: var(--mute); font-weight: 700; }
.pn-row {
  display: grid; grid-template-columns: 12px 1fr; column-gap: 12px; row-gap: 2px; align-items: center;
  width: 100%; text-align: left; border: 0; border-top: 1px solid var(--rule); background: none; padding: 16px 0;
}
.pn-row:last-of-type { border-bottom: 1px solid var(--rule); }
.pn-row b { font-size: 18px; }
.pn-row span, .pn-row em { grid-column: 2; font-size: 14px; color: var(--ink2); font-style: normal; }
.pn-row em { color: var(--ink); font-weight: 600; }
.pn-row:hover b { text-decoration: underline; text-underline-offset: 4px; }
.pn-note { display: flex; align-items: center; gap: 10px; margin: 18px 0 0; font-size: 14px; color: var(--ink2); }
.pn-photo { position: relative; margin: -22px -22px 18px; border-radius: 18px 18px 0 0; overflow: hidden; aspect-ratio: 16 / 8; background: #ddd; }
.pn-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pn-photo span {
  position: absolute; left: 14px; bottom: 12px; padding: 5px 11px; border-radius: 999px;
  font-size: 12.5px; font-weight: 700; color: #fff;
}
.pn-park span { background: var(--park); }
.pn-jub span { background: var(--jub); }
.pn-times { margin: 0 0 14px; }
.pn-times div { display: grid; grid-template-columns: 104px 1fr; gap: 10px; padding: 10px 0; border-top: 1px solid var(--rule); }
.pn-times div:last-child { border-bottom: 1px solid var(--rule); }
.pn-times dt { color: var(--mute); font-size: 13px; }
.pn-times dd { margin: 0; font-weight: 600; font-size: 14.5px; }
.pn-live { margin: 0 0 18px; color: var(--ink2); font-size: 14px; }
.pn-acts { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pn-pdf {
  display: inline-flex; gap: 8px; align-items: center; text-decoration: none;
  padding: 10px 16px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 14px; font-weight: 600;
}
.pn-back { border: 0; background: none; color: var(--ink2); font-size: 14px; padding: 6px 0; }

/* ---- three questions ---- */
.cp-q { padding: 64px 0 20px; }
.cp-q h2 { margin: 0 0 18px; font-size: 26px; font-weight: 900; }
.cp-q ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 2px solid var(--ink); }
.cp-q li { padding: 18px 22px 8px 0; display: grid; grid-template-columns: 44px 1fr; column-gap: 6px; }
.cp-q li + li { padding-left: 22px; border-left: 1px solid var(--rule); }
.cp-q li .num { grid-row: span 2; font-size: 22px; font-weight: 700; color: var(--city); line-height: 1.2; }
.cp-q li b { font-size: 16.5px; }
.cp-q li p { margin: 4px 0 0; color: var(--ink2); font-size: 14px; }

.cp-talk {
  margin: 40px 0 56px; padding: 22px 26px; border-radius: 18px; background: var(--ink); color: #fff;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.cp-talk p { margin: 0; font-size: 18px; }
.cp-copy {
  display: inline-flex; align-items: center; gap: 12px; border: 0; border-radius: 999px;
  background: #fff; color: var(--ink); padding: 10px 10px 10px 18px; font-size: 14px;
}
.cp-copy b { background: var(--paper); border-radius: 999px; padding: 4px 12px; font-size: 15px; }

.cp-foot {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px;
  max-width: 1240px; margin: 0 auto; padding: 22px 32px 34px; border-top: 1px solid var(--rule);
  font-size: 13px; color: var(--ink2);
}
.cp-foot a { text-decoration: none; }
.cp-foot-brand { font: 700 18px var(--num); letter-spacing: .08em; color: #3A6FD8; margin-right: auto; }
.cp-foot-brand small { font-size: 10px; letter-spacing: .18em; margin-left: 6px; }

/* ---- mobile ---- */
@media (max-width: 900px) {
  .cp { padding: 0 16px; }
  .cp-top { flex-direction: column; align-items: stretch; padding: 26px 0 16px; gap: 16px; }
  .cp-tabs { width: 100%; }
  .cp-tabs button { flex: 1; justify-content: center; padding: 9px 6px; font-size: 13px; gap: 6px; }
  .cp-stage { grid-template-columns: 1fr; gap: 14px; }
  .cp-map { border-radius: 14px; }
  .cp-legend { gap: 6px 14px; padding: 10px 14px; font-size: 12px; }
  .cp-legend em { margin-left: 0; width: 100%; }
  .cp-panel { position: static; min-height: 0; padding: 18px; border-radius: 14px; }
  .pn-photo { margin: -18px -18px 16px; border-radius: 14px 14px 0 0; }
  .mp-lbl, .mp-lbl-area { font-size: 20px; }
  .pin-name { font-size: 32px; }
  .pin-sub, .pin-small text { font-size: 21px; }
  .mp-off text { font-size: 19px; }
  .mp-pill text { font-size: 23px; }
  .rt-hop .mp-pill text, .mp-pill-warn text { font-size: 20px; }
  .mp-badge circle { r: 19px; }
  .mp-badge-n { font-size: 22px; }
  .cp-q { padding: 40px 0 8px; }
  .cp-q h2 { font-size: 21px; }
  .cp-q ol { grid-template-columns: 1fr; }
  .cp-q li, .cp-q li + li { padding: 14px 0; border-left: 0; }
  .cp-q li + li { border-top: 1px solid var(--rule); }
  .cp-talk { margin: 28px 0 40px; padding: 18px; }
  .cp-talk p { font-size: 16px; }
  .cp-foot { padding: 18px 16px 28px; }
}
@media (prefers-reduced-motion: reduce) {
  .mp-route-line, .mp-pill, .cp-panel { transition: none; animation: none; }
  .pin-ring { animation: none; }
}

/* real street map overlay (Leaflet); the SVG stays underneath as fallback */
.cp-map { position: relative; }
.cp-real { position: absolute; left: 0; right: 0; top: 0; aspect-ratio: 1000 / 712; z-index: 1; background: #EEF0EC; opacity: 0; transition: opacity .4s; }
.cp-map.real-on .cp-real { opacity: 1; }
.cp-map.real-on { background: #fff; border-color: var(--rule); }
.cp-map.real-on .cp-legend { background: #F8F6F0; border-top-color: var(--rule); color: var(--ink2); }
.cp-map.real-on .lg-bus { border-color: var(--ink); }
.cp-real .leaflet-tile-pane { filter: saturate(.45) contrast(.92) brightness(1.04); }
.cp-real .leaflet-control-attribution { font-size: 10px; background: rgba(255,255,255,.75); }
.cp-real .leaflet-control-zoom a { color: var(--ink); }
.rm { background: none; border: 0; }
.rm span { position: absolute; white-space: nowrap; font-family: "Noto Sans SC", system-ui, sans-serif; }
.rm-campus { left: 0; top: 0; transform: translate(-50%, -14px); display: flex; flex-direction: column; align-items: center; cursor: pointer; transition: opacity .3s; }
.rm-campus.is-dim { opacity: .45; }
.rm-campus i { width: 28px; height: 28px; border-radius: 50%; border: 4px solid #fff; box-shadow: 0 2px 8px rgba(20,32,46,.3); }
.rm-park i { background: var(--park); } .rm-jubilee i { background: var(--jub); }
.rm-campus b { margin-top: 4px; padding: 3px 10px; border-radius: 8px; background: var(--ink); color: #fff; font-size: 14px; font-weight: 700; }
.rm-park b { background: var(--park); } .rm-jubilee b { background: var(--jub); }
.rm-campus small { margin-top: 2px; font-size: 12px; color: var(--ink); font-weight: 600; text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff; }
.rm-city { left: 0; top: 0; transform: translate(-11px, -11px); display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 900; color: var(--ink); text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff; }
.rm-city i { width: 22px; height: 22px; border-radius: 50%; background: var(--city); border: 4px solid #fff; box-shadow: 0 2px 6px rgba(20,32,46,.3); }
.rm-station { left: 0; top: 0; transform: translate(-8px, -8px); display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink2); text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff; }
.rm-station i { width: 16px; height: 16px; border-radius: 4px; background: #fff; border: 3px solid var(--ink); }
.rm-zone { left: 0; top: 0; display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px; border-radius: 999px; background: #fff; color: var(--ink); font-size: 13px; font-weight: 700; box-shadow: 0 1px 4px rgba(20,32,46,.2); }
.rm-zone b { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--c); color: #fff; font: 700 13px var(--num); }
.rm-time { left: 0; top: 0; transform: translate(-50%, -50%); padding: 4px 11px; border-radius: 999px; font-size: 13px; font-weight: 700; color: #fff; box-shadow: 0 1px 4px rgba(20,32,46,.25); }
.rm-tram { background: #1F8A5B; } .rm-bus { background: var(--ink); } .rm-hop { background: #fff; color: #8A5D0E; border: 2px solid var(--jub); }
.rm-note { left: 0; top: 0; transform: translate(-50%, -50%); padding: 4px 11px; border-radius: 999px; background: #FFF4DC; color: #8A5D0E; border: 1px solid #EAC97E; font-size: 12.5px; font-weight: 600; }
.cp-map.real-on #cpMap { display: none; }
.cp-map.real-on .cp-real { position: relative; }
@media (max-width: 900px) {
  .cp-real { aspect-ratio: 1 / 1.12; }
  .rm-campus i { width: 22px; height: 22px; border-width: 3px; }
  .rm-campus b { font-size: 12px; padding: 2px 8px; }
  .rm-campus small { font-size: 11px; }
  .rm-city { font-size: 13px; }
  .rm-station { font-size: 12px; }
  .rm-zone { font-size: 12px; }
  .rm-zone b { width: 19px; height: 19px; font-size: 12px; }
  .rm-time { font-size: 12px; padding: 3px 9px; }
}
