* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Georgia, 'Times New Roman', serif;
  color: #222;
  background: #faf9f6;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  border-bottom: 1px solid #e5e2da;
  background: #fff;
}

.logo {
  font-size: 1.25rem;
  font-weight: bold;
  text-decoration: none;
  color: #222;
}

.cart-link {
  text-decoration: none;
  color: #222;
  font-size: 0.95rem;
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem;
}

.hero {
  display: flex;
  gap: 2rem;
  align-items: center;
  padding: 3rem 0;
  border-bottom: 1px solid #e5e2da;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.hero-cover {
  width: 220px;
  height: 320px;
  background: #ddd8cc;
  border-radius: 6px;
  flex-shrink: 0;
}

.hero-info h1 { font-size: 2rem; margin-bottom: 0.5rem; }
.hero-info p.blurb { color: #555; margin-bottom: 1.5rem; max-width: 480px; }

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  border: none;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
}

.btn-primary { background: #2c2c2c; color: #fff; }
.btn-secondary { background: transparent; color: #2c2c2c; border: 1px solid #2c2c2c; margin-left: 0.75rem; }

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.5rem;
}

.book-card {
  background: #fff;
  border: 1px solid #e5e2da;
  border-radius: 6px;
  padding: 0.75rem;
  text-align: center;
  text-decoration: none;
  color: inherit;
}

.book-card .cover {
  width: 100%;
  height: 220px;
  background: #ddd8cc;
  border-radius: 4px;
  margin-bottom: 0.75rem;
}

.book-card h3 { font-size: 1rem; margin: 0 0 0.25rem; }
.book-card p { font-size: 0.85rem; color: #666; margin: 0; }

.format-list {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 1rem 0;
}

.format-option {
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  background: #fff;
  font-size: 0.9rem;
}

.format-option.selected {
  border-color: #2c2c2c;
  background: #2c2c2c;
  color: #fff;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.modal {
  background: #fff;
  border-radius: 8px;
  padding: 1.5rem;
  max-width: 380px;
  width: 90%;
}

.excerpt-box {
  background: #f5f3ee;
  border-radius: 4px;
  padding: 1rem;
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 1rem 0;
  max-height: 160px;
  overflow: hidden;
  position: relative;
}

.excerpt-fade {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 40px;
  background: linear-gradient(transparent, #f5f3ee);
}

input[type="email"] {
  width: 100%;
  padding: 0.6rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}

.site-footer {
  text-align: center;
  padding: 2rem;
  color: #888;
  font-size: 0.85rem;
}
