/* How Waltham Works - site styles layered on Watch City (watch-city.css).
   Rule of thumb: reuse wc- classes and tokens first; this file only maps
   Markdown output onto them and adds layout glue. */

/* ---------- Page glue ---------- */
html { background: var(--vellum); }
body { margin: 0; }
.skip-link { position: absolute; left: var(--space-4); top: -100px; z-index: 10; padding: var(--space-2) var(--space-4); background: var(--graphite); color: var(--vellum); }
.wc-page a.skip-link { color: var(--vellum); }
.skip-link:focus { top: var(--space-2); }
main { display: block; padding-bottom: var(--space-16); }
.page-body { padding-top: var(--space-8); }
.page-head { display: flex; flex-direction: column; gap: var(--space-4); margin: var(--space-8) 0 var(--space-8); }
.page-head > * { margin: 0; }
.page-head .wc-display { overflow-wrap: anywhere; }
.meta { color: var(--pencil); }
.body-small { font-size: 15px; line-height: 22px; }
.guide-section { margin-top: var(--space-16); }
.wc-notice ul { margin: 0; padding-left: 1.2em; }

/* ---------- Hero ---------- */
.hero { border-bottom: var(--stroke-hairline) solid var(--rule); }
.hero__inner { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: var(--space-8); align-items: center; padding-block: var(--space-16) var(--space-8); }
.hero__text { display: flex; flex-direction: column; gap: var(--space-4); }
.hero__text > * { margin: 0; }
.hero__title { font-size: clamp(48px, 8vw, 96px); line-height: .95; }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--space-4); padding-top: var(--space-4); }
.hero__art svg { display: block; width: 100%; height: auto; }
@media (max-width: 760px) { .hero__inner { grid-template-columns: 1fr; padding-top: var(--space-8); } .hero__art { order: -1; max-width: 420px; } }

/* The drafted watch train (from the design system cover) */
.watch-train .grid { stroke: var(--rule); stroke-width: var(--stroke-hairline); opacity: .55; }
.watch-train .cons { stroke: var(--pencil); stroke-width: var(--stroke-hairline); fill: none; opacity: .45; }
.watch-train .hidden { stroke: var(--pencil); stroke-width: var(--stroke-hairline); fill: none; stroke-dasharray: 4 3; opacity: .7; }
.watch-train .wheel { fill: var(--brass-tint); stroke: var(--graphite); stroke-width: var(--stroke-hairline); stroke-linejoin: round; }
.watch-train .pinion { fill: var(--linen); stroke: var(--graphite); stroke-width: var(--stroke-hairline); stroke-linejoin: round; }
.watch-train .rim { fill: var(--vellum); stroke: var(--graphite); stroke-width: var(--stroke-bold); }
.watch-train .spoke { fill: var(--brass-tint); stroke: var(--brass); stroke-width: var(--stroke-hairline); stroke-linejoin: round; }
.watch-train .mark { stroke: var(--pencil); stroke-width: var(--stroke-hairline); }
.watch-train .jewel { fill: var(--oxide); }
.watch-train .dim { stroke: var(--rule-strong); stroke-width: var(--stroke-hairline); fill: none; }
.watch-train .arrow { fill: var(--rule-strong); }
.watch-train .callout { fill: var(--vellum); stroke: var(--rule-strong); stroke-width: var(--stroke-hairline); }
.watch-train .dimtext { font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: .06em; fill: var(--pencil); }

/* ---------- Plates ---------- */
.plate-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: var(--space-8); padding: 5px; }
.wc-page a.plate-link { color: var(--graphite); text-decoration: none; }
.wc-page a.plate-link:hover { color: var(--oxide); text-decoration: underline; }
.wc-plate__body .wc-status { font-size: 15px; }

/* ---------- Article layout ---------- */
.article-grid { display: grid; grid-template-columns: minmax(0, 680px) minmax(0, 300px); justify-content: space-between; gap: var(--space-16); }
.related { display: flex; flex-direction: column; gap: var(--space-4); padding-top: var(--space-8); }
.related .wc-plate__title { font-size: 22px; line-height: 28px; }
@media (max-width: 1000px) { .article-grid { grid-template-columns: minmax(0, 1fr); gap: var(--space-8); } }

