/* Reading view: a magazine style layout. Loaded after site.css. */
body.reader { display: block; background: var(--paper); font-family: var(--read); }

/* Top bar */
.bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .6rem clamp(1rem, 3vw, 2rem); background: var(--paper); border-bottom: 1px solid var(--stone); font-family: var(--ui); font-size: .9rem; }
.bar a, .copy { color: var(--forest); text-decoration: none; }
.back { border: 1px solid var(--forest); border-radius: 4px; padding: .35rem .8rem; }
.back:hover { background: var(--forest); color: var(--paper); }
.back-short { display: none; }
.wordmark { font: 1.3rem/1 var(--display); }
.copy { background: none; border: 1px solid var(--stone); border-radius: 4px; font: .85rem var(--ui); padding: .3rem .7rem; cursor: pointer; }
.copy:hover { border-color: var(--forest); }
.bar-copy { display: none; }
.progress { position: absolute; left: 0; bottom: -1px; width: 100%; height: 3px; appearance: none; border: 0; background: transparent; color: var(--forest); }
.progress::-webkit-progress-bar { background: transparent; }
.progress::-webkit-progress-value { background: var(--forest); }
.progress::-moz-progress-bar { background: var(--forest); }
.preview-note { margin: 0; padding: .5rem 1rem; background: var(--ochre); color: var(--ink); text-align: center; font: .9rem var(--ui); }

/* Hero (the class name is shared with the home page, so undo its grid background and padding here) */
body.reader .hero { position: relative; color: var(--paper); padding: 0; background: none; }
body.reader .hero > * { max-width: none; }
.hero-img img { display: block; width: 100%; height: min(78vh, 46rem); object-fit: cover; }
.hero-img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgb(20 28 22 / .88), rgb(20 28 22 / .35) 55%, rgb(20 28 22 / .1)); }
.hero-text { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 clamp(1rem, 6vw, 5rem) clamp(1.5rem, 5vw, 4rem); z-index: 1; max-width: 70rem; }
.hero h1 { color: var(--paper); font-size: clamp(2.4rem, 7vw, 5.25rem); line-height: 1.02; margin: .3em 0 .25em; }
.deck { font: italic 1.3rem/1.45 var(--read); max-width: 40rem; margin: 0; }
.hero .tag-list a { color: var(--paper); }
body.reader .hero.plain { color: var(--forest); padding: clamp(2.5rem, 7vw, 5rem) 0 1.5rem; }
/* No hero photo: the title sits centered over the text column, so it does not hug the left edge of a wide screen. */
body.reader .hero.plain .hero-text { position: static; margin: 0 auto; max-width: 52rem; text-align: center; padding: 0 clamp(1rem, 6vw, 5rem); }
.hero.plain .deck { margin-left: auto; margin-right: auto; }
.hero.plain .tag-list { justify-content: center; }
.hero.plain h1 { color: var(--forest); }
.hero.plain .tag-list a { color: var(--forest); }

.tag-list { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem .9rem; margin: 0 0 .5rem; padding: 0; font: .72rem/1.2 var(--mono); text-transform: uppercase; letter-spacing: .14em; }
.tag-list a { color: var(--forest); text-decoration: none; border-bottom: 1px solid var(--ochre); }

/* Dateline */
.dateline { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.4rem; max-width: 70rem; margin: 1.5rem auto 0; padding: .8rem clamp(1rem, 6vw, 5rem); border-top: 1px solid var(--stone); border-bottom: 1px solid var(--stone); font: .9rem var(--ui); color: var(--ink); }
.avatar { display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--forest); color: var(--paper); font: 1.1rem/1 var(--display); }
.dateline .copy { margin-left: auto; }
.location { max-width: 70rem; margin: .8rem auto 0; padding: 0 clamp(1rem, 6vw, 5rem); }

/* Body: three widths on one grid */
.prose {
  display: grid;
  grid-template-columns: [full-start] minmax(1rem, 1fr) [wide-start] minmax(0, 220px) [text-start] min(60rem, calc(100% - 2rem)) [text-end] minmax(0, 220px) [wide-end] minmax(1rem, 1fr) [full-end];
  font: 21px/1.75 var(--read);
  margin-top: 2.5rem;
  counter-reset: section fig;
}
.prose > * { grid-column: text; margin-top: 0; margin-bottom: 1.15em; }
.prose > .wide { grid-column: wide; }
.prose > .full { grid-column: full; }
.prose a { color: var(--forest); }

