/* =============================================================================
   0. Theme Tokens
   ============================================================================= */
:root {
  /* Colors */
  --primary-color: #d04b57;        /* 落ち着いた赤 */
  --secondary-color: #b33f4a;      /* ホバー時など */
  --success-color: #155724;
  --warning-color: #856404;
  --danger-color: #721c24;
  
  /* Text Colors */
  --text-primary: #333;
  --text-secondary: #666;
  
  /* UI Colors */
  --border-color: #e8e8e8;
  --surface: #fff;
  --surface-muted: #f8f9fa;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, .08);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, .12);
  
  /* Border Radius */
  --radius-sm: .375rem;
  --radius-md: .5rem;
  --radius-lg: .75rem;
  
  /* Layout */
  --content-max: 820px;            /* 1枚カードの理想幅 */
}

/* スコープ：アーカイブページのみ */
.post-type-archive-school_review {
  color: var(--text-primary);
}

/* パンくずナビの背景を白に変更 */
.p-breadcrumb.-bg-on {
  background: #fff !important;
}

/* =============================================================================
   1. レイアウト（2カラム）
   ============================================================================= */

/* メイン2カラムレイアウト */
.post-type-archive-school_review #content {
  display: grid !important;
  grid-template-columns: 1fr 320px !important;
  gap: 32px !important;
  align-items: start !important;
  max-width: 1200px !important;
  margin: 0 auto !important;
  padding: 0 20px !important;
}

/* メインコンテンツエリア */
.post-type-archive-school_review #content .container {
  grid-column: 1 !important;
  margin: 0 !important;
  padding: 0 !important;
  max-width: none !important;
}

/* サイドバーを右側に配置 */
.post-type-archive-school_review #content #sidebar {
  grid-column: 2 !important;
  position: sticky !important;
  top: 20px !important;
  margin: 0 !important;
}


/* =============================================================================
   2. Header / Stats / Filters
   ============================================================================= */

/* アーカイブヘッダー */
.post-type-archive-school_review .archive-header {
  background: linear-gradient(135deg, #fafafa, #f3f4f6);
  border-radius: 12px;
  padding: 40px 30px;
  margin:0 0 30px;
  text-align: center;
  color: var(--text-primary);
}

.post-type-archive-school_review .archive-title {
  margin: 0 0 15px;
  font-size: 32px;
  font-weight: 700;
}

.post-type-archive-school_review .archive-description {
  margin: 0;
  font-size: 16px;
  color: var(--text-secondary);
  opacity: .95;
}

/* 統計表示 */
.post-type-archive-school_review .archive-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.post-type-archive-school_review .archive-stats .stat-item {
  text-align: center;
}

.post-type-archive-school_review .archive-stats .stat-number {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary-color);
}

.post-type-archive-school_review .archive-stats .stat-label {
  font-size: 14px;
  color: var(--text-secondary);
}

/* フィルター */
.post-type-archive-school_review .review-filters {
  background: var(--surface-muted);
  border-radius: 12px;
  padding: 25px;
  margin-bottom: 30px;
}

.post-type-archive-school_review .filter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: end;
}

.post-type-archive-school_review .filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.post-type-archive-school_review .filter-group label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.post-type-archive-school_review .filter-group select,
.post-type-archive-school_review .filter-group input[type="checkbox"] {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: #fff;
  font-size: 14px;
}

