/* The New look (#79's New look section): "Sidebar journal". System fonts only, no JavaScript.
   From 900 px: a dark sidebar beside a white content column. Below it: a top bar with the name and a Menu disclosure. */

:root {
  --sidebar: #1c1e21;
  --sidebar-text: #ebe7df;
  --sidebar-muted: #9c978d;
  --sidebar-rule: #303338;
  --sidebar-current: #f0a179; /* the current page in the menu: light rust */
  --badge: #e9a37f;
  --text: #1c1e21;
  --muted: #6a6a6a;
  --rust: #b4532a;
  --notice: #fbf2ec;
  --notice-border: #efd3c3;
  --bar-track: #f1efea;
  --reply: #f6f5f2;
  --rule: #e8e6e1;
  --menu-button-border: #444;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font: 17px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color: var(--text);
  background: #fff;
}

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

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

/* The one embed (/a-good-belly-laugh/) is an old 4:3 YouTube video: it keeps that shape as it narrows. */
iframe {
  width: 100%;
  max-width: 480px;
  height: auto;
  aspect-ratio: 4 / 3;
}

/* The one table (two photos side by side) scrolls inside itself rather than widening the page. */
table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
}

/* Layout */

.shell {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  min-height: 100vh;
}

.column {
  width: 100%;
  max-width: 820px;
  padding: 3.25rem 4rem 4rem;
  overflow-wrap: break-word;
}

/* The sidebar (the header) */

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  display: flex;
  flex-direction: column;
  padding: 2.75rem 2rem;
  background: var(--sidebar);
  color: var(--sidebar-text);
}

.brand {
  display: block;
  color: var(--sidebar-text);
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  text-decoration: none;
}

.brand span {
  display: block;
}

.tagline {
  margin: 1rem 0 2rem;
  color: var(--sidebar-muted);
  font-size: 14px;
  line-height: 1.45;
}

.badge {
  margin: 0 0 0.75rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--rust);
  color: var(--badge);
  font: 600 11px/1 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Every list the look draws itself */
.menu ul,
.post-list,
.category-list,
.comment-list,
.comment-replies,
.more-in ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.menu a {
  display: block;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--sidebar-rule);
  color: var(--sidebar-text);
  font-size: 15px;
  text-decoration: none;
}

.menu a[aria-current="page"] {
  color: var(--sidebar-current);
}

.menu-phone {
  display: none;
}

.now {
  margin: auto 0 0;
  padding-top: 2rem;
  color: var(--sidebar-muted);
  font-size: 13px;
}

.now a {
  color: var(--sidebar-text);
}

/* Headings and text */

h1 {
  margin: 0 0 1.5rem;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.015em;
}

h1 a {
  color: inherit;
  text-decoration: none;
}

h2,
h3,
h4 {
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

blockquote {
  margin: 1.5rem 0;
  padding: 0.25rem 0 0.25rem 1rem;
  border-left: 3px solid var(--rust);
}

figure {
  margin: 1.5rem 0;
}

figcaption {
  color: var(--muted);
  font-size: 15px;
}

/* A post's date and categories, the category pages' "Categories /" and the 404 line: monospace, above the heading. */
.post-meta,
.breadcrumb,
.kicker {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font: 13px/1.5 var(--mono);
}

.post-meta a,
.breadcrumb a {
  color: var(--rust);
  text-decoration: none;
}

/* The count under a listing's heading */
h1 + .count {
  margin: -1rem 0 1.5rem;
  color: var(--muted);
  font: 13px var(--mono);
}

/* Home page */

.notice {
  margin: 0 0 2.75rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--notice-border);
  border-radius: 6px;
  background: var(--notice);
  font-size: 16px;
}

.more {
  margin-top: 2.25rem;
}

.more a {
  padding-bottom: 0.15rem;
  border-bottom: 2px solid var(--rust);
  font-weight: 700;
  text-decoration: none;
}

.more a::after {
  content: " →";
}

/* Listings: /posts/ and the category pages, grouped by year */

.year {
  margin: 2.5rem 0 0.25rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--rule);
  color: var(--rust);
  font: 700 13px/1 var(--mono);
  letter-spacing: 0.1em;
}

.post-list li {
  display: grid;
  grid-template-columns: 5rem minmax(0, 1fr);
  gap: 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--rule);
}

.post-list time {
  color: var(--muted);
  font: 13px/1.9 var(--mono);
}

.post-list a,
.category-list a {
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.post-list a:hover,
.category-list a:hover {
  color: var(--rust);
}

.post-list p {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

/* /category/: name, a bar for its size, its count */

.category-list li {
  display: grid;
  grid-template-columns: 12rem minmax(0, 1fr) 3rem;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--rule);
}

.category-list .bar {
  height: 10px;
  overflow: hidden;
  border-radius: 5px;
  background: var(--bar-track);
}

.category-list .bar span {
  display: block;
  height: 100%;
  border-radius: 5px;
  background: var(--rust);
}

.category-list .count {
  color: var(--muted);
  font: 13px var(--mono);
  text-align: right;
}

/* Archived comments and "More in" */

.comments {
  margin-top: 3.5rem;
}

.comments h2,
.more-in h2 {
  margin: 0 0 0.75rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--rule);
  color: var(--muted);
  font: 700 13px/1.4 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.comment {
  padding: 0.85rem 0;
}

.comment-meta {
  margin: 0;
  font-size: 15px;
}

.comment-meta [aria-hidden] {
  color: var(--rust);
}

.comment-meta time {
  margin-left: 0.6rem;
  color: var(--muted);
  font: 13px var(--mono);
}

.comment-text {
  font-size: 16px;
}

.comment-text p {
  margin: 0.35rem 0;
}

.comment-reply {
  margin: 0.5rem 0 0 1.75rem;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  background: var(--reply);
}

.comments-closed {
  margin-top: 1rem;
  color: var(--muted);
  font: 13px var(--mono);
}

.more-in {
  margin-top: 3rem;
}

.more-in li {
  padding: 0.45rem 0;
}

.more-in time {
  margin-right: 0.75rem;
  color: var(--muted);
  font: 13px var(--mono);
}

/* Footer */

.site-footer {
  margin-top: 4rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font: 13px var(--mono);
}

.site-footer a {
  color: var(--muted);
}

/* Phones and tablets: the sidebar becomes a top bar that stays put while scrolling. */

@media (max-width: 899px) {
  .shell {
    display: block;
  }

  .sidebar {
    z-index: 5;
    height: auto;
    overflow: visible;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
  }

  .brand {
    font-size: 1.15rem;
    line-height: 1.2;
    letter-spacing: 0;
  }

  .brand span {
    display: inline;
  }

  .tagline,
  .badge,
  .menu-wide,
  .now {
    display: none;
  }

  .menu-phone {
    display: block;
  }

  .menu-phone summary {
    padding: 0.4rem 0.65rem;
    border: 1px solid var(--menu-button-border);
    border-radius: 4px;
    color: var(--sidebar-text);
    font: 600 13px var(--mono);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    list-style: none;
    cursor: pointer;
  }

  .menu-phone summary::-webkit-details-marker {
    display: none;
  }

  /* The links open below the top bar, across its width, so the Menu button never moves (Jason's tweak on #81). */
  .menu-phone nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    padding: 0 1.25rem 0.75rem;
    background: var(--sidebar);
  }

  .column {
    padding: 2rem 1.25rem 3rem;
  }

  .post-list li {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .category-list li {
    grid-template-columns: minmax(0, 1fr) 3rem;
    gap: 0.4rem 1rem;
  }

  .category-list .bar {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}
