/* Writings by Thom Welch: welch.land/poetry */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: #FAF8F3;
  color: #1F1F1F;
  font-family: "Lora", Georgia, "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.75;
  overflow-wrap: break-word;
}
a { color: #4A5560; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover, a:focus-visible { color: #1F1F1F; }

header.site {
  max-width: 48rem;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 1.25rem;
  text-align: center;
  border-bottom: 1px solid #DDD8CE;
}
.site-title { margin: 0 0 0.75rem; font-size: 1.3rem; letter-spacing: 0.02em; }
.site-title a { color: #1F1F1F; text-decoration: none; }
header.site nav {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 0.35rem 1.4rem;
  font-size: 0.95rem;
}
header.site nav a { text-decoration: none; padding: 0.15rem 0; }
header.site nav a:hover, header.site nav a[aria-current="page"] {
  text-decoration: underline; text-underline-offset: 0.35em;
}

main { margin: 0 auto; padding: 3rem 1.25rem 4rem; }
main.verse { max-width: 36rem; }
main.prose { max-width: 40rem; }

header.piece { text-align: center; margin-bottom: 2.25rem; }
h1 { font-weight: 400; font-size: 2rem; line-height: 1.3; margin: 0; }
h2 { font-weight: 400; font-size: 1.35rem; line-height: 1.4; margin: 2.5rem 0 1rem; }
.label { margin: 0.4rem 0 0; font-size: 0.9rem; font-style: italic; color: #4A5560; }
.cw {
  margin: 0 auto 2.5rem; max-width: 28rem; text-align: center;
  font-size: 0.85rem; font-style: italic; color: #4A5560;
  padding: 0.6rem 0; border-top: 1px solid #DDD8CE; border-bottom: 1px solid #DDD8CE;
}
.center { text-align: center; }

.text.poem { width: fit-content; max-width: 100%; margin: 0 auto; }
.text.poem p { margin: 0 0 1.6em; }
.text.poem .l { display: block; padding-left: 1.5em; text-indent: -1.5em; white-space: pre-wrap; }
.text.prose p { margin: 0 0 1.15em; }
main.prose h2 { text-align: left; }
.text.prose p.numeral { text-align: center; font-size: 0.95rem; letter-spacing: 0.15em; color: #4A5560; margin: 2.5em 0 1.25em; }
.text.prose p.numeral:first-child { margin-top: 0; }
.text.prose p.ref { padding-left: 2em; text-indent: -2em; overflow-wrap: anywhere; font-size: 0.95rem; }
.text.scenes p { margin: 0 0 0.6em; }
.text.scenes p.scene { margin-top: 1.9em; }
.text.prose.lead { max-width: 36rem; margin: 0 auto 3rem; font-style: italic; }
main.prose h3 { font-weight: 400; font-style: italic; font-size: 1.1rem; margin: 1.75rem 0 0.6rem; }
.text ul { margin: 0 0 1.15em; padding-left: 1.4em; }
.text li { margin-bottom: 0.35em; }

section.part { margin-top: 3.5rem; padding-top: 2.5rem; border-top: 1px solid #DDD8CE; }
section.part:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
section.part h2 { text-align: center; margin: 0; }
section.part .label { text-align: center; margin-bottom: 1.75rem; }

ul.toc, ol.toc { list-style: none; padding: 0; margin: 0 0 2rem; text-align: center; }
ul.toc li, ol.toc li { margin: 0 0 0.7rem; }
ul.toc a, ol.toc a { text-decoration: none; }
ul.toc a:hover, ol.toc a:hover { text-decoration: underline; }
section.seq { text-align: center; padding-bottom: 1.5rem; margin-bottom: 2rem; border-bottom: 1px solid #DDD8CE; }
section.seq:last-child { border-bottom: 0; }
section.seq h2 { margin: 0; }
section.seq h2 a { color: #1F1F1F; text-decoration: none; }
section.seq .label { margin-bottom: 1rem; }
section.seq p:not(.label) { text-align: left; }
.more { text-align: center; margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid #DDD8CE; font-style: italic; }

.hero { margin: 0 auto 2rem; max-width: 18rem; }
.hero img { display: block; width: 100%; height: auto; }
main.home { max-width: 58rem; }
.intro { max-width: 36rem; margin: 0 auto; }
.intro p { margin: 0 0 1.2em; }
.intro p.note { margin-top: 2em; font-size: 0.9rem; font-style: italic; color: #4A5560; }
@media (min-width: 800px) {
  .home-grid { display: grid; grid-template-columns: 2fr 3fr; gap: 3rem; align-items: start; }
  .home-grid .hero { margin: 0; max-width: none; }
  .home-grid .intro { margin: 0; max-width: none; }
  .home-grid .intro p:first-child { margin-top: -0.3em; }
}

nav.pager {
  display: flex; justify-content: space-between; gap: 1.5rem;
  margin-top: 3.5rem; padding-top: 1.25rem; border-top: 1px solid #DDD8CE;
  font-size: 0.9rem; font-style: italic;
}
nav.pager a { text-decoration: none; max-width: 48%; }
nav.pager a:hover { text-decoration: underline; }
nav.pager .next { text-align: right; margin-left: auto; }

footer.site {
  max-width: 40rem; margin: 0 auto; padding: 1.5rem 1.25rem 3rem;
  border-top: 1px solid #DDD8CE; text-align: center;
  font-size: 0.82rem; line-height: 1.6; color: #4A5560;
}

@media (max-width: 600px) {
  header.site { padding-top: 1.75rem; }
  header.site nav { gap: 0.25rem 1rem; font-size: 0.92rem; }
  main { padding: 2rem 1.25rem 3rem; }
  h1 { font-size: 1.65rem; }
  nav.pager { flex-direction: column; gap: 0.75rem; }
  nav.pager a { max-width: none; }
  nav.pager .next { text-align: left; margin-left: 0; }
}

header.piece + p.center { margin: -1rem auto 2rem; max-width: 30rem; font-size: 0.95rem; font-style: italic; color: #4A5560; }

.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}

/* Structure pass: clearer separation on reading pages */
:root { --accent: #3D5A45; --rule: #DDD8CE; --panel: #FFFFFF; }
header.piece h1 { color: #1F1F1F; }
header.piece::after { content: ""; display: block; width: 3.5rem; height: 2px; background: var(--accent); margin: 1.1rem auto 0; }
.label { color: var(--accent); }

/* Index cards */
ul.cards { list-style: none; padding: 0; margin: 0 0 2rem; display: grid; gap: 0.9rem; }
@media (min-width: 700px) { ul.cards { grid-template-columns: 1fr 1fr; } }
ul.cards a.card {
  display: block; height: 100%; text-decoration: none; color: #1F1F1F;
  background: var(--panel); border: 1px solid var(--rule); border-left: 4px solid var(--accent);
  border-radius: 4px; padding: 1rem 1.15rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  transition: box-shadow .15s, transform .15s;
}
ul.cards a.card:hover, ul.cards a.card:focus-visible { box-shadow: 0 4px 12px rgba(0,0,0,0.09); transform: translateY(-1px); }
.card-title { display: block; font-size: 1.1rem; line-height: 1.4; font-weight: 600; }
.card-meta { display: block; margin-top: 0.3rem; font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.card-cw { display: inline-block; margin-top: 0.45rem; font-size: 0.78rem; font-style: italic; color: #6B4A3A; background: #F3ECE4; border-radius: 3px; padding: 0.1rem 0.5rem; }

/* Sequence parts as framed panels */
section.part, section.part:first-of-type {
  margin: 0 0 2.25rem; padding: 2rem 1.5rem 1.5rem;
  background: var(--panel); border: 1px solid var(--rule); border-top: 4px solid var(--accent);
  border-radius: 4px; box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.part-no { text-align: center; margin: 0 0 0.35rem; font-size: 0.78rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); }
section.part h2 { font-size: 1.5rem; font-weight: 600; }
section.part .label { font-size: 0.82rem; }
.text.prose.lead { background: #F1EEE6; border-radius: 4px; padding: 1.25rem 1.4rem; }

/* Sequences index blocks */
section.seq, section.seq:last-child {
  background: var(--panel); border: 1px solid var(--rule); border-left: 4px solid var(--accent);
  border-radius: 4px; padding: 1.5rem 1.4rem 1rem; margin-bottom: 1.75rem; box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
section.seq h2 { font-weight: 600; }
ol.toc.parts { counter-reset: part; text-align: left; margin: 1rem 0 0.5rem; }
ol.toc.parts li { counter-increment: part; padding: 0.55rem 0; border-top: 1px solid var(--rule); margin: 0; }
ol.toc.parts li::before { content: "Part " counter(part); display: inline-block; min-width: 4.2rem; font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }

/* Essays and long prose */
main.prose h2 {
  font-weight: 600; font-size: 1.35rem; color: var(--accent);
  margin: 3rem 0 1rem; padding-bottom: 0.4rem; border-bottom: 1px solid var(--rule);
}
main.prose h3 { font-style: normal; font-weight: 600; font-size: 1.08rem; color: #2B2B2B; margin: 2rem 0 0.6rem; padding-left: 0.75rem; border-left: 3px solid var(--accent); }
.text.prose p { margin-bottom: 1.3em; }
.text ul { background: #F3F0E9; border-radius: 4px; padding: 0.9rem 1rem 0.6rem 2.2rem; }
.text li::marker { color: var(--accent); }
.text.prose p.numeral { color: var(--accent); font-weight: 600; }
.text.scenes p.scene { margin-top: 1.6em; }

/* Single poems: framed page */
main.verse article > .text.poem { background: var(--panel); border: 1px solid var(--rule); border-radius: 4px; padding: 1.75rem 1.5rem 0.4rem; box-shadow: 0 1px 3px rgba(0,0,0,0.05); width: auto; }

nav.pager a { background: var(--panel); border: 1px solid var(--rule); border-radius: 4px; padding: 0.6rem 0.9rem; }

@media (max-width: 600px) {
  section.part, section.part:first-of-type { padding: 1.5rem 1rem 1rem; }
  main.verse article > .text.poem { padding: 1.25rem 1rem 0.2rem; }
  main.prose h2 { font-size: 1.22rem; }
}

.download { text-align: center; margin: -0.75rem 0 2.25rem; }
a.btn { display: inline-block; text-decoration: none; font-size: 0.9rem; letter-spacing: 0.04em; color: #FFFFFF; background: var(--accent); border-radius: 4px; padding: 0.55rem 1.2rem; }
a.btn:hover, a.btn:focus-visible { color: #FFFFFF; background: #2E4535; }

@media print {
  @page { margin: 0.9in 0.85in; }
  body { background: #FFFFFF; font-size: 11.5pt; line-height: 1.55; }
  header.site, footer.site, nav.pager, .download { display: none !important; }
  main { padding: 0; max-width: none !important; }
  main.prose h2 { break-after: avoid; }
  main.prose h3 { break-after: avoid; }
  .text ul { background: none; padding: 0 0 0 1.4em; }
  a { color: #1F1F1F; text-decoration: none; }
}

/* Clearer links */
a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 0.22em; }
a:hover, a:focus-visible { color: #22382A; }
header.site nav a { color: var(--accent); font-weight: 600; }
.site-title a { color: #1F1F1F; text-decoration: none; }
ul.toc a, ol.toc a { color: var(--accent); text-decoration: underline; font-weight: 600; }
section.seq h2 a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1.5px; }
nav.pager a { color: var(--accent); font-weight: 600; text-decoration: none; }
ul.cards a.card { color: #1F1F1F; text-decoration: none; }
a.btn { color: #FFFFFF; text-decoration: none; }

/* Consistent poem reading width and spacing. */
@media screen {
 main.verse:has(.text.poem) { max-width: 62rem; }
 .text.poem { line-height: 1.45; }
 .text.poem p { margin-top: 0; margin-bottom: 1.2em; }
 .text.poem .l { padding-left: 0; text-indent: 0; white-space: pre-wrap; }
 main.verse article > .text.poem { padding: 1.5rem 1.5rem .3rem; }
}
@media screen and (max-width:600px) {
 main.verse article > .text.poem { padding:1rem .8rem .2rem; }
 .text.poem { line-height:1.4; }
}

/* Framed single pieces: narrow, centered, light cream (2026-10-19). */
@media screen {
 main.verse:has(article > .text.poem) { max-width: 40rem; }
 main.verse article > .text.poem { background: #F3EEE3; max-width: 30rem; margin: 0 auto; padding: 2rem 2.25rem .6rem; }
}
@media screen and (max-width:600px) {
 main.verse article > .text.poem { padding: 1.4rem 1.25rem .4rem; }
}

/* Hanging indent for wrapped poem lines (2026-10-19). */
@media screen {
 .text.poem .l { padding-left: 1.5em; text-indent: -1.5em; }
}

/* Wider poem frames so lines keep their own breaks at desktop (2026-10-21). */
@media screen {
 main.verse:has(article > .text.poem), main.verse:has(section.part) { max-width: 50rem; }
 main.verse article > .text.poem { width: fit-content; min-width: min(30rem, 100%); max-width: 44em; padding: 2rem 2.5rem .6rem; }
 .text.poem .l { padding-left: 1.5em; text-indent: -1.5em; }
}
@media screen and (max-width:600px) {
 main.verse article > .text.poem { padding: 1.25rem 1rem .4rem; }
 .text.poem { font-size: 16.5px; }
 .text.poem .l { padding-left: 1.2em; text-indent: -1.2em; }
}