.post-type-archive-school_review .filter-submit {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  background: var(--primary-color);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.post-type-archive-school_review .filter-submit:hover {
  background: var(--secondary-color);
}

.post-type-archive-school_review .filter-reset {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 6px;
  background: #6c757d;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.post-type-archive-school_review .filter-reset:hover {
  background: #545b62;
}

/* =============================================================================
   3. Card
   ============================================================================= */

/* カードベース */
.post-type-archive-school_review .review-card {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
  margin: 0 0 30px;
}

.post-type-archive-school_review .review-card:hover {
  transform: translateY(-2px);
  border-color: rgba(208, 75, 87, .35);
  box-shadow: var(--shadow-md);
  margin: 0 0 30px;
}

/* カードヘッダー */
.post-type-archive-school_review .review-card-header {
  padding: 20px 20px 12px;
  border-bottom: 1px solid #f1f5f9;
}

.post-type-archive-school_review .school-name {
  margin: 0 0 6px;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
}

.post-type-archive-school_review .review-rating {
  display: flex;
  align-items: center;
  gap: 8px;
}

.post-type-archive-school_review .stars {
  font-size: 16px;
  color: #ffc107;
}

.post-type-archive-school_review .rating-value,
.post-type-archive-school_review .rating-number {
  font-weight: 700;
  color: var(--text-primary);
}

/* メタ情報ボックス */
.post-type-archive-school_review .review-card-meta {
  background: var(--surface-muted);
  border-radius: 8px;
  padding: 12px;
  margin: 12px 20px 0;
  font-size: 14px;
  color: var(--text-secondary);
}

.post-type-archive-school_review .reviewer-info,
.post-type-archive-school_review .course-info {
  margin: 0 0 6px;
}

.post-type-archive-school_review .reviewer-info:last-child,
.post-type-archive-school_review .course-info:last-child {
  margin-bottom: 0;
}

/* スコア表示 */
.post-type-archive-school_review .review-card-scores {
  display: flex;
  gap: 15px;
  padding: 12px 20px 0;
}

.post-type-archive-school_review .review-card-scores .score {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.post-type-archive-school_review .score-label {
  margin-bottom: 3px;
  font-size: 12px;
  color: #666;
}

.post-type-archive-school_review .score-value {
  font-size: 16px;
  font-weight: 700;
}

.post-type-archive-school_review .score-value.high {
  color: var(--success-color);
}

.post-type-archive-school_review .score-value.medium {
  color: var(--warning-color);
}

.post-type-archive-school_review .score-value.low {
  color: var(--danger-color);
}

/* バッジ */
.post-type-archive-school_review .review-card-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 20px 0;
}

.post-type-archive-school_review .badge {
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.post-type-archive-school_review .badge.high-trust {
  background: #eaf7ef;
  border-color: #d7efdf;
  color: #0b5b36;
}

.post-type-archive-school_review .badge.verified {
  background: #ecf2ff;
  border-color: #dfe7ff;
  color: #223aa2;
}

.post-type-archive-school_review .badge.recent {
  background: #fff6df;
  border-color: #ffeab0;
  color: #7a5a00;
}

/* 本文エリア（主役） */
.post-type-archive-school_review .review-card-excerpt,
.post-type-archive-school_review .review-text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 6;
  overflow: hidden;
  background: #fff1f1;
  border-radius: 10px;
  margin: 14px 20px 12px;
  padding: 16px 18px;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-primary);
}

/* フッター */
.post-type-archive-school_review .review-card-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
  padding: 0 20px 20px;
}

.post-type-archive-school_review .read-more-btn {
  display: inline-block;
  width: 100%;
  padding: .75rem;
  border: 2px solid var(--primary-color);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--primary-color);
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  transition: all .15s ease;
}

.post-type-archive-school_review .read-more-btn:hover {
  background: var(--primary-color);
  color: #fff;
}

.post-type-archive-school_review .post-date {
  font-size: .8rem;
  color: #888;
  text-align: right;
}

/* =============================================================================
   4. サイドバーのスタイリング
   ============================================================================= */

/* WordPressデフォルトサイドバーのスタイリング */
.post-type-archive-school_review #sidebar .c-widget {
  background: var(--surface-muted);
  border-radius: 12px;
  padding: 20px;
  margin:0 0 24px;
}

.post-type-archive-school_review #sidebar h2 {
  margin: 0 0 12px;
  font-size: 18px;
  color: var(--text-primary);
}

