/* Dark Grey & Royal Blue theme
   Use with: pandoc input.md --css mh.css -o output.html --standalone -M document-css=false
*/

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,400;0,700;1,400&family=Newsreader:ital,wght@0,400;0,700;1,400&display=swap');

:root {
  --ink: #262626;
  --muted: #6b6b6b;
  --panel: #ece8df;
  --text: #2b2b2b;
  --bg: #f3efe5;
  --blue: #2d67b9;
  --blue-light: #e1e9f4;
}

html {
  color: var(--text);
  background-color: var(--bg);
}

/* Nav bar */

.site-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2em;
  padding: 1em 2em;
  background-color: var(--panel);
  font-family: 'Newsreader', Georgia, 'Times New Roman', serif;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 1.05em;
  letter-spacing: 0.02em;
  padding-bottom: 0.2em;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--text);
  border-bottom-color: var(--blue);
}

.site-nav a.active {
  color: var(--text);
  border-bottom-color: var(--blue);
}

body {
  font-family: 'Newsreader', Georgia, 'Times New Roman', serif;
  font-size: 18px;
  line-height: 1.65;
  margin: 0 auto;
  max-width: 42em;
  padding: 50px;
  hyphens: auto;
  overflow-wrap: break-word;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Newsreader', Georgia, serif;
  color: var(--ink);
  margin-top: 1.5em;
  line-height: 1.3;
}

h1 {
  border-bottom: 3px solid var(--blue);
  padding-bottom: 0.3em;
}

h2 {
  border-bottom: 1px solid var(--blue-light);
  padding-bottom: 0.2em;
}

a {
  color: var(--blue);
  text-decoration: underline;
  text-decoration-color: var(--blue);
}

a:hover {
  color: var(--blue);
}

a:visited {
  color: var(--ink);
}

blockquote {
  margin: 1em 0 1em 1.7em;
  padding-left: 1em;
  border-left: 3px solid var(--blue);
  color: var(--ink);
  background-color: var(--panel);
  padding: 0.6em 1em;
}

code {
  font-family: 'JetBrains Mono', Menlo, Consolas, 'Lucida Console', monospace;
  font-size: 85%;
  background-color: var(--panel);
  color: var(--blue);
  padding: 0.2em 0.4em;
  border-radius: 3px;
}

pre {
  background-color: var(--panel);
  color: var(--ink);
  padding: 1em;
  border-radius: 4px;
  overflow: auto;
}

pre code {
  background-color: transparent;
  color: inherit;
  padding: 0;
}

/* Code blocks: line numbers + copy button */

.sourceCode {
  position: relative;
}

.copy-button {
  position: absolute;
  top: 0.5em;
  right: 0.5em;
  font-family: 'JetBrains Mono', Menlo, Consolas, 'Lucida Console', monospace;
  font-size: 0.75em;
  padding: 0.3em 0.6em;
  border: 1px solid var(--blue-light);
  border-radius: 3px;
  background-color: var(--bg);
  color: var(--blue);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.sourceCode:hover .copy-button,
.copy-button:focus-visible {
  opacity: 1;
}

.copy-button:hover {
  background-color: var(--blue);
  color: #ffffff;
  border-color: var(--blue);
}

/* Pandoc emits its own numberSource line-numbering rules inline;
   these overrides just re-theme them. */

pre.numberSource {
  border-left: 1px solid var(--blue-light);
}

pre.numberSource code > span > a:first-child {
  text-decoration: none;
}

pre.numberSource code > span > a:first-child::before {
  color: var(--muted);
}

hr {
  border: none;
  border-top: 2px solid var(--blue);
  margin: 2em 0;
}

table {
  margin: 1em 0;
  border-collapse: collapse;
  width: 100%;
}

th {
  background-color: var(--ink);
  color: #ffffff;
  padding: 0.5em 0.75em;
  text-align: left;
}

td {
  padding: 0.4em 0.75em;
  border-bottom: 1px solid var(--blue-light);
}

tr:nth-child(even) {
  background-color: var(--panel);
}

img {
  max-width: 100%;
  border: 1px solid var(--blue-light);
}

::selection {
  background-color: var(--blue);
  color: #ffffff;
}
