/* ============================================
   ともしび書店 - 詳細ページ / フォームページ専用スタイル
   ============================================ */

/* ============ 詳細ページ ============ */
.detail-layout {
  max-width: 860px;
  margin: 0 auto;
  padding: 32px 20px;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 32px;
  align-items: start;
}

.detail-cover-col {
  position: sticky;
  top: 84px;
}

.detail-cover-wrap {
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  aspect-ratio: 3/4;
  background: #f5ece6;
}

.detail-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-meta-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.detail-read-btn {
  margin-top: 14px;
  width: 100%;
  justify-content: center;
  font-size: 1rem;
}

.detail-read-btn.read {
  background: var(--secondary) !important;
}

.read-count-display {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  justify-content: center;
  font-size: 0.88rem;
  color: var(--text-light);
  font-weight: 600;
}

.read-count-num {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
}

/* ============ 詳細情報コラム ============ */
.detail-info-col {
  min-width: 0;
}

.detail-genre-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 14px;
  border-radius: var(--radius-full);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 14px;
}

.detail-title {
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.35;
  margin-bottom: 12px;
}

.detail-stars {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 16px;
}

.detail-stars .star {
  font-size: 1.3rem;
}

.detail-rating-text {
  font-size: 0.88rem;
  color: var(--text-light);
  margin-left: 8px;
  font-weight: 600;
}

.detail-recommender-card {
  background: var(--bg-main);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1.5px solid var(--border);
}

.recommender-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.2rem;
  font-weight: 700;
  flex-shrink: 0;
}

.recommender-name {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 2px;
}

.recommender-label {
  font-size: 0.78rem;
  color: var(--text-light);
}

.detail-comment-box {
  background: linear-gradient(135deg, #fff9f0, #fff5ec);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-bottom: 20px;
  border-left: 4px solid var(--primary);
  position: relative;
}

.detail-comment-box::before {
  content: '❝';
  position: absolute;
  top: -8px;
  left: 20px;
  font-size: 2rem;
  color: var(--primary);
  opacity: 0.4;
  font-family: serif;
}

.detail-comment-text {
  font-size: 0.97rem;
  line-height: 1.8;
  color: var(--text-mid);
  margin-top: 8px;
}

/* YouTube ボタン */
.youtube-btn {
  background: #ff0000;
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  transition: all 0.2s;
  font-family: inherit;
}

.youtube-btn:hover {
  background: #cc0000;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(255,0,0,0.35);
}

.detail-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 2px solid var(--border);
}

/* ============ バック ブレッドクラム ============ */
.breadcrumb {
  max-width: 860px;
  margin: 0 auto;
  padding: 16px 20px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-light);
}

.breadcrumb a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.breadcrumb a:hover { text-decoration: underline; }

/* ============ 登録フォームページ ============ */
.form-page {
  max-width: 640px;
  margin: 0 auto;
  padding: 32px 20px;
}

.form-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow-md);
}

.star-rating-input {
  display: flex;
  gap: 6px;
  flex-direction: row-reverse;
  justify-content: flex-end;
}

.star-rating-input input {
  display: none;
}

.star-rating-input label {
  font-size: 1.8rem;
  color: #ddd;
  cursor: pointer;
  transition: color 0.15s, transform 0.15s;
}

.star-rating-input label:hover,
.star-rating-input label:hover ~ label,
.star-rating-input input:checked ~ label {
  color: #f7b731;
}

.star-rating-input label:hover {
  transform: scale(1.15);
}

.cover-preview {
  margin-top: 10px;
  width: 100%;
  max-width: 180px;
  aspect-ratio: 3/4;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-main);
  border: 2px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: 0.85rem;
  text-align: center;
}

.cover-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ============ プロフィールページ ============ */
.profile-layout {
  max-width: 800px;
  margin: 0 auto;
  padding: 32px 20px;
}

.profile-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow-md);
  text-align: center;
  margin-bottom: 28px;
}

.profile-avatar-wrap {
  position: relative;
  display: inline-block;
  margin-bottom: 16px;
}

.profile-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--primary);
  box-shadow: 0 4px 16px rgba(255,107,53,0.3);
}

.profile-avatar-placeholder {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 2.5rem;
  font-weight: 700;
  border: 4px solid var(--primary);
  box-shadow: 0 4px 16px rgba(255,107,53,0.3);
}

.profile-name {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.profile-id {
  font-size: 0.82rem;
  color: var(--text-light);
  margin-bottom: 20px;
}

/* バッジセクション */
.badge-showcase {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.badge-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 24px;
  background: var(--bg-main);
  border-radius: var(--radius-md);
  border: 2px solid var(--border);
  min-width: 110px;
  transition: all 0.2s;
}

.badge-item.active {
  border-color: var(--accent);
  background: linear-gradient(135deg, #fff9f0, #fff5e0);
  box-shadow: var(--shadow-sm);
}

.badge-icon {
  font-size: 2.2rem;
}

.badge-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary);
}

.badge-label {
  font-size: 0.78rem;
  color: var(--text-light);
  font-weight: 600;
  text-align: center;
}

/* 読んだ本リスト */
.read-books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}

/* ログインプロンプト */
.login-prompt {
  max-width: 500px;
  margin: 0 auto;
  padding: 60px 20px;
  text-align: center;
}

.login-prompt .icon {
  font-size: 5rem;
  margin-bottom: 20px;
}

.login-prompt h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-dark);
}

.login-prompt p {
  color: var(--text-light);
  margin-bottom: 28px;
  line-height: 1.7;
}

/* ============ レスポンシブ（詳細ページ） ============ */
@media (max-width: 640px) {
  .detail-layout {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 20px 16px;
  }
  .detail-cover-col {
    position: static;
    max-width: 200px;
    margin: 0 auto;
  }
  .detail-cover-wrap { aspect-ratio: 3/4; }
  .detail-title { font-size: 1.35rem; }
  .form-card { padding: 24px 20px; }
  .profile-card { padding: 24px 20px; }
}
