/* 探索地圖 (explore.html), in the 晴天 system. Loaded after site.css; tokens and components come from there.
   The map is flat paper land like the landing picker: land #FFE6AE, a #E9C77F edge a few pixels below, white borders.
   Land is never blue or green and never shaded by number of events. Amber means "yours" (and the chosen district, with a cobalt pin). */

/* ---------- page frame: header, then the map and the panel fill the screen ---------- */
body.ex{display:flex;flex-direction:column;height:100vh;height:100svh;overflow:hidden}
.ex .top{flex:none}
.ex .top-in{max-width:none}
/* laptop: the map and the news share the screen half and half */
.ex-main{position:relative;flex:1;min-height:0;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
.ex .ic{width:20px;height:20px;flex:none}
.ex [hidden]{display:none!important}

/* ---------- the map ---------- */
.ex-map{position:relative;min-width:0;min-height:0;overflow:hidden;background:#fff}
.ex-svg{position:absolute;inset:0;width:100%;height:100%;max-width:none;touch-action:none;cursor:grab;user-select:none;-webkit-user-select:none;-webkit-tap-highlight-color:transparent}
.ex-svg.grabbing{cursor:grabbing}
.ex-svg path{vector-effect:non-scaling-stroke;fill-rule:evenodd}
.m-edge path{fill:#E9C77F;pointer-events:none}
.ex-svg.open #edgeAll path{fill:#F6E7C6}
.m-land path{fill:#FFE6AE;pointer-events:none}
.m-land path.dim{fill:#FFF8EA}
.m-open{fill:#FFE6AE;pointer-events:none}
.m-towns path{fill:none;stroke:none;pointer-events:fill;cursor:pointer}
.m-towns path.own,.m-towns path.sel{fill:var(--amber)}
.m-tmesh{fill:none;stroke:rgba(255,255,255,.8);stroke-width:.6;pointer-events:none}
.ex-svg.open .m-tmesh{stroke:rgba(255,255,255,.9)}
.m-omesh{fill:none;stroke:#fff;stroke-width:1.4;stroke-linejoin:round;pointer-events:none}
.m-cmesh{fill:none;stroke:#fff;stroke-width:1.8;stroke-linejoin:round;pointer-events:none}
.m-selline{fill:none;stroke:var(--amber-deep);stroke-width:2;stroke-linejoin:round;pointer-events:none}
.m-hov{fill:none;stroke:var(--cobalt);stroke-width:2.2;stroke-linejoin:round;pointer-events:none}

/* names and counts over the map: the count is a plain white numeral in a cobalt circle, one size, never coloured by number */
.ex-labels,.ex-lbs{position:absolute;inset:0;pointer-events:none;overflow:hidden}
.lb{position:absolute;left:0;top:0;display:flex;align-items:center;gap:5px;white-space:nowrap;font-size:14px;font-weight:700;line-height:1.3;color:var(--ink);visibility:hidden;
  text-shadow:0 0 3px #fff,0 0 3px #fff,0 0 2px #fff,0 0 1px #fff}
.lb.on{visibility:visible}
.lb i{font-style:normal}
.lb b,.ex-n{display:inline-block;min-width:26px;height:26px;padding:0 7px;border-radius:13px;background:var(--cobalt);box-shadow:0 0 0 2px #fff;font-family:var(--round);font-weight:900;font-size:14px;line-height:26px;text-align:center;color:#fff;font-variant-numeric:tabular-nums;text-shadow:none;font-style:normal}
/* a label moved off its place: a thin cobalt line from a dot on the place to the label, under every label */
.ex-leads .ld{position:absolute;left:0;top:0;height:2px;margin-top:-1px;background:var(--cobalt);transform-origin:0 50%;text-decoration:none}
.ex-leads .ld::before{content:"";position:absolute;left:-4px;top:-3px;width:8px;height:8px;border-radius:50%;background:var(--cobalt);box-shadow:0 0 0 2px #fff}
.lb.dim{color:var(--ink-soft);font-weight:600}
.lb.own i{padding:1px 8px;border-radius:5px;background:var(--amber);color:var(--ink);text-shadow:none}
.lb.s:not(.own) i{padding:1px 10px;border-radius:6px;background:#fff;text-shadow:none;box-shadow:inset 0 0 0 2px var(--cobalt)}
.lb.s{z-index:2}
.ex-pin{position:absolute;left:0;top:0;width:0;height:0;z-index:3}
.ex-pin svg{position:absolute;left:-20px;top:-54px;max-width:none}
/* the pin drops in with a small bounce once the camera has arrived */
.ex-pin.drop svg{animation:pinDrop .5s var(--out) var(--d,0ms) both}
@keyframes pinDrop{from{transform:translateY(-46px);opacity:0}40%{opacity:1}to{transform:none;opacity:1}}

.ex-tip{position:absolute;left:0;top:0;z-index:6;padding:6px 12px;border-radius:6px;background:var(--ink);color:#fff;font-size:14px;font-weight:700;white-space:nowrap;pointer-events:none}

/* over the map: back out, the outlying islands, zoom, the key */
.ex-top{position:absolute;left:20px;right:20px;top:18px;z-index:5;pointer-events:none}
.ex-top>*{pointer-events:auto}
.ex-nav{display:flex;flex-wrap:wrap;gap:10px;align-items:center;pointer-events:none}
.ex-nav>*{pointer-events:auto}
.ex-nav .btn .ic{width:18px;height:18px}
.ex-nav .chip .ex-n{margin-right:-6px}
/* the 全市 / 全國 pill: a white tag with the cobalt number inside; over the map it is a button that brings that group into view */
.ex-pill{display:inline-flex;align-items:center;gap:7px;min-height:32px;padding:3px 12px 3px 3px;border-radius:var(--r-s);background:#fff;box-shadow:inset 0 0 0 1.5px var(--sky-deep);font-family:var(--ui);font-size:15px;font-weight:700;line-height:1.2;color:var(--ink);white-space:nowrap}
.ex-pill .ex-n{box-shadow:none}
.ex-pill.sm{min-height:24px;padding:0 9px;font-size:14px}
.ex-pills{display:flex;gap:8px;margin-left:auto}
.ex-pillbtn{display:inline-flex;align-items:center;min-height:44px;padding:0;border:0;background:none;cursor:pointer}
.ex-pillbtn:hover .ex-pill{box-shadow:inset 0 0 0 1.5px var(--cobalt);color:var(--cobalt-deep)}
.ex-zoom{position:absolute;right:20px;bottom:24px;z-index:5;display:flex;flex-direction:column;gap:12px}
.ex-zoom button{display:flex;align-items:center;justify-content:center;width:48px;height:48px;border:0;border-radius:8px;background:#fff;color:var(--ink);box-shadow:inset 0 0 0 1px var(--line);cursor:pointer;transition:transform .12s var(--out)}
.ex-zoom button:hover{color:var(--cobalt-deep);background:var(--sky-faint)}
/* the key: one short line, and the long explanation behind 「數字代表什麼？」 */
.ex-key{position:absolute;left:20px;bottom:24px;z-index:5;display:flex;flex-wrap:wrap;align-items:center;gap:6px 16px;max-width:calc(100% - 110px);padding:6px 14px;border-radius:var(--r-m);background:#fff;box-shadow:inset 0 0 0 1px var(--line);font-size:14px;font-weight:700;color:var(--ink-soft)}
.ex-k{display:inline-flex;align-items:center;gap:7px}
.ex-k .ex-n{min-width:22px;height:22px;padding:0 6px;line-height:22px;font-size:13px;box-shadow:none}
.ex-what{position:relative}
.ex-what summary{display:inline-flex;align-items:center;min-height:36px;font-weight:700;color:var(--cobalt-deep);text-decoration:underline;text-underline-offset:4px;cursor:pointer;list-style:none}
.ex-what summary::-webkit-details-marker{display:none}
.ex-key .ex-what p{position:absolute;left:-14px;bottom:calc(100% + 12px);width:min(340px,70vw);margin:0;padding:12px 16px;border-radius:var(--r-m);background:#fff;box-shadow:inset 0 0 0 1px var(--line),0 10px 24px -10px rgba(15,35,65,.2);font-weight:400;line-height:1.65;color:var(--ink-soft)}
.ex-what-p{display:none}

/* ---------- the panel ---------- */
.ex-panel{position:relative;z-index:8;display:flex;flex-direction:column;min-height:0;background:#fff;border-left:1px solid var(--line)}
.ex-grab{display:none}
.ex-find{position:relative;padding:20px 24px 10px}
.ex-find input::-webkit-search-cancel-button{cursor:pointer}
.ex-res{position:absolute;left:24px;right:24px;top:calc(100% - 4px);z-index:20;list-style:none;margin:0;padding:0;border-radius:12px;background:#fff;overflow:hidden;border:1px solid var(--line-strong);box-shadow:0 14px 30px -10px rgba(15,35,65,.2)}
.ex-res li+li{border-top:1px solid var(--line)}
.ex-res button{display:flex;align-items:center;gap:10px;width:100%;min-height:52px;padding:8px 20px;border:0;background:none;font-size:17px;font-weight:700;color:var(--ink);text-align:left;cursor:pointer}
.ex-res button .ic{width:18px;height:18px;color:var(--ink-soft)}
.ex-res button small{margin-left:auto;font-size:14px;font-weight:400;color:var(--ink-soft)}
.ex-res button:hover,.ex-res button:focus-visible{background:var(--sky-faint);color:var(--cobalt-deep)}
.ex-res button:focus-visible{outline-offset:-4px}
.ex-msg{margin:0;font-size:14px;color:var(--ink-soft)}
.ex-msg:empty{display:none}
.ex-res:not([hidden])+.ex-msg{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
.ex-msg{padding:8px 4px 0}

.ex-scroll{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;padding:0 24px 36px}
.ex-crumbs{display:flex;flex-wrap:wrap;align-items:center;gap:0 6px;min-height:44px;font-size:15px;color:var(--ink-soft)}
.ex-crumbs .link{min-height:44px;font-size:15px}
.ex-crumbs .sep{color:var(--ink-soft)}
.ex-crumbs [aria-current]{font-weight:700;color:var(--ink)}
.ex-head{display:flex;flex-wrap:wrap;align-items:center;gap:4px 16px;margin-top:8px}
.ex-crumbs{flex-basis:100%}
.ex-name{display:flex;align-items:center;gap:10px;font-size:clamp(28px,2.4vw,34px);line-height:1.25}
.ex-name .ex-n{min-width:30px;height:30px;line-height:30px;font-size:16px;border-radius:15px}
.ex-dot{display:inline-block;flex:none;width:12px;height:12px;border-radius:50%;background:var(--amber)}
.ex-dot.sky{background:var(--sky-deep)}
.ex-name:focus{outline:none}
.ex-mine{margin-left:auto}
.ex-mine .note{margin-top:10px}
.ex-mine .note a{color:var(--cobalt-deep);font-weight:700}
.ex-mine .tag{min-height:34px;padding:0 14px;font-size:15px}
.ex-mine .tag .ic{width:16px;height:16px}
.ex-mine .tag:focus{outline:none}

/* topics: picture chips in one row that scrolls sideways; time and sort stay folded in 更多篩選 */
.ex-filters{display:flex;flex-direction:column;gap:8px;margin-top:6px}
.ex-topics-row{display:flex;align-items:center;gap:12px;min-width:0}
.ex-topics{display:flex;gap:8px;flex:1;min-width:0;overflow-x:auto;scrollbar-width:none;padding:2px;margin:-2px;overscroll-behavior-x:contain}
.ex-topics::-webkit-scrollbar{display:none}
.ex-topics .chip{flex:none;padding:0 14px 0 6px;white-space:nowrap}
.ex-topics .chip:first-child{padding:0 16px}
.ex-topics .cat-ic{width:30px;height:30px;flex:none;border-radius:6px}
.ex-more{flex:none;font-size:15px}
.ex-morebox{display:flex;flex-direction:column;gap:10px;padding:4px 0 6px}
.ex-nojs{padding:16px 24px}
.ex-morebox .chips{gap:8px}
.ex-morebox .chip{padding:0 16px}

.ex-list{margin-top:14px}
.ex-h{display:flex;align-items:center;gap:9px;margin:26px 0 12px;font-size:20px;line-height:1.4}
.ex-h span{font-family:var(--ui);font-size:15px;font-weight:700;color:var(--ink-soft);font-variant-numeric:tabular-nums}
.ex-h:focus{outline:none}
.ex-list .rows{border-radius:var(--r-card)}
.ex-search{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px 16px;margin:4px 0 12px}
.ex-search .ex-h{margin:0}
.ex-none,.ex-err{margin:8px 0;font-size:16px;color:var(--ink-soft)}

/* quiet: evidence of what was checked, never a verdict */
.ex-empty{display:flex;align-items:center;gap:16px;padding:14px 0;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}
.ex-empty img{width:92px;height:auto;flex:none}
.ex-empty h3{font-size:19px}
.ex-empty p{margin:6px 0 0;font-size:15px;line-height:1.7;color:var(--ink-soft)}
.ex-empty .ex-ev-line{font-size:14px}

/* every district (or county) as a chip: the keyboard's way around the map, folded under one line */
.ex-places{margin-top:28px;border-top:1px solid var(--line)}
.ex-places summary{display:flex;align-items:center;gap:8px;min-height:52px;font-weight:700;color:var(--ink-soft);cursor:pointer;list-style:none}
.ex-places summary::-webkit-details-marker{display:none}
.ex-places summary::after{content:"";width:8px;height:8px;margin-left:2px;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:translateY(-2px) rotate(45deg);transition:transform .2s var(--out)}
.ex-places[open] summary::after{transform:translateY(2px) rotate(-135deg)}
.ex-places .chips{gap:8px;padding-bottom:8px}
.ex-places .chip{padding:0 15px}
.ex-legal{display:flex;flex-wrap:wrap;gap:4px 18px;padding:20px 0 28px;font-size:14px}
/* the phone strip is only for the phone sheet */
.ex-stripwrap{display:none}
.ex-demo{margin:28px 0 0}

/* the toast from core.js */
.toast.show{opacity:1;transform:translate(-50%,0)}
.ex .toast{width:max-content;max-width:calc(100vw - 32px);line-height:1.5}
.toast .ic{width:20px;height:20px;flex:none}

/* ---------- phone: map on top, the list in a bottom sheet that can be dragged up ---------- */
@media (max-width:899px){
  .ex-crumbs{display:none}
  .ex-head{flex-wrap:nowrap;justify-content:space-between;margin-top:0;min-height:48px}
  .ex-name{min-width:0}
  .ex-mine{text-align:right}
  .ex-mine .note{display:none}
  .ex-what-p{display:block;margin-top:20px;font-size:15px}
  .ex-what-p p{margin:4px 0 0;line-height:1.7;color:var(--ink-soft)}
  .ex-main{display:block}
  .ex-map{position:absolute;inset:0}
  .ex-top{left:16px;right:16px;top:12px}
  .ex-find{padding:0}
  .ex-res{left:0;right:0}
  .ex-msg{margin-top:8px;padding:8px 14px;border-radius:12px;background:#fff;box-shadow:inset 0 0 0 1px var(--line)}
  .ex-nav{margin-top:10px}
  .ex-pills{flex-direction:column;align-items:flex-end;gap:0}
  .ex-zoom,.ex-key{display:none}
  .lb{gap:4px;font-size:13px}
  .lb b{min-width:22px;height:22px;padding:0 6px;border-radius:11px;font-size:13px;line-height:22px}
  .ex-panel{position:absolute;left:0;right:0;bottom:0;height:calc(100% - 82px);border-radius:12px 12px 0 0;border-left:0;border-top:1px solid var(--line-strong);box-shadow:0 -6px 18px rgba(15,35,65,.08);
    transition:transform .3s var(--out);will-change:transform}
  .ex-panel.dragging{transition:none}
  .ex-panel:not(.full){touch-action:none}
  .ex-panel:not(.full) .ex-scroll{overflow:hidden}
  .ex-panel.full #grab,.ex-panel.full #head{touch-action:none}
  .ex-grab{display:flex;justify-content:center;flex:none;padding-top:4px}
  .ex-handle{display:flex;align-items:center;justify-content:center;width:88px;height:44px;border:0;background:none;cursor:grab}
  .ex-handle::before{content:"";width:44px;height:5px;border-radius:6px;background:var(--line)}
  .ex-handle:focus-visible{outline-offset:-2px}
  .ex-scroll{display:flex;flex-direction:column;padding:0 16px calc(32px + env(safe-area-inset-bottom))}
  .ex-scroll>*{flex:none}
  .ex-name{font-size:26px}
  .ex-name .ex-n{min-width:28px;height:28px;line-height:28px;font-size:15px}
  .ex-filters{margin-top:4px}
  /* low sheet (peek, half): the cards of this place in one row to swipe; full sheet: the groups, one under another */
  .ex-panel:not(.full):not(.ssr) .ex-stripwrap{display:block;margin-top:10px}
  .ex-panel:not(.full):not(.ssr) #list,.ex-panel:not(.full):not(.ssr) .ex-what-p,.ex-panel:not(.full) .ex-places,.ex-panel:not(.full) .ex-legal{display:none}
}
@media (max-width:560px){
  .ex-empty{align-items:flex-start}
  .ex-empty img{width:72px}
}

/* Server-rendered list (app/seo.py) for readers and crawlers without JavaScript; draw() replaces it once
   the feed has loaded, and keeps it if the feed fails. */
.ssr-list{list-style:none;margin:0;padding:0;border-top:1px solid var(--line)}
.ssr-list li{display:flex;flex-direction:column;gap:3px;padding:12px 0;border-bottom:1px solid var(--line)}
.ssr-list a{font-weight:700;color:var(--ink);line-height:1.5}
.ssr-list a:hover{color:var(--cobalt-deep)}
.ssr-list .ssr-meta{font-size:14px;color:var(--ink-soft);font-variant-numeric:tabular-nums}
