:root {
  --text-color: #333;
  --aside-color: #29627e;
  --body-max-width: 650px;
}

/* The design is light only; say so, so a dark-themed browser or webview
   never puts the dark text on a dark canvas. */
html {
  scrollbar-gutter: stable;
  color-scheme: light;
  background: #ffffff;
}

body {
  font-family: Verdana;
  margin: 40px auto;
  max-width: var(--body-max-width);
  line-height: 1.6;
  font-size: 16px;
  color: var(--text-color);
  padding: 0 10px 70px 10px;
}

h1, h2, h3, h4, h5 {
  font-family: Georgia;
  margin: 20px 0;
  line-height: 1.2;
}

figure {
  width: 100%;
  margin: auto;
}

figure img {
  display: block;
  max-width: 100%;
}

figure figcaption {
  display: block;
  color: gray;
  text-align: center;
}

.subheader {
  margin: 20px 0;
  line-height: 1.2
}

header a {
  color: var(--text-color);
}

header a:visited {
  color: var(--text-color);
}

.site-title {
  font-family: Georgia;
  font-size: 48px;
  font-weight: bold;
  line-height: 1.2;
}

header a.title {
  /*text-decoration: none;*/
  font-weight: bold;
}

.site-footer {
  margin-top: 3rem;
  font-size: 0.9rem;
}

.site-footer hr {
  margin-bottom: 1rem;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: #ffffff;
  color: var(--text-color);
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--text-color);
  z-index: 10;
}

.skip-link:focus {
  left: 0;
}

a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--aside-color);
  outline-offset: 2px;
}

.blog-list {
  list-style: none;
  padding-left: 0;
  display: grid;
  gap: 2.5rem;
}

/* Every card is image on top, then date, title and description, on all
   screen sizes. Desktop shows two cards per row in the 950px breakout. */
.blog-list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.9rem;
  align-content: start;
}

@media (min-width: 1000px) {
  .blog-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2.75rem 2rem;
  }
}

.blog-list-image {
  display: block;
}

.blog-list-image img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid #d8d8d8;
}

.blog-list-copy {
  min-width: 0;
}

.blog-list-copy time {
  display: block;
  font-family: monospace;
  color: #666;
  margin-bottom: 0.35rem;
}

.blog-list-copy h2 {
  margin: 0 0 0.35rem 0;
  font-size: 1.5rem;
}

.blog-list-copy h2 a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.1em;
}

.blog-list-copy p {
  margin: 0;
}

.contact-line {
  margin: 0 0 1.5rem 0;
}

@media (max-width: 640px) {
  .site-title {
    font-size: 36px;
  }

  .site-footer a {
    display: inline-block;
    padding: 0.5rem 0;
  }
}

/* Sidenotes.
   Narrow screens: an in-flow dotted box.
   Wide screens: floated into the right margin, in document order. Each note
   clears the previous one, so consecutive notes stack instead of overlapping —
   the layout no longer needs the positioning script. */
aside {
  border: 2px var(--aside-color) dotted;
  box-sizing: border-box;
  color: var(--aside-color);
  font-style: italic;
  padding: 10px;
  margin: 1rem 0;
  width: 100%;
}

aside > :first-child {
  margin-top: 0;
}

aside > :last-child {
  margin-bottom: 0;
}

@media (min-width: 1250px) {
  aside {
    float: right;
    clear: right;
    border: none;
    border-left: 2px dotted var(--aside-color);
    width: 15rem;
    margin: 0 -17rem 1.25rem 1.5rem;
    padding: 0 0 0 0.6rem;
  }
}

blockquote {
  background: #f9f9f9;
  border-left: 5px solid #ccc;
  margin: 1.5em 10px;
  padding: 1em 10px;
  quotes: "\201C""\201D""\2018""\2019";
}

blockquote:before {
  color: #ccc;
  font-size: 4em;
  line-height: 0.1em;
  margin-right: 0.25em;
  vertical-align: -0.4em;
}

cite.article {
  font-style: normal;
}

cite.article::before {
  content: "\201C";
}

cite.article::after {
  content: "\201D";
}

iframe {
  border:none;
  display: block;
  width: 100%;
}

/* Breakout: on desktop the homepage post list (and any iframe marked
   `wide="true"`) is wider than the text column and centred on it. */
@media (min-width: 1000px) {
  .wide {
    --wide: min(950px, calc(100vw - 48px));
    width: var(--wide);
    max-width: none;
    margin-left: calc((100% - var(--wide)) / 2);
    margin-right: 0;
    clear: both;
  }
}



.katex-display {
  overflow-x: auto;
  overflow-y: hidden;
}

.highlight {
  margin: 1.5rem 0;
  overflow-x: auto;
}

.highlight pre {
  padding: 1rem;
  width: fit-content;
  min-width: 100%;
}

article table {
  width: 100%;
  margin: 1.5rem 0;
  border-collapse: collapse;
  border: 1px solid #d8d8d8;
  font-size: 0.95rem;
  background: #f0f0f0;
}

article thead th {
  background: #d8d8d8;
  color: #000;
  text-align: left;
  vertical-align: bottom;
}

article th,
article td {
  padding: 0.7rem 0.85rem;
  border: 1px solid #d8d8d8;
  text-align: left;
}

article tbody tr:nth-child(even) {
  background: #ffffff;
}

article tbody tr:nth-child(odd) {
  background: #f0f0f0;
}
