/* 시애틀 유용한 장소. 토큰과 규칙은 DESIGN.md를 따른다. */

:root {
  --ground: #F3F5F4;
  --text: #16202A;
  --text-muted: #5A6672;
  --rule: #D3DAD8;
  --link: #1B5E8C;
  --highlight: #FFE45C;
  --cat-food: #D1452E;
  --cat-cafe: #B07415;
  --cat-bar: #2B7A8B;
  --cat-grocery: #3D8A4E;
  --cat-other: #707A84;

  --font-latin: "Overpass", "Wanted Sans Variable", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  --font-ko: "Wanted Sans Variable", "Wanted Sans", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;

  --dot: 11px;
  --dot-gap: 5px;
  --dot-hollow: 2px;
  --dot-ring: 3px;
  --bar-h: 46px;
  --anchor-gap: 56px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #11181E;
    --text: #E5EBEE;
    --text-muted: #97A4AE;
    --rule: #26323B;
    --link: #7DB8E2;
    --highlight: rgba(255, 228, 92, 0.30);
    --cat-food: #F06A52;
    --cat-cafe: #E3A43A;
    --cat-bar: #4FA6B8;
    --cat-grocery: #62B072;
    --cat-other: #97A1AA;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--ground);
  color: var(--text);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  font-family: var(--font-ko);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.6;
}

p, ul, ol, h1, h2, h3 { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

[lang="en"] { font-family: var(--font-latin); }

.n {
  font-family: var(--font-latin);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.01em;
  font-feature-settings: "tnum";
  color: var(--text-muted);
}

/* --- 쪽 -------------------------------------------------------------- */

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px;
}

.rail { display: none; }

/* --- 머리말 ------------------------------------------------------------ */

.masthead { padding-top: 28px; }

.site-title {
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.intro { margin-top: 4px; }

.edition {
  margin-top: 8px;
  font-family: var(--font-latin);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.01em;
  font-feature-settings: "tnum";
  color: var(--text-muted);
}

mark.hl {
  background: var(--highlight);
  color: var(--text);
}

/* --- 개요 -------------------------------------------------------------- */

.overview { margin-top: 28px; }

.count-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.count { display: flex; align-items: baseline; gap: 4px; }

.count-num {
  font-family: "Overpass", var(--font-latin);
  font-weight: 800;
  font-size: clamp(56px, 18vw, 88px);
  line-height: 0.9;
  letter-spacing: -0.03em;
  font-feature-settings: "tnum";
}

.count-unit {
  font-weight: 700;
  font-size: 22px;
}

.to-list {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--font-latin);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.01em;
  color: var(--link);
  text-decoration: none;
}

.dotmap { margin-top: 20px; }

.dot-group {
  position: relative;
  padding: 8px 0;
}

.dot-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
}

.dots {
  display: flex;
  flex-wrap: wrap;
  gap: var(--dot-gap);
}

.dot {
  display: inline-block;
  flex: none;
  width: var(--dot);
  height: var(--dot);
  border-radius: 9999px;
  background: currentColor;
}

.dot.is-hollow {
  background: transparent;
  border: var(--dot-hollow) solid currentColor;
}

.dot.is-ringed { outline: var(--dot-ring) solid var(--highlight); }

.dot-food { color: var(--cat-food); }
.dot-cafe { color: var(--cat-cafe); }
.dot-bar { color: var(--cat-bar); }
.dot-grocery { color: var(--cat-grocery); }
.dot-other { color: var(--cat-other); }
.dot-legend { color: var(--text-muted); }

.small-dots {
  --dot: 7px;
  --dot-gap: 3px;
  --dot-hollow: 1.5px;
  --dot-ring: 2px;
}

/* 점 지도의 점은 정밀한 포인터에서만 링크다. 터치에서는 묶음 전체가 섹션으로 점프한다. */
.dot-touch { display: none; }

@media (pointer: coarse) {
  .dots .dot { pointer-events: none; }
  .dot-touch {
    display: block;
    position: absolute;
    inset: 0;
  }
  .dot-label { position: relative; z-index: 1; }
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin-top: 12px;
  font-size: 14px;
  color: var(--text-muted);
}

