/*
 * SwipePic — shared stylesheet for the legal pages
 * (support.html, privacy-policy.html, privacy-choices.html).
 *
 * Always black on white: no dark mode, no web fonts, nothing third-party.
 *
 * Tables: wrap each <table> in <div class="table-wrap"> so it scrolls
 * sideways on narrow screens instead of widening the page.
 * Back-to-top links: <a class="back-to-top" href="#top"> (the "#top"
 * fragment scrolls to the start of the document without needing an id).
 */

/* ---------- Tokens ---------- */

:root {
  --text: #111;
  --bg: #fff;
  --muted: #555;        /* 7.4:1 on white */
  --border: #ddd;
  --link: #0b4fd8;      /* 6.7:1 on white */
  --surface: #f6f7f8;
  --accent: var(--link);
  --focus: var(--link);

  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --measure: 46rem;
  --gutter: 1rem;       /* 16 px minimum side padding on phones */

  color-scheme: light;
}

@media (min-width: 40em) {
  :root {
    --gutter: 1.5rem;
  }
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem; /* 17 px */
  line-height: 1.65;
  overflow-wrap: break-word;
}

main {
  display: block;
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 2rem var(--gutter) 3rem;
}

/* ---------- Typography ---------- */

h1,
h2,
h3 {
  line-height: 1.25;
  color: var(--text);
}

h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0.5rem 0 0.75rem;
}

h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 2.75rem 0 0.75rem;
}

h3 {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 1.75rem 0 0.5rem;
}

p,
ul,
ol,
dl,
address {
  margin: 0 0 1rem;
}

ul,
ol {
  padding-left: 1.5rem;
}

li + li {
  margin-top: 0.35rem;
}

dt {
  font-weight: 700;
}

dd {
  margin: 0 0 0.75rem;
}

address {
  font-style: normal;
}

strong {
  font-weight: 700;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.05em 0.3em;
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 3.5rem 0;
}

/* Language sections: leave a little room above when jumped to. */
main > section[id] {
  scroll-margin-top: 1rem;
}

/* ---------- Links & focus ---------- */

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---------- Skip link ---------- */

.skip-link {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
  border-radius: 4px;
  transform: translateY(-200%);
}

.skip-link:focus,
.skip-link:focus-visible {
  transform: none;
  outline-color: var(--text);
  outline-offset: 3px;
}

/* ---------- Site header ---------- */

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  /* Full-width border, contents aligned with the main column. */
  padding: 1rem max(var(--gutter), calc((100% - var(--measure)) / 2));
  border-bottom: 1px solid var(--border);
}

.site-header .brand {
  color: var(--text);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.site-header .brand:hover {
  text-decoration: underline;
}

.site-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  font-size: 0.9375rem;
}

.site-header nav a {
  color: var(--text);
  text-decoration: none;
}

.site-header nav a:hover,
.site-header nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

.site-header nav a[aria-current="page"] {
  font-weight: 600;
}

/* ---------- Language switch ---------- */

.lang-switch {
  margin: 0 0 1.5rem;
  font-size: 0.9375rem;
  color: var(--muted);
}

.lang-switch a {
  font-weight: 600;
}

/* ---------- "Last updated" line ---------- */

.meta {
  margin: 0 0 1.5rem;
  font-size: 0.875rem;
  color: var(--muted);
}

/* ---------- Callout ("In short" summary) ---------- */

.callout {
  margin: 1.5rem 0 2rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 0 6px 6px 0;
}

.callout > :first-child {
  margin-top: 0;
}

.callout > :last-child {
  margin-bottom: 0;
}

.callout h2,
.callout h3 {
  margin-top: 0;
  font-size: 1.0625rem;
}

/* ---------- Table of contents ---------- */

.toc {
  margin: 0 0 2rem;
  padding: 0.75rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.9375rem;
}

.toc > :last-child {
  margin-bottom: 0;
}

.toc h2,
.toc h3,
.toc .toc-title {
  margin: 0 0 0.35rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.toc ul,
.toc ol,
ul.toc,
ol.toc {
  padding-left: 1.25rem;
}

.toc li + li {
  margin-top: 0.2rem;
}

/* ---------- Tables ---------- */

.table-wrap {
  margin: 0 0 1.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: 6px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  line-height: 1.5;
  margin: 0 0 1.5rem;
}

.table-wrap > table {
  margin: 0;
  min-width: 32rem; /* keep columns readable; the wrapper scrolls instead */
}

caption {
  padding: 0 0 0.5rem;
  text-align: left;
  font-weight: 600;
  color: var(--muted);
}

th,
td {
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.table-wrap th,
.table-wrap td {
  border-width: 0 0 1px 1px;
}

.table-wrap tr > :first-child {
  border-left: 0;
}

.table-wrap tr:last-child > td {
  border-bottom: 0;
}

thead th,
th[scope="col"] {
  background: var(--surface);
  font-weight: 700;
}

/* ---------- Back to top ---------- */

.back-to-top {
  display: inline-block;
  margin-top: 1.5rem;
  font-size: 0.875rem;
}

/* ---------- Site footer ---------- */

.site-footer {
  padding: 1.5rem max(var(--gutter), calc((100% - var(--measure)) / 2)) 2.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--muted);
}

.site-footer nav,
.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin: 0 0 0.75rem;
  padding: 0;
  list-style: none;
}

.site-footer li + li {
  margin-top: 0;
}

.site-footer a {
  color: var(--muted);
}

.site-footer a:hover {
  color: var(--text);
}

.site-footer p {
  margin: 0;
}

/* ---------- Print ---------- */

@media print {
  @page {
    margin: 2cm;
  }

  :root {
    --text: #000;
    --muted: #000;
    --link: #000;
    --surface: #fff;
  }

  body {
    font-size: 11pt;
    line-height: 1.5;
    color: #000;
    background: #fff;
  }

  .skip-link,
  .site-header,
  .site-footer,
  .lang-switch,
  .back-to-top {
    display: none !important;
  }

  main {
    max-width: none;
    padding: 0;
  }

  a,
  a:visited {
    color: #000;
    text-decoration: underline;
  }

  a[href]::after {
    content: none !important;
  }

  .callout {
    border-color: #000;
    border-left-width: 3px;
  }

  .table-wrap {
    overflow: visible;
  }

  .table-wrap > table {
    min-width: 0;
  }

  h1,
  h2,
  h3 {
    break-after: avoid;
  }

  tr,
  .callout {
    break-inside: avoid;
  }
}
