/*
 * Page layout and shared controls.
 * Layout: one screen, never scrolls. Desktop: side panel | map. Phone: map above,
 * panel below as a scrollable sheet.
 */

/* The artifact viewer pads :root by the phone's safe-area insets. border-box keeps
   that padding inside the 100% height; with content-box the page was taller than
   the screen and could be scrolled (by scrollIntoView) with no way back. */
html { box-sizing: border-box; height: 100%; overflow: hidden; }
body {
  height: 100%; margin: 0; overflow: hidden;
  background: var(--bg); color: var(--fg);
  font-family: var(--font-ui); font-size: 14px; line-height: 1.45;
}
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.app { display: grid; grid-template-columns: minmax(320px, 390px) minmax(0, 1fr); height: 100%; }
.panel {
  /* position: relative keeps absolutely positioned helpers (.visually-hidden) inside
     the panel's scroll area instead of stretching the page */
  position: relative;
  display: flex; flex-direction: column; gap: 18px; min-width: 0; overflow-y: auto; overscroll-behavior: contain;
  background: var(--panel); border-right: 1px solid var(--line);
  padding-block: 16px 20px; padding-inline: 16px;
}
/* A static picture of the city centre shows until Leaflet starts (it then paints
   .leaflet-container over it). The first frame and claude.ai's link-preview
   screenshot, which is taken before scripts run, therefore show a map. */
.map-area {
  position: relative; min-width: 0; min-height: 0;
  background: var(--map-ground) url("../assets/social/map-placeholder.svg") 68% 50% / cover no-repeat;
}
#map { position: absolute; inset: 0; }

@media (max-width: 760px) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .map-area { order: 1; }
  .panel {
    order: 2; max-height: 46vh; max-height: 46dvh; gap: 16px; padding-block: 12px 18px;
    border-right: 0; border-top: 1px solid var(--line); box-shadow: 0 -6px 18px rgba(0, 0, 0, .08);
  }
}

/* typography helpers */
.section-label { margin: 0 0 6px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.sep { padding: 0 .3em 0 .15em; color: var(--muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.source-note { margin: 0; font-size: 11.5px; color: var(--muted); }
.source-note a { color: inherit; }

/* controls */
.btn { border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 6px 11px 4px; cursor: pointer; font-weight: 600; font-size: 13px; }
.btn:hover { border-color: var(--muted); }
.btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.chip { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 5px 11px 3px; cursor: pointer; font-size: 13px; font-weight: 600; }
.chip[aria-pressed="true"] { background: var(--fg); color: var(--panel); border-color: var(--fg); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.icon-button { flex: none; width: 30px; height: 30px; padding-top: 3px; border: 0; border-radius: 8px; background: var(--soft); cursor: pointer; font-size: 18px; line-height: 1; }

/* the blue "P" traffic sign; the P is an SVG path (js/lib/icons.js), centred by construction */
.parking-sign {
  flex: none; display: grid; place-items: center; box-sizing: border-box; width: 38px; height: 38px;
  border-radius: 6px; background: var(--sign-blue); color: #fff;
  box-shadow: inset 0 0 0 2px #fff, 0 0 0 1px var(--sign-blue);
}
.parking-sign .p-glyph { display: block; width: 100%; height: 100%; }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
