:root {
  color-scheme: light;
  --paper: #fbfaf7;
  --ink: #24231f;
  --muted: #625f58;
  --gutter: clamp(24px, 4vw, 64px);
  --rail: clamp(145px, 15.5vw, 236px);
  --top: clamp(32px, 6vh, 72px);
  --photo-height: clamp(300px, 70svh, 780px);
  --photo-ratio: calc(4 / 3);
  font: 15px/1.5 system-ui, sans-serif;
  scrollbar-gutter: stable;
  background: var(--paper);
  color: var(--ink);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100svh;
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  column-gap: var(--gutter);
  align-items: start;
  padding: var(--top) var(--gutter) 48px;
}

[hidden] { display: none !important; }

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
}

a:focus-visible {
  outline: 1px solid currentColor;
  outline-offset: 4px;
}

.sidebar {
  position: sticky;
  top: var(--top);
  max-height: calc(100svh - var(--top) - 16px);
  overflow: auto;
  padding: 4px;
  margin: -4px;
}

.sidebar a,
.pager a { text-decoration: none; }

.site-name {
  display: inline-block;
  font-size: 1.12rem;
  font-weight: 550;
  letter-spacing: -0.025em;
}

.collections {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.44rem;
  margin-top: 1.9rem;
}

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

.collections a[aria-current] {
  color: var(--ink);
  text-decoration-line: underline;
}

.stage {
  max-width: 1200px;
  min-width: 0;
  margin-block-start: 1.5rem;
}

.pager {
  display: flex;
  align-items: baseline;
  gap: 0.38rem;
  margin: 0 0 0.9rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.pager a[href] { color: var(--ink); }
.count {
  margin-inline-start: 0.35rem;
  color: #77736b;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}

.entry {
  min-width: 0;
  touch-action: pan-y pinch-zoom;
}

.entry:focus { outline: none; }

.photo {
  width: min(100%, calc(var(--photo-height) * var(--photo-ratio)));
  margin: 0;
}

.photo img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: var(--photo-ratio);
  object-fit: cover;
}

.photo figcaption {
  display: grid;
  grid-template-columns: minmax(0, 1fr) fit-content(50%);
  gap: 0.4rem 1rem;
  margin-top: 0.35rem;
  font-size: 0.86rem;
  color: var(--muted);
}

.photo figcaption > span,
.photo time {
  min-width: 0;
  overflow: hidden;
  font-family: ui-monospace, monospace;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.photo time {
  grid-column: 2;
  grid-row: 1;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.photo-credit { grid-column: 1 / -1; }

.text {
  width: 50%;
  max-width: 42rem;
  overflow-wrap: anywhere;
  font-size: 1.28rem;
  line-height: 1.62;
}

.text h1 {
  margin: 0 0 1rem;
  font-size: 1.36em;
  line-height: 1.18;
  font-weight: normal;
}

.text p {
  margin: 0 0 1em;
  white-space: pre-line;
}

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

.text-with-image {
  display: grid;
  grid-template-columns: min(30%, 11rem) minmax(0, 1fr);
  gap: clamp(14px, 3vw, 36px);
  align-items: start;
  max-width: 38rem;
}

.text-with-image img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 9 / 16;
  object-fit: cover;
}

.text-with-image .text { width: 100%; }

.text.text-compact {
  font-size: 0.95rem;
  line-height: 1.55;
}

@media (max-width: 840px) {
  .text { width: 75%; }
}

@media (max-width: 680px) {
  :root { --gutter: 22px; --photo-height: 67svh; }

  body {
    display: block;
    padding: 0 var(--gutter) 32px;
  }

  .sidebar {
    z-index: 1;
    top: 0;
    max-height: 50svh;
    margin: 0 calc(-1 * var(--gutter));
    padding: 1.2rem var(--gutter) 0.85rem;
    background: var(--paper);
  }

  .collections {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.25rem 1.1rem;
    margin-top: 0.55rem;
  }

  .collections a,
  .pager a {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
  }

  .pager { margin-bottom: 0.6rem; }
  .text { width: 100%; font-size: 1.18rem; }
}
