/* ============================================
   PEACE POEMS — styles.css
   Aesthetic: organic editorial / literary press
   Fonts: Playfair Display (headings) + Source Serif 4 (body)
   ============================================ */

/* ---- Custom Properties ---- */
:root {
  --ink:        #1e1a16;
  --ink-mid:    #4a4038;
  --ink-light:  #7a6e62;
  --paper:      #faf7f2;
  --paper-alt:  #f3ede4;
  --paper-warm: #ede5d8;
  --accent:     #7b5c3e;
  --accent-light: #a5805c;
  --accent-pale:  #e8d9c6;
  --sky:        #4a7c9e;

  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Source Serif 4', Georgia, serif;

  --header-h: 68px;
  --max-w: 1100px;
  --book-gap: 3.5rem;

  --ease-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --transition: 0.25s var(--ease-out);
}

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

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

body {
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--transition), opacity var(--transition);
}

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

ul {
  list-style: none;
}

/* ---- Utility ---- */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
}

/* ============================================
   HEADER
   ============================================ */
#site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  background-color: rgba(30, 26, 22, 0.93);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: padding var(--transition);
}

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

/* Shrink header on scroll (toggled by JS) */
#site-header.scrolled {
  --header-h: 52px;
}

.site-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--paper);
  text-decoration: none;
  letter-spacing: 0.02em;
  white-space: nowrap;
  flex-shrink: 0;
}

.site-title:hover {
  color: var(--accent-pale);
}

#main-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.25rem;
  align-items: center;
}

.nav-link {
  display: block;
  padding: 0.35rem 0.65rem;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 300;
  color: rgba(250, 247, 242, 0.7);
  text-decoration: none;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 2px;
  transition: color var(--transition), background var(--transition);
}

.nav-link:hover {
  color: var(--paper);
  background: rgba(255,255,255,0.08);
}

.nav-fresh {
  color: var(--accent-light) !important;
  font-weight: 400;
}

.nav-fresh:hover {
  color: var(--paper) !important;
}

/* Hamburger button — hidden on desktop */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  margin-right: -8px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background-color: var(--paper);
  transition: transform 0.3s var(--ease-out), opacity 0.3s;
  transform-origin: center;
}

/* Animate hamburger → X */
.nav-toggle.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ============================================
   MOBILE NAV
   ============================================ */
@media (max-width: 900px) {
  .nav-toggle {
    display: flex;
  }

  #main-nav {
    position: absolute;
    top: var(--header-h);
    left: 0;
    width: 100%;
    background-color: rgba(25, 22, 18, 0.97);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s var(--ease-out);
  }

  #main-nav.open {
    max-height: 500px;
  }

  #main-nav ul {
    flex-direction: column;
    gap: 0;
    padding: 0.75rem 0 1.25rem;
  }

  #main-nav li {
    width: 100%;
  }

  .nav-link {
    padding: 0.7rem 2rem;
    font-size: 0.85rem;
    border-radius: 0;
    text-transform: none;
    letter-spacing: 0.02em;
  }
}

/* ============================================
   HERO
   ============================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  transform: scale(1.03);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(30, 26, 22, 0.55) 0%,
    rgba(30, 26, 22, 0.45) 60%,
    rgba(30, 26, 22, 0.70) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 2rem;
  animation: heroFadeUp 1.2s var(--ease-out) both;
}

@keyframes heroFadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-byline {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 300;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(250, 247, 242, 0.7);
  margin-bottom: 0.75rem;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(3rem, 9vw, 7.5rem);
  font-weight: 700;
  color: var(--paper);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.hero-sub {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  color: rgba(250, 247, 242, 0.75);
  margin-bottom: 2.5rem;
}

.hero-cta {
  display: inline-block;
  padding: 0.75rem 2.25rem;
  border: 1.5px solid rgba(250, 247, 242, 0.6);
  color: var(--paper);
  text-decoration: none;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 300;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: 2px;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.hero-cta:hover {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--paper);
}

/* ============================================
   INTRO SECTION
   ============================================ */
.section-intro {
  padding: 5rem 0 4rem;
  background: var(--paper);
}

.section-intro h2 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 1.25rem;
}

.section-intro p {
  max-width: 680px;
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--ink-mid);
}

.section-intro a {
  color: var(--accent);
}

/* ============================================
   BOOK SECTIONS
   ============================================ */
.book-section {
  padding: var(--book-gap) 0;
  background: var(--paper);
}

.book-section.alt {
  background: var(--paper-alt);
}

