/* Xin Zhi — Literary Print Quarterly stylesheet (2026) */
:root {
  --bg: #F6F1E7;
  --surface: #EFE8DA;
  --card: #FBF8F2;
  --ink: #1B1917;
  --muted: #5F584F;
  --line: #D8CFC0;
  --accent: #2E4F3E;
  --rubric: #9A4A32;
  --max: 68rem;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 18px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--rubric);
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--rubric);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--card);
  font-family: var(--sans);
  font-size: 0.82rem;
  padding: 0.55rem 0.9rem;
  z-index: 100;
}

.skip-link:focus {
  left: 0.75rem;
  top: 0.75rem;
}

.wrap {
  width: min(var(--max), calc(100% - 2.5rem));
  margin: 0 auto;
}

.meta-caps {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.rubric {
  font-family: var(--sans);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  color: var(--rubric);
}

.lede {
  font-size: 1.15rem;
  line-height: 1.62;
  color: var(--muted);
  margin: 0 0 1.5rem;
  max-width: 42rem;
}

/* Dateline strip inside header */
.dateline {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  padding: 0.45rem 0;
}

.dateline-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem 1rem;
  flex-wrap: wrap;
}

/* Masthead */
.masthead {
  padding: 1.35rem 0 1.2rem;
  border-bottom: 3px double var(--line);
}

.masthead-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.2rem;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--ink);
}

.brand:hover {
  color: var(--ink);
}

.brand-seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 1.5px solid var(--rubric);
  color: var(--rubric);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1;
  background: var(--card);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-name {
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand-sub {
  font-family: var(--sans);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

nav.main-nav {
  display: flex;
  align-items: center;
  gap: 1.35rem;
  flex-wrap: wrap;
}

nav.main-nav a {
  font-family: var(--sans);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  padding-bottom: 0.15rem;
  border-bottom: 1.5px solid transparent;
}

nav.main-nav a:hover,
nav.main-nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--rubric);
}

main {
  padding: 2.5rem 0 4rem;
}

/* Home Hero 12-column asymmetric split */
.hero-grid {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: 2.5rem;
  align-items: start;
  padding-bottom: 2.6rem;
  border-bottom: 1px solid var(--line);
}

.hero-copy h1 {
  font-size: 2.65rem;
  font-weight: 600;
  line-height: 1.13;
  letter-spacing: -0.025em;
  margin: 0.65rem 0 1rem;
}

.hero-lede {
  font-size: 1.16rem;
  line-height: 1.62;
  color: var(--muted);
  margin: 0 0 1.5rem;
  max-width: 34rem;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.btn-editorial {
  display: inline-block;
  background: var(--accent);
  color: var(--card);
  text-decoration: none;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.72rem 1.25rem;
  border: 1px solid var(--accent);
}

.btn-editorial:hover {
  background: #223C2F;
  color: var(--card);
}

.hero-frame {
  background: var(--card);
  border: 1px solid var(--line);
  padding: 1.1rem;
}

.hero-art {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  background: #F4EDE0;
}

.editors-note {
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
}

.editors-note p {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--muted);
  margin: 0.35rem 0 0;
}

/* Notice / Emergency Band */
.notice-band {
  margin: 2rem 0;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border-left: 3px solid var(--rubric);
  border-top: 1px solid var(--line);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.notice-band p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--ink);
  flex: 1 1 28rem;
}

.notice-links {
  font-family: var(--sans);
  font-size: 0.78rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.notice-links a {
  white-space: nowrap;
}

/* Index of Guides: Hairline 2-col grid */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin: 2.4rem 0 1.2rem;
  padding-bottom: 0.65rem;
  border-bottom: 2px solid var(--ink);
  flex-wrap: wrap;
}

.section-head h2 {
  font-size: 1.4rem;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.015em;
}

.guides-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

.guide-entry {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 1.5rem 1.6rem 1.55rem 0;
  border-top: 1px solid var(--line);
  transition: background-color 0.15s ease;
}

.guide-entry:nth-child(even) {
  padding-left: 1.6rem;
  padding-right: 0;
  border-left: 1px solid var(--line);
}

.guide-entry:nth-child(1),
.guide-entry:nth-child(2) {
  border-top: 0;
}

