/* Inner pages: a vacuum masthead under the header, then paper chapters, then the vacuum footer.
   No map here (One Map Rule). The world's language carries over through the marked h1
   (leader line + hollow anchor), readout labels pinned to facts, and hairlines between real rows. */

/* ---- Masthead -------------------------------------------------------------------- */
.masthead {
  background: var(--vacuum); color: var(--text);
  padding-top: calc(5.5rem + clamp(3.5rem, 2rem + 6vw, 8rem));
  padding-bottom: clamp(3.5rem, 2rem + 5vw, 7rem);
}
.masthead__title { font-size: var(--h2); font-weight: 600; line-height: 1.1; letter-spacing: -0.025em; text-wrap: balance; max-width: 22ch; }
.masthead__title.display { font-size: var(--display); max-width: 14ch; }
.masthead__lead { margin-top: var(--s-6); font-size: var(--lead); line-height: 1.5; color: var(--ice); max-width: 56ch; }

/* Facts row under the title: readout label pinned above each value, one hairline above the row. */
.masthead__facts {
  display: flex; flex-wrap: wrap; gap: var(--s-5) clamp(2rem, 1rem + 4vw, 5rem);
  margin-top: clamp(2.5rem, 1.5rem + 3vw, 4rem); padding-top: var(--s-5); border-top: 1px solid var(--hairline);
}
.masthead__facts div { display: grid; gap: var(--s-1); }
.masthead__facts dt { font-size: var(--label); font-weight: 500; letter-spacing: var(--track-label); text-transform: uppercase; color: var(--energy); }
.masthead__facts dd { font-size: var(--body); color: var(--white); }
.masthead__facts a { text-decoration-color: var(--track); }

/* ---- Document chapter: aside (contents or facts) + long-form body --------------------- */
.doc.chapter { padding-block: clamp(4rem, 2.5rem + 5vw, 8rem); }
.doc__layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(2.5rem, 1.5rem + 3vw, 4rem); }
@media (min-width: 64rem) {
  .doc__layout { grid-template-columns: minmax(14rem, 1fr) minmax(0, 2.6fr); gap: clamp(3rem, 1rem + 5vw, 8rem); align-items: start; }
  .doc__aside { position: sticky; top: 7rem; max-height: calc(100vh - 9rem); overflow: auto; }
}
.doc__main { min-width: 0; }

/* Long-form body. Headings sit closer to what follows than to what precedes. */
.doc__body { max-width: 68ch; color: var(--ink-2); }
.doc__body > * + * { margin-top: 1.1em; }
.doc__body h2 { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); font-weight: 600; line-height: 1.15; letter-spacing: -0.015em; color: var(--ink); margin-top: 2.6em; scroll-margin-top: 6rem; }
.doc__body h3 { font-size: 1.1875rem; font-weight: 600; line-height: 1.25; color: var(--ink); margin-top: 2em; scroll-margin-top: 6rem; }
.doc__body h2 + *, .doc__body h3 + * { margin-top: 0.6em; }
.doc__body > :first-child { margin-top: 0; }
.doc__body strong { font-weight: 600; color: var(--ink); }
.doc__body a { color: var(--ink); text-decoration-color: var(--detector); overflow-wrap: anywhere; }
.doc__body a:hover { text-decoration-thickness: 2px; }
.doc__lead { font-size: var(--lead); line-height: 1.5; color: var(--ink); }

/* Lists: a short leader line instead of a bullet. */
.doc__body ul > li { position: relative; padding-left: 1.75rem; }
.doc__body ul > li + li { margin-top: 0.5em; }
.doc__body ul > li::before { content: ""; position: absolute; left: 0; top: 0.8em; width: 1rem; height: 1px; background: var(--ink); opacity: 0.45; }
.doc__body ol { list-style: decimal; padding-left: 1.5rem; }
.doc__body ol > li + li { margin-top: 0.5em; }

/* Defined terms (legal definitions): term on its own line, then the text. */
.doc__body dl > div + div { margin-top: 1.1em; }
.doc__body dt { font-weight: 600; color: var(--ink); }
.doc__body dd { margin-top: 0.25em; }

/* ---- Contents navigation (aside) --------------------------------------------------- */
.toc__label, .facts dt { font-size: var(--label); font-weight: 500; letter-spacing: var(--track-label); text-transform: uppercase; color: var(--ink-3); }
.toc ol { margin-top: var(--s-4); border-top: 1px solid var(--hairline); }
.toc li { border-bottom: 1px solid var(--hairline); }
.toc a { display: block; padding: var(--s-3) 0; min-height: 44px; font-size: var(--small); line-height: 1.35; color: var(--ink-2); text-decoration: none; }
.toc a:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--detector); }
.toc a[aria-current="page"], .toc a[aria-current="location"] { color: var(--ink); font-weight: 600; }
@media (max-width: 63.99rem) {
  .toc ol { columns: 2 16rem; column-gap: var(--s-6); border-top: 0; }
  .toc li { break-inside: avoid; }
}

