@charset "utf-8";
/* =========================================================
   カルーセル共通スタイル（接頭辞: crsl-）

   html/temp/ 配下の各カルーセルテンプレートで共用する。
   - popular_carousel.php        (#pd-carousel-section)
   - browsing_history_carousel.php (#bh-carousel-section)
   - personalized_carousel.php   (#ps-carousel-section)
   - recommendation_carousel.php (#rc-carousel-section)
   - similar_carousel.php        (#sc-carousel-section)
   - genre_carousel.php          (#gc-carousel-section)
   - notfound_similar.php        (#nf-similar-section / .crsl-grid)

   各テンプレート固有のスタイル（ランキングタブ・閲覧履歴タブ等）は
   各テンプレート側の <style> に残す。
   ========================================================= */

/* --- セクション --- */
.crsl-section {
  width: 100%;
  padding: 10px 0;
  background: #f0f0f0;
}

/* --- タイトル --- */
.crsl-carousel-title {
  font-size: 15px;
  font-weight: bold;
  color: #555;
  padding: 0 0 10px 15px;
}

/* --- カルーセル外枠 --- */
.crsl-carousel-wrap {
  position: relative;
  z-index: 0;
}
.crsl-carousel-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  gap: 10px;
  padding-left: 15px;
  scroll-padding-left: 15px;
  scrollbar-width: none;
}
.crsl-carousel-track::-webkit-scrollbar { display: none; }
.crsl-carousel-track {
  cursor: grab;
  user-select: none;
}
.crsl-carousel-track.crsl-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
}
.crsl-carousel-track.crsl-dragging a,
.crsl-carousel-track.crsl-dragging button {
  pointer-events: none;
}
@media (min-width: 961px) {
  .crsl-carousel-track {
    scroll-snap-type: none;
  }
}

/* --- 右端の見切れ演出用シャドウ --- */
.crsl-carousel-shadow {
  position: absolute;
  top: 0;
  right: 0;
  width: 60px;
  height: calc(100% - 12px);
  background: linear-gradient(to right, rgba(240,240,240,0) 0%, rgba(240,240,240,0.9) 100%);
  pointer-events: none;
  z-index: 1;
}

/* --- スクロール矢印ボタン --- */
.crsl-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(calc(-50% - 6px));
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.95);
  border: 1px solid #ccc;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #555;
  transition: opacity 0.2s, box-shadow 0.2s;
}
.crsl-arrow:hover {
  box-shadow: 0 3px 10px rgba(0,0,0,0.2);
  color: #333;
}
.crsl-arrow-left {
  left: 4px;
}
.crsl-arrow-right {
  right: 4px;
}
.crsl-arrow.crsl-arrow-hidden {
  opacity: 0;
  pointer-events: none;
}
@media (max-width: 960px) {
  .crsl-arrow { display: none !important; }
}

/* --- カード本体 --- */
.crsl-card {
  flex: 0 0 220px;
  scroll-snap-align: start;
  background: #fff;
  border: 2px solid #d5d5d5;
  border-radius: 5px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-decoration: none;
  color: #666;
  font-size: 12px;
  transition: box-shadow 0.2s;
  min-height: 110px;
}
.crsl-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  text-decoration: none;
  border: solid 2px #0009c1;
}
.crsl-card a {
  color:#0009c1;
}

/* --- ヘッダー: ドメイン名 + ボタン --- */
.crsl-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 4px;
}
.crsl-card-domain {
  font-size: 13px;
  font-weight: bold;
  color: #0009c1;
  line-height: 1.3;
  flex: 1;
  min-width: 0;
  height: calc(13px * 1.3);
  overflow: hidden;
  position: relative;
  display: block;
  white-space: nowrap;
  word-break: normal;
  text-decoration: none;
}
.crsl-card-domain:after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 30px;
  height: 100%;
  background: linear-gradient(to right, rgba(255,255,255,0) 0%, #fff 85%);
  pointer-events: none;
}
.crsl-card-domain:hover {
  text-decoration: none;
}
.crsl-card-actions {
  flex-shrink: 0;
  white-space: nowrap;
  position: relative;
  z-index: 1;
}
.crsl-card-actions img {
  width: 16px;
  height: 16px;
  cursor: pointer;
  padding: 10px;
  margin: -10px;
  position: relative;
  vertical-align: middle;
}

