/* page: every page but home (build.py adds it). The masthead on a pane of the blue glass, then one of the templates on
 * marble: feature, compare, scenario, index, faq, text (long-form), sections (full-width home-style sections).
 * Tokens only; see ../../DESIGN.md "Pages" and ../../README.md for the markup each template expects. */

/* Masthead: breadcrumb, title, lede, the checked line. Pulls up under the glass header like the hero. */
.mast { position: relative; isolation: isolate; margin-top: calc(-1 * var(--top-h));
  padding: calc(var(--top-h) + var(--space-7)) 0 var(--space-8);
  box-shadow: inset 0 -1px 0 rgb(255 255 255 / 0.35), inset 0 -28px 32px -24px var(--glass-shade); }
.on-blue.mast { background-image: var(--glass-pane); }
.mast-in { display: grid; gap: var(--space-4); justify-items: start; }
.mast h1 { font-size: var(--text-title); line-height: 0.95; letter-spacing: -0.005em; max-width: 16em; }
.mast .lede { color: var(--white); max-width: 34em; }
.byline { font-size: var(--text-sm); margin-top: var(--space-2); }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center;
  column-gap: var(--space-2); font-size: var(--text-sm); }
.crumbs li + li::before { content: "/" / ""; margin-inline-end: var(--space-2); }
.crumbs a { display: inline-block; padding-block: var(--space-2); color: inherit; white-space: nowrap; }

/* The page column under the masthead: the template's blocks, stacked. */
.page-body { display: grid; gap: var(--space-9); padding-block: var(--space-8) var(--space-9); }
.page-body h2 { font-size: var(--text-2xl); line-height: 1.05; }

/* The short answer first (compare, scenario): one panel on white. */
.answer { max-width: 52rem; background: var(--surface); border-radius: var(--radius-panel); padding: var(--space-6); }
.answer p { font: 400 var(--text-xl) / 1.3 var(--font-display); letter-spacing: 0.005em; color: var(--ink); text-wrap: pretty; }

/* Feature and scenario: a real screen that stays put beside the text blocks. */
.split { display: grid; grid-template-columns: minmax(0, 17rem) minmax(0, 1fr); gap: var(--space-9); align-items: start; }
.split-fig { position: sticky; top: calc(var(--top-h) + var(--space-5)); }
.split-text { display: grid; gap: var(--space-8); max-width: 44rem; }
.block { display: grid; gap: var(--space-4); align-content: start; }
.block > p { color: var(--ink-2); max-width: var(--measure); }
.note { font-size: var(--text-sm); color: var(--ink-2); }

/* A real sequence of steps, numbered (only where order matters). */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 2.25rem minmax(0, 1fr); column-gap: var(--space-3);
  padding-block: var(--space-4); border-top: var(--rule) solid var(--vein); }
.steps li::before { content: counter(step); grid-row: span 2; font: 300 var(--text-2xl) / 0.9 var(--font-display); color: var(--accent); }
.steps h3 { font-size: var(--text-xl); margin-bottom: var(--space-2); }
.steps p { color: var(--ink-2); }

/* What it cannot do: the one panel on ink. */
.limits { display: grid; gap: var(--space-6); padding: var(--space-7); border-radius: var(--radius-panel);
  background: var(--deep); color: var(--on-deep); --ink: var(--on-deep); --ink-2: var(--on-deep-2); --vein: var(--deep-line);
  --link: var(--deep-link); --accent: var(--night-blue); }
.limits ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: var(--space-6); }
.limits li { display: grid; gap: var(--space-2); align-content: start; padding-top: var(--space-4); border-top: var(--rule) solid var(--vein); }
.limits h3 { font-size: var(--text-xl); }
.limits p { color: var(--ink-2); }

/* Compare: the table. The Secrates column sits on white; under 641px each row's label takes its own line above the two
 * answers (build.py gives the table explicit ARIA roles, so it stays a table to screen readers whatever its display). */
.compare { width: 100%; border-collapse: collapse; }
.compare caption { caption-side: top; text-align: start; padding-bottom: var(--space-5);
  font: 500 var(--text-2xl) / 1.05 var(--font-display); text-wrap: balance; }
