/* cards.css */
.portal-home .book-card {
  position: relative;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  transition: transform 0.24s ease, box-shadow 0.24s ease;
}

.portal-home .book-card:hover,
.portal-home .book-card:focus-within {
  transform: translateY(-6px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.12);
}

.portal-home .book-card-cover-link {
  color: inherit;
  text-decoration: none;
  display: block;
  width: 100%;
  height: 100%;
}

.portal-home .book-title-link {
  color: inherit;
  text-decoration: none;
}

.portal-home .book-title-link:hover,
.portal-home .book-title-link:focus-visible {
  color: #111;
}

.portal-home .book-cta[href] {
  text-decoration: none;
}

.portal-home .book-cover {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: #efefef;
}

.portal-home .book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.28s ease;
}

.portal-home .book-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: #909090;
  font-size: 0.8rem;
  background: linear-gradient(145deg, #f3f3f3 0%, #e8e8e8 100%);
}

.portal-home .book-card:hover .book-cover img {
  transform: scale(1.04);
}

.portal-home .book-meta {
  padding: 10px 12px 14px;
}

.portal-home .book-title {
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: #222;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.4;
}

.portal-home .book-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
}

.portal-home .book-tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #f1f1f1;
  color: #444;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
}

.portal-home .book-tags.is-featured-tags .book-tag.is-featured-tag {
  background: color-mix(in srgb, var(--portal-highlight, #ff9900) 18%, #f1f1f1);
  color: #2a2a2a;
}

.portal-home .book-sub {
  margin-top: 4px;
  color: #666;
  font-size: 0.78rem;
}

.portal-home .book-sub.is-featured-description {
  color: #444;
  font-size: 0.88rem;
  line-height: 1.65;
  line-clamp: 4;
  -webkit-line-clamp: 4;
}

.portal-home.is-feature-freeworks #featured .book-sub.is-featured-description,
.portal-home.is-feature-ranking #ranking .book-sub.is-featured-description,
.portal-home.is-feature-newbooks #new-releases .book-sub.is-featured-description,
.portal-home.is-feature-salebooks #sales .book-sub.is-featured-description,
.portal-home.is-feature-mediaworks #media .book-sub.is-featured-description {
  color: var(--portal-highlight-strong, #e68700);
}

.portal-home .book-cta {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.42rem 0.8rem;
  border-radius: 999px;
  background: #ff9900;
  color: #181818;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
}

.portal-home .book-cta.is-featured-cta {
  min-height: 44px;
  font-size: 0.86rem;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}

/* =========================
   ストアリンク列
========================= */

.book-store-link-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.book-store-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid #e2e2e2;
  border-radius: 999px;
  background: #fff;
  color: #444;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
}

.book-store-link:hover,
.book-store-link:focus-visible {
  border-color: var(--portal-highlight, #ff9900);
  color: var(--portal-highlight-dark, #e68600);
}

/* =========================
   主役カードのストアリンク列
========================= */

.is-featured-store-links .book-store-link-list {
  gap: 10px;
  margin-top: 12px;
}

.is-featured-store-links .book-store-link {
  border: 1px solid #ffd18b;
  background: var(--portal-highlight-soft, #fff1dd);
  color: var(--portal-highlight-dark, #e68600);
  font-size: 0.8rem;
  font-weight: 800;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
}

.is-featured-store-links .book-store-link:hover,
.is-featured-store-links .book-store-link:focus-visible {
  border-color: var(--portal-highlight, #ff9900);
  color: var(--portal-highlight-dark, #e68600);
  background: #fff;
}

/* =========================
   +他ストア / 閉じる ボタン
========================= */

.book-store-link--more {
  appearance: none;
  cursor: pointer;
  min-height: 44px;
  background: #f7f7f7;
  color: #666;
  border-style: dashed;
  font: inherit;
}

.portal-home .book-cta + .book-store-link-list {
  margin-top: 12px;
}

@media (max-width: 767px) {
  .portal-home .book-meta {
    padding: 12px 12px 14px;
  }

  .portal-home .book-title {
    line-height: 1.45;
  }

  .portal-home .book-sub.is-featured-description {
    margin-top: 6px;
    line-height: 1.7;
  }
}

/* no-JS: expanded links should stay accessible, and dead toggle should be hidden. */
html:not(.js) .book-store-link--more {
  display: none;
}

html:not(.js) .book-store-link-group-more[hidden] {
  display: inline-flex !important;
}

.is-featured-store-links .book-store-link--more {
  background: #fff;
  color: var(--portal-highlight-dark, #e68600);
  border-color: #d9d9d9;
}

/* 採用案3: 上品で少し軽い */
.is-featured-store-links .book-store-link--more.is-expanded {
  background: #faf8f4;
  color: #756854;
  border-color: #ddd6cc;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
  margin-left: 6px;
  padding-left: 14px;
  position: relative;
}

.is-featured-store-links .book-store-link--more.is-expanded::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 1px;
  height: 18px;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.12);
}

/* =========================
   展開される残りストアリンク群
========================= */

.book-store-link-group-more[hidden] {
  display: none !important;
}

.is-featured-store-links .book-store-link-group-more {
  position: relative;
}

.is-featured-store-links .book-store-link-group-more:not([hidden]) {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: 8px;
  padding-left: 10px;
  opacity: 0;
  transform: translateY(2px);
  transition:
    opacity 0.14s ease,
    transform 0.16s ease;
}

.is-featured-store-links .book-store-link-group-more.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.is-featured-store-links .book-store-link-group-more:not([hidden])::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 14px;
  height: 26px;
  transform: translateY(-50%);
  pointer-events: none;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    var(--portal-highlight-soft, #fff1dd) 100%
  );
}

@media (prefers-reduced-motion: reduce) {
  .is-featured-store-links .book-store-link-group-more {
    transition: none;
    transform: none;
  }
}

.book-store-link--expanded {
  background: #fff;
}

.portal-home .rank-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #ff9900;
  color: #1d1d1d;
  border: 2px solid #fff;
  font-weight: 800;
  font-size: 0.8rem;
  line-height: 1;
  display: grid;
  place-items: center;
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.2);
}