.guide-entry:hover {
  background: var(--card);
  color: inherit;
}

.guide-entry:hover h2,
.guide-entry:hover h3 {
  color: var(--accent);
}

.guide-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.guide-num {
  font-family: var(--sans);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.guide-entry h2,
.guide-entry h3 {
  font-size: 1.28rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 0.45rem;
  letter-spacing: -0.01em;
}

.guide-entry p {
  font-size: 0.94rem;
  line-height: 1.6;
  color: var(--muted);
  margin: 0;
}

/* Colophon & Resources strip */
.colophon-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.2rem;
  margin-top: 2.8rem;
  padding-top: 2rem;
  border-top: 3px double var(--line);
}

.colophon-box h2,
.colophon-box h3 {
  font-size: 1.1rem;
  margin: 0.35rem 0 0.6rem;
}

.colophon-box p,
.colophon-box li {
  font-size: 0.92rem;
  line-height: 1.62;
  color: var(--muted);
}

.colophon-box ul {
  margin: 0.6rem 0 0;
  padding-left: 1.15rem;
}

/* Guides Archive Intro */
.archive-header {
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.5rem;
}

.archive-header h1 {
  font-size: 2.25rem;
  line-height: 1.16;
  letter-spacing: -0.025em;
  margin: 0.5rem 0 0.85rem;
}

.archive-header .lede {
  margin-bottom: 0;
}

.archive-ornament {
  display: block;
  width: 100%;
  max-width: 18rem;
  height: auto;
  margin-top: 1.25rem;
}

/* Essay View */
.essay-crumb {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1.25rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--line);
  gap: 1rem;
  flex-wrap: wrap;
}

.back-link {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--accent);
  font-weight: 600;
}

.essay-layout {
  display: grid;
  grid-template-columns: 13rem minmax(0, 38rem);
  gap: 3rem;
  align-items: start;
}

.essay-rail {
  position: sticky;
  top: 1.5rem;
  border-top: 2px solid var(--ink);
  padding-top: 0.9rem;
}

.rail-row {
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
}

.rail-label {
  display: block;
  font-family: var(--sans);
  font-size: 0.68rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.rail-val {
  display: block;
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--ink);
  margin-top: 0.1rem;
}

.margin-note {
  margin-top: 1.4rem;
  padding: 0.85rem;
  background: var(--surface);
  border-left: 2px solid var(--accent);
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--muted);
}

.essay-body h1 {
  font-size: 2.35rem;
  line-height: 1.16;
  letter-spacing: -0.025em;
  margin: 0.5rem 0 0.9rem;
}

.essay-lede {
  font-size: 1.18rem;
  line-height: 1.62;
  color: var(--muted);
  margin: 0 0 1.8rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}

.essay-body p {
  font-size: 1rem;
  margin: 0 0 1.25rem;
}

.essay-body p.opening::first-letter {
  float: left;
  font-size: 3.65rem;
  line-height: 0.85;
  padding-right: 0.5rem;
  padding-top: 0.22rem;
  color: var(--rubric);
  font-weight: 600;
}

.essay-body h2 {
  font-size: 1.35rem;
  margin: 2.2rem 0 0.7rem;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.pull-quote {
  margin: 2rem 0;
  padding: 1.15rem 1.4rem;
  border-top: 2px solid var(--rubric);
  border-bottom: 1px solid var(--line);
  background: var(--card);
  font-size: 1.18rem;
  line-height: 1.55;
  color: var(--ink);
  font-style: italic;
}

.essay-figure {
  margin: 2rem 0;
  background: var(--card);
  border: 1px solid var(--line);
  padding: 0.9rem;
}

.essay-figure svg {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  background: #F4EDE0;
}

.figure-caption {
  margin-top: 0.65rem;
  font-family: var(--sans);
  font-size: 0.76rem;
  line-height: 1.45;
  color: var(--muted);
}

.essay-endnote {
  margin-top: 2.4rem;
  padding: 1.15rem 1.3rem;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--muted);
}