.book-card {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 3rem;
  align-items: start;
}

.book-card.reverse {
  grid-template-columns: 1fr 240px;
}

.book-card.reverse .book-cover {
  order: 2;
}

.book-card.reverse .book-info {
  order: 1;
}

/* Book cover */
.book-cover {
  position: sticky;
  top: calc(var(--header-h) + 1.5rem);
}

.book-cover a {
  display: block;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  box-shadow: 4px 6px 24px rgba(30, 26, 22, 0.2);
  transition: transform var(--transition), box-shadow var(--transition);
}

.book-cover a:hover {
  transform: translateY(-3px);
  box-shadow: 6px 12px 32px rgba(30, 26, 22, 0.28);
}

.book-cover img {
  width: 100%;
  border-radius: 4px;
  display: block;
}

.buy-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(30, 26, 22, 0.82);
  color: var(--paper);
  text-align: center;
  padding: 0.6rem;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-family: var(--font-body);
  font-weight: 300;
  transform: translateY(100%);
  transition: transform 0.25s var(--ease-out);
}

.book-cover a:hover .buy-label {
  transform: translateY(0);
}

/* Book info */
.book-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--paper-warm);
}

.book-header h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.8vw, 2.1rem);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
  margin-bottom: 0.3rem;
}

.book-subtitle {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1rem;
  color: var(--ink-mid);
  margin-bottom: 0.35rem;
}

.book-date {
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-light);
  font-family: var(--font-body);
  font-weight: 300;
}

.book-description p {
  color: var(--ink-mid);
  margin-bottom: 1rem;
  font-size: 1rem;
  line-height: 1.85;
}

/* Book details definition list */
.book-details {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--paper-warm);
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 1.5rem;
  row-gap: 0.35rem;
  font-size: 0.85rem;
}

.book-details dt {
  font-weight: 400;
  color: var(--ink-light);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.book-details dd {
  color: var(--ink-mid);
}

/* ============================================
   RESOURCES SECTION
   ============================================ */
.section-resources {
  padding: 4.5rem 0;
  background: var(--paper-warm);
}

.section-resources h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 700;
  margin-bottom: 2rem;
  color: var(--ink);
}

.resource-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.resource-list li a {
  font-size: 1rem;
  color: var(--sky);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition), color var(--transition);
}

.resource-list li a:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

/* ============================================
   ABOUT SECTION
   ============================================ */
.section-about {
  padding: 4.5rem 0;
  background: var(--paper);
}

.section-about h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--ink);
}

.section-about p {
  max-width: 680px;
  color: var(--ink-mid);
  margin-bottom: 1.25rem;
  line-height: 1.85;
}

.affiliate-notice {
  font-size: 0.82rem !important;
  color: var(--ink-light) !important;
  font-style: italic;
  border-top: 1px solid var(--paper-warm);
  padding-top: 1.25rem;
  margin-top: 0.5rem;
}

/* ============================================
   FOOTER
   ============================================ */
footer {
  background: var(--ink);
  color: rgba(250, 247, 242, 0.65);
  padding: 2.5rem 0;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer-copy {
  font-size: 0.85rem;
}

.footer-copy a {
  color: var(--accent-pale);
  text-decoration: none;
}

.footer-copy a:hover {
  color: var(--paper);
}

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

.footer-links a {
  font-size: 0.82rem;
  color: rgba(250, 247, 242, 0.55);
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: color var(--transition);
}

.footer-links a:hover {
  color: var(--paper);
}

/* ============================================
   RESPONSIVE — TABLET
   ============================================ */
@media (max-width: 800px) {
  .book-card,
  .book-card.reverse {
    grid-template-columns: 1fr;
  }

  .book-card.reverse .book-cover,
  .book-card.reverse .book-info {
    order: unset;
  }

  .book-cover {
    position: static;
    max-width: 220px;
    margin: 0 auto 1.5rem;
  }

  .buy-label {
    transform: translateY(0);
  }

  hr.section-divider {
    width: 80%;
  }
}

/* ============================================
   RESPONSIVE — MOBILE
   ============================================ */
@media (max-width: 480px) {
  :root {
    --book-gap: 2.5rem;
  }

  .container {
    padding: 0 1.25rem;
  }

  .book-section {
    padding: var(--book-gap) 0;
  }

  .book-details {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .book-details dt {
    margin-top: 0.5rem;
    font-weight: 400;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ============================================
   SCROLL REVEAL (toggled by JS)
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.reveal.visible {
  opacity: 1;
  transform: none;
}