/* ---------- Markdown prose (KB articles and digests) ---------- */
.prose-body > p:first-child::first-letter { float: left; font-family: var(--font-display); font-size: 64px; line-height: 52px; font-weight: 500; color: var(--graphite); background: var(--linen); border: var(--stroke-hairline) solid var(--rule-strong); padding: 8px 10px 4px; margin: 6px 12px 0 0; }
.layout-digest .prose-body > p:first-child::first-letter { all: unset; }
.prose-body h2 { position: relative; margin: var(--space-16) 0 var(--space-8); padding-bottom: 12px; border-bottom: var(--stroke-bold) solid var(--graphite); font-family: var(--font-display); font-size: 34px; line-height: 40px; font-weight: 500; }
.prose-body h2::after { content: ""; position: absolute; left: 0; right: 0; bottom: -6px; border-top: var(--stroke-hairline) solid var(--graphite); }
.prose-body h3 { margin: var(--space-8) 0 var(--space-2); font-family: var(--font-display); font-size: 22px; line-height: 28px; font-weight: 400; font-style: italic; }
.prose-body ul, .prose-body ol { margin: 0 0 var(--space-4); padding-left: 1.3em; }
.prose-body li { margin-bottom: var(--space-2); }
.prose-body li::marker { color: var(--brass); }
.prose-body strong { font-weight: 600; }
.prose-body blockquote { margin: 0 0 var(--space-4); padding: var(--space-4) 20px; background: var(--linen); border: var(--stroke-hairline) solid var(--rule-strong); }

/* Tables: kramdown emits bare <table>; give it the DataTable look */
.prose-body table { display: block; overflow-x: auto; width: 100%; border-collapse: collapse; margin: 0 0 var(--space-8); font-size: 16px; line-height: 24px; border-bottom: var(--stroke-bold) solid var(--graphite); }
.prose-body thead th { border-top: var(--stroke-bold) solid var(--graphite); background: var(--linen); text-align: left; padding: 10px var(--space-4); border-bottom: var(--stroke-hairline) solid var(--graphite); font-family: var(--font-mono); font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--pencil); }
.prose-body td { padding: 12px var(--space-4); border-bottom: var(--stroke-hairline) solid var(--rule); vertical-align: top; }
.prose-body tbody tr:last-child td { border-bottom: 0; }

/* Footnotes: kramdown's <sup><a class="footnote"> and <div class="footnotes"> */
.prose-body sup { line-height: 0; }
.prose-body a.footnote { font-size: 0.8em; text-decoration: none; padding-left: 1px; font-variant-numeric: lining-nums; }
.prose-body a.footnote::before { content: "["; } .prose-body a.footnote::after { content: "]"; }
.prose-body .footnotes { position: relative; margin-top: var(--space-4); padding-top: var(--space-4); font-size: 15px; line-height: 22px; color: var(--pencil); overflow-wrap: anywhere; }
.prose-body .footnotes::before { content: ""; position: absolute; top: 0; left: 0; width: 96px; border-top: var(--stroke-hairline) solid var(--graphite); }
.prose-body .footnotes ol { padding-left: 1.6em; }
.prose-body .footnotes li::marker { color: var(--oxide); font-variant-numeric: lining-nums; }
.prose-body .footnotes code { font-family: var(--font-mono); font-size: 13px; }
.prose-body a.reversefootnote { text-decoration: none; margin-left: var(--space-1); }
.prose-body :target { background: var(--brass-tint); }

/* ---------- Digest list ---------- */
.digest-list { list-style: none; margin: 0 0 var(--space-8); padding: 0; border-top: var(--stroke-hairline) solid var(--rule-strong); }
.digest-list > li { display: flex; flex-direction: column; gap: var(--space-2); padding: 20px 0; border-bottom: var(--stroke-hairline) solid var(--rule-strong); }
.digest-list > li > * { margin: 0; max-width: 44em; }
.wc-page .wc-subheading a { color: var(--graphite); }
.wc-page .wc-subheading a:hover { color: var(--oxide); }

/* ---------- Org chart ---------- */
.org-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: var(--space-4); }
.org-node:target { outline: var(--stroke-bold) solid var(--oxide); outline-offset: 2px; }
.org-edges { list-style: none; margin: 0; padding: 12px 0 0; border-top: var(--stroke-hairline) solid var(--rule); display: flex; flex-direction: column; gap: var(--space-1); font-size: 16px; line-height: 24px; }
.org-edges .wc-label { font-size: 15px; color: var(--pencil); }

