/* ============================================================
   Echoes of the Soul — Main Stylesheet
   Design: Cream + Deep Purple + Gold, inspired by the book cover
   ============================================================ */

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

/* --- CSS Variables --- */
:root {
  --cream:       #f7f3ef;
  --cream-dark:  #ede7df;
  --purple:      #5c1e4f;
  --purple-light:#7d3570;
  --purple-pale: #f0e6ee;
  --gold:        #c9a235;
  --gold-light:  #e8cc7a;
  --text:        #3a3239;
  --text-light:  #7a6f78;
  --white:       #ffffff;
  --shadow:      0 4px 24px rgba(92,30,79,0.08);
  --shadow-hover:0 8px 40px rgba(92,30,79,0.15);
  --radius:      12px;
  --sidebar-w:   300px;
  --font-serif:  'Cormorant Garant', Georgia, serif;
  --font-sans:   'Raleway', sans-serif;
  --transition:  0.25s ease;
}

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

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

body {
  font-family: var(--font-sans);
  background-color: var(--cream);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
}

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

a { color: var(--purple); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--gold); }

h1, h2, h3, h4, h5 {
  font-family: var(--font-serif);
  color: var(--purple);
  line-height: 1.25;
  letter-spacing: 0.01em;
}

p { margin-bottom: 1.25rem; }

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--cream-dark); }
::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 3px; }

/* ============================================================
   NAVIGATION
   ============================================================ */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(247,243,239,0.97);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--cream-dark);
  box-shadow: 0 2px 16px rgba(92,30,79,0.06);
}

.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.nav-brand {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.nav-brand .book-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--purple);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.nav-brand .book-subtitle-sm {
  font-size: 0.7rem;
  color: var(--gold);
  letter-spacing: 0.12em;
  font-weight: 500;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--purple);
  border-bottom-color: var(--gold);
}

.nav-cta {
  background: var(--purple) !important;
  color: var(--white) !important;
  padding: 0.5rem 1.2rem !important;
  border-radius: 50px !important;
  border: none !important;
  transition: background var(--transition), transform var(--transition) !important;
}

.nav-cta:hover {
  background: var(--gold) !important;
  color: var(--purple) !important;
  transform: translateY(-1px);
}

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  background: none;
  border: none;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--purple);
  border-radius: 2px;
  transition: all var(--transition);
}

/* Gold divider ornament */
.ornament {
  text-align: center;
  color: var(--gold);
  font-size: 1.5rem;
  letter-spacing: 0.5rem;
  margin: 1rem 0;
  opacity: 0.7;
}

/* ============================================================
   HERO — Landing Page
   ============================================================ */
.hero {
  background: linear-gradient(135deg, #f7f3ef 0%, #f0e6ee 50%, #f7f3ef 100%);
  padding: 5rem 2rem 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 50%, rgba(201,162,53,0.07) 0%, transparent 70%);
  pointer-events: none;
}

.hero-inner {
  max-width: 900px;
  margin: 0 auto;
  position: relative;
}

.hero-cover {
  width: 220px;
  margin: 0 auto 2.5rem;
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(92,30,79,0.25), 0 4px 16px rgba(201,162,53,0.15);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.hero-cover:hover {
  transform: translateY(-6px) rotate(-1deg);
  box-shadow: 0 32px 80px rgba(92,30,79,0.3), 0 8px 24px rgba(201,162,53,0.2);
}

.hero-eyebrow {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1rem;
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 700;
  color: var(--purple);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  line-height: 1.1;
  margin-bottom: 0.5rem;
}

.hero-title .of-the {
  font-size: 0.55em;
  font-weight: 300;
  letter-spacing: 0.2em;
  display: block;
  margin: 0.2rem 0;
}

.hero-tagline {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1rem, 2.5vw, 1.35rem);
  color: var(--text-light);
  margin: 1.5rem auto;
  max-width: 520px;
  font-weight: 300;
}

.hero-author {
  font-size: 0.82rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 2.5rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.8rem;
  border-radius: 50px;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--purple);
  color: var(--white);
  border-color: var(--purple);
}

.btn-primary:hover {
  background: var(--purple-light);
  border-color: var(--purple-light);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(92,30,79,0.3);
}

.btn-gold {
  background: var(--gold);
  color: var(--white);
  border-color: var(--gold);
}

.btn-gold:hover {
  background: var(--gold-light);
  border-color: var(--gold-light);
  color: var(--purple);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(201,162,53,0.3);
}

.btn-outline {
  background: transparent;
  color: var(--purple);
  border-color: var(--purple);
}

.btn-outline:hover {
  background: var(--purple);
  color: var(--white);
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  color: var(--gold);
  border-color: var(--gold);
}

