/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

img {
  max-width: 100%;
  height: auto;
}

body {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    system-ui,
    sans-serif;
  line-height: 1.6;
  color: #717254;
  background-color: #f4f1ec;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Header and Navigation */
header {
  background-color: #f4f1ec;
  border-bottom: 1px solid #cecdcd;
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.logo a {
  text-decoration: none;
  font-size: 1.25rem;
  font-weight: 500;
  color: #717254;
  letter-spacing: -0.025em;
}

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

.nav-links a {
  text-decoration: none;
  color: #cecdcd;
  font-weight: 400;
  transition: color 0.2s ease;
  color: #717254;
}

.nav-links a:hover {
  color: #5a5a40;
}

/* Hide toggle mechanism on desktop */
.nav-toggle {
  display: none;
}

.nav-hamburger {
  display: none;
}

/* Hero Section */
.hero {
  padding: 4rem 0 6rem;
  background: linear-gradient(135deg, #f4f1ec 0%, #ebdad2 100%);
}

.hero-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  margin-bottom: 3rem;
}

.hero-text h1 {
  font-size: 3rem;
  font-weight: 300;
  color: #717254;
  margin-bottom: 1rem;
  letter-spacing: -0.05em;
}

.hero-image {
  display: flex;
  justify-content: center;
  align-items: center;
}

.headshot {
  max-width: min(400px, 100%);
  height: auto;
  display: block;
}

.hero-img {
  width: 100%;
  max-width: 400px;
  height: auto;
  border-radius: 0.5rem;
  box-shadow: 0 8px 25px rgba(113, 114, 84, 0.15);
  transition:
    transform 0.3s ease,
    filter 0.3s ease;
  filter: sepia(25%) saturate(0.75) brightness(0.95) contrast(1.05)
    hue-rotate(-5deg);
}

.hero-img:hover {
  transform: scale(1.02);
  filter: sepia(20%) saturate(0.8) brightness(1) contrast(1.1) hue-rotate(-3deg);
}

.hero-description {
  font-size: 1.125rem;
  color: #717254;
  max-width: 600px;
  margin-bottom: 2rem;
  line-height: 1.7;
}

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

/* Service Cards (in hero) */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.service-card {
  padding: 2rem;
  background-color: #ebdad2;
  border-radius: 0.5rem;
  border: 1px solid #cecdcd;
  transition: all 0.2s ease;
}

.service-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(113, 114, 84, 0.1);
  border-color: #717254;
}

.service-card h3 {
  font-size: 1.25rem;
  font-weight: 500;
  color: #717254;
  margin-bottom: 0.75rem;
}

.service-card p {
  color: #717254;
  margin-bottom: 1rem;
  line-height: 1.6;
}

.service-link {
  color: #717254;
  text-decoration: none;
  font-weight: 400;
  transition: color 0.2s ease;
}

.service-link:hover {
  color: #5a5a40;
}

/* Buttons */
.btn-primary {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background-color: #717254;
  color: #f4f1ec;
  text-decoration: none;
  border-radius: 0.375rem;
  font-weight: 400;
  transition: background-color 0.2s ease;
}

.btn-primary:hover {
  background-color: #5a5a40;
}

.btn-secondary {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background-color: transparent;
  color: #717254;
  text-decoration: none;
  border: 1px solid #cecdcd;
  border-radius: 0.375rem;
  font-weight: 400;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background-color: #ebdad2;
  border-color: #717254;
}

/* Preview Section */
.preview {
  padding: 4rem 0;
  background-color: #f4f1ec;
}

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

.preview-card {
  padding: 2rem;
  background-color: #ebdad2;
  border-radius: 0.5rem;
  border: 1px solid #cecdcd;
  transition: all 0.2s ease;
}

.preview-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(113, 114, 84, 0.1);
  border-color: #717254;
}

.preview-card h3 {
  font-size: 1.25rem;
  font-weight: 500;
  color: #717254;
  margin-bottom: 0.75rem;
}

.preview-card p {
  color: #717254;
  margin-bottom: 1rem;
  line-height: 1.6;
}

.preview-link {
  color: #717254;
  text-decoration: none;
  font-weight: 400;
  transition: color 0.2s ease;
}

.preview-link:hover {
  color: #5a5a40;
}

