/* PAQ Research theme for Outline document content.
 * Linked from every page: the image build adds it to Outline's index.html (paq-wiki/Dockerfile),
 * the local dev stack's nginx injects it (outline-local/nginx.conf). Fonts are served from the
 * same origin because Outline's CSP only allows 'self' for fonts. Paths are relative, so the
 * theme works under any folder.
 * Sizes follow the PAQ Google Docs template (pt -> px at 96 dpi). */
@import url("fonts.css");

/* The colours below are defaults: admins can override --paq-text and --paq-toc-active, and add
 * CSS, in Settings → Document theme (outline-patches 0015), without a new image. That page
 * shows these values as its defaults (PaqThemeDefaults in shared/utils/paqTheme.ts), so change
 * both together. */
:root {
  --paq-blue: #001056;
  --paq-serif: "Source Serif 4", Georgia, serif;
  --paq-sans: "Montserrat", "Helvetica Neue", Arial, sans-serif;
  --paq-text: var(--paq-blue);
  --paq-toc-active: var(--paq-blue);
}

/* Dark mode: a warm light gray chosen by the graphics team (2026-11-25), for
 * the text and for the active Contents entry (the team accent #001056 is
 * unreadable on the dark background). It replaced Light Blue #cfe2ff and the
 * mid light blue #5e91ff.
 * Outline sets no class for dark mode, but it does keep
 * <meta name="color-scheme"> in sync with the chosen theme (also when the
 * theme follows the system setting, and back to light for printing). */
:root:has(meta[name="color-scheme"][content="dark"]) {
  --paq-text: #D4CFCE;
  --paq-toc-active: #D4CFCE;
}

/* Contents panel (table of contents beside the document): the active and
 * hovered entries use the team accent, which is too dark in dark mode.
 * Hooks `data-paq-toc` and `aria-current` come from the PAQ patch in
 * app/scenes/Document/components/Contents.tsx (image 1.12.0-paq4+). */
[data-paq-toc] a[aria-current="location"],
[data-paq-toc] a[aria-current="location"] span,
[data-paq-toc] a:hover {
  color: var(--paq-toc-active) !important;
}

/* Body text in documents */
.ProseMirror {
  font-family: var(--paq-serif) !important;
  color: var(--paq-text) !important;
  --font-size-h1: 32px;      /* 24pt */
  --font-size-h2: 29.33px;   /* 22pt */
  --font-size-h3: 26.67px;   /* 20pt */
  --font-size-h4: 24px;      /* 18pt */
  --font-size-h5: 21.33px;   /* 16pt */
  --font-size-h6: 18.67px;   /* 14pt */
}

/* Bold like Google Docs (700); Outline's default is 600 */
.ProseMirror b,
.ProseMirror strong {
  font-weight: 700 !important;
}

/* Justified body text like the PAQ Google Docs template. Table cells keep
 * their own alignment. */
.ProseMirror p,
.ProseMirror li {
  text-align: justify !important; /* Outline sets `ul li { text-align: start }` */
}
.ProseMirror td p,
.ProseMirror th p {
  text-align: inherit !important;
}

/* A paragraph of only images (ImageRowPlugin) starts at the left like text, as
 * in Google Docs; justify would stretch the spaces between them. */
.ProseMirror p.image-row-block {
  text-align: left !important;
}

/* Headings: Montserrat, H1 bold, the rest regular */
.ProseMirror h1, .ProseMirror h2, .ProseMirror h3,
.ProseMirror h4, .ProseMirror h5, .ProseMirror h6 {
  font-family: var(--paq-sans) !important;
  color: var(--paq-text) !important;
  font-weight: 400 !important;
}
.ProseMirror h1 { font-weight: 700 !important; }

/* H2–H6: Source Serif 4 bold (sizes unchanged) */
.ProseMirror h2,
.ProseMirror h3,
.ProseMirror h4,
.ProseMirror h5,
.ProseMirror h6 {
  font-family: var(--paq-serif) !important;
  font-weight: 700 !important;
}

/* Document title (aria-label is localized) */
[aria-label="Document title"], [aria-label="Název dokumentu"] {
  font-family: var(--paq-sans) !important;
  color: var(--paq-text) !important;
  font-weight: 700 !important;
}

/* Lists: indent the first level one character more than Outline's default
 * (margin-left: -26px), closer to Google Docs. Nested levels move with it. */
.ProseMirror > ul:not(.checkbox_list),
.ProseMirror > ol {
  margin-left: calc(-26px + 1ch) !important;
}

/* Keep code in a monospace font */
.ProseMirror code, .ProseMirror pre { font-family: var(--font-family-mono, monospace) !important; }

/* Tables: Montserrat by default, headings included (matches the default in
 * shared/editor/marks/Font.ts, so the toggle switches cells to Source Serif 4) */
.ProseMirror table,
.ProseMirror table h1, .ProseMirror table h2, .ProseMirror table h3,
.ProseMirror table h4, .ProseMirror table h5, .ProseMirror table h6 {
  font-family: var(--paq-sans) !important;
}

/* Font overrides from the editor's font toggle ("Aa" in the formatting bar) */
.ProseMirror [data-font="sans"] {
  font-family: var(--paq-sans) !important;
}
.ProseMirror [data-font="serif"] {
  font-family: var(--paq-serif) !important;
}
