/* Shared components from DESIGN.md. */

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; border: 1px solid var(--ink); border-radius: var(--r); background: var(--ink); color: var(--paper); font: 600 15px/1 var(--sans); white-space: nowrap; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--ink-2); border-color: var(--ink-2); }
.btn.quiet { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.quiet:hover { border-color: var(--ink); }
.btn.small { height: 36px; padding: 0 14px; font-size: 14px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.5; pointer-events: none; }

/* Command box */
.cmd { display: flex; align-items: center; gap: 10px; min-width: 0; max-width: 100%; min-height: 42px; padding: 4px 6px 4px 12px; border: 1px solid var(--line); background: var(--paper-2); }
.cmd code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; font-size: 15px; color: var(--ink); }
.cmd .copy { flex: none; height: 30px; padding: 0 10px; border: 1px solid var(--line); border-radius: 4px; background: var(--paper); color: var(--ink-2); font: 500 13px var(--sans); cursor: pointer; }
.cmd .copy:hover { border-color: var(--ink); color: var(--ink); }
.pm { display: inline-flex; flex: none; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: 4px; background: var(--paper); }
.pm button { border: 0; border-radius: 3px; padding: 3px 8px; background: transparent; color: var(--muted); font: 500 12.5px var(--sans); cursor: pointer; }
.pm button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* Prose pages */
.prose { max-width: none; }
.prose h1 { font-size: var(--fs-h1); line-height: 1.08; margin: 40px 0 16px; }
.prose h2 { font-size: var(--fs-h2-article); line-height: 1.2; margin: 48px 0 12px; }
.prose .lede { font-size: var(--fs-lede); line-height: 1.55; color: var(--ink-2); margin: 0 0 24px; }
.prose p, .prose li { max-width: 38em; }
.prose code { color: var(--ink); }

