/* SocialSecretary — documentation stylesheet
   https://socialsecretary.pub
   SPDX-License-Identifier: AGPL-3.0-or-later
   Copyright (C) 2026 Rob Reed and SocialSecretary contributors

   Applied to the HTML that pandoc produces from docs/*.md. The tokens are
   the home page's, so the guide and the page read as one site. Styles only
   the elements pandoc emits from GitHub-flavored markdown: headings,
   paragraphs, lists, code, tables, rules, emphasis, links. Nothing here
   depends on a class pandoc might rename. */

:root {
  --paper: #F7F6F1;
  --ink:   #22302B;
  --ink-2: #4C5A54;
  --verdigris: #1F6E5B;
  --rule:  #D7D9D2;
  --ground:#EDEEE8;
  --measure: 70ch;
}

* { box-sizing: border-box; }

html { background: var(--paper); color: var(--ink); }

body {
  margin: 0 auto;
  max-width: calc(var(--measure) + 4rem);
  padding: 3rem 2rem 6rem;
  font-family: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  font-size: 1.125rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* pandoc's own inline style sets code{white-space: pre-wrap}; we keep that
   for inline code and let blocks scroll instead of wrapping. */

h1, h2, h3, h4 {
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
h1 { font-size: 2.4rem; margin: 0 0 0.25rem; }
h1 + h2 { margin-top: 0.25rem; color: var(--ink-2); font-size: 1.25rem; }  /* the "Version N — date" line */
h2 { font-size: 1.7rem; margin: 3rem 0 1rem; }
h3 { font-size: 1.25rem; margin: 2.25rem 0 0.75rem; }
h4 { font-size: 1.05rem; margin: 1.75rem 0 0.5rem; }

/* Every heading is an anchor target; give the reader a way to see the URL. */
h2:target, h3:target { color: var(--verdigris); }

p  { max-width: var(--measure); margin: 0 0 1.1rem; }
ul, ol { max-width: var(--measure); padding-left: 1.4rem; margin: 0 0 1.25rem; }
li { margin-bottom: 0.4rem; }
li > p { margin-bottom: 0.4rem; }

a { color: var(--verdigris); text-decoration-thickness: 1px; text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 2px solid var(--verdigris); outline-offset: 3px; border-radius: 2px; }

strong { font-weight: 700; }
em { font-style: italic; }

pre, code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.92rem;
}
code {
  background: var(--ground);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}
pre {
  background: var(--ground);
  border-left: 3px solid var(--rule);
  padding: 1.1rem 1.4rem;
  margin: 1.25rem 0 1.75rem;
  overflow-x: auto;
  line-height: 1.5;
}
pre code {
  background: none;
  padding: 0;
  white-space: pre;      /* override pandoc's pre-wrap: commands must not wrap mid-token */
}

/* Tables: the file-roles and route tables are the most scanned things in
   the guide. Hairlines only, no zebra, generous cell padding, left-aligned. */
table {
  border-collapse: collapse;
  width: 100%;
  margin: 1.25rem 0 1.75rem;
  font-size: 1rem;
  line-height: 1.45;
}
th, td {
  text-align: left;
  vertical-align: top;
  padding: 0.6rem 0.9rem 0.6rem 0;
  border-bottom: 1px solid var(--rule);
}
th { font-weight: 400; color: var(--ink-2); border-bottom-color: var(--ink-2); }
td code { white-space: nowrap; }

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

blockquote {
  margin: 1.25rem 0;
  padding-left: 1.25rem;
  border-left: 3px solid var(--rule);
  color: var(--ink-2);
}

/* The license footer pandoc renders from the trailing italic line. */
body > p:last-child { margin-top: 3rem; color: var(--ink-2); font-size: 0.95rem; }

@media (max-width: 40rem) {
  body { padding: 2rem 1.25rem 4rem; }
  h1 { font-size: 1.9rem; }
  table { display: block; overflow-x: auto; }
  td code { white-space: normal; }
}

@media print {
  html { background: #fff; }
  body { max-width: none; padding: 0; font-size: 11pt; }
  pre { border: 1px solid var(--rule); page-break-inside: avoid; }
  a { color: var(--ink); text-decoration: none; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.85em; color: var(--ink-2); }
}