.compare thead :is(th, td) { padding: var(--space-4); border-bottom: 2px solid var(--ink); text-align: start;
  font: 500 var(--text-xl) / 1.1 var(--font-display); }
.compare tbody tr { border-bottom: var(--rule) solid var(--vein); }
.compare tbody th { width: 26%; padding-block: var(--space-4); padding-inline: 0 var(--space-4); text-align: start; vertical-align: top;
  font: 500 var(--text-lg) / 1.2 var(--font-display); }
.compare td { padding: var(--space-4); vertical-align: top; color: var(--ink-2); }
.compare tr > :nth-child(2) { background: var(--surface); color: var(--ink); }
.compare thead tr > :nth-child(2) { border-radius: var(--radius-panel) var(--radius-panel) 0 0; }

/* Compare: where each side is the better choice, side by side. */
.weigh { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-7); }
.weigh section { display: grid; gap: var(--space-4); align-content: start; padding-top: var(--space-4); border-top: 2px solid var(--ink); }
.weigh ul, .sources ul { margin: 0; padding-inline-start: 1.25em; display: grid; gap: var(--space-2); }
.weigh li { color: var(--ink-2); }
.weigh li::marker, .sources li::marker { color: var(--ink-2); }

/* What a page's outside facts are based on: small, with links. */
.sources { display: grid; gap: var(--space-4); max-width: 44rem; }
.sources li { font-size: var(--text-sm); color: var(--ink-2); }

/* Related pages: a ledger (base.css); hidden while the folder has no other page. */
.related { display: grid; gap: var(--space-5); }
.related:not(:has(.ledger)) { display: none; }

/* Index: the folder's ledger straight under the masthead. */
.tpl-index { gap: var(--space-7); }

/* Text: long pages (privacy, terms, support, credits). Contents beside one readable column when there are three or more
 * headings; otherwise the column alone. */
.text-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.2fr); gap: var(--space-6) var(--space-8);
  align-items: start; padding-block: var(--space-8) var(--space-9); }
.text-grid:has(> .text-side:empty) { grid-template-columns: minmax(0, 1fr); }
.text-side:empty { display: none; }
.toc summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: var(--space-3);
  font: 500 var(--text-lg) / 1 var(--font-display); letter-spacing: 0.01em; color: var(--ink);
  border-block: var(--rule) solid var(--vein); list-style: none; }
.toc summary::-webkit-details-marker { display: none; }
.toc summary::after { content: ""; width: 0.5rem; height: 0.5rem; margin-inline: auto var(--space-2);
  border: solid var(--ink-2); border-width: 0 1.5px 1.5px 0; rotate: 45deg; translate: 0 -25%; }
.toc[open] summary::after { rotate: 225deg; translate: 0 25%; }
.toc[open] summary { margin-bottom: var(--space-3); }
.toc ul { list-style: none; margin: 0; padding: 0; border-inline-start: var(--rule) solid var(--vein); }
.toc a { display: block; padding-block: var(--space-1); padding-inline: var(--space-4) 0; margin-inline-start: calc(-1 * var(--rule));
  border-inline-start: 2px solid transparent; color: var(--ink-2); text-decoration: none;
  font: 400 var(--text-lg) / 1.2 var(--font-display); letter-spacing: 0.01em;
  transition: color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out); }
.toc a:hover { color: var(--ink); border-inline-start-color: var(--accent); }
.toc a:focus-visible { outline-offset: 0; }

.prose { max-width: 40em; min-width: 0; }
.prose > * + *, .prose section > * + * { margin-top: var(--space-4); }
.prose h2 { font-size: var(--text-2xl); line-height: 1.05; margin-top: var(--space-7); padding-top: var(--space-5);
  border-top: var(--rule) solid var(--vein); scroll-margin-top: calc(var(--top-h) + var(--space-4)); }