.prose h2 { font: 400 2.2rem/1.1 var(--display); color: var(--forest); margin-top: 1.6em; counter-increment: section; }
.prose h2::before { content: counter(section, decimal-leading-zero); display: block; font: .72rem/1 var(--mono); letter-spacing: .14em; color: var(--forest); margin-bottom: .6rem; }
.prose h3 { font: 400 1.6rem/1.2 var(--display); color: var(--forest); margin-top: 1.4em; }

/* Drop cap and small caps first line, with plain CSS so ordinary post HTML works */
.prose:not(.no-dropcap) > p:first-of-type::first-letter { font: 400 6.6em/.78 var(--display); color: var(--forest); float: left; padding: .04em .08em 0 0; }
.prose:not(.no-dropcap) > p:first-of-type::first-line { font-variant: small-caps; letter-spacing: .03em; }

/* A small square closes the story */
.prose > p:last-of-type::after { content: ""; display: inline-block; width: .5em; height: .5em; margin-left: .35em; background: var(--forest); }

.prose figure { margin-bottom: 2em; }
.prose figure img { display: block; width: 100%; height: auto; border: 1px solid var(--stone); }
.prose figure.full img { border-left: 0; border-right: 0; }
.prose figcaption { font: .9rem/1.5 var(--ui); color: var(--ink); padding: .6rem 0 0; }
.prose .fig { font: .7rem var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--forest); }
.prose .credit { color: var(--ink); opacity: .8; }
.video { position: relative; aspect-ratio: 16 / 9; background: var(--ink); }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .5rem; }
.gallery img { aspect-ratio: 4 / 3; object-fit: cover; }

.prose blockquote { border-left: 3px solid var(--stone); padding-left: 1.2rem; font-style: italic; }
.prose blockquote.pullquote { grid-column: wide; border: 0; padding: 1.6rem 0 0; text-align: center; font: 400 clamp(1.7rem, 4vw, 2.6rem)/1.25 var(--display); color: var(--forest); position: relative; }
.prose blockquote.pullquote::before { content: ""; display: block; width: 3rem; height: 3px; background: var(--ochre); margin: 0 auto 1rem; }
.prose blockquote.pullquote p { margin: 0; }
.prose blockquote.pullquote cite { display: block; margin-top: .8rem; font: normal .72rem var(--mono); text-transform: uppercase; letter-spacing: .14em; }
.prose .fieldnote { background: var(--paper-deep); border: 1px solid var(--stone); border-left: 4px solid var(--forest); border-radius: 4px; padding: 1rem 1.2rem; font: 1.05rem/1.6 var(--ui); }
.prose .fieldnote::before { content: "Field note"; display: block; font: .7rem var(--mono); text-transform: uppercase; letter-spacing: .14em; color: var(--forest); margin-bottom: .4rem; }
.prose .fieldnote p { margin: 0 0 .5em; }
.prose hr { border: 0; height: 18px; background: linear-gradient(var(--stone) 0 6px, var(--ochre) 6px 7px, var(--paper-deep) 7px 18px); }

/* After the story */
.after { max-width: 70rem; margin: 3rem auto 0; padding: 0 clamp(1rem, 6vw, 5rem) 4rem; font-family: var(--read); }
.contact-line { font: 1.1rem var(--read); }

@media (max-width: 47.99rem) {
  .prose { font-size: 18.5px; }
  .back-long, .wordmark { display: none; }
  .back-short { display: inline; }
  .bar-copy { display: inline-block; }
  .dateline .copy { display: none; }
  .hero-img img { height: 70vh; }
}

@media print {
  .bar, .progress, .copy, .preview-note, .after .post-list, .after h2 { display: none !important; }
  body.reader { background: #fff; color: #000; }
  .hero { color: #000; }
  .hero-img::after { display: none; }
  .hero-text { position: static; }
  .hero h1, .hero.plain h1 { color: #000; }
  .hero-img img { height: 14rem; }
  .prose { font-size: 12pt; display: block; max-width: 40rem; margin-left: auto; margin-right: auto; }
  .prose figure { break-inside: avoid; }
}

/* Reader labels: top bar, byline, copy button and figure captions in the mono font. The after-story sentences use Newsreader. */
.bar, .copy, .dateline, .prose figcaption { font-family: var(--mono); font-size: .78rem; letter-spacing: .04em; }
.prose figcaption { line-height: 1.5; }
