/* ==========================================================================
   Boulean Logic — site styles

   A Victorian treatise on bread, as reproduced in 2003 by someone with MS
   Paint and a free web host. Alegreya carries the titles and page copy,
   Alegreya Sans the post bodies, and Courier New anything that looks typed;
   web-default link colours, flat Paint-palette fills, 2px black borders and
   no rounded corners. Pictures are pixel art and must stay that way.
   ========================================================================== */

:root {
  /* Colour: the page is off-white; everything else is from the MS Paint palette */
  --paper: #fffff8;
  --ink: #000000;
  --link: #0000ee;
  --visited: #551a8b;
  --crumb: #efe4b0;     /* light yellow */
  --red: #ed1c24;
  --gray: #c3c3c3;
  --light-gray: #efefef;
  --note: #fffbb8;      /* sticky notes */

  /* Type */
  --font-title: Alegreya, Georgia, "Times New Roman", Times, serif;
  --font-body: Alegreya, Georgia, "Times New Roman", Times, serif;
  --font-post-body: "Alegreya Sans", "Trebuchet MS", "Segoe UI", Arial, sans-serif;
  --font-typed: "Courier New", Courier, monospace;

  /* Layout widths */
  --measure: 42rem;
  --gutter: 1rem;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

@media (min-width: 40em) {
  html {
    font-size: 18px;
  }
}

body {
  margin: 0;
  padding: 0 var(--gutter);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1 0 auto;
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding-bottom: 3rem;
}

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

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

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

:focus-visible {
  outline: 2px dotted var(--ink);
  outline-offset: 2px;
}

img {
  max-width: 100%;
  height: auto;
}

/* Pixel art stays pixel art */
.pixel {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* Text that looks typed on a typewriter or in a terminal */
.typed {
  font-family: var(--font-typed);
  font-size: 0.88rem;
}

/* --------------------------------------------------------------------------
   Banner: the title page (home only)
   -------------------------------------------------------------------------- */

.banner {
  width: 100%;
  max-width: var(--measure);
  margin: 2rem auto 0;
}

.banner__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.5rem;
}

.banner__logo {
  flex: none;
  display: block;
  width: 152px;
}

.banner__logo img {
  display: block;
  width: 100%;
}

.banner__text {
  flex: 1 1 16rem;
}

.banner__name {
  margin: 0;
  line-height: 0;
}

.banner__name img {
  width: 100%;
  max-width: 412px;
}

.banner__tagline {
  margin: 0.9rem 0 0;
  font-size: 1.15rem;
  font-style: italic;
}

@media (max-width: 30em) {
  .banner__row {
    justify-content: center;
    text-align: center;
  }

  .banner__logo {
    width: 120px;
  }
}

/* --------------------------------------------------------------------------
   Running head: every other page
   -------------------------------------------------------------------------- */

.runhead {
  width: 100%;
  max-width: var(--measure);
  margin: 1rem auto 2rem;
  padding: 0.6rem 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  border-bottom: 2px solid var(--ink);
}

.runhead__home {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.runhead__home img:first-child {
  width: 40px;
}

.runhead__home img:last-child {
  width: 176px;
}

.runhead .nav {
  margin: 0 0 0 auto;
}

/* Navigation: typed links in square brackets */
.nav {
  margin: 0.75rem 0 0;
}

.nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}

.nav a::before,
.nav strong::before {
  content: "[ ";
}

.nav a::after,
.nav strong::after {
  content: " ]";
}

/* --------------------------------------------------------------------------
   Contents: the post list
   -------------------------------------------------------------------------- */

.contents {
  margin-top: 2.25rem;
}

.contents__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.contents__item {
  position: relative;
  margin: 0 0 1.5rem;
  padding-left: 2.6rem;
}

/* A little loaf for a bullet */
.contents__item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.15em;
  width: 30px;
  height: 20px;
  background: url("/static/img/bullet-loaf.png") no-repeat left top / 30px 20px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.contents__line {
  display: flex;
  align-items: baseline;
  gap: 0.5em;
}

.contents__title {
  font-size: 1.2rem;
  font-weight: bold;
}

/* Typed dot leader between the title and the date */
.contents__leader {
  flex: 1 1 1em;
  overflow: hidden;
  white-space: nowrap;
  font-family: var(--font-typed);
  font-size: 0.88rem;
  color: var(--ink);
}

.contents__leader::after {
  content: ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .";
}

.contents__date {
  flex: none;
}

.contents__summary {
  margin: 0.3rem 0 0;
}

.contents__tags {
  margin: 0.3rem 0 0;
}

.contents__empty {
  margin: 0;
  font-style: italic;
}

@media (max-width: 30em) {
  .contents__line {
    flex-wrap: wrap;
    gap: 0.1rem 0.5em;
  }

  .contents__title {
    flex: 1 1 100%;
  }

  .contents__leader {
    display: none;
  }
}

/* Tags: typed in square brackets */
a[rel="tag"] {
  font-family: var(--font-typed);
  font-size: 0.88rem;
  white-space: nowrap;
  margin-right: 0.35em;
}

a[rel="tag"]::before {
  content: "[";
}

a[rel="tag"]::after {
  content: "]";
}

/* --------------------------------------------------------------------------
   Posts and pages
   -------------------------------------------------------------------------- */

.page__title,
.post__title {
  font-family: var(--font-title);
  margin: 0 0 1.25rem;
  font-size: 1.9rem;
  line-height: 1.2;
}

.page__title code {
  font-size: 0.85em;
}

.post__meta {
  margin: 0 0 0.6rem;
}

.post__title {
  margin-bottom: 0.6rem;
}

.post__summary {
  margin: 0 0 1.75rem;
  font-size: 1.1rem;
  font-style: italic;
}

.post__footer {
  margin-top: 2.5rem;
}


.backlink {
  margin: 2.5rem 0 0;
}

.index-list {
  margin: 0;
  padding: 0 0 0 1.5rem;
}

.index-list li {
  margin-bottom: 0.4rem;
}

/* --------------------------------------------------------------------------
   Prose: Markdown content inside posts and pages
   -------------------------------------------------------------------------- */

.post .prose {
  font-family: var(--font-post-body);
  font-size: 1.05rem;
}

.prose > :first-child {
  margin-top: 0;
}

.prose p,
.prose ul,
.prose ol,
.prose pre,
.prose table,
.prose figure {
  margin: 0 0 1.1em;
}

.prose h2,
.prose h3,
.prose h4 {
  line-height: 1.25;
  margin: 1.8em 0 0.5em;
}

.prose h2 {
  font-size: 1.45rem;
}

.prose h3 {
  font-size: 1.2rem;
}

.prose h4 {
  font-size: 1rem;
  font-style: italic;
}

.prose ul,
.prose ol {
  padding-left: 1.5em;
}

.prose li + li {
  margin-top: 0.25em;
}

.prose img {
  display: block;
  margin: 1.25em auto;
}

.prose figure {
  margin-left: 0;
  margin-right: 0;
}

.prose figure img {
  margin-bottom: 0.4em;
}

.prose figcaption {
  font-family: var(--font-typed);
  font-size: 0.85rem;
  text-align: center;
}

/* Quotations go on a sticky note */
.prose blockquote {
  margin: 1.5em 0.5em;
  padding: 0.75em 1em;
  font-style: italic;
  background-color: var(--note);
  border: 1px solid var(--ink);
}

.prose blockquote p:last-child {
  margin-bottom: 0;
}

.prose hr {
  height: 0;
  margin: 2em 0;
  border: 0;
  border-top: 2px dashed var(--ink);
}

.prose code {
  font-family: var(--font-typed);
  font-size: 0.9em;
  padding: 0 0.25em;
  background-color: var(--light-gray);
  border: 1px solid var(--gray);
}

.prose pre {
  padding: 0.75em 1em;
  overflow-x: auto;
  font-family: var(--font-typed);
  font-size: 0.88rem;
  line-height: 1.45;
  background-color: var(--light-gray);
  border: 2px solid var(--ink);
  -moz-tab-size: 2;
  tab-size: 2;
}

.prose pre code {
  padding: 0;
  font-size: inherit;
  background: none;
  border: 0;
}

/* Tables (ingredient lists, bakers' percentages) */
.prose table {
  width: 100%;
  border-collapse: collapse;
  border: 2px solid var(--ink);
  font-size: 0.95rem;
}

.prose th,
.prose td {
  padding: 0.35em 0.6em;
  text-align: left;
  vertical-align: top;
  border: 1px solid var(--ink);
}

.prose th {
  font-family: var(--font-typed);
  font-size: 0.85rem;
  font-weight: bold;
  background-color: var(--crumb);
}

.prose td {
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.colophon {
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 1.5rem 0 2.5rem;
  border-top: 2px solid var(--ink);
  text-align: center;
}

.colophon__line {
  margin: 0;
}