.btn-ghost:hover {
  background: var(--gold);
  color: var(--white);
  transform: translateY(-2px);
}

/* ============================================================
   MAIN LAYOUT — Sidebar + Content
   ============================================================ */
.page-wrapper {
  max-width: 1280px;
  margin: 0 auto;
  padding: 3rem 2rem;
  display: grid;
  grid-template-columns: 1fr var(--sidebar-w);
  gap: 3rem;
  align-items: start;
}

.page-main { min-width: 0; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  position: sticky;
  top: 90px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.sidebar-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--cream-dark);
  text-align: center;
}

.sidebar-card h3 {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--purple);
  letter-spacing: 0.05em;
}

.sidebar-cover {
  width: 140px;
  margin: 0 auto 1rem;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(92,30,79,0.18);
}

.sidebar-card .btn {
  width: 100%;
  justify-content: center;
  margin-bottom: 0.6rem;
  font-size: 0.78rem;
}

.sidebar-divider {
  border: none;
  border-top: 1px solid var(--cream-dark);
  margin: 0.75rem 0;
}

.sidebar-quote {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--text-light);
  line-height: 1.7;
  padding: 0.5rem 0;
}

.sidebar-progress-label {
  font-size: 0.75rem;
  color: var(--text-light);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.progress-bar {
  height: 4px;
  background: var(--cream-dark);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple), var(--gold));
  border-radius: 4px;
  transition: width 0.5s ease;
}

.progress-text {
  font-size: 0.75rem;
  color: var(--text-light);
}

/* ============================================================
   ABOUT SECTION — Landing Page
   ============================================================ */
.section {
  padding: 4rem 2rem;
}

.section-inner {
  max-width: 1280px;
  margin: 0 auto;
}

.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  color: var(--purple);
  margin-bottom: 1.5rem;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.about-text {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  line-height: 1.9;
  color: var(--text);
}

.about-image {
  border-radius: var(--radius);
  box-shadow: var(--shadow-hover);
}

/* ============================================================
   CHAPTERS LIST — Landing Page
   ============================================================ */
.chapters-section {
  background: var(--cream-dark);
  padding: 5rem 2rem;
}

.chapters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2.5rem;
}

.chapter-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
  border: 1px solid transparent;
  transition: all var(--transition);
  text-decoration: none;
  display: block;
  position: relative;
  overflow: hidden;
}

.chapter-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  background: linear-gradient(180deg, var(--purple), var(--gold));
  opacity: 0;
  transition: opacity var(--transition);
}

.chapter-card:hover {
  border-color: var(--purple-pale);
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
}

.chapter-card:hover::before { opacity: 1; }

.chapter-num {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

.chapter-card-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: var(--purple);
  margin-bottom: 0.75rem;
}

.chapter-card-excerpt {
  font-size: 0.875rem;
  color: var(--text-light);
  line-height: 1.6;
}

.chapter-card-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--purple);
  margin-top: 1rem;
  transition: gap var(--transition);
}

.chapter-card:hover .chapter-card-arrow { gap: 0.7rem; }

/* ============================================================
   TESTIMONIALS
   ============================================================ */
.testimonials-section {
  padding: 5rem 2rem;
  background: var(--purple);
  text-align: center;
}

.testimonials-section .section-label { color: var(--gold-light); }
.testimonials-section .section-title { color: var(--white); }

.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.testimonial-card {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: left;
}

.testimonial-text {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.05rem;
  color: rgba(255,255,255,0.9);
  line-height: 1.8;
  margin-bottom: 1.25rem;
}

.testimonial-author {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-light);
}

/* ============================================================
   CHAPTER READING PAGE
   ============================================================ */
.chapter-hero {
  background: linear-gradient(135deg, var(--purple) 0%, #3d1240 100%);
  padding: 4rem 2rem 3rem;
  text-align: center;
  color: var(--white);
  position: relative;
  overflow: hidden;
}

.chapter-hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 40px;
  background: var(--cream);
  clip-path: ellipse(55% 100% at 50% 100%);
}

.chapter-hero-eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-light);
  margin-bottom: 1rem;
}

.chapter-hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 3rem);
  color: var(--white);
  margin-bottom: 0.75rem;
}

.chapter-hero-sub {
  font-family: var(--font-serif);
  font-style: italic;
  color: rgba(255,255,255,0.7);
  font-size: 1.05rem;
}

/* Chapter content */
.chapter-content {
  font-family: var(--font-serif);
  font-size: 1.175rem;
  line-height: 2;
  color: var(--text);
  max-width: 680px;
}

.chapter-content p { margin-bottom: 1.75rem; }

