/* ── Reset & Base ──────────────────────────────────────────── */

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

:root {
  --parchment:      #FAF6EF;
  --parchment-deep: #F2EBE0;
  --ink:            #2C2416;
  --ink-light:      #6B5B45;
  --sepia:          #C8A97A;
  --sepia-pale:     #E8D9C5;
  --white:          #FFFFFF;

  --font-display: 'Playfair Display', Georgia, serif;
  --font-serif:   'Lora', Georgia, serif;
  --font-sans:    'Jost', system-ui, sans-serif;

  --max-width: 640px;
  --gutter: 2rem;
}

html {
  font-size: 18px;
  background-color: var(--parchment);
  color: var(--ink);
}

body {
  font-family: var(--font-serif);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 var(--gutter);
  position: relative;
  overflow-x: hidden;
}

/* ── Grain texture overlay ──────────────────────────────────── */

.grain {
  pointer-events: none;
  position: fixed;
  inset: -50%;
  width: 200%;
  height: 200%;
  opacity: 0.032;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  z-index: 0;
}

/* ── Site Header ────────────────────────────────────────────── */

.site-header {
  width: 100%;
  max-width: var(--max-width);
  text-align: center;
  padding: 2.75rem 0 0;
  position: relative;
  z-index: 1;
}

.site-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 5vw, 2.25rem);
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.2;
  display: block;
}

.site-title:hover {
  color: var(--ink-light);
}

.site-tagline {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 300;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--sepia);
  margin-top: 0.75rem;
}

/* Header divider */
.site-header::after {
  content: '';
  display: block;
  width: 3rem;
  height: 1px;
  background: var(--sepia);
  margin: 1.5rem auto 0;
  opacity: 0.7;
}

/* ── Main content ───────────────────────────────────────────── */

.main-content {
  width: 100%;
  max-width: var(--max-width);
  flex: 1;
  position: relative;
  z-index: 1;
}

/* ── Home page — poem list ──────────────────────────────────── */

.poem-list {
  list-style: none;
  padding: 1.25rem 0 4rem;
}

.poem-list-item {
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--sepia-pale);
}

.poem-list-item:first-child {
  border-top: 1px solid var(--sepia-pale);
}

.poem-list-link {
  text-decoration: none;
  display: block;
}

.poem-list-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--ink);
  line-height: 1.3;
  transition: color 0.2s ease;
}

.poem-list-link:hover .poem-list-title {
  color: var(--ink-light);
}

.poem-list-date {
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 300;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sepia);
  margin-top: 0.4rem;
}

.poem-list-excerpt {
  font-family: var(--font-serif);
  font-size: 0.88rem;
  font-weight: 400;
  font-style: italic;
  color: var(--ink-light);
  margin-top: 0.5rem;
  line-height: 1.6;
}

.no-poems {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--ink-light);
  padding: 3rem 0;
  text-align: center;
}

/* ── Individual poem page ───────────────────────────────────── */

.poem-header {
  padding: 1.5rem 0 1.5rem;
  text-align: left;
}

.poem-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.25;
  color: var(--ink);
}

.poem-date {
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 300;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sepia);
  margin-top: 0.75rem;
  display: block;
}

.poem-divider {
  width: 2.5rem;
  height: 1px;
  background: var(--sepia);
  opacity: 0.6;
  border: none;
  margin: 1.75rem 0;
}

.poem-body {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.85;
  color: var(--ink);
  white-space: pre-wrap;
  padding-bottom: 3rem;
}

/* Stanza spacing — blank lines between paragraphs */
.poem-body p {
  margin-bottom: 1.5rem;
}

/* ── Poem navigation (prev / next) ─────────────────────────── */

.poem-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 2.5rem 0 4rem;
  border-top: 1px solid var(--sepia-pale);
}

.poem-nav-link {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 300;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sepia);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.2s ease;
}

.poem-nav-link:hover {
  color: var(--ink);
}