.essay-pager {
  margin-top: 2.2rem;
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.pager-link {
  display: block;
  padding: 1.1rem 1rem 1.1rem 0;
  text-decoration: none;
  color: var(--ink);
}

.pager-link + .pager-link {
  border-left: 1px solid var(--line);
  padding-left: 1.25rem;
  padding-right: 0;
  text-align: right;
}

.pager-link:hover .pager-title {
  color: var(--rubric);
}

.pager-dir {
  display: block;
  font-family: var(--sans);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.pager-title {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
}

/* Narrow standalone pages: About & Resources */
.page-narrow {
  max-width: 44rem;
}

.page-narrow h1 {
  font-size: 2.3rem;
  line-height: 1.16;
  letter-spacing: -0.025em;
  margin: 0.5rem 0 0.9rem;
}

.page-narrow h2 {
  font-size: 1.35rem;
  margin: 2.1rem 0 0.7rem;
  letter-spacing: -0.015em;
}

.page-narrow p {
  margin: 0 0 1.15rem;
}

.rules-list {
  margin: 1.5rem 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.rules-list li {
  padding: 1.05rem 0;
  border-bottom: 1px solid var(--line);
}

.rules-list strong {
  display: block;
  font-size: 1.05rem;
  margin-bottom: 0.3rem;
  color: var(--ink);
}

.rules-list span {
  display: block;
  font-size: 0.94rem;
  color: var(--muted);
}

.resource-list {
  display: grid;
  gap: 1rem;
  margin: 1.5rem 0 2rem;
}

.resource-item {
  background: var(--card);
  border: 1px solid var(--line);
  padding: 1.25rem 1.35rem;
}

.resource-item h3 {
  font-size: 1.18rem;
  margin: 0.25rem 0 0.45rem;
}

.resource-item p {
  font-size: 0.94rem;
  color: var(--muted);
  margin: 0 0 0.65rem;
}

.resource-item a {
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.colophon-card {
  margin-top: 2.2rem;
  background: var(--card);
  border: 1px solid var(--line);
  padding: 1.2rem 1.35rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.colophon-card p {
  margin-top: 0.45rem;
}

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

/* Footer */
footer {
  border-top: 3px double var(--line);
  padding: 1.6rem 0 2.6rem;
  color: var(--muted);
  font-size: 0.84rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.2rem;
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

@media (max-width: 860px) {
  .hero-grid,
  .essay-layout,
  .colophon-grid,
  .guides-grid,
  .essay-pager {
    grid-template-columns: 1fr;
  }

  .guide-entry,
  .guide-entry:nth-child(even) {
    padding: 1.25rem 0;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .guide-entry:first-child {
    border-top: 0;
  }

  .essay-rail {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem 1.2rem;
  }

  .margin-note {
    grid-column: 1 / -1;
  }

  .pager-link + .pager-link {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-left: 0;
    text-align: left;
  }

  .hero-copy h1,
  .archive-header h1,
  .page-narrow h1 {
    font-size: 2rem;
  }

  .essay-body h1 {
    font-size: 1.85rem;
  }
}

@media (max-width: 520px) {
  .wrap {
    width: min(var(--max), calc(100% - 1.75rem));
  }

  .dateline {
    padding: 0.35rem 0;
  }

  .dateline-inner {
    gap: 0.2rem 0.75rem;
  }

  .dateline .meta-caps {
    font-size: 0.64rem;
    letter-spacing: 0.05em;
  }

  .masthead {
    padding: 1rem 0 0.95rem;
  }

  nav.main-nav {
    gap: 0.85rem;
  }

  nav.main-nav a {
    font-size: 0.74rem;
    letter-spacing: 0.04em;
  }

  main {
    padding: 1.8rem 0 3rem;
  }
}

@media print {
  html {
    font-size: 11pt;
  }

  body {
    background: #FFFFFF;
    color: #000000;
    font-size: 1rem;
  }

  .dateline,
  .main-nav,
  .essay-crumb,
  .essay-pager,
  .skip-link,
  .hero-actions {
    display: none;
  }

  .masthead {
    border-bottom: 1pt solid #000000;
  }

  .essay-layout {
    display: block;
  }

  .essay-rail {
    display: block;
    position: static;
    margin-bottom: 1.2rem;
    padding-bottom: 0.9rem;
    border-bottom: 1pt solid #CCCCCC;
  }

  .margin-note {
    margin-top: 0.85rem;
  }
}
