/* Singapore urban analysis board — paper theme over the shared sheet. */
@import url('./sheet.css');

:root {
  --ink: #ffffff;
  --plate: #faf8f4;
  --plate-2: #faf8f4;
  --rule: #d9d4ca;
  --rule-soft: #e8e4dc;
  --line: #1a1a1a;
  --text: #1a1a1a;
  --dim: #6d6a63;
  --dimmer: #9c988f;
  --amber: #d9480f;
}

body {
  background: var(--ink);
  -webkit-font-smoothing: auto;
}

/* Subtle paper grain, once, behind everything. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

.sheet__head { background: var(--plate); }
.callout { background: rgba(255, 255, 255, 0.92); border-color: var(--rule); }
.leader { stroke: var(--dim); }
.leader.is-selected { stroke: var(--amber); }
.hint { color: var(--dimmer); }

.bom__legend { display: inline-flex; gap: 3px; margin-left: 6px; }
.bom__legend i,
.legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border: 1px solid var(--rule);
}
.legend { list-style: none; margin: 4px 0 0; padding: 0; }
.legend li { display: flex; align-items: center; gap: 8px; padding: 2px 0; }
.data__block h5 { margin: 10px 0 2px; font-size: 11px; color: var(--dim); font-weight: 500; }

/* Offscreen render source only — never shown; each frame's viewport rect is
   copied into its .thumb's own <canvas>, which is what the circle clips. */
#thumb-canvas { position: fixed; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; z-index: -1; }
.obs { display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: start; margin: 0 0 18px; }
.thumb { width: 96px; height: 96px; border-radius: 50%; background: var(--plate); border: 1px solid var(--rule); overflow: hidden; }
.thumb canvas { width: 100%; height: 100%; display: block; }

@media (prefers-color-scheme: dark) {
  /* The board is a paper artefact; it stays light in every scheme. */
}

/* ── Remaining hardcoded colours in sheet.css ─────────────────────────────
   sheet.css bakes a few literal dark-theme hex/rgba values instead of using
   the custom properties above (see grep -n '#0\|#1\|rgba' css/sheet.css and
   the near-white #e8f4ff title colour that grep misses). Override the
   selectors here rather than editing sheet.css, which the tank sheet also
   uses. */
.ident__designation,
.data__title {
  color: var(--text);
}

.field {
  background: var(--ink);
}

.bom__btn:hover {
  background: var(--rule-soft);
}

.bom__btn.is-active {
  background: rgba(217, 72, 15, 0.08);
}

.callout:hover {
  background: rgba(255, 255, 255, 0.98);
}

.callout.is-selected {
  background: rgba(255, 255, 255, 0.98);
}

.data__block--note p {
  border-left-color: rgba(217, 72, 15, 0.35);
}

.panel__actions button:hover:not(:disabled) {
  background: var(--rule-soft);
}

.panel__actions button:disabled {
  color: var(--dimmer);
}

.panel__actions button.is-on {
  background: rgba(217, 72, 15, 0.1);
}

.control--presets button.is-on {
  background: var(--rule-soft);
}

/* ── Poster mode: camera/explode plumbing ────────────────────────────────── */
body.is-poster .callouts { display: none; }
body.is-poster .control--slider,
body.is-poster .control--presets,
body.is-poster .control--toggles .switch { display: none; }
body.is-poster #btn-reset,
body.is-poster .panel__actions { display: none; }
.guide { fill: none; stroke: var(--dimmer); stroke-width: 1; stroke-dasharray: 4 6; }

/* ── Poster mode layout ────────────────────────────────────────────────── */
body.is-poster { overflow: auto; }
body.is-poster .sheet {
  height: auto; min-height: 100dvh; max-width: 1240px; margin: 24px auto;
  border: none; grid-template-rows: auto 1fr auto;
}
body.is-poster .sheet__head { border-bottom: none; padding: 24px 32px 8px; background: none; }
body.is-poster .ident__designation { font-size: 30px; letter-spacing: 0.04em; }
body.is-poster .ident__type { font-size: 20px; letter-spacing: 0.06em; }
body.is-poster .titleblock, body.is-poster .mobile-tabs { display: none; }
body.is-poster .sheet__body { grid-template-columns: 300px minmax(460px, 1fr) 320px; gap: 24px; padding: 0 32px; }
body.is-poster .panel { border: none; background: none; overflow: visible; }
body.is-poster .panel__head { display: none; }
body.is-poster .field { width: 100%; height: auto; min-height: 1200px; align-self: stretch; background: none; }
body.is-poster #field { background: transparent; }

