:root {
  /* Content fills the window; the body margin is the only gutter. */
  --max-width: 100%;
}

* {
  box-sizing: border-box;
}

body {
  margin: 1.25rem;
  background: #ffffff;
  color: #1a1a1a;
  font-family: Times, 'Times New Roman', serif;
  font-size: 16px;
  line-height: 1.4;
}

header, main, footer {
  max-width: var(--max-width);
}

h1 {
  font-size: 1.9rem;
  margin: 0 0 0.6rem;
}

h1 a {
  color: #1a1a1a;
  text-decoration: none;
}

h2 {
  font-size: 1.25rem;
}


.simple-nav {
  margin: 0.5rem 0;
}

.inline-form {
  display: inline;
}

.link-button {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: #0000ee;
  text-decoration: underline;
  cursor: pointer;
}

.link-button:visited,
.link-button:hover {
  color: #0000ee;
}

a {
  color: #0000ee;
}

a:visited {
  color: #551a8b;
}

a:active {
  color: #ff0000;
}

hr {
  margin: 0.75rem 0;
}

.category-list,
.sub-list {
  margin: 0.35rem 0;
}

.sub-list {
  margin-top: 0.25rem;
  margin-bottom: 0.9rem;
}

.timeline {
  list-style: none;
  margin: 0.35rem 0;
  padding: 0;
}

.lede {
  margin: 0 0 1.2rem;
}

/* Years sit in a left gutter; the spine is a border on the entry column, so
   it runs continuously as long as the entries pad rather than margin. */
.timeline > li {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 0 1.25rem;
}

.timeline .year {
  text-align: right;
}

.timeline .entry {
  position: relative;
  border-left: 1px solid #cccccc;
  padding: 0 0 1.4rem 1.25rem;
}

.timeline .entry::before {
  content: "";
  position: absolute;
  left: -3px;
  top: 0.45rem;
  width: 5px;
  height: 5px;
  background: #1a1a1a;
  border-radius: 50%;
}

.timeline p {
  margin: 0;
}

.timeline .sub-list {
  margin: 0.35rem 0;
}

.learned {
  margin-top: 0.2rem;
}

/* Narrow screens: stack the year above its entry and drop the spine. */
@media (max-width: 34rem) {
  .timeline > li {
    grid-template-columns: 1fr;
  }

  .timeline .year {
    text-align: left;
  }

  .timeline .entry {
    border-left: none;
    padding-left: 0;
  }

  .timeline .entry::before {
    display: none;
  }
}

/* Books: the work timeline's year gutter and spine, but with two columns so
   fiction and everything else run side by side down the same years. */
.shelves {
  list-style: none;
  margin: 0.35rem 0;
  padding: 0;
}

.shelves > li {
  display: grid;
  grid-template-columns: 4.5rem 1fr 1fr;
  gap: 0 1.25rem;
}

.shelves .year {
  text-align: right;
}

.shelves .shelf {
  position: relative;
  border-left: 1px solid #cccccc;
  padding: 0 0 1.4rem 1.25rem;
}

/* A dot per shelf that actually has books, so an empty year reads as a gap in
   the spine rather than a missing entry. */
.shelves .shelf:not(.empty)::before {
  content: "";
  position: absolute;
  left: -3px;
  top: 0.45rem;
  width: 5px;
  height: 5px;
  background: #1a1a1a;
  border-radius: 50%;
}

.shelves .shelf ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.shelves .shelf li {
  margin-bottom: 0.6rem;
}

.shelves .shelf li:last-child {
  margin-bottom: 0;
}

/* The column headings sit above the spine, so they get no border or dot. */
.shelves .shelf-head .shelf {
  border-left: none;
  padding-bottom: 0.4rem;
}

.shelf-label {
  display: none;
}

.byline {
  color: #444444;
}

/* Narrow screens: one column, year above its books, spine dropped. */
@media (max-width: 40rem) {
  .shelves > li {
    grid-template-columns: 1fr;
  }

  .shelves .year {
    text-align: left;
  }

  .shelves .shelf {
    border-left: none;
    padding: 0 0 0.9rem 0;
  }

  .shelves .shelf:not(.empty)::before {
    display: none;
  }

  .shelves .shelf.empty {
    display: none;
  }

  .shelves .shelf-head {
    display: none;
  }

  /* With the column headings gone, each shelf has to name itself. */
  .shelf-label {
    display: block;
    font-weight: normal;
    font-style: italic;
    color: #444444;
  }
}

/* Square tiles that reflow to fit the window; no fixed column count, so the
   grid works from a phone to a wide monitor without breakpoints. */
.photo-grid {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.5rem;
}

.photo-grid img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.photo-grid li.wide img {
  aspect-ratio: 2 / 1;
}

/* Only span two columns once there are two to span. Below this the grid is a
   single column, and spanning would invent a second one and break the row. */
@media (min-width: 26rem) {
  .photo-grid li.wide {
    grid-column: span 2;
  }
}

.thoughts {
  font-style: italic;
}

.error {
  color: #ff0000;
}

.stacked-form {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-width: 24rem;
  margin-top: 0.75rem;
}

.stacked-form label {
  font-weight: bold;
  margin-top: 0.4rem;
}

table {
  border-collapse: collapse;
  margin-top: 0.75rem;
}

th, td {
  border: 1px solid #1a1a1a;
  padding: 4px 8px;
  text-align: left;
}

.admin-actions {
  display: flex;
  gap: 0.6rem;
}

.admin-actions form {
  display: inline;
}

footer small {
  color: #444444;
}