/* リストスタイリング */
.post-type-archive-school_review #sidebar .wp-block-latest-posts,
.post-type-archive-school_review #sidebar .wp-block-categories-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.post-type-archive-school_review #sidebar .wp-block-latest-posts li,
.post-type-archive-school_review #sidebar .wp-block-categories-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
}

.post-type-archive-school_review #sidebar .wp-block-latest-posts li:last-child,
.post-type-archive-school_review #sidebar .wp-block-categories-list li:last-child {
  border-bottom: none;
}

.post-type-archive-school_review #sidebar a {
  color: var(--text-primary);
  text-decoration: none;
}

.post-type-archive-school_review #sidebar a:hover {
  color: var(--primary-color);
}

/* 検索フォームのスタイリング */
.post-type-archive-school_review #sidebar .wp-block-search__input {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: #fff;
  font-size: 14px;
}

.post-type-archive-school_review #sidebar .wp-block-search__button {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  background: var(--primary-color);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.post-type-archive-school_review #sidebar .wp-block-search__button:hover {
  background: var(--secondary-color);
}

/* =============================================================================
   5. レビュアープロフィール（ミニ版）
   ============================================================================= */

.post-type-archive-school_review .reviewer-profile--mini {
  margin: 8px 20px 0;
  background: #ffffff;
}

.post-type-archive-school_review .rp-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.post-type-archive-school_review .rp-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 10px;
}

.post-type-archive-school_review .rp-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #ffe5e8;
  color: var(--primary-color);
}

.post-type-archive-school_review .rp-label {
  margin-bottom: 2px;
  font-size: 12px;
  line-height: 1;
  color: #6b7280;
}

.post-type-archive-school_review .rp-value {
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}

/* =============================================================================
   6. SRW v2 — Archive overrides
   ============================================================================= */

/* 信頼度・有用度を一覧では非表示 */
.post-type-archive-school_review .review-card-scores,
.post-type-archive-school_review .trust-score,
.post-type-archive-school_review .utility-score,
.post-type-archive-school_review .badge.high-trust,
.post-type-archive-school_review .badge.high-useful {
  display: none !important;
}

/* レビュアー情報を見やすく（チップ風） */
.post-type-archive-school_review .review-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  padding: 12px 14px;
  margin: 12px 20px 0;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 10px;
}

.post-type-archive-school_review .review-card-meta .reviewer-info {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--border-color);
  border-radius: 9999px;
  background: #fff;
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.3;
}

.post-type-archive-school_review .review-card-meta .reviewer-info::before {
  content: "\f007";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
}

/* コース情報は控えめに右側 */
.post-type-archive-school_review .review-card-meta .course-info {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  color: var(--text-secondary);
}

.post-type-archive-school_review .review-card-meta .course-info::before {
  content: "\f02d";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
}

/* 本文との間隔最適化 */
.post-type-archive-school_review .review-card-excerpt,
.post-type-archive-school_review .review-text {
  margin-top: 12px;
}

/* =============================================================================
   7. レスポンシブ
   ============================================================================= */

@media (max-width: 992px) {
  /* タブレット・モバイルでは1カラムに */
  .post-type-archive-school_review #content {
    display: block !important;
    padding: 0 15px !important;
  }

  .post-type-archive-school_review #content #sidebar {
    position: static !important;
    margin-top: 24px !important;
  }

  .post-type-archive-school_review .review-card-excerpt,
  .post-type-archive-school_review .review-text {
    -webkit-line-clamp: 8;
  }

  .post-type-archive-school_review .rp-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .post-type-archive-school_review .archive-header {
    padding: 30px 20px;
  }

  .post-type-archive-school_review .archive-title {
    font-size: 24px;
  }

  .post-type-archive-school_review .archive-stats {
    gap: 20px;
  }

  .post-type-archive-school_review .filter-form {
    flex-direction: column;
    align-items: stretch;
  }

  .post-type-archive-school_review .filter-group {
    width: 100%;
  }

  .post-type-archive-school_review #content {
    padding: 0 10px !important;
  }

  .post-type-archive-school_review .review-card-excerpt,
  .post-type-archive-school_review .review-text {
    -webkit-line-clamp: 5;
    font-size: 1rem;
    padding: 14px 16px;
  }

  .post-type-archive-school_review .review-card-meta {
    gap: 8px;
  }

  .post-type-archive-school_review .review-card-meta .course-info {
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
  }
}

