/* A Few... but Roses - poems by Roger Fogelman
   Static archive. Quiet serif on warm paper. */

:root {
  color-scheme: light dark;

  --paper:   #fbf8f3;
  --surface: #fffdfa;
  --ink:     #2b241d;
  --ink-mid: #574c40;
  --ink-soft:#7c6f60;
  --rule:    #e4dbcc;
  --accent:  #8a3f30;
  --accent-soft: #f2e7e2;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua",
           Georgia, "Times New Roman", serif;
  --measure: 34rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:   #16130f;
    --surface: #1d1915;
    --ink:     #ece5d9;
    --ink-mid: #c0b5a5;
    --ink-soft:#9d907e;
    --rule:    #352d24;
    --accent:  #d79483;
    --accent-soft: #2a201c;
  }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(1.02rem, 0.98rem + 0.25vw, 1.18rem);
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* ---- skip link ------------------------------------------------------- */

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--surface);
  color: var(--ink);
  padding: 0.7rem 1.1rem;
  border: 1px solid var(--rule);
  z-index: 10;
}
.skip:focus { left: 0.75rem; top: 0.75rem; }

/* ---- links ----------------------------------------------------------- */

a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---- masthead -------------------------------------------------------- */

.masthead {
  max-width: 52rem;
  margin: 0 auto;
  padding: 2.4rem 1.5rem 1.4rem;
  text-align: center;
  border-bottom: 1px solid var(--rule);
}

.wordmark {
  margin: 0;
  font-size: 1.28rem;
  letter-spacing: 0.015em;
}
.wordmark a { color: var(--ink); text-decoration: none; }
.wordmark a:hover { color: var(--accent); }

.byline {
  margin: 0.25rem 0 0;
  font-size: 0.86rem;
  font-style: italic;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}

.masthead nav { margin-top: 1.1rem; }
.masthead ul {
  list-style: none;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.55rem 1.6rem;
  margin: 0;
  padding: 0;
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.masthead a { color: var(--ink-mid); text-decoration: none; }
.masthead nav a:hover,
.masthead nav a[aria-current] { color: var(--accent); }

/* ---- layout ---------------------------------------------------------- */

main {
  max-width: 52rem;
  margin: 0 auto;
  padding: 2.8rem 1.5rem 4rem;
}

.prose { max-width: var(--measure); margin-inline: auto; }
.prose p { margin: 0 0 1.05em; }

h1, h2 { font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; }

h1 { font-size: 1.85rem; margin: 0 0 0.9rem; }
h2 { font-size: 1.3rem; margin: 2.4rem 0 0.8rem; }

.standfirst { color: var(--ink-mid); font-size: 0.97rem; }

/* ---- landing --------------------------------------------------------- */

.lede { text-align: left; }
.site-title {
  font-size: clamp(2rem, 1.5rem + 2.2vw, 2.9rem);
  text-align: center;
  margin-bottom: 0.15rem;
}
.site-sub {
  text-align: center;
  font-style: italic;
  color: var(--ink-soft);
  margin: 0;
}
.site-dates {
  text-align: center;
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
}

.masthead.bare { padding-top: 1.6rem; border-bottom: 0; }

.rule {
  border: 0;
  border-top: 1px solid var(--rule);
  width: 5rem;
  margin: 2rem auto 2.2rem;
}
.cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.4rem;
  margin-top: 2.2rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--rule);
  font-size: 0.95rem;
}

/* ---- poem index ------------------------------------------------------ */

.alphabet {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: center;
  max-width: var(--measure);
  margin: 1.8rem auto 2.6rem;
  padding-block: 1rem;
  border-block: 1px solid var(--rule);
  font-size: 0.88rem;
}
.alphabet a {
  text-decoration: none;
  min-width: 1.6rem;
  text-align: center;
  padding: 0.15rem 0.2rem;
}
.alphabet a:hover { text-decoration: underline; }

.letter-group { max-width: var(--measure); margin-inline: auto; }

.letter {
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 600;
  margin: 2.2rem 0 0.7rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--rule);
}

.poem-list { list-style: none; margin: 0; padding: 0; }
.poem-list li + li { border-top: 1px solid var(--rule); }
.poem-list a {
  display: block;
  padding: 0.75rem 0;
  text-decoration: none;
  color: var(--ink);
}
.poem-list a:hover .t { color: var(--accent); text-decoration: underline; }
.poem-list .t { font-size: 1.06rem; }
.poem-list .fl {
  display: block;
  font-size: 0.86rem;
  font-style: italic;
  color: var(--ink-soft);
  margin-top: 0.15rem;
}