.poem-nav-label {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.9rem;
  font-weight: 300;
  text-transform: none;
  letter-spacing: 0;
  display: block;
  color: var(--ink-light);
  margin-top: 0.2rem;
}

.poem-nav-back {
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 300;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sepia);
  text-decoration: none;
  display: block;
  text-align: center;
  padding: 0 0 3rem;
  transition: color 0.2s ease;
}

.poem-nav-back:hover {
  color: var(--ink);
}

/* ── Footer ────────────────────────────────────────────────── */

.site-footer {
  width: 100%;
  max-width: var(--max-width);
  text-align: center;
  padding: 2rem 0 3rem;
  position: relative;
  z-index: 1;
}

.footer-divider {
  display: block;
  width: 3rem;
  height: 1px;
  background: var(--sepia);
  opacity: 0.5;
  margin: 0 auto 1.5rem;
}

.site-footer p {
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 300;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sepia);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.footer-dot {
  opacity: 0.5;
}

.footer-rss {
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 300;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sepia);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

/* ── Poet's Note / Synopsis ─────────────────────────────────── */

.poem-synopsis {
  border-left: 1px solid var(--sepia-pale);
  padding: 0.25rem 0 0.25rem 1.25rem;
  margin: 0 0 3rem;
}

.poem-synopsis-label {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.62rem;
  font-weight: 300;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--sepia);
  margin-bottom: 0.6rem;
}

.poem-synopsis-text {
  font-family: var(--font-serif);
  font-size: 0.88rem;
  font-weight: 400;
  font-style: italic;
  line-height: 1.8;
  color: var(--ink-light);
  margin-bottom: 0.75rem;
}

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

/* ── Comments / Reflections ────────────────────────────────── */

.comments-section {
  padding: 0 0 3rem;
}

.comments-header {
  margin-bottom: 2rem;
}

.comments-divider {
  width: 2.5rem;
  height: 1px;
  background: var(--sepia);
  opacity: 0.5;
  border: none;
  margin: 0 0 1.5rem;
}

.comments-title {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 400;
  font-style: italic;
  letter-spacing: 0.06em;
  color: var(--ink-light);
}

.comment-list {
  list-style: none;
  margin-bottom: 2.5rem;
}

.comment-item {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--sepia-pale);
}

.comment-item:first-child {
  border-top: 1px solid var(--sepia-pale);
}

.comment-text {
  font-family: var(--font-serif);
  font-size: 0.97rem;
  font-weight: 400;
  font-style: italic;
  line-height: 1.8;
  color: var(--ink);
  margin: 0 0 0.75rem;
  padding: 0;
  border: none;
}

.comment-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
}

.comment-name {
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 300;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-light);
}

.comment-date {
  font-family: var(--font-sans);
  font-size: 0.62rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  color: var(--sepia);
}

.comments-empty {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.9rem;
  color: var(--sepia);
  padding: 1.25rem 0;
}

/* ── Comment form ───────────────────────────────────────────── */

.comment-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.comment-form-fields {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.comment-input,
.comment-textarea {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 400;
  font-style: italic;
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--sepia-pale);
  border-radius: 0;
  padding: 0.4rem 0;
  width: 100%;
  outline: none;
  transition: border-color 0.2s ease;
  -webkit-appearance: none;
  resize: none;
}

.comment-input::placeholder,
.comment-textarea::placeholder {
  color: var(--sepia);
  font-style: italic;
}

.comment-input:focus,
.comment-textarea:focus {
  border-bottom-color: var(--sepia);
}

.comment-form-footer {
  display: flex;
  justify-content: flex-end;
}

.comment-submit {
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 300;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sepia);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem 0;
  transition: color 0.2s ease;
}

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

.comment-submit:disabled {
  color: var(--sepia);
  cursor: default;
}

/* ── Responsive ────────────────────────────────────────────── */

@media (max-width: 480px) {
  :root {
    --gutter: 1.25rem;
  }

  .site-header {
    padding: 2rem 0 0;
  }

  .poem-nav {
    flex-direction: column;
    gap: 1.25rem;
  }
}
