@import url("/css/tokens.css");

/*
 * Base typography for markharris.uk: aims to read like a rendered
 * markdown document rather than a "designed" site. Colours all come
 * from the custom properties in tokens.css so light/dark stay
 * consistent with any feature page that opts into the same tokens.
 */

* {
  box-sizing: border-box;
}

body {
  background: var(--color-bg);
  color: var(--color-fg);
  font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo,
    Consolas, "DejaVu Sans Mono", monospace;
  font-size: 16px;
  line-height: 1.6;
  max-width: 700px;
  margin: 2rem auto;
  padding: 0 1rem;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-size: 1em;
  font-weight: 700;
  margin-top: 1.6em;
  margin-bottom: 0.6em;
}

h1 {
  color: var(--color-heading-1);
}

h2 {
  color: var(--color-heading-2);
}

h3 {
  color: var(--color-heading-3);
}

h4 {
  color: var(--color-heading-4);
}

h5 {
  color: var(--color-heading-5);
}

h6 {
  color: var(--color-heading-6);
}

h1::before {
  content: "# ";
}

h2::before {
  content: "## ";
}

h3::before {
  content: "### ";
}

h4::before {
  content: "#### ";
}

h5::before {
  content: "##### ";
}

h6::before {
  content: "###### ";
}

p,
ul,
ol,
blockquote,
pre,
table {
  margin-top: 0;
  margin-bottom: 1em;
}

a {
  color: var(--color-link);
}

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

ul,
ol {
  padding-left: 2em;
}

blockquote {
  margin-left: 0;
  padding: 0 1em;
  color: var(--color-fg-muted);
  border-left: 0.25em solid var(--color-border);
}

code,
pre {
  font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo,
    Consolas, "DejaVu Sans Mono", monospace;
  font-size: 0.9em;
}

code {
  background: var(--color-bg-inset);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

pre {
  background: var(--color-bg-inset);
  padding: 1em;
  border-radius: 6px;
  overflow-x: auto;
}

pre code {
  background: none;
  padding: 0;
}

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

img {
  max-width: 100%;
}

table {
  border-collapse: collapse;
  width: 100%;
}

th,
td {
  padding: 0.4em 0.8em;
  border: 1px solid var(--color-border);
}

/* Site chrome (header/nav/footer/theme toggle) */

header,
footer {
  color: var(--color-fg-muted);
}

header nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1em;
  margin-bottom: 1em;
  border-bottom: 1px solid var(--color-border);
}

#theme-toggle {
  font: inherit;
  font-size: 0.9em;
  color: var(--color-fg-muted);
  background: var(--color-bg-inset);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 0.3em 0.7em;
  cursor: pointer;
}

#theme-toggle:hover {
  color: var(--color-fg);
}

footer {
  margin-top: 2em;
  padding-top: 1em;
  border-top: 1px solid var(--color-border);
  font-size: 0.9em;
}