.tag {
  display: inline-block;
  margin-left: 0.5rem;
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 0.05rem 0.4rem;
  vertical-align: 0.15em;
}

/* ---- a poem ---------------------------------------------------------- */

.poem-page { max-width: var(--measure); margin-inline: auto; }

.poem-title {
  font-size: clamp(1.6rem, 1.3rem + 1.3vw, 2.1rem);
  margin-bottom: 1.8rem;
  text-align: center;
}

.kicker {
  margin: -1.4rem 0 1.8rem;
  text-align: center;
  font-size: 0.74rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.dedication {
  margin: -1.1rem 0 2rem;
  text-align: center;
  font-style: italic;
  color: var(--ink-mid);
}

.poem { font-size: 1.06em; }

/* Each stanza is a paragraph; each line is a <span class="l">.
   The hanging indent means a line too long for the viewport wraps
   with a visible indent, so it still reads as one line of verse. */
.stanza {
  margin: 0 0 1.6em;
  line-height: 1.75;
}

/* Each line of verse is its own block, with a hanging indent so that a line
   too long for the viewport wraps to a visibly indented continuation rather
   than reading as a new line of the poem. */
.stanza .l {
  display: block;
  padding-left: 1.6em;
  text-indent: -1.6em;
}
.stanza:last-child { margin-bottom: 0; }

/* Prose rather than verse - the eulogy. No hanging indent. */
.para {
  margin: 0 0 1.15em;
  text-indent: 0;
  padding-left: 0;
  line-height: 1.68;
  overflow-wrap: break-word;
}

/* Section headings inside a poem - the animals in "A Partial Bestiary". */
.creature {
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 600;
  margin: 2.4rem 0 1rem;
}
.creature:first-child { margin-top: 0; }

.coda { margin-top: 3rem; }

.notes {
  margin-top: 2.6rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--rule);
  font-size: 0.87rem;
  color: var(--ink-soft);
}
.notes p { margin: 0 0 0.5em; font-style: italic; }
.notes p:last-child { margin-bottom: 0; }
.crosslink { border-top: 0; padding-top: 0; margin-top: 1rem; }

/* ---- pager ----------------------------------------------------------- */

.pager {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem 1.2rem;
  align-items: start;
  max-width: var(--measure);
  margin: 3.5rem auto 0;
  padding-top: 1.4rem;
  border-top: 1px solid var(--rule);
  font-size: 0.9rem;
}
.pager a { text-decoration: none; }
.pager a:hover { text-decoration: underline; }
.pager .prev { text-align: left; }
.pager .next { text-align: right; grid-column: 3; }
.pager .up {
  color: var(--ink-soft);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  padding-top: 0.15rem;
}
.pager span {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.15rem;
}

/* ---- archive --------------------------------------------------------- */

.gallery {
  list-style: none;
  margin: 2rem auto;
  padding: 0;
  display: grid;
  gap: 2.4rem 1.8rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  max-width: 50rem;
}
.gallery figure { margin: 0; }
.gallery img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--rule);
  background: var(--surface);
}
.gallery a { display: block; }
.gallery a:hover img { border-color: var(--accent); }
.gallery figcaption {
  margin-top: 0.7rem;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--ink-mid);
}

.elsewhere { margin-top: 3.4rem; }

.reading-list { list-style: none; margin: 1.4rem 0 0; padding: 0; }
.reading-list li {
  padding: 0.85rem 0;
  border-top: 1px solid var(--rule);
}
.reading-list li:last-child { border-bottom: 1px solid var(--rule); }
.reading-list a { font-size: 1.02rem; }
.reading-list .where,
.reading-list .note { display: block; font-size: 0.85rem; }
.reading-list .where { color: var(--ink-mid); margin-top: 0.15rem; }
.reading-list .note { color: var(--ink-soft); font-style: italic; margin-top: 0.1rem; }

/* ---- footer ---------------------------------------------------------- */

.colophon {
  max-width: 52rem;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  border-top: 1px solid var(--rule);
  text-align: center;
  font-size: 0.8rem;
  color: var(--ink-soft);
}
.colophon p { margin: 0 0 0.35em; }
.fine { font-size: 0.74rem; }

/* ---- motion & print -------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .masthead nav, .pager, .skip, .cta, .alphabet { display: none; }
  body { background: #fff; color: #000; font-size: 11pt; }
  main { padding: 0; }
  a { color: #000; text-decoration: none; }
  .poem-page, .prose { max-width: none; }
}