.legend li { display: inline-flex; align-items: center; gap: 8px; }
.legend .dot { --dot: 11px; --dot-hollow: 2px; --dot-ring: 3px; }

/* --- 카테고리 바와 찾기 ------------------------------------------------ */

.catbar {
  position: sticky;
  top: 0;
  z-index: 10;
  margin: 28px -20px 0;
  padding: 0 20px;
  background: var(--ground);
  border-bottom: 1px solid var(--rule);
}

.catbar-main {
  display: flex;
  align-items: stretch;
  min-height: var(--bar-h);
}

.search-open {
  flex: none;
  min-width: 44px;
  min-height: 44px;
  margin-right: 8px;
  font-weight: 600;
  font-size: 15px;
  color: var(--text-muted);
}

.catbar-scroll {
  display: flex;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent);
}

.catbar-scroll::-webkit-scrollbar { display: none; }

.catbar-scroll.at-end {
  -webkit-mask-image: none;
  mask-image: none;
}

.catbar-item {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 44px;
  padding: 0 10px;
  border-bottom: 3px solid transparent;
  font-weight: 600;
  font-size: 15px;
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
}

.catbar-item[aria-current="true"] {
  color: var(--text);
  border-bottom-color: var(--text);
}

.catbar-item[aria-current="true"] .n { color: var(--text); }

.search {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.search-bar { display: none; min-height: var(--bar-h); }
.catbar.is-searching .catbar-main { display: none; }
.catbar.is-searching .search-bar { display: flex; }

.search-input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--rule);
  border-radius: 0;
  background: var(--ground);
  color: var(--text);
  font: inherit;
  font-size: 16px;
}

.search-pos {
  min-width: 3ch;
  font-family: var(--font-latin);
  font-weight: 600;
  font-size: 14px;
  font-feature-settings: "tnum";
  color: var(--text-muted);
  text-align: center;
}

.search-prev, .search-next, .search-close {
  min-width: 44px;
  min-height: 44px;
  font-weight: 600;
  font-size: 15px;
  color: var(--text-muted);
}

.search-status {
  flex-basis: 100%;
  font-size: 14px;
  color: var(--text-muted);
}

.search-status:empty { display: none; }
.search-status.is-silent {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.no-js .search, .no-js .search-open { display: none !important; }

/* --- 섹션 -------------------------------------------------------------- */

.cat {
  margin-top: 36px;
  scroll-margin-top: var(--anchor-gap);
}

.cat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--text);
  font-weight: 800;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.dot-head { --dot: 14px; }

.cui-jump {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  padding-top: 4px;
  color: var(--link);
}

.cui-jump a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 600;
  font-size: 15px;
  color: var(--link);
  text-decoration: none;
}

.cui-jump .sep { padding: 0 6px; color: var(--text-muted); }

.cui {
  margin-top: 26px;
  scroll-margin-top: var(--anchor-gap);
}

.cui-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--text);
  font-weight: 800;
  font-size: 17px;
}

/* --- 장소 행 ----------------------------------------------------------- */

.place {
  position: relative;
  display: grid;
  grid-template-columns: 11px minmax(0, 1fr);
  column-gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
  scroll-margin-top: var(--anchor-gap);
}

.place > .dot {
  --dot: 11px;
  --dot-hollow: 2px;
  margin-top: 7px;
}

.old-id {
  position: absolute;
  top: 0;
  scroll-margin-top: var(--anchor-gap);
}

.place-body { min-width: 0; }

/* 공유 버튼 위쪽 칸을 비워 두어 상호 링크의 누르는 영역과 겹치지 않게 한다. */
.name-line {
  padding-right: 52px;
  overflow-wrap: break-word;
}

.place-name {
  padding: 10px 0;
  font-family: var(--font-latin);
  font-weight: 700;
  font-size: 18px;
  line-height: 1.35;
  letter-spacing: -0.005em;
  text-decoration: none;
}

.place-name .arrow {
  margin-left: 3px;
  color: var(--link);
  font-weight: 600;
}

.is-new .place-name .name {
  background: linear-gradient(to bottom, transparent 52%, var(--highlight) 52%, var(--highlight) 94%, transparent 94%);
}

