/**
 * Life Troubles Child - Style Enhancements
 * デザイン要素のプロトタイプ用CSS
 * 既存のstyle.cssに追加するか、functions.phpで読み込んでください
 */

/* ==============================================
   ランキングカード（lrp-cards）のスタイル強化
   ============================================== */

.lrp-ranking.lrp-cards {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
}

.lrp-card {
  display: flex;
  align-items: flex-start;
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.lrp-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.lrp-rank {
  background: linear-gradient(135deg, #0066cc, #004499);
  color: white;
  font-weight: bold;
  font-size: 1.2rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 20px;
  flex-shrink: 0;
}

.lrp-card:nth-child(1) .lrp-rank {
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #333;
}

.lrp-card:nth-child(2) .lrp-rank {
  background: linear-gradient(135deg, #C0C0C0, #A0A0A0);
  color: #333;
}

.lrp-card:nth-child(3) .lrp-rank {
  background: linear-gradient(135deg, #CD7F32, #B8860B);
  color: white;
}

.lrp-main {
  flex: 1;
}

.lrp-title {
  font-size: 1.3rem;
  font-weight: bold;
  margin: 0 0 10px 0;
  line-height: 1.4;
}

.lrp-title a {
  color: #333;
  text-decoration: none;
  transition: color 0.3s ease;
}

.lrp-title a:hover {
  color: #0066cc;
}

.lrp-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: bold;
  margin-left: 8px;
}

.lrp-badge.lrp-pr {
  background: #ff6b35;
  color: white;
}

.lrp-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.lrp-stars {
  position: relative;
  display: inline-block;
  width: 100px;
  height: 16px;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23ddd"><path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"/></svg>') repeat-x;
  background-size: 20px 16px;
}

.lrp-stars span {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23FFD700"><path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"/></svg>') repeat-x;
  background-size: 20px 16px;
  transition: width 0.3s ease;
}

.lrp-score {
  font-size: 0.9rem;
  color: #666;
}

/* ==============================================
   ナビゲーション要素（rk-nav）のスタイル強化
   ============================================== */

.rk-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 15px;
}

.cols-2 ul { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.cols-3 ul { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.cols-4 ul { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }

.rk-nav li {
  margin: 0;
}

.rk-nav a {
  display: block;
  padding: 15px 20px;
  background: #f8f9fa;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  text-decoration: none;
  color: #495057;
  font-weight: 500;
  text-align: center;
  transition: all 0.3s ease;
}

.rk-nav a:hover {
  background: #0066cc;
  border-color: #0066cc;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

/* ==============================================
   トラブルアイコンナビゲーション
   ============================================== */

.trouble-icon-nav ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 20px;
}

.trouble-icon-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  background: white;
  border: 2px solid #e9ecef;
  border-radius: 12px;
  text-decoration: none;
  color: #495057;
  transition: all 0.3s ease;
}

.trouble-icon-nav a:hover {
  border-color: #0066cc;
  background: #f8f9ff;
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 102, 204, 0.2);
}

.trouble-icon {
  width: 60px;
  height: 60px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8f9fa;
  border-radius: 50%;
}

.trouble-icon img {
  max-width: 40px;
  max-height: 40px;
  object-fit: contain;
}

.trouble-name {
  font-weight: 600;
  font-size: 0.9rem;
}

/* ==============================================
   口コミ・施工事例の表示強化
   ============================================== */

.lrp-reviews,
.lrp-cases {
  display: grid;
  gap: 20px;
  margin: 20px 0;
}

.lrp-review,
.lrp-case {
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.lrp-review-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-weight: bold;
  color: #0066cc;
}

.lrp-review-body,
.lrp-case-body {
  line-height: 1.6;
  color: #333;
  margin: 10px 0;
}

.lrp-review-reply {
  background: #f8f9fa;
  border-left: 4px solid #0066cc;
  padding: 10px 15px;
  margin-top: 15px;
  border-radius: 0 4px 4px 0;
}

.lrp-case h4 {
  margin: 0 0 15px 0;
  color: #333;
  font-size: 1.1rem;
}

.lrp-case-images {
  display: flex;
  gap: 15px;
  margin: 15px 0;
  flex-wrap: wrap;
}

.lrp-case-images img {
  max-width: 200px;
  height: auto;
  border-radius: 4px;
  border: 1px solid #e0e0e0;
}

.lrp-case-price {
  background: #e8f4fd;
  color: #0066cc;
  padding: 8px 12px;
  border-radius: 4px;
  font-weight: bold;
  display: inline-block;
  margin: 10px 0;
}

/* ==============================================
   レスポンシブ対応
   ============================================== */

@media (max-width: 768px) {
  .lrp-card {
    flex-direction: column;
    text-align: center;
  }
  
  .lrp-rank {
    margin: 0 0 15px 0;
    align-self: center;
  }
  
  .rk-nav ul {
    grid-template-columns: 1fr;
  }
  
  .trouble-icon-nav ul {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }
  
  .lrp-case-images {
    justify-content: center;
  }
  
  .lrp-case-images img {
    max-width: 150px;
  }
}

@media (max-width: 480px) {
  .lrp-card {
    padding: 15px;
  }
  
  .lrp-title {
    font-size: 1.1rem;
  }
  
  .trouble-icon-nav ul {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .trouble-icon {
    width: 50px;
    height: 50px;
  }
  
  .trouble-icon img {
    max-width: 30px;
    max-height: 30px;
  }
}

/* ==============================================
   アニメーション効果
   ============================================== */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.lrp-card {
  animation: fadeInUp 0.6s ease-out;
}

.lrp-card:nth-child(1) { animation-delay: 0.1s; }
.lrp-card:nth-child(2) { animation-delay: 0.2s; }
.lrp-card:nth-child(3) { animation-delay: 0.3s; }
.lrp-card:nth-child(4) { animation-delay: 0.4s; }
.lrp-card:nth-child(5) { animation-delay: 0.5s; }

/* ==============================================
   プリント用スタイル
   ============================================== */

@media print {
  .lrp-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ccc;
  }
  
  .lrp-badge.lrp-pr {
    background: #ccc !important;
    color: #000 !important;
  }
  
  .rk-nav,
  .trouble-icon-nav {
    display: none;
  }
}

/* ==============================================
   アクセシビリティ対応
   ============================================== */

.lrp-card:focus-within {
  outline: 2px solid #0066cc;
  outline-offset: 2px;
}

.rk-nav a:focus,
.trouble-icon-nav a:focus {
  outline: 2px solid #0066cc;
  outline-offset: 2px;
}

/* ハイコントラストモード対応 */
@media (prefers-contrast: high) {
  .lrp-card {
    border-width: 2px;
  }
  
  .lrp-badge.lrp-pr {
    border: 1px solid #000;
  }
}

/* 動きを減らす設定に対応 */
@media (prefers-reduced-motion: reduce) {
  .lrp-card,
  .rk-nav a,
  .trouble-icon-nav a {
    transition: none;
    animation: none;
  }
  
  .lrp-card:hover,
  .rk-nav a:hover,
  .trouble-icon-nav a:hover {
    transform: none;
  }
}