/* ---------- Org chart: the interactive dial (assets/js/org-chart.js) ---------- */
.org-dial { margin-bottom: var(--space-16); }
.org-dial__bar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-4); }
.org-dial__find { display: flex; flex-direction: column; gap: var(--space-2); flex: 1 1 260px; max-width: 420px; }
.org-dial__find .wc-input { width: 100%; }
.org-dial__zoom { display: flex; gap: var(--space-2); }
.org-dial__zoom .wc-btn { padding-inline: var(--space-4); }
.org-dial__zoom .wc-btn--icon { padding: 0; font-size: 24px; }
.org-dial__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 360px); gap: var(--space-8); align-items: start; }
.org-dial__figure { margin: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.org-dial__svg { display: block; width: 100%; height: auto; aspect-ratio: 1; background: var(--vellum); border: var(--stroke-hairline) solid var(--rule-strong); touch-action: pan-x pan-y; user-select: none; -webkit-user-select: none; }
.org-dial__svg.is-zoomed { touch-action: none; cursor: grab; }
.org-dial__panel { position: sticky; top: var(--space-4); max-height: calc(100vh - 2 * var(--space-4)); overflow-y: auto; }
.org-dial__p { margin: 0; }
.org-dial__starts { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0; }
.org-dial__starts .wc-btn { padding-inline: var(--space-4); }
.org-dial__kicker { margin: var(--space-2) 0 0; }
.org-dial__edges { gap: var(--space-4); }
.org-dial__edges > li { display: flex; flex-direction: column; gap: var(--space-1); }
.org-dial__rel { display: block; }
.org-dial__jump { padding: 0; border: 0; background: none; font: inherit; color: var(--oxide); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; text-align: left; }
.org-dial__jump:hover { color: var(--graphite); }
.org-dial__cites { list-style: none; margin: 0; padding: 0 0 0 22px; font-size: 14px; line-height: 20px; overflow-wrap: anywhere; }
.org-dial__dagger { color: var(--oxide); padding-right: var(--space-1); }
.org-dial__swatch { display: inline-block; width: 16px; height: 0; margin-right: 6px; vertical-align: middle; border-top: 2px solid; }
.org-dial__foot a { color: inherit; }
.org-dial__legend { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-8); list-style: none; margin: var(--space-4) 0 0; padding: var(--space-4) 0 0; border-top: var(--stroke-hairline) solid var(--rule); color: var(--pencil); }
.org-dial__legend li { display: flex; align-items: center; gap: var(--space-2); }
.org-dial__legend svg { overflow: visible; flex: none; }
@media (max-width: 900px) {
  .org-dial__grid { grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
  .org-dial__panel { position: static; max-height: none; }
}

/* Dial drawing. Strokes stay hairline at any zoom (non-scaling). */
.dial-layer * { pointer-events: none; vector-effect: non-scaling-stroke; }
.dial-layer text { vector-effect: none; }
.dial-face .bezel { fill: none; stroke: var(--graphite); stroke-width: 2; }
.dial-face .bezel-in, .dial-face .tick { fill: none; stroke: var(--rule-strong); stroke-width: 1; }
.dial-face .ring { fill: none; stroke: var(--rule); stroke-width: 1; stroke-dasharray: 4 3; }
.dial-face .numeral { font-family: var(--font-mono); font-weight: 500; letter-spacing: .08em; fill: var(--brass); text-anchor: middle; paint-order: stroke; stroke: var(--vellum); }
.dial-links .spoke { fill: none; stroke: var(--rule-strong); stroke-width: 1; transition: opacity .2s; }
.dot { stroke: var(--graphite); stroke-width: 1; transition: opacity .2s; }
.dot.is-hover { stroke-width: 2.5; }
.t-voters { fill: var(--graphite); }
.t-elected { fill: var(--oxide); }
.t-officer { fill: var(--brass); }
.t-department { fill: var(--brass-tint); stroke: var(--brass); }
.t-board { fill: var(--vellum); }
.t-state { fill: var(--patina); }
.org-dial__legend .t-department, .org-dial__legend .t-board, .org-dial__legend circle { stroke-width: 1; }
.org-dial__legend .t-board, .org-dial__legend .t-elected, .org-dial__legend .t-officer, .org-dial__legend .t-state { stroke: var(--graphite); }
.lbl { font-family: var(--font-serif); fill: var(--graphite); paint-order: stroke; stroke: var(--vellum); stroke-linejoin: round; transition: opacity .2s; }
.lbl-d0, .lbl-d1 { font-family: var(--font-display); font-weight: 500; }
.lbl.is-hidden { display: none; }
.selected-halo { fill: none; stroke: var(--oxide); stroke-width: 1.5; stroke-dasharray: 2 2; opacity: 0; }
.selected-halo.is-on { opacity: 1; }
.has-selection .dot:not(.is-focus), .has-selection .lbl:not(.is-focus), .has-selection .spoke { opacity: .22; }
.has-selection .lbl.is-selected { font-weight: 700; }
.hi { fill: none; stroke-width: 2; }
.arrow { stroke: none; }

/* Relation styles, shared by the dial, its legend and the panel swatches. */
.k-chooses { stroke: var(--oxide); color: var(--oxide); fill: var(--oxide); }
.k-confirms { stroke: var(--patina); color: var(--patina); fill: var(--patina); }
.k-oversees { stroke: var(--graphite); color: var(--graphite); fill: var(--graphite); }
.k-other { stroke: var(--brass); color: var(--brass); fill: var(--brass); }
.hi.k-confirms, .org-dial__legend .k-confirms { stroke-dasharray: 6 4; }
.hi.k-other, .org-dial__legend .k-other { stroke-dasharray: 1 4; stroke-linecap: round; }
.org-dial__legend line { stroke-width: 2; }
.hi, .org-dial__legend line { fill: none; }
.org-dial__swatch.k-confirms { border-top-style: dashed; }
.org-dial__swatch.k-other { border-top-style: dotted; }