.chapter-content p:first-of-type::first-letter {
  font-size: 4rem;
  font-weight: 700;
  color: var(--purple);
  float: left;
  line-height: 0.75;
  margin: 0.1em 0.1em 0 0;
  font-family: var(--font-serif);
}

.chapter-content blockquote {
  border-left: 3px solid var(--gold);
  margin: 2rem 0;
  padding: 1rem 1.5rem;
  font-style: italic;
  color: var(--text-light);
  background: var(--purple-pale);
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* Chapter navigation */
.chapter-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem 0;
  border-top: 1px solid var(--cream-dark);
  margin-top: 3rem;
  gap: 1rem;
}

.chapter-nav-link {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.chapter-nav-link.next { text-align: right; }

.chapter-nav-label {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-light);
}

.chapter-nav-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--purple);
  font-weight: 600;
}

/* Font size controls */
.reading-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
  padding: 0.75rem 1rem;
  background: var(--white);
  border-radius: 50px;
  box-shadow: var(--shadow);
  width: fit-content;
}

.reading-controls-label {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-light);
}

.font-btn {
  background: none;
  border: 1px solid var(--cream-dark);
  border-radius: 50%;
  width: 28px; height: 28px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--purple);
  font-size: 0.9rem;
  transition: all var(--transition);
}

.font-btn:hover {
  background: var(--purple);
  color: var(--white);
  border-color: var(--purple);
}

/* ============================================================
   COMMENTS — Disqus wrapper
   ============================================================ */
.comments-section {
  margin-top: 4rem;
  padding-top: 3rem;
  border-top: 1px solid var(--cream-dark);
}

.comments-title {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  color: var(--purple);
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.comments-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--gold), transparent);
}

#disqus_thread { margin-top: 1.5rem; }

/* ============================================================
   DONATE PAGE
   ============================================================ */
.donate-hero {
  background: linear-gradient(135deg, #f7f3ef 0%, #f0e6ee 100%);
  padding: 5rem 2rem 4rem;
  text-align: center;
}

.donate-amounts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
  max-width: 700px;
  margin-left: auto; margin-right: auto;
}

.amount-card {
  background: var(--white);
  border: 2px solid var(--cream-dark);
  border-radius: var(--radius);
  padding: 1.5rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
}

.amount-card:hover,
.amount-card.selected {
  border-color: var(--purple);
  background: var(--purple-pale);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.amount-value {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  color: var(--purple);
  display: block;
}

.amount-label {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-top: 0.25rem;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--purple);
  color: rgba(255,255,255,0.8);
  padding: 4rem 2rem 2rem;
  margin-top: 4rem;
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-brand .book-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--white);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}

.footer-brand p {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.6);
  max-width: 280px;
  margin-top: 0.75rem;
}

.footer-heading {
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-light);
  margin-bottom: 1.25rem;
  font-family: var(--font-sans);
  font-weight: 600;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-links a {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.65);
  transition: color var(--transition);
}

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

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 2rem;
  text-align: center;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.4);
}

/* ============================================================
   UTILITIES
   ============================================================ */
.text-center { text-align: center; }
.text-gold { color: var(--gold); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }

.gold-rule {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 2rem 0;
  color: var(--gold);
  opacity: 0.5;
  font-size: 1.2rem;
  letter-spacing: 0.5rem;
}

.gold-rule::before,
.gold-rule::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gold);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .page-wrapper {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }
  .about-grid { gap: 2rem; }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 68px;
    left: 0; right: 0;
    background: var(--cream);
    flex-direction: column;
    gap: 0;
    border-top: 1px solid var(--cream-dark);
    box-shadow: var(--shadow);
    z-index: 99;
  }

  .nav-links.open { display: flex; }

  .nav-links li { width: 100%; }

  .nav-links a {
    display: block;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--cream-dark);
    border-bottom-width: 1px !important;
  }

  .nav-toggle { display: flex; }

  .about-grid { grid-template-columns: 1fr; }

  .footer-inner { grid-template-columns: 1fr; gap: 2rem; }

  .hero { padding: 3rem 1.5rem 2.5rem; }

  .sidebar { grid-template-columns: 1fr; }

  .page-wrapper { padding: 2rem 1.25rem; }

  .chapter-nav { flex-direction: column; align-items: flex-start; }

  .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 2.2rem; }
  .footer-inner { grid-template-columns: 1fr; }
  .donate-amounts { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-up {
  animation: fadeUp 0.6s ease forwards;
}

.fade-up-delay-1 { animation-delay: 0.1s; opacity: 0; }
.fade-up-delay-2 { animation-delay: 0.2s; opacity: 0; }
.fade-up-delay-3 { animation-delay: 0.3s; opacity: 0; }
.fade-up-delay-4 { animation-delay: 0.4s; opacity: 0; }
