/* Bookshelf Styles */

.bookshelf {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.bookshelf-header {
  margin-bottom: 3rem;
  text-align: center;
}

.bookshelf-header h1 {
  margin-bottom: 1rem;
  color: #1a1a1a;
}

/* Gallery Grid */
.bookshelf-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  margin-top: 2rem;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

/* Book Cards */
.book-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
}

.book-card figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Book Cover */
.book-cover {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 2/3;
  object-fit: cover;
  background: #f5f5f5;
}

/* Placeholder for missing images */
.book-cover-placeholder {
  width: 100%;
  aspect-ratio: 2/3;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  text-align: center;
}

.book-title-text {
  color: #fff;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.4;
}

/* Book Info */
.book-info {
  padding: 1.25rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.book-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
  color: #1a1a1a;
  line-height: 1.3;
}

.book-author {
  font-size: 0.938rem;
  color: #666;
  margin: 0 0 0.5rem 0;
  font-style: italic;
}

.book-year {
  font-size: 0.875rem;
  color: #888;
  margin: 0 0 0.75rem 0;
}

.book-impact {
  font-size: 0.938rem;
  color: #4a4a4a;
  margin: 0;
  line-height: 1.5;
  flex-grow: 1;
  border-top: 1px solid #e5e5e5;
  padding-top: 0.75rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .bookshelf-gallery {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    max-width: 500px;
  }
  
  .bookshelf-header h1 {
    font-size: 2rem;
  }
}

@media (max-width: 480px) {
  .bookshelf-gallery {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    max-width: 400px;
  }
  
  .book-info {
    padding: 1rem;
  }
  
  .book-title {
    font-size: 1rem;
  }
  
  .book-impact {
    font-size: 0.875rem;
  }
  
  .bookshelf-header h1 {
    font-size: 1.75rem;
  }
}

/* Focus Styles for Accessibility */
.book-card:focus-within {
  outline: 3px solid #667eea;
  outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .book-card {
    transition: none;
  }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .book-card {
    border: 2px solid currentColor;
  }
  
  .book-impact {
    border-top: 2px solid currentColor;
  }
}

/* Print Styles */
@media print {
  .bookshelf-gallery {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .book-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ccc;
  }
}