/* -------------------------- Fonts -------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;1,400&family=Spectral:ital,wght@0,300;0,400;0,600;1,300;1,400&display=swap');

/* -------------------------- Base Body -------------------------- */
body {
  font-family: 'Spectral', serif;
  font-weight: 300;
  font-size: 1.0rem;
  line-height: 1.45;
  color: #333;
  background-color: #faf9f7;
  max-width: 1200px;
  margin: 2rem auto;
  padding: 2.5rem;
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
  -ms-hyphens: auto;
  text-rendering: optimizeLegibility;
}

/* -------------------------- Headings -------------------------- */
h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-weight: 400;          
  text-transform: uppercase; 
  letter-spacing: 0.02em;
  color: #2b2b2b;
  line-height: 1.1;
  margin-top: 1.6rem;
  margin-bottom: 1rem;
}

h2, h3 {
  font-family: 'Playfair Display', serif;
  font-weight: 400;
  color: #2b2b2b;
  line-height: 1.25;
  margin-top: 3rem;
  margin-bottom: 0.8rem;
}

.site-header h1 {
  font-size: 3.5rem;
  margin: 2rem 0 1rem 0;
  text-align: left;
}

.site-header h2 {
  font-size: 2.5rem;
  margin: 1rem 0 0.5rem 0;
  text-align: left;
}

/* -------------------------- Articles -------------------------- */
article {
  background-color: #f2f2f2;
  padding: 3rem clamp(6rem, 14vw, 14rem);
  max-width: 1100px;
  margin: 1.5rem 4.5rem auto;
}

/* -------------------------- Poem Layout -------------------------- */
.poem-article, .poem {
  max-width: 700px;
  margin: 0 auto;
  padding: 1.5rem 2rem;
  text-align: left;
  box-sizing: border-box;
}

.poem-article figure, .poem figure {
  margin-bottom: 1rem;
}

.poem-article p, .poem p {
  margin: 1rem 0;
  line-height: 1.5;
  font-size: 1rem;
}

.poem-article .meta, .poem .meta {
  text-align: right;
  font-size: 0.9rem;
  font-weight: 400;
  line-height: 1.4;
  margin-top: 0.5rem;
  margin-bottom: 0;
}

/* Italic text */
article p em {
  font-style: italic;
}

/* -------------------------- Meta text and figure captions -------------------------- */
.meta, figcaption {
  font-family: 'Spectral', serif;
  font-size: 0.9rem;
  color: #222;
  margin-top: 0.5rem;
  margin-bottom: 0rem;
  text-align: right;
}

figure figcaption {
  font-style: normal;
  text-align: left;
  margin-top: 0.5rem;
  margin-bottom: 1rem;
}

/* -------------------------- Links -------------------------- */
a {
  color: #333;
  text-decoration: none;
}
a:hover {
  border-bottom: 1px solid #999;
}

/* -------------------------- Images -------------------------- */
img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0rem auto;
}

figure {
  margin: 0rem 0;
}

figure img {
  margin: 0 auto;
}

/* ---------------- Bold dates in poem meta ---------------- */
.poem-article .meta strong,
.poem .meta strong {
  font-weight: 700;
}

/* -------------------------- Poem Footer -------------------------- */
.poem-article + footer,
.poem + footer {
  max-width: 700px;           /* match poem width */
  margin: 0 auto;             /* center under poem */
  padding: 0 2rem 0 2rem;     /* match poem horizontal padding */
  text-align: left;
}

.poem-article + footer a,
.poem + footer a {
  display: inline-block;
  margin-top: 1rem;           /* gap from poem grey box */
  padding: 0;
  background: none;
  color: #333;
  font-weight: 500;
  text-decoration: none;
}

.poem-article + footer a:hover,
.poem + footer a:hover {
  text-decoration: underline;
}

/* -------------------------- Essay Footer (aligned with grey box) -------------------------- */
.essay-footer-container {
  max-width: 1100px;       /* match article max-width */
  margin: 0 auto;          /* center horizontally */
  padding: 0 3rem;         /* match article horizontal padding */
}

.essay-footer-container footer {
  text-align: left;
  padding-top: 1rem;       /* gap from grey box */
  margin: 0;
}

.essay-footer-container footer a {
  display: inline-block;
  padding: 0;
  background: none;
  color: #333;
  font-weight: 500;
  text-decoration: none;
}

.essay-footer-container footer a:hover {
  text-decoration: underline;
}

/* -------------------------- Responsive -------------------------- */
@media (max-width: 1024px) {
  article {
    padding: 0rem clamp(2rem, 6vw, 8rem);
  }
}

@media (max-width: 768px) {

  body {
    max-width: 100%;
    margin: 0;
    padding: 0;
    font-size: 1.05rem;
    font-weight: 400;
    line-height: 1.6;
    text-align: justify;
  }

  article {
    max-width: 100%;
    margin: 0;
    padding: 1.2rem 1.4rem;
  }

  article p {
    margin: 1.3rem 0;
    font-size: 1.05rem;
    font-weight: 500;
    line-height: 1.6;
    text-align: justify;
    letter-spacing: 0.02em;
  }

  .poem p {
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.6;
    letter-spacing: 0.02em;
  }

  figure {
    margin: 0;
  }

  figcaption {
    text-align: left;
    font-size: 0.75rem;
  }

  /* Mobile poem container matching essays */
  .poem-article, .poem {
    max-width: 100%;
    width: 100%;
    margin: 0.8rem 0;
    padding: 0.8rem;
    text-align: justify;
    box-sizing: border-box;
  }

  .poem-article figure, .poem figure {
    margin-bottom: 0.8rem;
  }

  .poem-article p, .poem p {
    margin: 0.8rem 0;
  }

  .poem-article .meta, .poem .meta {
    margin-top: 0.8rem;
    margin-bottom: 0;
    text-align: right;
    font-size: 0.9rem;
    font-weight: 400;
    line-height: 1.4;
  }

  .poem-article + footer,
  .poem + footer {
    padding: 0 1rem 2rem 1rem;   /* bottom padding added for gap */
  }

  .essay-footer-container {
    max-width: 100%;
    padding: 0 1.2rem 2rem 1.2rem; /* bottom padding added for gap */
  }

}