/* 交通指引：縣市地圖、院區清單與院區視窗。只在交通指引頁載入；色彩與尺寸待正式 Figma 再調整。 */
.directions { max-width: min(1200px, 90%); }
.county-picker { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 16px; }
.county-picker label { font-weight: 700; }
.county-picker select, .county-picker button { min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); background: #fff; color: var(--ink); font: inherit; }
.county-picker select { min-width: min(100%, 16em); max-width: 100%; }
.county-picker button { background: var(--navy); color: #fff; border-color: var(--navy); }
.js .county-picker button { display: none; }
.county-status { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin: 0 0 12px; color: var(--muted); }
.county-status .jump-link { display: inline-flex; align-items: center; min-height: 44px; }

.directions-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; }
.taiwan-map { margin: 0 !important; justify-self: center; width: min(100%, 560px); }
.county-map { display: block; width: 100%; height: auto; }
.county path { fill: #dfe6ec; stroke: #fff; stroke-width: 1.2px; vector-effect: non-scaling-stroke; transition: fill .15s; }
.county.has-campus path { fill: #a8d8d8; }
.county:hover path, .county:focus-visible path { fill: #59bdbd; }
.county.is-selected path { fill: #2b8f8f; stroke: var(--navy); stroke-width: 2.5px; }
.county:focus-visible { outline: none; }
.county:focus-visible path { stroke: var(--navy); stroke-width: 3px; }
.county-labels text { font-size: 20px; font-weight: 700; fill: var(--ink); text-anchor: middle; paint-order: stroke; stroke: #fff; stroke-width: 4px; stroke-linejoin: round; pointer-events: none; }
.county-labels .label-count { font-size: 18px; fill: var(--navy); }
.map-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .875rem; color: var(--muted); }
.map-legend span::before { content: ""; display: inline-block; width: 14px; height: 14px; margin-right: 6px; vertical-align: -2px; border: 1px solid var(--line); }
.legend-has::before { background: #a8d8d8; }
.legend-none::before { background: #dfe6ec; }
.legend-selected::before { background: #2b8f8f; }
.map-source { flex-basis: 100%; font-size: .75rem; }

.campus-panel:focus { outline: none; }
.county-group h2 { margin-top: 0 !important; }
.county-group + .county-group { margin-top: 24px; }
.county-count { margin-left: 8px; font: 400 1rem/1.4 'Noto Sans TC', 'Microsoft JhengHei', sans-serif; color: var(--muted); }
.county-empty { padding: 14px 16px; background: #fff; }
.campus-list { list-style: none; padding: 0 !important; margin: 0; display: grid; gap: 8px; }
.campus-list a { display: flex; align-items: center; min-height: 48px; padding: 8px 16px; background: #fff; color: var(--ink) !important; text-decoration: none !important; border-left: 4px solid var(--aqua); }
.campus-list a:hover, .campus-list a[aria-current=true] { background: var(--navy); color: #fff !important; }
.campus-detail { margin-top: 32px; padding: 20px; background: #fff; }
.campus-detail h2 { margin-top: 0 !important; }
.not-provided { color: var(--muted); }
.maps-hint { font-size: .875rem; }
/* Google 地圖只在桌機寬度顯示（M15 修訂）；手機隱藏，JS 也不會載入 */
.campus-map { display: none; }

.campus-dialog { width: min(560px, calc(100vw - 32px)); max-height: min(640px, calc(100dvh - 32px)); padding: 0; border: 0; color: var(--ink); background: #fff; box-shadow: 0 20px 50px #0006; overflow: hidden; }
.campus-dialog[open] { display: flex; flex-direction: column; }
.campus-dialog::backdrop { background: #091527b3; }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 20px; background: var(--navy); color: #fff; }
.dialog-head h2 { margin: 0 !important; font-size: 1.4rem !important; }
.dialog-close { flex: none; min-width: 44px; min-height: 44px; padding: 8px 12px; border: 1px solid #ffffff80; background: none; color: #fff; }
.dialog-body { overflow: auto; padding: 20px 20px calc(20px + env(safe-area-inset-bottom)); }

@media (max-width: 767px) {
  .campus-facts { grid-template-columns: 1fr; gap: 2px; }
  .campus-facts dd + dt { margin-top: 10px; }
}
@media (min-width: 768px) {
  .campus-map { display: block; height: 320px; margin-top: 16px; background: #dfe6ec; }
  .campus-map iframe { display: block; width: 100%; height: 100%; border: 0; }
  .campus-dialog { width: min(720px, calc(100vw - 32px)); max-height: min(760px, calc(100dvh - 32px)); }
}
@media (min-width: 1024px) {
  .directions-layout { grid-template-columns: minmax(0, 55fr) minmax(0, 45fr); }
  .taiwan-map { width: min(100%, 540px); }
  .county-status .jump-link { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .county path { transition: none; }
}