.name-ko {
  display: inline-block;
  font-family: var(--font-ko);
  font-weight: 500;
  font-size: 15px;
  color: var(--text-muted);
}

.meta {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 2px;
}

.meta-items {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 12px;
  min-width: 0;
  font-family: var(--font-latin);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.01em;
  font-feature-settings: "tnum";
  color: var(--text-muted);
}

.meta-items .kind, .meta-items .is-unknown { font-family: var(--font-ko); }

.new-label {
  font-family: var(--font-ko);
  font-weight: 800;
  color: var(--text);
}

.unlocated {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-ko);
}

.dot.is-mini { --dot: 9px; --dot-hollow: 1.5px; color: var(--text-muted); }

/* JS가 없으면 장소 앵커로 가는 링크이고, JS가 있으면 같은 자리의 버튼이 된다 */
.share {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  text-decoration: none;
  margin: -11px 0 -11px auto;
  font-family: var(--font-ko);
  font-weight: 600;
  font-size: 14px;
  color: var(--text-muted);
}

.share-url {
  display: block;
  width: 100%;
  margin-top: 6px;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--rule);
  border-radius: 0;
  background: var(--ground);
  color: var(--text);
  font: inherit;
  font-size: 14px;
}

.tips {
  margin-top: 6px;
  font-size: 15.5px;
  line-height: 1.6;
}

.minus-label {
  margin-right: 4px;
  font-weight: 700;
  font-size: 12.5px;
  color: var(--text-muted);
}

/* 앵커로 열리거나 찾기로 이동한 행: 0.2초 뒤 칠하고, 2.6초 중 앞 35%를 유지한 뒤 지운다. */
@keyframes flash {
  0%, 35% { background-color: var(--highlight); animation-timing-function: ease-out; }
  100% { background-color: transparent; }
}

.place.is-flash { animation: flash 2.6s 0.2s forwards; }
.no-js .place:target,
.no-js .place:has(> .old-id:target) { animation: flash 2.6s 0.2s forwards; }

@media (prefers-reduced-motion: reduce) {
  .place.is-flash,
  .no-js .place:target,
  .no-js .place:has(> .old-id:target) {
    animation: none;
    background-color: var(--highlight);
  }
}

/* --- 판권면 ------------------------------------------------------------ */

.colophon {
  margin-top: 56px;
  padding: 14px 0 40px;
  border-top: 2px solid var(--text);
  font-size: 14px;
  color: var(--text-muted);
}

.colophon p + p { margin-top: 6px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 20;
  padding: 10px 16px;
  background: var(--text);
  color: var(--ground);
  font-size: 14px;
  font-weight: 600;
}

.toast:empty { display: none; }

/* --- 넓은 화면: 범례 레일 ------------------------------------------------ */

@media (min-width: 1040px) {
  .page {
    max-width: calc(220px + 48px + 680px + 40px);
    display: grid;
    grid-template-columns: 220px minmax(0, 680px);
    column-gap: 48px;
    justify-content: center;
  }

  .page > * { grid-column: 2; }

  .catbar { display: none; }

  .rail {
    display: block;
    grid-column: 1;
    grid-row: 1 / span 6;
    align-self: start;
    position: sticky;
    top: 0;
    max-height: 100vh;
    overflow-y: auto;
    padding: 28px 4px 24px;
  }

  .search-rail { margin-bottom: 20px; }
  .search-rail .search-input { flex-basis: 100%; }
  .search-rail .search-pos { margin-right: auto; text-align: left; }

  .rail-label {
    font-family: var(--font-ko);
    font-weight: 700;
    font-size: 14px;
    color: var(--text-muted);
  }

  .rail-list { margin-top: 6px; }

  .rail-item, .rail-cuisine {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    font-weight: 600;
    font-size: 15px;
    color: var(--text-muted);
    text-decoration: none;
  }

  .rail-item[aria-current="true"], .rail-item[aria-current="true"] .n { color: var(--text); }

  .rail-cuisines { padding-left: 19px; }
  .rail-cuisine { font-size: 14px; }

  .dot-group {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    align-items: start;
    column-gap: 8px;
  }

  .dot-group .dots { padding-top: 16px; }

}