/* --- 価格 --- */
.crsl-card-price {
  font-size: 13px;
  font-weight: bold;
  color: #333;
}

/* --- 指標行 --- */
.crsl-card-stats {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid #eee;
  border-bottom: 1px solid #eee;
  padding: 4px 0;
}
.crsl-stat {
  text-align: center;
  flex: 1;
}
.crsl-stat-label {
  display: block;
  font-size: 10px;
  color: #999;
  line-height: 1;
  margin-bottom: 2px;
}

/* --- DR強調 --- */
.crsl-dr-high { color: #e65100; font-weight: bold; }
.crsl-dr-mid { color: #f57c00; font-weight: bold; }
.crsl-dr-low { color: #388e3c; font-weight: bold; }

/* --- 備考アイコン + アンカーテキスト（インライン2行） --- */
.crsl-card-meta {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 18px;
  max-height: 40px;
  font-size: 11px;
  color: #888;
  min-width: 0;
}
.crsl-card-meta img {
  height: 14px;
  width: auto;
  vertical-align: middle;
  margin-right: 1px;
}
.crsl-card-comment {
  font-weight: bold;
  color: #555;
  vertical-align: middle;
}
.crsl-card-anchor-text {
  vertical-align: middle;
  margin-left: 3px;
  word-break: break-all;
  overflow-wrap: anywhere;
}

/* --- カード内リンク --- */
.crsl-card-link {
  text-decoration: none;
  color: inherit;
}
.crsl-card-link:hover {
  text-decoration: none;
}

/* --- もっと見るカード --- */
.crsl-card-more {
  align-items: center;
  justify-content: center;
  color: #0009c1;
  font-weight: bold;
  font-size: 14px;
  text-decoration: none;
  min-height: 110px;
  margin-right: 15px;
}
.crsl-card-more:hover {
  color: #333;
  text-decoration: none;
}
.crsl-card-more-text {
  margin-bottom: 6px;
}

/* --- スケルトンローディング --- */
.crsl-skeleton-card {
  pointer-events: none;
  flex: 1 0 0;
  min-width: 0;
}
.crsl-skeleton-domain,
.crsl-skeleton-stats,
.crsl-skeleton-meta {
  background: linear-gradient(90deg, #e8e8e8 25%, #f0f0f0 50%, #e8e8e8 75%);
  background-size: 200% 100%;
  animation: crsl-skeleton-shimmer 1.5s infinite;
  border-radius: 3px;
}
.crsl-skeleton-domain {
  height: 16px;
  width: 80%;
  margin-bottom: 4px;
}
.crsl-skeleton-stats {
  height: 28px;
  width: 100%;
  margin-bottom: 4px;
}
.crsl-skeleton-meta {
  height: 32px;
  width: 100%;
}
@keyframes crsl-skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* =========================================================
   グリッド表示（カルーセルではなく2列グリッドで並べる場合）
   notfound_similar.php で使用。カード自体は共通のものを使い、
   横スクロールしない分の差分だけをここで上書きする。
   ========================================================= */
.crsl-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
@media (max-width: 640px) {
  .crsl-grid {
    grid-template-columns: 1fr;
  }
}
.crsl-grid .crsl-card {
  width: 100%;
  box-sizing: border-box;
}
/* グリッドではカード幅に余裕があるためドメイン名は2行まで折り返して全文表示する */
.crsl-grid .crsl-card-domain {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  white-space: normal;
  word-break: break-all;
  height: auto;
  max-height: calc(13px * 1.3 * 2);
}
.crsl-grid .crsl-card-domain:after {
  display: none;
}