.prose h2:target { border-top-color: var(--accent); }
.prose > h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.prose h3 { font-size: var(--text-lg); margin-top: var(--space-5); }
.prose p, .prose li { color: var(--ink); }
.prose ul, .prose ol { padding-inline-start: 1.25em; }
.prose li + li { margin-top: var(--space-2); }
.prose li::marker { color: var(--ink-2); }
.prose table { border-collapse: collapse; width: 100%; font-size: var(--text-sm); display: block; overflow-x: auto; }
.prose th, .prose td { text-align: start; vertical-align: top; padding-block: var(--space-2); padding-inline: 0 var(--space-3); border-bottom: var(--rule) solid var(--vein); }
.prose th { font-family: var(--font-mono); font-weight: 400; font-size: var(--text-xs); letter-spacing: var(--tracking-mono); text-transform: uppercase; color: var(--ink-2); }
.prose code { font-family: var(--font-mono); font-size: 0.9em; }
.page-text .prose > p:first-child { font-size: var(--text-lg); line-height: 1.5; }

/* Terms: Apple's Standard EULA, which applies too, on white above the terms. */
.prose .eula { background: var(--surface); border-radius: var(--radius-panel); padding: var(--space-5) var(--space-6); }
/* Privacy: the short version is the page's summary, so it sits on white as one panel (heading + list). */
.prose #the-short-version { background: var(--surface); border-top: 0; margin-top: var(--space-7);
  padding: var(--space-6) var(--space-6) 0; border-radius: var(--radius-panel) var(--radius-panel) 0 0; }
.prose #the-short-version + ul { background: var(--surface); margin-top: 0; list-style: none;
  padding: var(--space-4) var(--space-6) var(--space-5); border-radius: 0 0 var(--radius-panel) var(--radius-panel); }
.prose #the-short-version + ul li { font-size: var(--text-lg); line-height: 1.45; padding-block: var(--space-3); }
.prose #the-short-version + ul li + li { margin-top: 0; border-top: var(--rule) solid var(--vein); }
/* Support: the limit nobody can get around, on ink. */
.prose .key { background: var(--deep); color: var(--on-deep); --ink: var(--on-deep); --vein: var(--deep-line); --link: var(--deep-link);
  border-radius: var(--radius-panel); padding: var(--space-6); margin-top: var(--space-8); }
.prose .key h2 { margin-top: 0; padding-top: 0; border-top: 0; }

/* 404: the masthead is the page. */
.page-404 .mast { min-height: 60svh; display: grid; align-content: center; }
.page-404 .mast h1 { font-size: var(--text-display); line-height: 0.9; }

@media (min-width: 861px) {
  @supports selector(::details-content) {
    .toc summary { display: none; }
    .toc::details-content { content-visibility: visible; display: block; }
  }
  .text-side { position: sticky; top: calc(var(--top-h) + var(--space-4)); max-height: calc(100svh - var(--top-h) - 2 * var(--space-4)); overflow-y: auto; }
}
@media (max-width: 860px) {
  .split { grid-template-columns: minmax(0, 1fr); gap: var(--space-7); }
  .split-fig { position: static; max-width: 16rem; }
  .weigh { grid-template-columns: minmax(0, 1fr); }
  .text-grid { grid-template-columns: minmax(0, 1fr); padding-top: var(--space-6); gap: var(--space-6); }
  .toc a { padding-block: var(--space-2); }
  .prose #the-short-version { padding-inline: var(--space-5); margin-top: var(--space-6); }
  .prose #the-short-version + ul { padding-inline: var(--space-5); }
  .prose .key { padding: var(--space-5); }
}
@media (max-width: 640px) {
  .page-body { gap: var(--space-8); padding-top: var(--space-7); }
  .answer, .limits { padding: var(--space-5); }
  .compare, .compare thead, .compare tbody { display: block; }
  .compare tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .compare thead td { display: none; }
  .compare thead th { font-size: var(--text-lg); padding: var(--space-3); }
  .compare tbody th { grid-column: 1 / -1; width: auto; padding: var(--space-4) 0 var(--space-2); }
  .compare td { padding: var(--space-3); font-size: var(--text-sm); }
}
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .on-blue.mast { background-image: none; }
}
