/*
  Legal (/privacy/) and 404 (/404.html) styles.
  /privacy/ is a plain reading document: a white page, a centred title and date, and one compact
  text column set in Inter. /404.html keeps one opaque editorial card.
  Page rules are wrapped in @layer pages; colour tokens come from site.css.
*/

/* Inter, used on /privacy/ only. SIL Open Font License 1.1: /assets/fonts/OFL-Inter.txt */
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-var-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-var-latin-ext.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@layer pages {
  /* The notice page is plain paper: flat white (the flat Amber Night canvas in the dark theme), no backdrop light, no grain. */
  .legal-page {
    --legal-paper: #FFFFFF;
    --atmo-bg: none;
    background-color: var(--legal-paper);
  }

  :root[data-theme="dark"] .legal-page {
    --legal-paper: var(--color-canvas);
  }

  .legal-page .grain {
    display: none;
  }

  /* Document type: Inter at its true size (the site-wide font-size-adjust is tuned for Nunito and Quicksand). */
  .legal {
    padding-block-start: clamp(6.25rem, 9vw, 7.5rem);
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 1rem;
    font-size-adjust: none;
    line-height: 1.6;
  }

  .legal :where(h1, h2, h3) {
    font-family: inherit;
    font-size-adjust: none;
  }

  /* One centred reading column. .wrap keeps equal side gutters at every width. */
  .legal__inner {
    max-inline-size: 40rem;
  }

  /* Centred title and date, then text straight on the page. No cards, panels or tables. */
  .legal__header {
    text-align: center;
  }

  .legal .page-title {
    font-size: clamp(1.75rem, 1.45rem + 1.3vw, 2.125rem);
    line-height: 1.2;
    letter-spacing: -0.02em;
  }

  .legal__meta {
    margin-block-start: 0.625rem;
    color: var(--color-text-secondary);
    font-size: 0.875rem;
  }

  .legal__applies {
    margin-block-start: clamp(1.5rem, 3.5vw, 2rem);
    text-align: start;
  }

  .legal__body {
    max-inline-size: none;
    margin-block-start: 0.875rem;
  }

  .legal__body > * + * {
    margin-block-start: 0.875rem;
  }

  .legal__body :where(h2, h3) {
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.01em;
  }

  .legal__body :where(h2) {
    margin-block-start: 2.25rem;
    font-size: 1.25rem;
  }

  .legal__body :where(h3) {
    margin-block-start: 1.5rem;
    font-size: 1.0625rem;
  }

  .legal__body :where(h2, h3) + * {
    margin-block-start: 0.5rem;
  }

  .legal__body :where(h2) + :where(h3) {
    margin-block-start: 0.875rem;
  }

  .legal__body :where(li + li) {
    margin-block-start: 0.375rem;
  }

  .legal__body :where(li)::marker {
    color: var(--color-text-secondary);
    font-weight: 400;
  }

  .legal__body :where(strong) {
    font-weight: 600;
  }

  /* Long addresses and links wrap instead of pushing the page sideways on narrow phones */
  .legal__body :where(a) {
    overflow-wrap: anywhere;
  }

  /* Contents: one quiet row between two hairlines that opens the list of sections (native <details>, works with scripts off) */
  .legal__toc {
    margin-block-start: 1.5rem;
    border-block: 1px solid var(--color-hairline);
  }

  .legal__toc details {
    padding-inline: 0;
    border: 0;
    border-radius: 0;
    background-color: transparent;
    box-shadow: none;
  }

  .legal__toc summary {
    min-block-size: 3rem;
    padding-block: 0.75rem;
    color: var(--color-text);
    font-family: inherit;
    font-size: inherit;
    font-size-adjust: none;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0;
  }

  .legal__toc summary::after {
    inline-size: 0.5rem;
    block-size: 0.5rem;
    margin-inline-end: 0.25rem;
    border: solid currentColor;
    border-width: 0 2px 2px 0;
    border-radius: 0;
    background: none;
    rotate: 45deg;
    translate: 0 -0.125rem;
  }

  .legal__toc details[open] > summary::after {
    rotate: 225deg;
    translate: 0 0.125rem;
  }

  .legal__toc ol {
    max-inline-size: none;
    margin-block: 0 1rem;
    color: inherit;
  }

  .legal__toc li + li {
    margin-block-start: 0;
  }

  .legal__toc a {
    display: block;
    inline-size: fit-content;
    padding-block: 0.3125rem;
  }

  @media (min-width: 40rem) {
    .legal__toc ol {
      columns: 2;
      column-gap: 2.5rem;
    }

    .legal__toc li {
      break-inside: avoid;
    }
  }

  /* Wider screens: the compact size legal pages are usually set in */
  @media (min-width: 48rem) {
    .legal {
      font-size: 0.9375rem;
      line-height: 1.65;
    }
  }

  /* Printed copy: the notice only */
  @media print {
    .site-header,
    .site-footer,
    .scroll-progress,
    .grain,
    .skip-link,
    .legal__toc {
      display: none;
    }

    .legal {
      padding-block-start: 0;
    }
  }

  /* 404 page: clears the floating header pill with one opaque editorial card */
  .not-found-section {
    padding-block: clamp(6.75rem, 10vw, 8.5rem) clamp(3.5rem, 7.5vw, 6rem);
  }

  .not-found {
    max-inline-size: 44rem;
    padding: clamp(1.75rem, 4.5vw, 3rem);
  }
}