/* Page Header */
.page-header {
  padding: 4rem 0;
  background: linear-gradient(135deg, #f4f1ec 0%, #ebdad2 100%);
}

.page-header h1 {
  font-size: 2.5rem;
  font-weight: 300;
  color: #717254;
  margin-bottom: 1rem;
  letter-spacing: -0.05em;
}

.bio {
  overflow-wrap: break-word;
  max-width: 100%;
  line-height: 1.7;
}

.bio p {
  margin-bottom: 1rem;
}

.page-description {
  font-size: 1.125rem;
  color: #717254;
  line-height: 1.7;
}

/* Footer */
footer {
  background-color: #ebdad2;
  border-top: 1px solid #cecdcd;
  padding: 2rem 0;
  margin-top: 4rem;
}

footer p {
  text-align: center;
  color: #cecdcd;
  font-size: 0.875rem;
  color: #717254;
}

/* Newsletter Form */
.embeddable-buttondown-form {
  max-width: 500px;
  margin: 2rem 0 0;
  padding: 2rem;
  background-color: #ebdad2;
  border-radius: 0.5rem;
  border: 1px solid #cecdcd;
  box-shadow: 0 4px 15px rgba(113, 114, 84, 0.1);
}

.embeddable-buttondown-form label {
  display: block;
  font-size: 1rem;
  font-weight: 500;
  color: #717254;
  margin-bottom: 0.5rem;
}

.embeddable-buttondown-form input[type="email"] {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #cecdcd;
  border-radius: 0.375rem;
  background-color: #f4f1ec;
  color: #717254;
  font-size: 1rem;
  font-family: inherit;
  margin-bottom: 1rem;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.embeddable-buttondown-form input[type="email"]:focus {
  outline: none;
  border-color: #717254;
  box-shadow: 0 0 0 3px rgba(113, 114, 84, 0.1);
}

.embeddable-buttondown-form input[type="email"]::placeholder {
  color: #cecdcd;
}

.embeddable-buttondown-form input[type="submit"] {
  background-color: #717254;
  color: #f4f1ec;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 0.375rem;
  font-size: 1rem;
  font-weight: 400;
  font-family: inherit;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    transform 0.1s ease;
  width: 100%;
}

.embeddable-buttondown-form input[type="submit"]:hover {
  background-color: #5a5a40;
  transform: translateY(-1px);
}

.embeddable-buttondown-form input[type="submit"]:active {
  transform: translateY(0);
}

/* Book Recommendations */
.book-filters {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.book-filters label {
  font-size: 0.875rem;
  color: #717254;
  font-weight: 500;
}

.book-filters select {
  padding: 0.4rem 0.75rem;
  border: 1px solid #cecdcd;
  border-radius: 4px;
  background: #f4f1ec;
  color: #717254;
  font-size: 0.875rem;
  cursor: pointer;
}

.book-count {
  font-size: 0.875rem;
  color: #717254;
  margin-bottom: 1.5rem;
}

.book-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 2rem;
}

.book-card {
  background-color: #ebdad2;
  border: 1px solid #cecdcd;
  border-radius: 0.5rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.book-cover {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
}

.book-info {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.book-info h3 {
  font-size: 1rem;
  font-weight: 500;
  color: #717254;
  margin-bottom: 0.25rem;
}

.book-author {
  font-size: 0.875rem;
  color: #717254;
  margin-bottom: 0.5rem;
}

.book-age {
  font-size: 0.8rem;
  color: #717254;
  margin-bottom: 0.5rem;
}

.book-themes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.tag {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  background-color: #f4f1ec;
  border: 1px solid #cecdcd;
  border-radius: 999px;
  color: #717254;
}

.book-why {
  font-size: 0.875rem;
  color: #717254;
  line-height: 1.5;
  margin-bottom: 0.75rem;
  flex: 1;
}

.worldcat-link {
  display: inline-block;
  margin-top: auto;
  font-size: 0.875rem;
  color: #717254;
  text-decoration: underline;
}

.worldcat-link:hover {
  color: #5a5a40;
}

.no-results {
  color: #717254;
  padding: 2rem 0;
}

/* Responsive Design */
@media (max-width: 768px) {
  /* Nav: hamburger layout — header stays fixed height, links drop as overlay */
  header {
    position: relative;
  }

  .nav-container {
    height: 3.5rem;
    padding: 0 1.25rem;
  }

  .nav-hamburger {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 1.5rem;
    height: 1.125rem;
    cursor: pointer;
    margin: auto 0;
  }

  .nav-hamburger span {
    display: block;
    height: 2px;
    background-color: #717254;
    border-radius: 2px;
    transition:
      transform 0.2s ease,
      opacity 0.2s ease;
  }

  /* Hide links by default on mobile */
  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #f4f1ec;
    border-bottom: 1px solid #cecdcd;
    gap: 0;
    padding: 0.5rem 1.25rem 1rem;
    z-index: 99;
  }

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

  .nav-links a {
    display: block;
    padding: 0.75rem 0;
    font-size: 1rem;
  }

  /* Show links when checkbox is checked */
  .nav-toggle:checked ~ .nav-links {
    display: flex;
  }

  /* Animate hamburger to X when open */
  .nav-toggle:checked ~ .nav-hamburger span:nth-child(1) {
    transform: translateY(0.5rem) rotate(45deg);
  }

  .nav-toggle:checked ~ .nav-hamburger span:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle:checked ~ .nav-hamburger span:nth-child(3) {
    transform: translateY(-0.5rem) rotate(-45deg);
  }

  .hero-content {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }

  .hero-text h1 {
    font-size: 2.25rem;
  }

  .hero-image {
    order: -1; /* Show image before text on mobile */
  }

  .hero-img {
    max-width: 300px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .btn-primary,
  .btn-secondary {
    display: block;
    text-align: center;
    min-width: 200px;
  }

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

@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }

  .hero {
    padding: 2rem 0 3rem;
  }

  .hero h1 {
    font-size: 1.875rem;
  }

  .preview {
    padding: 2rem 0;
  }
}