/* ---- Facts (aside on job posts) ------------------------------------------------------ */
.facts { display: grid; gap: 0; border-top: 1px solid var(--hairline); }
.facts > div { padding: var(--s-4) 0; border-bottom: 1px solid var(--hairline); display: grid; gap: var(--s-1); }
.facts dd { color: var(--ink); }
.facts dd a { text-decoration-color: var(--detector); }
.doc__aside .plate { margin-top: var(--s-6); width: 100%; }

/* ---- Tables (GDPR processors) --------------------------------------------------------- */
.table-scroll { position: relative; overflow-x: auto; max-width: 100%; }
.table-scroll:focus-visible { outline-offset: 2px; }
.doc table { width: 100%; min-width: 46rem; border-collapse: collapse; font-size: var(--small); line-height: 1.45; color: var(--ink-2); }
.doc th { text-align: left; vertical-align: bottom; padding: 0 var(--s-4) var(--s-3) 0; font-size: var(--label); font-weight: 500; letter-spacing: var(--track-label); text-transform: uppercase; color: var(--ink-3); border-bottom: 1px solid var(--ink); }
.doc td { vertical-align: top; padding: var(--s-4) var(--s-4) var(--s-4) 0; border-bottom: 1px solid var(--hairline); }
.doc td:first-child { font-weight: 600; color: var(--ink); }

/* ---- End of page: back link row ------------------------------------------------------ */
.doc__end { margin-top: clamp(3rem, 2rem + 3vw, 5rem); padding-top: var(--s-5); border-top: 1px solid var(--hairline); display: flex; flex-wrap: wrap; gap: var(--s-5) var(--s-7); }
.link-arrow--back svg { transform: scaleX(-1); }
.link-arrow--back:hover svg { transform: scaleX(-1) translateX(4px); }
.doc__after { margin-top: clamp(3rem, 2rem + 3vw, 5rem); }
.toc + .toc { margin-top: var(--s-7); }
.doc td a { white-space: nowrap; }
.link-arrow--back { flex-direction: row-reverse; }

/* Single date under a title (announcement), set like the home row date. */
p.masthead__facts time { color: var(--energy); }

/* Page without an aside: body keeps the reading column. */
.doc__layout--noside { display: block; }

/* Contents as a disclosure: always open on wide screens, closed on phones (site.js). */
.toc__details > summary { list-style: none; cursor: default; display: flex; align-items: center; min-height: 44px; }
.toc__details > summary::-webkit-details-marker { display: none; }
@media (max-width: 63.99rem) {
  .toc__details > summary {
    display: flex; align-items: center; justify-content: space-between; min-height: 44px; cursor: pointer;
    border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline);
  }
  .toc__details > summary::after { content: ""; width: 0.5rem; height: 0.5rem; border-right: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); transform: translateY(-25%) rotate(45deg); transition: transform 160ms var(--ease-out); }
  .toc__details[open] > summary::after { transform: translateY(25%) rotate(-135deg); }
  .toc--contents ol { margin-top: 0; }
}
.doc td.is-unlinked { color: var(--ink-3); }

/* GDPR table on phones: each row stacks, every value under its column label. */
@media (max-width: 47.99rem) {
  .doc table { min-width: 0; }
  .doc thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .doc tr, .doc td { display: block; }
  .doc tbody { border-top: 1px solid var(--ink); }
  .doc tr { padding-block: var(--s-4); border-bottom: 1px solid var(--hairline); }
  .doc td { padding: var(--s-1) 0; border: 0; }
  .doc td[data-label]:not(:first-child)::before { content: attr(data-label); display: block; font-size: var(--label); font-weight: 500; letter-spacing: var(--track-label); text-transform: uppercase; color: var(--ink-3); margin-top: var(--s-2); }
  .doc td:first-child { font-size: var(--body); }
}

/* Phones: a way back to the contents from deep in a long document (added by site.js). */
.toc-return { display: none; }
@media (max-width: 63.99rem) {
  .toc-return {
    position: fixed; right: var(--s-4); bottom: var(--s-4); z-index: 40; display: inline-flex; align-items: center; gap: var(--s-2);
    min-height: 44px; padding: 0 var(--s-4); background: var(--vacuum); color: var(--white); font-weight: 600; font-size: var(--small);
    text-decoration: none; opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity 160ms var(--ease-out), transform 160ms var(--ease-out);
  }
  .toc-return.is-shown { opacity: 1; transform: none; pointer-events: auto; }
  .toc-return svg { width: 0.875rem; height: 0.875rem; fill: none; stroke: currentColor; stroke-width: 1.75; }
  .toc-return:focus-visible { outline: 2px solid var(--detector); outline-offset: 3px; }
}

/* Job posts: the application action again where the reader decides (phones; desktop keeps the sticky aside). */
.doc__end-plate { display: none; }
@media (max-width: 63.99rem) { .doc__end .doc__end-plate { display: flex; width: 100%; min-height: 3.5rem; } }

/* Legal pages on phones: deliver the document sooner. */
@media (max-width: 47.99rem) {
  .page-legal.masthead { padding-top: 7rem; padding-bottom: var(--s-6); }
  .page-legal .masthead__facts { margin-top: var(--s-5); }
  .page-legal.doc.chapter { padding-top: 2.5rem; }
  .page-legal .doc__layout { gap: var(--s-5); }
  .page-legal .toc + .toc { margin-top: var(--s-5); }
}