/* modules (left) */
body.is-poster .bom__group { display: none; }
body.is-poster .bom__row { margin: 0 0 28px; }
body.is-poster .bom__btn {
  display: grid; grid-template-columns: 44px 1fr; grid-auto-rows: auto; gap: 2px 10px;
  padding: 0; background: none; border: none; border-left: 2px solid var(--rule); padding-left: 12px;
  text-align: left; white-space: normal;
}
body.is-poster .bom__btn.is-active { border-left-color: var(--amber); }
body.is-poster .bom__id, body.is-poster .bom__qty, body.is-poster .bom__legend { display: none; }
.module__num, .module__spec, .bom__btn .legend { display: none; }
body.is-poster .module__num { display: block; grid-row: 1 / span 2; font: 700 40px/1 var(--display); }
body.is-poster .bom__name { grid-column: 2; font: 600 15px/1.2 var(--display); letter-spacing: 0.06em; text-transform: uppercase; }
body.is-poster .module__spec { display: block; grid-column: 2; font-size: 12px; line-height: 1.45; color: var(--dim); }
body.is-poster .bom__btn .legend { display: block; grid-column: 2; margin-top: 6px; }
body.is-poster .bom__btn .legend li { font-size: 11px; }

/* observations (right) */
body.is-poster .data { padding: 0; }
body.is-poster .data__block h4 { font: 600 14px/1.2 var(--display); letter-spacing: 0.08em; text-transform: uppercase; border-bottom: 1px solid var(--rule); padding-bottom: 6px; }

/* bottom strip */
.attrib { position: absolute; left: 24px; bottom: 48px; font-size: 9px; color: var(--dimmer); }
.scale { position: absolute; left: 24px; bottom: 20px; width: 220px; font-size: 10px; color: var(--text); }
.scale__rule { display: flex; height: 6px; border: 1px solid var(--text); }
.scale__rule i { flex: 1; }
.scale__rule i:nth-child(odd) { background: var(--text); }
.scale__ticks { display: flex; justify-content: space-between; margin-top: 3px; }
.scale__ticks b { font-weight: 400; transform: translateX(-50%); }
.scale__ticks b:first-child { transform: none; }
.scale__ticks b:last-child { transform: translateX(15%); }
.compass { position: absolute; right: 24px; bottom: 16px; width: 44px; height: 44px; }
/* Sheet mode keeps the same scale bar, smaller and where the tank sheet's sits. */
body:not(.is-poster) .scale { left: 50%; bottom: 42px; width: 150px; transform: translateX(-50%); font-size: 9px; color: var(--dim); }
body:not(.is-poster) .compass { width: 30px; height: 30px; }
body.is-poster .hint { display: none; }
body.is-poster .sheet__foot { border: none; justify-content: flex-end; }

/* @page is document-wide, so the poster's paper size is injected by
   js/urban/app.js only when the poster view is on. */
@media print {
  body.is-poster .sheet__foot { display: none; }
  body.is-poster .sheet { margin: 0; max-width: none; }
}

/* ── Poster home: call-to-action into the interactive sheet ──────────── */
body.is-poster .cta {
  display: inline-block;
  padding: 9px 16px;
  background: var(--amber);
  color: #ffffff;
  border: none;
  font: 600 13px/1 var(--display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
}
body.is-poster .cta:hover { background: #b93a0a; color: #ffffff; }
.view-hint { display: none; }
body.is-poster .view-hint { display: block; margin: 6px 0 0; font-size: 11px; color: var(--dim); }

.cta-row { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
