/* ============================
   Liver Profile Stylesheet
   File: liver.css
   ============================ */

/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: #374151;
  background: #f9fafb;
}

.page-vliver__container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 5vw;
}

/* ============================
   Page Header
   ============================ */
.page-header {
  background: white;
  padding: 2rem 0;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
} 

.page-title {
  font-size: 2.5rem;
  font-weight: bold;
  color: #111827;
  margin-bottom: 0.5rem;
}

.page-subtitle {
  font-size: 1.2rem;
  color: #6b7280;
  text-align: center;
}

/* ============================
   Filters
   ============================ */
.search-filters {
  background: #fff;
  padding: 2rem 0;
  border-bottom: 1px solid #e5e7eb;
}

.search-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.search-input-container {
  position: relative;
}

.search-icon,
.filter-icon {
  position: absolute;
  top: 50%;
  left: 0.75rem;
  transform: translateY(-50%);
  width: 1rem;
  height: 1rem;
  color: #9ca3af;
}

.search-input,
.filter-select {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  border: 1px solid #d1d5db;
  border-radius: 0.75rem;
  font-size: 1rem;
}

/* ============================
   Livers Grid
   ============================ */
.livers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 2rem;
  padding: 2rem 0;
}

.liver-card {
  width: 100%;
  max-width: 360px;
  margin-inline: auto;
}

.liver-card:hover {
  transform: translateY(-4px);
}

.liver-image-container {
  max-width: 360px;
  margin-inline: auto;
}


.liver-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.liver-placeholder {
  width: 100%;
  height: 100%;
  background: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #9ca3af;
}

.live-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: #ef4444;
  color: #fff;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
}

.live-dot {
  width: 0.5rem;
  height: 0.5rem;
  background: white;
  border-radius: 50%;
}

/* カテゴリとレベルを右上に縦積み */
.badge-stack {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .5rem;
}

/* バッジを縦積みの中で使うため static に */
.liver-image-container .category-badge {
  position: static;
}

/* 上から下へ並べる（トップ揃え） */
.level-icons{
  display: flex;
  flex-direction: column;     /* ← 縦方向／通常順（上→下） */
  justify-content: flex-start;/* ← 上揃え */
  align-items: center;
  gap: 2px;
  padding: .25rem .35rem;
  border-radius: 8px;
  background: #fafafa;
  /* 下から積む時に使っていた固定高があるなら、外すか上揃えに変更 */
  /* height: 78px;  ← 揃えたい場合は残してOK（その場合も flex-start のまま） */
}

.level-icons .clover-icon {
  display: block;
  width: 20px;
  height: 20px;
  object-fit: contain;
}

/* アクセシビリティ用（視覚非表示テキスト） */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
  white-space: nowrap;
}


.viewer-count {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 0.3rem 0.6rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
}

.liver-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}


.liver-name {
  font-size: 1.25rem;
  font-weight: bold;
  color: #111827;
}

.liver-description {
  font-size: 1rem;
  color: #6b7280;
  line-height: 1.6;
}

.liver-actions {
  margin-top: auto;
  /* ← 最下部に押し下げる役割 */
  display: flex;
  gap: 0.75rem;
}

.btn-liver {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: #ec4899;
  color: #fff;
  font-weight: bold;
  border-radius: 0.75rem;
  text-decoration: none;
  transition: background 0.2s ease;
}

.btn-liver:hover {
  background: #db2777;
}

.btn-secondary {
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.75rem;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.no-results {
  text-align: center;
  padding: 2rem 0;
  color: #6b7280;
}

.no-results-icon {
  width: 3rem;
  height: 3rem;
  color: #9ca3af;
  margin: 0 auto 1rem;
}

/* Responsive */
@media (max-width: 768px) {
  .search-form {
    flex-direction: column;
  }

  .liver-actions {
    flex-direction: column;
  }
}

.liver-name-en {
  display: block;
  font-size: 1.5rem;
  font-weight: normal;
  color: #6b7280;
  margin-top: 0.25rem;
}


/* livers-grid 基本 */
.livers-grid {
  display: grid;
  gap: 20px;
  justify-content: center;
  /* 中央寄せの基本 */
}

/* 件数ごとのカラム指定 */
.livers-grid.items-1 {
  grid-template-columns: 1fr;
}

.livers-grid.items-2 {
  grid-template-columns: repeat(2, 1fr);
}

.livers-grid.items-3-or-more {
  grid-template-columns: repeat(3, 1fr);
}

/* 0件メッセージ中央寄せ */
.livers-grid .no-results {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 200px;
}

/* 中央寄せの土台（既存） */
.livers-grid {
  display: grid;
  gap: 20px;
  justify-content: center;
  /* 中央寄せ */
}

.livers-grid.items-1,
.livers-grid.items-2 {
  justify-content: center;
  /* 列グループを中央に */
  justify-items: center;
  /* 各アイテムも中央に */
}

/* 3件以上＝通常の自動詰め（横幅に応じて段組み） */
.livers-grid.items-3-or-more {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

/* 0件メッセージ中央寄せ（既存のままでOK） */
.livers-grid .no-results {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 200px;
}



/* アーカイブ: liver-page の一覧（post-type-archive-liver-page が body に付く） */
.post-type-archive-liver-page .livers-grid {
  justify-content: center;
}

.post-type-archive-liver-page .livers-grid.items-1 {
  grid-template-columns: minmax(260px, 360px);
}

.post-type-archive-liver-page .livers-grid.items-2 {
  grid-template-columns: repeat(2, minmax(260px, 360px));
}

/* アーカイブ時のみカード幅を制限 */
.post-type-archive-liver-page .liver-card {
  width: 100%;
  max-width: 360px;
  margin-inline: auto;
}

/* シングル: 詳細ページでは幅制限を解除 */
.single-liver-page .liver-card {
  max-width: none;
  width: 100%;
  margin-inline: 0;
}

/* アイキャッチだけ：下40%を透明にフェード（上60%はそのまま） */
.liver-image.is-featured{
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;

  /* ← 以前の clip-path/inset 指定は削除 */
  /* -webkit-clip-path: none; clip-path: none; */

  /* マスクでフェード（Safari対応の -webkit- も） */
  -webkit-mask-image: linear-gradient(to bottom, #000 70%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 70%, transparent 100%);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
}

/* 念のため：マスクの透明部分から背景色が見えるように */
.liver-image-container{
  position: relative;     /* 絶対配置要素の基準にもなる */
  overflow: hidden;       /* はみ出し対策（任意） */
  background: #f9fafb;    /* ページ背景色に合わせると自然（任意） */
}

/* マスクが使えない場合の簡易フォールバック（背景色 #f9fafb に溶かす） */
@supports not ((mask-image: linear-gradient(#000, transparent)) or (-webkit-mask-image: linear-gradient(#000, transparent))){
  .liver-image-container::after{
    content: "";
    position: absolute;
    inset: 60% 0 0 0; /* 上60%以降にだけ重ねる */
    background: linear-gradient(to bottom, rgba(249,250,251,0) 0%, #f9fafb 100%);
    pointer-events: none;
  }
}