@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Work+Sans:wght@400;500;600;700&display=swap');

:root {
  --color-primary: #4c4a3e;
  --color-secondary: #8b4513;
  --color-accent: #d4a574;
  --color-text: #333333;
  --color-text-light: #666666;
  --color-headline: #4c4a3e;
  --color-background: #ffffff;
  --color-background-alt: #f8f7f4;
  --color-border: #e0ddd7;
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Work Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --max-width: 1200px;
  --spacing-unit: 1rem;
}

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

body {
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 1.7;
  color: var(--color-text);
  background-color: var(--color-background);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  font-weight: 500;
  line-height: 1.3;
  color: var(--color-headline);
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }

/* First heading in a section shouldn't have top margin */
h1:first-child,
h2:first-child,
h3:first-child,
h4:first-child,
h5:first-child,
h6:first-child {
  margin-top: 0;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--spacing-unit);
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-sans);
  font-weight: 500;
  border-radius: 4px;
  transition: all 0.3s ease;
  cursor: pointer;
  text-align: center;
}

.btn-primary {
  background-color: var(--color-primary);
  color: white;
  border: 2px solid var(--color-primary);
}

.btn-primary:hover {
  background-color: transparent;
  color: var(--color-primary);
}

.btn-secondary {
  background-color: var(--color-secondary);
  color: white;
  border: 2px solid var(--color-secondary);
}

.btn-secondary:hover {
  background-color: transparent;
  color: var(--color-secondary);
}

.btn-outline {
  background-color: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}

.btn-outline:hover {
  background-color: var(--color-primary);
  color: white;
}

.site-header {
  background-color: var(--color-background);
  border-bottom: 1px solid var(--color-border);
  padding: calc(var(--spacing-unit) * 1.5) 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-title {
  color: var(--color-text);
}

.site-title h1 {
  font-size: 1.5rem;
  margin: 0;
}

.tagline {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.9rem;
  color: var(--color-text-light);
  margin: 0;
}

.main-nav {
  display: flex;
  align-items: center;
}

/* Add breathing room under nav on all pages except homepage */
.main-content {
  padding-top: calc(var(--spacing-unit) * 2);
}

/* Homepage hero already has its own padding */
.home .main-content {
  padding-top: 0;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle span {
  display: block;
  width: 25px;
  height: 3px;
  background-color: var(--color-text);
  margin: 5px 0;
  transition: 0.3s;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: calc(var(--spacing-unit) * 2);
}

.nav-link {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--color-text);
  position: relative;
  white-space: nowrap;
}

.nav-link.active,
.nav-link:hover {
  color: var(--color-primary);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--color-primary);
}

.hero {
  background-color: var(--color-background-alt);
  padding: calc(var(--spacing-unit) * 4) 0;
}

.hero-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: calc(var(--spacing-unit) * 4);
  align-items: center;
}

.hero-title {
  font-size: 3rem;
  color: var(--color-headline);
  margin-bottom: var(--spacing-unit);
}

.hero-subtitle {
  font-size: 1.5rem;
  font-style: italic;
  color: var(--color-text-light);
  margin-bottom: 1.5rem;
}

.hero-description {
  font-size: 1.1rem;
  line-height: 1.8;
  margin-bottom: calc(var(--spacing-unit) * 2);
}

.hero-cta {
  display: flex;
  gap: var(--spacing-unit);
  flex-wrap: wrap;
}

.featured-book {
  text-align: center;
}

.featured-book-cover {
  max-width: 300px;
  width: 100%;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  margin-bottom: var(--spacing-unit);
}

.featured-book-info h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.publisher {
  color: var(--color-text-light);
  font-style: italic;
  margin-bottom: var(--spacing-unit);
}

.featured-review {
  font-style: italic;
  border-left: 3px solid var(--color-accent);
  padding-left: var(--spacing-unit);
  margin: calc(var(--spacing-unit) * 1.5) 0;
}

.featured-review cite {
  font-style: normal;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--color-text-light);
}

.section-title {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: calc(var(--spacing-unit) * 2);
  color: var(--color-headline);
}

.section-description {
  text-align: center;
  max-width: 700px;
  margin: 0 auto calc(var(--spacing-unit) * 3);
  font-size: 1.1rem;
  color: var(--color-text-light);
}

.recent-posts,
.chapter-extras-preview,
.media-highlight {
  padding: calc(var(--spacing-unit) * 4) 0;
}

.posts-grid,
.extras-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: calc(var(--spacing-unit) * 2);
  margin-bottom: calc(var(--spacing-unit) * 2);
}

.post-card,
.extra-card {
  background-color: var(--color-background);
  border: 1px solid var(--color-border);
  padding: calc(var(--spacing-unit) * 1.5);
  border-radius: 8px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post-card:hover,
.extra-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.post-card h3,
.extra-card h3 {
  margin-bottom: 0.5rem;
}

.post-card time {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--color-text-light);
}

.post-excerpt {
  margin: var(--spacing-unit) 0;
  line-height: 1.6;
}

.read-more {
  font-family: var(--font-sans);
  font-weight: 500;
  color: var(--color-primary);
}

.read-more:hover {
  color: var(--color-secondary);
}

.chapter-number {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-secondary);
  background-color: var(--color-background-alt);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

.section-footer {
  text-align: center;
  margin-top: calc(var(--spacing-unit) * 2);
}

.media-highlight {
  background-color: var(--color-background-alt);
}

.media-feature {
  background-color: var(--color-background);
  border: 1px solid var(--color-border);
  padding: calc(var(--spacing-unit) * 2);
  border-radius: 8px;
  margin-bottom: calc(var(--spacing-unit) * 2);
}

.media-publication {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--color-text-light);
  margin-bottom: var(--spacing-unit);
}

.media-excerpt {
  font-size: 1.1rem;
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

.link-arrow {
  font-family: var(--font-sans);
  font-weight: 500;
}

.site-footer {
  background-color: var(--color-headline);
  color: white;
  padding: calc(var(--spacing-unit) * 3) 0 var(--spacing-unit);
  margin-top: calc(var(--spacing-unit) * 4);
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: calc(var(--spacing-unit) * 2);
  margin-bottom: calc(var(--spacing-unit) * 2);
}

.footer-section h3 {
  font-size: 1.2rem;
  margin-bottom: var(--spacing-unit);
}

.footer-links {
  list-style: none;
}

.footer-links a {
  color: rgba(255,255,255,0.8);
  font-family: var(--font-sans);
  font-size: 0.95rem;
}

.footer-links a:hover {
  color: white;
}

.social-links {
  display: flex;
  gap: var(--spacing-unit);
  margin-bottom: var(--spacing-unit);
}

.footer-bottom {
  text-align: center;
  padding-top: calc(var(--spacing-unit) * 2);
  border-top: 1px solid rgba(255,255,255,0.2);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: rgba(255,255,255,0.8);
}

@media (max-width: 800px) {
  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
  }

  /* Center hero CTA buttons on small screens */
  .hero-cta {
    justify-content: center;
  }

  .hero-title {
    font-size: 2rem;
  }

  .nav-toggle {
    display: block;
  }

  .nav-menu {
    position: fixed;
    left: -100%;
    top: 70px;
    flex-direction: column;
    background-color: white;
    width: 100%;
    text-align: center;
    transition: 0.3s;
    box-shadow: 0 10px 27px rgba(0,0,0,0.05);
    padding: calc(var(--spacing-unit) * 2) 0;
  }

  .nav-menu.active {
    left: 0;
  }

  .posts-grid,
  .extras-grid {
    grid-template-columns: 1fr;
  }
}
