/* books */

#books h3 {
  color: var(--text-secondary-color);
  font-weight: 600;
  margin-bottom: 2rem;
  text-align: center;
}

#books a {
  text-decoration: none;
  color: var(--text-secondary-color);
}

#books a:hover {
  color: var(--primary-color);
}

/* --- Card --- */

#books .card {
  background-color: var(--background-color); 
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: default;
  display: flex;
  flex-direction: column;
}

#books .card:hover {
  box-shadow: 0 12px 24px rgba(0,0,0,0.15), 0 4px 12px rgba(0,0,0,0.08);
  transform: translateY(-4px);
}

/* --- Book cover --- */

#books .card-img-top {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  transition: transform 0.4s ease, filter 0.4s ease;
}

#books .card:hover .card-img-top {
  transform: scale(1.05);
  filter: brightness(1.05);
}

/* --- Content --- */

#books .card-body {
  flex-grow: 1;            
  display: flex;
  flex-direction: column;
  justify-content: flex-start; 
}

#books .card-footer {
  margin-top: auto;    
}


#books .card-text {
  color: var(--text-secondary-color);
  font-size: 0.8rem;   
  line-height: 1.3;    
  flex-grow: 1;        
}

/* --- Badges --- */

#books .badge {
  background-color: rgba(0,0,0,0.05);
  color: var(--text-secondary-color);
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  border-radius: 0.4rem;
  margin: 0 0.2rem 0.2rem 0;
  transition: all 0.2s ease;
}

#books .badge:hover {
  background-color: rgba(0,0,0,0.1);
  color: var(--primary-color);
}

/* --- Footer --- */

#books .card-footer {
  background-color: var(--background-color);
  padding: 0.5rem 0.75rem;
  border-top: 1px solid rgba(0,0,0,0.05);
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}

#books .card-footer a {
  color: var(--text-secondary-color);
  font-weight: 500;
  border: none;
  font-size: 0.8rem;
  transition: color 0.2s ease;
}

#books .card-footer a:hover {
  color: var(--primary-color);
  opacity: 0.9;
}

/* --- Score badge --- */

#books .book-score {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  color: var(--primary-color);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.3rem 0.6rem;
  border-radius: 0.5rem;
  backdrop-filter: blur(4px);
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* --- Clickable area --- */

.card-link-wrapper {
  text-decoration: none;
  color: inherit;
  display: block;
}

.card-link-wrapper:hover .card-title {
  color: var(--primary-color);
}

/* --- Grid adjustments for 4 cards per row --- */

@media (min-width: 1200px) {
  #books .col-lg-4 {
    flex: 0 0 25%;
    max-width: 25%;
  }
}

@media (min-width: 992px) and (max-width: 1199px) {
  #books .col-md-6 {
    flex: 0 0 33.333%;
    max-width: 33.333%;
  }
}

@media (max-width: 991px) {
  #books .col-md-6, #books .col-lg-4 {
    flex: 0 0 50%;
    max-width: 50%;
  }
}

@media (max-width: 576px) {
  #books .col-md-6, #books .col-lg-4 {
    flex: 0 0 100%;
    max-width: 100%;
  }
}


/* Single page */


.book-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 3rem 1rem;
  text-align: center;
}

.book-page .book-cover {
  max-width: 400px;
  width: 100%;
  margin: 0 auto 1.5rem auto;
  border-radius: 0.75rem;
  box-shadow: 0 6px 24px rgba(0,0,0,0.25);
}

.book-page .book-title {
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.book-page .book-author {
  color: var(--text-secondary-color);
  margin-bottom: 0.5rem;
}

.book-page .book-badges .badge {
  color: var(--text-color);
  margin: 0 0.25rem;
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: 0.45rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}


.book-page .book-summary {
  max-width: 600px;
  margin: 0 auto 1.5rem auto; 
  line-height: 1.3;
  font-size: 1.1rem;
  font-style: italic;         
  color: var(--text-secondary-color);
}

/* --- Finished date --- */

.book-page .book-finished {
  display: inline-flex;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-secondary-color);
  padding: 0.3rem 0.6rem;
  border-radius: 0.5rem;
  gap: 0.3rem;
}

.book-page .book-finished .finished-label {
  font-weight: 600;
}