@media (min-width: 1200px) {
  .post-type-archive-school_review #content {
    gap: 40px !important;
    max-width: 1200px !important;
    padding: 0 40px !important;
  }
}

/* =============================================================================
   8. ダークモード
   ============================================================================= */

@media (prefers-color-scheme: dark) {
  :root {
    --text-primary: #f3f4f6;
    --text-secondary: #cbd5e1;
    --border-color: #374151;
    --surface: #1f2937;
    --surface-muted: #111827;
  }

  body {
    background: #0b1220;
    color: var(--text-primary);
  }

  .post-type-archive-school_review .review-card,
  .post-type-archive-school_review .review-card-meta,
  .post-type-archive-school_review #sidebar .c-widget {
    background: var(--surface);
    border-color: var(--border-color);
  }

  .post-type-archive-school_review .review-card-excerpt,
  .post-type-archive-school_review .review-text {
    background: linear-gradient(180deg, #1f2937, #111827);
    border-color: var(--border-color);
  }
}

/* =============================================================================
   カスタムサイドバー（.archive-sidebar）の装飾
   ============================================================================= */

/* カスタムサイドバー全体の装飾 */
.post-type-archive-school_review .archive-sidebar {
  margin:0 0 30px;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

/* ウィジェットボックスの装飾 */
.post-type-archive-school_review .sidebar-widget {
  background: var(--surface);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s ease;
}

.post-type-archive-school_review .sidebar-widget:hover {
  box-shadow: var(--shadow-md);
}

.post-type-archive-school_review .sidebar-widget:last-child {
  margin-bottom: 0;
}

/* ウィジェットタイトルの装飾 */
.post-type-archive-school_review .sidebar-widget h3 {
  margin: 0 0 15px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary-color);
}

/* ウィジェット内のテキスト */
.post-type-archive-school_review .sidebar-widget p {
  margin: 0 0 15px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* 人気スクールリストの装飾 */
.post-type-archive-school_review .popular-schools-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.post-type-archive-school_review .popular-schools-list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
  transition: background-color .2s ease;
}

.post-type-archive-school_review .popular-schools-list li:last-child {
  border-bottom: none;
}

.post-type-archive-school_review .popular-schools-list li:hover {
  background-color: rgba(208, 75, 87, .05);
  border-radius: 6px;
  padding-left: 8px;
  padding-right: 8px;
}

.post-type-archive-school_review .popular-schools-list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  transition: color .2s ease;
}

.post-type-archive-school_review .popular-schools-list a:hover {
  color: var(--primary-color);
}

.post-type-archive-school_review .popular-schools-list strong {
  font-weight: 700;
}

.post-type-archive-school_review .popular-schools-list .rating {
  color: #ffc107;
  font-weight: 700;
  font-size: 14px;
  background: #fff8e1;
  padding: 4px 8px;
  border-radius: 12px;
  border: 1px solid #ffecb3;
}

/* 口コミ投稿ボタンの装飾 */
.post-type-archive-school_review .submit-review-btn {
  display: inline-block;
  width: 100%;
  padding: 15px 20px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: #fff;
  text-decoration: none;
  border-radius: var(--radius-md);
  text-align: center;
  font-weight: 700;
  font-size: 16px;
  transition: all .3s ease;
  box-shadow: var(--shadow-sm);
  border: none;
  cursor: pointer;
}

.post-type-archive-school_review .submit-review-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  background: linear-gradient(135deg, var(--secondary-color), #954044);
}

.post-type-archive-school_review .submit-review-btn:active {
  transform: translateY(0);
}