/* Support routes */
.routes { list-style: none; margin: 32px 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.routes li { padding: 20px; border: 1px solid var(--line); }
.routes h2 { margin: 0 0 8px; font-size: var(--fs-h3); line-height: 1.25; }
.routes p { margin: 0 0 12px; }
.routes a { display: block; margin-top: 4px; }
.routes p a { display: inline; margin: 0; } /* a link inside a sentence stays in the sentence */
@media (max-width: 860px) { .routes { grid-template-columns: 1fr; } }

/* Plain note box */
.note { margin: 24px 0; padding: 20px 22px; background: var(--paper-2); }
.note p { margin: 0 0 10px; }
.note p:last-child { margin-bottom: 0; }
.note .cmd { margin-top: 8px; max-width: 32em; }

/* FAQ */
.faq details { border-bottom: 1px solid var(--line); padding: 16px 0; }
.faq details:first-of-type { border-top: 1px solid var(--line); }
.faq summary { cursor: pointer; color: var(--ink); font: 600 18px/1.35 var(--serif); }
.faq details p { margin: 10px 0 0; max-width: 40em; }
.faq .cmd { margin-top: 10px; max-width: 32em; }

/* Entity chip: report icon in its type colour, left edge in the same colour */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 6px; border: 1px solid var(--line); border-left: 3px solid var(--c, var(--line)); border-radius: var(--r-chip); background: var(--paper); color: var(--ink); font-size: 14px; line-height: 1.35; }
.chip svg { width: 16px; height: 16px; flex: none; color: var(--c, currentColor); fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.c-source { --c: var(--t-source); } .c-query { --c: var(--t-query); } .c-table { --c: var(--t-table); }
.c-column { --c: var(--t-column); } .c-calc { --c: var(--t-calc); } .c-measure { --c: var(--t-measure); }
.c-calcgroup { --c: var(--t-calcgroup); } .c-visual { --c: var(--t-visual); } .c-page { --c: var(--t-page); }
.c-model { --c: var(--t-model); } .c-report { --c: var(--t-report); }

/* Figure with numbered callouts */
.fig { margin: 0; }
.fig .shot { position: relative; border: 1px solid var(--line); overflow: hidden; background: var(--paper-2); }
.fig .shot img { display: block; width: 100%; height: auto; }
/* A figure that links to the demo: a play button in the middle, teal on hover or focus. */
.fig .play-link { display: block; }
.fig .shot iframe { display: block; width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; }
.fig .shot.playing .pins { display: none; }
.fig .play { position: absolute; left: 50%; top: 50%; width: 76px; height: 76px; margin: -38px 0 0 -38px; border-radius: 50%; background: var(--ink); opacity: .88; transition: transform .15s, background .15s; }
.fig .play::after { content: ""; position: absolute; left: 30px; top: 23px; border-style: solid; border-width: 15px 0 15px 24px; border-color: transparent transparent transparent var(--paper); }
.fig .play-link:hover .play, .fig .play-link:focus-visible .play { transform: scale(1.06); background: var(--teal); opacity: 1; }
@media (max-width: 520px) { .fig .play { width: 52px; height: 52px; margin: -26px 0 0 -26px; } .fig .play::after { left: 21px; top: 16px; border-width: 10px 0 10px 16px; } }
.fig .pins { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.fig .pins circle { fill: var(--ink); stroke: var(--paper); }
.fig .pins text { fill: var(--paper); font-family: var(--sans); font-weight: 600; text-anchor: middle; }
.fig figcaption { margin-top: 14px; font-size: var(--fs-small); color: var(--ink-2); }
.fig figcaption ol { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 24px; margin: 0 0 10px; padding: 0; list-style: none; counter-reset: pin; }
.fig figcaption li { counter-increment: pin; display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 10px; }
.fig figcaption li::before { content: counter(pin); display: flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: var(--paper); font-size: 12px; font-weight: 600; }
.fig .credit { display: block; color: var(--muted); font-size: 13.5px; }
@media (max-width: 860px) { .fig figcaption ol { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .fig .pins { display: none; } .fig figcaption ol { display: none; } }

/* Verified quote */
.quote { margin: 24px 0; padding: 2px 0 2px 18px; border-left: 3px solid var(--teal); }
.quote p { margin: 0; color: var(--ink); font: italic 500 19px/1.45 var(--serif); }
.quote cite { display: block; margin-top: 8px; color: var(--muted); font: normal 13.5px/1.4 var(--sans); }
.quote cite a { color: var(--muted); }

/* Limits box */
.limits { margin: 32px 0; padding: 22px 24px; background: var(--paper-2); }
.limits h2 { margin: 0 0 10px; font-size: 22px; }
.limits ul { margin: 0; padding-left: 20px; }
.limits li { margin-bottom: 6px; }

/* Sources and related */
.refs { margin: 0; padding-left: 22px; font-size: var(--fs-small); }
.refs li { margin-bottom: 8px; }
.related { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }

/* Author */
.author { display: flex; gap: 16px; align-items: flex-start; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); }
.author img { border-radius: 50%; }
.author p { margin: 0 0 4px; font-size: var(--fs-small); }
.author .name { color: var(--ink); font-weight: 600; }

/* Answer panel (home hero) */
.answer { border: 1px solid var(--line); background: var(--paper-2); padding: 18px; }
.answer header { padding: 2px 2px 38px; }
.answer .q { margin: 0; color: var(--ink); font: 600 24px/1.3 var(--serif); }
.answer .tag { white-space: nowrap; padding: 1px 6px; border: 1px solid var(--line); border-radius: 4px; background: var(--paper); font: 500 0.78em/1.6 var(--sans); }
/* Tree: one layer per kind of object, lines drawn by site.js into svg.links behind the chips. */
.tree { position: relative; }
.tree .links { position: absolute; inset: 0; z-index: 1; overflow: visible; pointer-events: none; }
.links .link { fill: none; stroke: var(--muted); stroke-width: 1.25; }
.links marker path { fill: var(--muted); }
.flow { position: relative; border: 1.5px dotted var(--muted); border-radius: 0; padding: 22px 12px 20px; }
/* Each side's name sits on its outer edge (top for upstream, bottom for downstream), where no line runs. */
.answer .flow-h { position: absolute; left: 12px; top: -0.8em; z-index: 2; margin: 0; padding: 0 6px; white-space: nowrap; background: var(--paper-2); color: var(--ink); font: 600 14.5px/1.6 var(--sans); letter-spacing: 0; }
.answer .down .flow-h { top: auto; bottom: -0.8em; }
.answer .flow-h span { margin-left: 6px; color: var(--muted); font-size: 13px; font-weight: 400; }
.trail { margin: 0; display: grid; gap: 20px; }
.grp dd { margin: 0; display: flex; justify-content: space-around; gap: 6px; }
.up .g-measures dd { justify-content: space-between; }
.tree .chip { position: relative; z-index: 2; min-width: 0; padding: 3px 8px 3px 5px; font-size: 13.5px; }
.tree .chip svg { width: 15px; height: 15px; }
.chip .n { margin-left: 2px; color: var(--muted); font-size: 13px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.focus { display: flex; justify-content: center; padding: 20px 0; }
.tree .focus .chip { padding: 6px 14px 6px 10px; border-color: var(--c); border-radius: var(--r-pill); font-size: 15.5px; font-weight: 600; }
.tree .focus .chip svg { width: 18px; height: 18px; }
.answer footer { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 10px; padding: 26px 0 0; font-size: 12px; }
.answer footer .src { color: var(--muted); font-size: 11px; }
/* Laptops: more room between the layers and above the measure, so the lines are longer. */
@media (min-width: 1024px) { .up .trail { gap: 30px; } .down .trail { gap: 26px; } .focus { padding-top: 30px; } }
@media (max-width: 420px) {
  .answer { padding: 14px 12px; }
  .flow { padding-inline: 6px; }
  .grp dd { gap: 4px; }
  .tree .chip { gap: 4px; padding: 2px 6px 2px 4px; font-size: 12.5px; }
  .tree .chip svg { width: 13px; height: 13px; }
  .answer .flow-h { left: 8px; font-size: 13.5px; }
  .answer .flow-h span { font-size: 12px; }
}
/* On the smallest phones a layer only fits on one line without icons; the colour edge still gives the kind. */
@media (max-width: 360px) {
  .tree .grp .chip svg { display: none; }
  .tree .grp .chip { padding-left: 6px; }
}

/* Lineage line drawings (lib/lineage-art.js): chips and lines coloured from the tokens. */
.la .la-l { fill: none; stroke: var(--muted); stroke-width: 1.6; }
.la .la-ahp { fill: var(--muted); }
.la .la-box { fill: var(--paper); stroke: var(--line); }
.la .hi .la-box { stroke: currentColor; stroke-width: 1.5; }
.la .la-edge { fill: currentColor; }
.la .la-i { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.la .la-bar { fill: var(--line); }
.la .la-bar2 { opacity: .7; }
.la .dead { opacity: .7; }
.la .la-mask { fill: var(--paper-2); }
.la .la-x { fill: none; stroke: var(--bad); stroke-width: 1.8; stroke-linecap: round; }
.la .la-w { fill: var(--paper); stroke: var(--bad); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.la .la-ok { fill: none; stroke: var(--teal); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.la .k-source { color: var(--t-source); } .la .k-table { color: var(--t-table); } .la .k-column { color: var(--t-column); }
.la .k-measure { color: var(--t-measure); } .la .k-visual { color: var(--t-visual); } .la .k-page { color: var(--t-page); }
.la .k-model { color: var(--t-model); }

/* The home page's hairline pattern, shared by every page. Boxes have square corners (no radius on the box rules), and
   quotes are marked with a hairline. Laptops: frame lines at the content column's edges for the whole
   page (the home page draws its own, per section), and the route cards become hairline cells. */
.quote { border-left: 1px solid var(--line); }
.prose .hub > li { max-width: none; }
@media (min-width: 1024px) {
  /* main holds its children's margins (flow-root) and the footer's gap, so the lines meet the header and the footer. */
  body:not(.home) main { position: relative; display: flow-root; padding-bottom: var(--section); }
  body:not(.home) .foot { margin-top: 0; }
  body:not(.home) main::before { content: ""; position: absolute; z-index: 0; top: 0; bottom: 0; left: max(0px, (100% - var(--wrap)) / 2); right: max(0px, (100% - var(--wrap)) / 2); border-inline: 1px solid var(--line); pointer-events: none; }
  body:not(.home) main > * { position: relative; z-index: 1; }
  /* Feedback: the three ways to reach us. */
  .routes { gap: 0; margin-inline: calc(-1 * var(--gutter)); border-block: 1px solid var(--line); }
  .routes li { position: relative; padding: 24px; border: 0; }
  .routes li:first-child { padding-left: var(--gutter); }
  .routes li:last-child { padding-right: var(--gutter); }
  .routes li + li { border-left: 1px solid var(--line); }
  .routes li + li::after { content: ""; position: absolute; z-index: 2; pointer-events: none; background: var(--plus) left top / 11px 11px no-repeat, var(--plus) left bottom / 11px 11px no-repeat; top: -6px; bottom: -6px; left: -6px; width: 11px; }
}

/* Hover: every card on the site tints a little when the pointer is over it. The tint is set against
   the card's own background: the card colour on pages, the page colour inside the card-coloured tour,
   and a faint white on the navy trust band. The other card grids set theirs with their layout. */
.hub > li, .routes li, .views > figure, .steps > li, .facts > div, .tour-list > li { transition: background-color .15s ease; }
.hub > li:hover, .routes li:hover, .views > figure:hover, main .steps > li:hover { background-color: var(--paper-2); }
.tour-list > li:hover { background-color: var(--paper); }
.band .facts > div:hover { background-color: rgb(255 255 255 / .05); }
/* Blog and compare rows: the title's link covers the row. */
.hub > li { position: relative; }
.hub h2 a::after { content: ""; position: absolute; inset: 0; }
.hub > li:focus-within { outline: 2px solid var(--teal); outline-offset: -2px; }
.hub h2 a:focus-visible { outline: none; }
