/* 아카데미 맵 app shell — Aquila toss-v2 light tokens only (V20~V26, D34). */

:root { color-scheme: light; }
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-block-start: 5rem;
  overflow-x: clip;
}

body.aq-page {
  max-width: none;
  min-height: 100dvh;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
  background: var(--aq-bg);
  color: var(--aq-fg);
  font-family: var(--aq-font);
  font-size: 15px;
  line-height: 1.55;
  word-break: keep-all;
}

main, section, aside, header, footer, nav, form, div, li { min-width: 0; }
#view { flex: 1; width: 100%; outline: none; }

h1, h2, h3 {
  font-weight: var(--aq-display-weight);
  line-height: var(--aq-display-line-height);
  letter-spacing: var(--aq-display-tracking);
  text-wrap: balance;
}
p, h1, h2, h3, dl, dd, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
button, input, select { font: inherit; color: inherit; }
a { color: inherit; text-underline-offset: .2em; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--aq-accent); outline-offset: 2px; }
/* 경로 이동 뒤 읽기 위치용 프로그램 포커스(h1 tabindex=-1)는 테두리를 그리지 않는다. */
h1[tabindex="-1"]:focus { outline: none; }
img, svg, video, canvas, iframe { max-width: 100%; }

.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: 16px;
}
.muted { color: var(--aq-fg-secondary); }

.skip {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 1000;
  padding: 10px 16px;
  background: var(--aq-fg);
  color: var(--aq-fg-inverse);
  border-radius: var(--aq-radius-sm);
  font-size: 13px;
  text-decoration: none;
  transform: translateY(-220%);
}
.skip:focus { transform: none; }

/* ── Sticky top bar ── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 500;
  background: var(--aq-surface);
  border-bottom: 1px solid var(--aq-border-subtle);
}
.topbar-inner {
  position: relative;
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 18px;
  font-weight: var(--aq-display-weight);
  letter-spacing: var(--aq-display-tracking);
  color: var(--aq-fg);
  text-decoration: none;
  flex-shrink: 0;
}
.logo:hover { text-decoration: none; }
.logo-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--aq-radius-full);
  background: var(--aq-accent);
  flex-shrink: 0;
}
.topbar-search { flex: 1; max-width: 520px; margin-inline: auto; }
body[data-route='home'] .topbar-search { display: none; }
.topbar-search input {
  display: block;
  width: 100%;
  height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--aq-radius-full);
  background: var(--aq-surface-sunken);
  color: var(--aq-fg);
  font-size: 14px;
}
.topbar-search input::placeholder { color: var(--aq-fg-placeholder); opacity: 1; }
.topbar-search input:hover { background: var(--aq-surface-strong); }
.topbar-search input:focus-visible { border-color: var(--aq-accent); background: var(--aq-surface); }
.topbar-search input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; }
.menu-button {
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-inline-start: auto;
  padding: 0 14px;
  border: 1px solid var(--aq-border);
  border-radius: var(--aq-radius-sm);
  background: var(--aq-surface);
  color: var(--aq-fg);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.site-nav { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border-radius: var(--aq-radius-sm);
  color: var(--aq-fg-secondary);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.site-nav a:hover { background: var(--aq-surface-sunken); color: var(--aq-fg); text-decoration: none; }
.site-nav a[aria-current="page"] { color: var(--aq-accent); font-weight: 600; }

/* ── Footer ── */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--aq-border-subtle);
  background: var(--aq-surface);
}
.site-footer .container { padding-block: 20px 24px; }
.site-notice { font-size: 13px; color: var(--aq-fg-secondary); }
.data-status { margin-top: 8px; font-size: 12px; color: var(--aq-fg-subtle); }
.noscript {
  display: block;
  margin-block: 24px;
  padding: 16px 18px;
  background: var(--aq-surface);
  border-radius: var(--aq-radius-card);
  box-shadow: var(--aq-shadow-sm);
  font-size: 14px;
  color: var(--aq-fg-secondary);
}

/* ── Page building blocks ── */
.page-head { padding-block: 28px 18px; }
.page-head h1 { font-size: 26px; margin-bottom: 6px; }
.page-head p { color: var(--aq-fg-secondary); font-size: 14px; }
.page-title { font-size: 22px; margin-bottom: 8px; }
.route-notice { margin-block: 32px; }
.card-action { margin-top: 16px; }
.view-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 72px 0;
  color: var(--aq-fg-secondary);
  font-size: 14px;
}
.layout-split {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 16px;
  align-items: start;
}
.layout-split > .map-panel { position: sticky; top: 80px; }
.map-panel {
  min-height: 360px;
  border-radius: var(--aq-radius-card);
  overflow: hidden;
  background: var(--aq-surface);
  box-shadow: var(--aq-shadow-sm);
}
.map-panel .maplibregl-map { min-height: 360px; width: 100%; }
.result-list { display: grid; gap: 10px; }
.result-card {
  display: block;
  padding: 16px 18px;
  background: var(--aq-surface);
  border-radius: var(--aq-radius-card);
  box-shadow: var(--aq-shadow-sm);
  color: inherit;
  text-decoration: none;
}
.result-card:hover { box-shadow: var(--aq-shadow-md); text-decoration: none; }
.result-card h2, .result-card h3 { font-size: 17px; margin-bottom: 4px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-static { cursor: default; }
.chip-cat-1 { background: var(--aq-cat-1-light); color: var(--aq-cat-1-dark); border-color: transparent; }
.chip-cat-2 { background: var(--aq-cat-2-light); color: var(--aq-cat-2-dark); border-color: transparent; }
.chip-cat-3 { background: var(--aq-cat-3-light); color: var(--aq-cat-3-dark); border-color: transparent; }
.chip-cat-4 { background: var(--aq-cat-4-light); color: var(--aq-cat-4-dark); border-color: transparent; }
.chip-cat-5 { background: var(--aq-cat-5-light); color: var(--aq-cat-5-dark); border-color: transparent; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.stat-hint { font-size: 12px; color: var(--aq-fg-subtle); margin-top: 2px; }
.kv { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); row-gap: 10px; column-gap: 12px; }
.kv dt { color: var(--aq-fg-secondary); font-size: 13px; }
.kv dd { min-width: 0; }

/* ── Narrow screens ── */
@media (max-width: 767.98px) {
  .topbar-inner { min-height: 56px; flex-wrap: wrap; padding-block: 8px; row-gap: 10px; }
  .topbar-search { order: 3; flex: 1 1 100%; max-width: none; margin-inline: 0; }
  .menu-button { display: inline-flex; }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 8px 16px calc(12px + env(safe-area-inset-bottom));
    background: var(--aq-surface);
    border-bottom: 1px solid var(--aq-border-subtle);
    box-shadow: var(--aq-shadow-md);
  }
  .site-nav[data-open="true"] { display: flex; }
  .site-nav a { min-height: 44px; padding-inline: 10px; }
  .layout-split { grid-template-columns: minmax(0, 1fr); }
  .layout-split > .map-panel { position: static; }
  .map-panel, .map-panel .maplibregl-map { min-height: 280px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-head { padding-block: 20px 14px; }
  .page-head h1 { font-size: 22px; }
}
@media (min-width: 768px) {
  .container { padding-inline: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
