.newbooks-carousel {
 /* overflow-x: auto;
  padding: 1rem;*/
  position: relative;
  padding: 0 3rem; /* space for buttons */
}


/*.newbooks-carousel {
  position: relative;
  overflow: hidden;
}*/

/* Each book cover has a fixed width */
.carousel-item {
  flex: 0 0 160px; /* width of one item */
}

/* The viewport shows 5 items max */
.carousel-list {
  --items-visible: 5;
  
  position: relative;

  display: flex;
  gap: 1rem;
  list-style: none;

  padding: 1rem 2.5rem;
  margin: 0;

  overflow-x: auto;
  scroll-behavior: smooth;

  /* 160px per item + 1rem gap */
  max-width: calc((160px + 1rem) * var(--items-visible));
}



.carousel-item img {
  height: 200px;
  width: auto;
  border-radius: 4px;
}

.carousel-item a:focus img {
  outline: 3px solid #005fcc;
}



.carousel-controls 
{
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;

  display: flex;
  justify-content: space-between;
  align-items: center;

  transform: translateY(-50%);
  pointer-events: none; /* buttons opt-in below */
}


.carousel-controls button {
  pointer-events: auto;

  background: #ffffff;
  border: 2px solid #005fcc;
  color: #005fcc;

  width: 2.5rem;
  height: 2.5rem;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 1.5rem;
  line-height: 1;

  border-radius: 999px; /* circular */
  cursor: pointer;

  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}


/* Push buttons inward from edges */
.carousel-prev {
  margin-left: 0.5rem;
}

.carousel-next {
  margin-right: 0.5rem;
}


/* Focus styles (WCAG 2.1 AA) */
.carousel-controls button:focus-visible {
  outline: 3px solid #005fcc;
  outline-offset: 2px;
}



