/**
 * home.css - トップページ固有スタイル
 */

/* カルーセル */
.carousel-section {
  padding: 0 1.5rem;
  max-width: 1100px;
  margin: 1.25rem auto 0;
}

.carousel-container {
  position: relative;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}

.carousel-viewport {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.08);
}

.carousel-track {
  display: flex;
}

.carousel-slide {
  flex: 0 0 100%;
  max-width: 100%;
}

.carousel-slide img {
  width: 100%;
  height: auto;
  display: block;
}

.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s, opacity 0.3s;
  z-index: 10;
  opacity: 0;
}

.carousel-viewport:hover .carousel-nav {
  opacity: 1;
}

.carousel-nav:hover {
  background: rgba(0, 0, 0, 0.7);
}

.carousel-nav.prev {
  left: 1rem;
}

.carousel-nav.next {
  right: 1rem;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 0;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-border);
  border: none;
  cursor: pointer;
  transition: background 0.3s;
}

.carousel-dot.active {
  background: var(--color-primary);
}

/* 最新情報セクション */
.latest-section {
  padding: 2rem 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
}

/* 新刊情報 */
.books-section {
  margin-bottom: 3rem;
}

.books-list {
  margin-top: 0.5rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.book-item {
  display: flex;
  gap: 0.8rem;
  text-decoration: none;
  color: inherit;
  transition: opacity 0.2s;
}

.book-item:hover {
  opacity: 0.8;
}

.book-item-cover {
  flex-shrink: 0;
  width: 70px;
}

.book-item-cover img {
  width: 100%;
  height: auto;
  display: block;
}

.book-item-info {
  flex: 1;
  min-width: 0;
  padding-top: 0.2rem;
}

.book-item-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.4rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-item-meta {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* バナーエリア */
.banners-section {
  margin-top: 2.5rem;
  margin-bottom: 2.5rem;
}

.banners-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.banner-item {
  display: block;
  max-width: 600px;
  width: 100%;
  transition: opacity 0.2s, transform 0.2s;
}

.banner-item:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

.banner-item img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* お知らせ */
.news-section {
  margin-top: 2rem;
}

.news-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.news-item {
  padding: 0 0 0.3rem 0;
}

.news-item a {
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: baseline;
  gap: 1rem;
}

.news-item:hover {
  opacity: 0.7;
}

.news-date {
  flex-shrink: 0;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.news-title {
  flex: 1;
  font-size: 0.95rem;
  color: var(--color-text);
  font-weight: 500;
}

.news-item:hover .news-title {
  color: var(--color-accent);
}


/* レスポンシブ */
@media screen and (max-width: 900px) {
  .books-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media screen and (max-width: 768px) {
  .carousel-nav {
    width: 32px;
    height: 32px;
    font-size: 1rem;
    opacity: 1;
  }

  .carousel-nav.prev {
    left: 0.5rem;
  }

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

@media screen and (max-width: 600px) {
  .books-list {
    grid-template-columns: 1fr;
  }

  .book-item-cover {
    width: 60px;
  }
}