/* Shared UI component styles used across static pages */

/* Grid list for books/cards */
.book-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 1rem;
}

/* Responsive tweaks for book list */
@media (max-width: 768px) {
  .book-list {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
  }
}

@media (max-width: 480px) {
  .book-list {
    grid-template-columns: 1fr;
  }
}

/* Card component */
.book-card {
  border: 1px solid rgba(128, 128, 128, 0.3);
  border-radius: 12px;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  background-color: var(--bg-color);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.book-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  border-color: rgba(128, 128, 128, 0.5);
}

.book-card h3 {
  margin-bottom: 1rem;
  font-size: 1.3rem;
  color: var(--text-color);
  line-height: 1.4;
}

/* Metadata lines within cards */
.book-meta {
  margin: 0.5rem 0;
  font-size: 0.95rem;
  opacity: 0.8;
}

.book-meta strong {
  color: var(--text-color);
  opacity: 1;
}

/* Clickable author pill/button */
.author-button {
  background: none;
  border: 1px solid rgba(128, 128, 128, 0.5);
  color: var(--text-color);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: inherit;
  transition: all 0.2s ease;
  display: inline-block;
  margin: 0.1rem 0.2rem 0.1rem 0;
  cursor: pointer;
}

.author-button:hover {
  background: rgba(128, 128, 128, 0.2);
  border-color: rgba(128, 128, 128, 0.7);
}

/* Common button styles used across header/settings */
:is(.menu-button, .toc-button, .settings-button, .bookmark-button, .theme-button) {
  background-color: var(--bg-color);
  color: var(--text-color);
  border: 1px solid var(--text-color);
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 300ms, color 300ms, border-color 300ms;
  font-size: 1rem;
  white-space: nowrap;
  /* Allow text-labeled buttons to expand while keeping a sensible minimum */
  min-width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

:is(.menu-button, .toc-button, .settings-button, .bookmark-button, .theme-button):hover {
  background-color: rgba(128, 128, 128, 0.2);
}

/* Theme button states */
.theme-button.active {
  background-color: var(--text-color);
  color: var(--bg-color);
}

.theme-button.active:hover {
  background-color: var(--text-color);
  opacity: 0.8;
}
