/*
 * Ukiyo Journal - Minimal Design Enhancements
 * 既存テンプレートを壊さない最小限の改善
 */

/* ============================================
   CSS Variables
   ============================================ */
:root {
  --ukiyo-primary: #1a365d;
  --ukiyo-accent: #d69e2e;
  --ukiyo-text: #1a202c;
  --ukiyo-text-muted: #718096;
}

/* ============================================
   Typography
   ============================================ */
.blog-title a {
  transition: color 0.2s ease;
}

.blog-title a:hover {
  color: var(--ukiyo-primary);
}

/* Main Featured Article (1件目) */
.blog-post.post-style-01 {
  position: relative !important;
  overflow: hidden !important;
  border-radius: 12px !important;
}

.blog-post.post-style-01 .blog-post-details {
  position: absolute !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  padding: 1.5rem !important;
  background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.6) 60%, transparent 100%) !important;
}

.blog-post.post-style-01 .blog-title {
  margin-bottom: 0.5rem !important;
}

.blog-post.post-style-01 .blog-title a {
  font-size: 1.4rem !important;
  font-weight: 700 !important;
  line-height: 1.4 !important;
  color: #ffffff !important;
  display: block !important;
  text-shadow: 0 2px 8px rgba(0,0,0,0.8), 0 1px 3px rgba(0,0,0,0.9) !important;
}

.blog-post.post-style-01 .blog-title a:hover {
  color: var(--ukiyo-accent) !important;
}

.blog-post.post-style-01 .blog-post-meta,
.blog-post.post-style-01 .blog-post-time,
.blog-post.post-style-01 .blog-post-time a {
  color: rgba(255,255,255,0.95) !important;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8) !important;
}

.blog-post.post-style-01 .blog-post-time i {
  color: var(--ukiyo-accent) !important;
}

/* ============================================
   Section Title
   ============================================ */
.section-title .title i {
  color: var(--ukiyo-accent);
}

/* ============================================
   Blog Cards - Hover Effects
   ============================================ */
.blog-post .blog-image img {
  transition: transform 0.4s ease;
}

.blog-post:hover .blog-image img {
  transform: scale(1.03);
}

/* ============================================
   Popular/Recent Articles List
   ============================================ */
.popular-articles-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.popular-article-card {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.75rem;
  background: #fff;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
  border: 1px solid #f0f0f0;
  position: relative;
}

.popular-article-card:hover {
  background: #fafafa;
  border-color: var(--ukiyo-accent);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  text-decoration: none;
  color: inherit;
  transform: translateX(4px);
}

/* Rank Badge */
.popular-rank-badge {
  position: absolute;
  top: -6px;
  left: -6px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ukiyo-primary);
  color: white;
  font-weight: 700;
  font-size: 0.75rem;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  z-index: 1;
}

.popular-article-card:nth-child(1) .popular-rank-badge {
  background: linear-gradient(135deg, #ffd700 0%, #f0b800 100%);
  color: #333;
}

.popular-article-card:nth-child(2) .popular-rank-badge {
  background: linear-gradient(135deg, #b8b8b8 0%, #9a9a9a 100%);
}

.popular-article-card:nth-child(3) .popular-rank-badge {
  background: linear-gradient(135deg, #cd7f32 0%, #b5682a 100%);
}

/* Thumbnail */
.popular-article-thumb {
  flex: 0 0 80px;
  width: 80px;
  height: 56px;
  border-radius: 6px;
  overflow: hidden;
}

.popular-article-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.popular-article-card:hover .popular-article-thumb img {
  transform: scale(1.08);
}

/* Content */
.popular-article-content {
  flex: 1;
  min-width: 0;
}

.popular-article-title {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 0 0 0.35rem 0;
  color: var(--ukiyo-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s ease;
}

.popular-article-card:hover .popular-article-title {
  color: var(--ukiyo-primary);
}

.popular-article-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: var(--ukiyo-text-muted);
}

.popular-article-date i,
.popular-article-views i {
  color: var(--ukiyo-accent);
  margin-right: 0.2rem;
}

/* Responsive */
@media (max-width: 991px) {
  .popular-articles-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  
  .popular-article-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 0;
    border: none;
    background: transparent;
  }
  
  .popular-article-card:hover {
    transform: none;
    box-shadow: none;
  }
  
  .popular-rank-badge {
    top: 8px;
    left: 8px;
  }
  
  .popular-article-thumb {
    width: 100%;
    height: 120px;
    border-radius: 8px;
  }
  
  .popular-article-content {
    padding: 0.5rem 0;
  }
}

@media (max-width: 576px) {
  .popular-articles-list {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   Meta Enhancements
   ============================================ */
.blog-post-time i {
  color: var(--ukiyo-accent);
}

/* ============================================
   Article Page - 読みやすさ改善
   ============================================ */

/* 記事画像 */
.blog-post-image {
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.blog-post-image img {
  width: 100%;
  height: auto;
}

/* 記事タイトル */
.blog-single .blog-post-title h1 {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.4;
  color: #1a1a1a;
  margin-bottom: 1rem;
}

/* メタ情報バー */
.article-meta-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  background: #f7f8fa;
  border-radius: 8px;
  margin-bottom: 2rem;
  border-left: 4px solid var(--ukiyo-accent);
}

/* 記事本文 */
.article_content {
  font-size: 1.1rem;
  line-height: 2;
  color: #333;
  letter-spacing: 0.02em;
}

/* 段落 */
.article_content p {
  margin-bottom: 1.75rem;
}

/* 見出し */
.article_content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--ukiyo-accent);
}

.article_content h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  padding-left: 0.75rem;
  border-left: 4px solid var(--ukiyo-accent);
}

.article_content h4 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #333;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

/* リンク */
.article_content a {
  color: var(--ukiyo-primary);
  text-decoration: underline;
  text-decoration-color: var(--ukiyo-accent);
  text-underline-offset: 3px;
  text-decoration-thickness: 2px;
  transition: all 0.2s ease;
}

.article_content a:hover {
  color: var(--ukiyo-accent);
  background: rgba(214, 158, 46, 0.1);
}

/* リスト */
.article_content ul,
.article_content ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.article_content li {
  margin-bottom: 0.5rem;
  line-height: 1.8;
}

.article_content ul li::marker {
  color: var(--ukiyo-accent);
}

/* 引用 */
.article_content blockquote {
  margin: 2rem 0;
  padding: 1.5rem 1.5rem 1.5rem 2rem;
  background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
  border-left: 4px solid var(--ukiyo-accent);
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: #555;
}

.article_content blockquote p:last-child {
  margin-bottom: 0;
}

/* 画像 */
.article_content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1.5rem 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* コード */
.article_content code {
  background: #f4f4f4;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.9em;
  color: #c7254e;
}

.article_content pre {
  background: #2d2d2d;
  color: #f8f8f2;
  padding: 1.5rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1.5rem 0;
}

.article_content pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

/* テーブル */
.article_content table {
  width: 100%;
  margin: 1.5rem 0;
  border-collapse: collapse;
}

.article_content th,
.article_content td {
  padding: 0.75rem 1rem;
  border: 1px solid #e0e0e0;
}

.article_content th {
  background: #f7f8fa;
  font-weight: 600;
}

/* 水平線 */
.article_content hr {
  margin: 2.5rem 0;
  border: none;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--ukiyo-accent), transparent);
}

/* 戻るリンク */
.back-navigation {
  padding: 2rem 0;
  margin-top: 1rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: #f7f8fa;
  color: var(--ukiyo-primary);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.back-link:hover {
  background: var(--ukiyo-primary);
  color: white;
}

/* 関連記事セクション */
.related-articles-section {
  background: #f7f8fa;
  margin-top: 2rem;
  padding: 2rem 0;
}

/* レスポンシブ */
@media (max-width: 768px) {
  .blog-single .blog-post-title h1 {
    font-size: 1.4rem;
  }
  
  .article_content {
    font-size: 1rem;
  }
  
  .article_content h2 {
    font-size: 1.3rem;
  }
  
  .article_content h3 {
    font-size: 1.15rem;
  }
  
  .article-meta-bar {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }
}

/* Share Buttons */
.share-box a {
  transition: all 0.2s ease;
}

.share-box a:hover {
  transform: translateY(-2px);
}

/* ============================================
   Footer
   ============================================ */
.footer a:hover {
  color: var(--ukiyo-accent);
}

/* ============================================
   Carousel Navigation
   ============================================ */
.owl-carousel .owl-nav button:hover {
  background: var(--ukiyo-primary) !important;
  color: white !important;
}

/* ============================================
   Amazon Products Section
   ============================================ */
.amazon-products-section {
  margin-top: 3rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, #fef9e7 0%, #fff8e1 100%);
  border: 1px solid #f0e6c8;
  border-radius: 12px;
}

.amazon-products-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #ff9900;
}

.amazon-products-header i {
  font-size: 1.5rem;
  color: #ff9900;
}

.amazon-products-header span {
  font-size: 1.1rem;
  font-weight: 700;
  color: #232f3e;
}

.amazon-products-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.amazon-product-card {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: white;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.amazon-product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  text-decoration: none;
  color: inherit;
}

.amazon-product-image {
  flex: 0 0 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.amazon-product-image img {
  max-width: 100px;
  max-height: 100px;
  object-fit: contain;
  border-radius: 4px;
}

.amazon-product-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.amazon-product-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #0066c0;
  margin: 0 0 0.5rem 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.amazon-product-card:hover .amazon-product-title {
  color: #c45500;
  text-decoration: underline;
}

.amazon-product-author {
  font-size: 0.85rem;
  color: #555;
  margin: 0 0 0.25rem 0;
}

.amazon-product-price {
  font-size: 1rem;
  font-weight: 700;
  color: #b12704;
  margin: 0 0 0.5rem 0;
}

.amazon-product-btn {
  display: inline-block;
  padding: 0.4rem 0.75rem;
  background: linear-gradient(180deg, #f7dfa5 0%, #f0c14b 100%);
  border: 1px solid #a88734;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #111;
  text-align: center;
  width: fit-content;
}

.amazon-product-card:hover .amazon-product-btn {
  background: linear-gradient(180deg, #f5d78e 0%, #eeb933 100%);
}

.amazon-affiliate-disclosure {
  margin-top: 1rem;
  font-size: 0.75rem;
  color: #666;
  text-align: right;
}

/* レスポンシブ */
@media (max-width: 576px) {
  .amazon-product-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  
  .amazon-product-image {
    flex: none;
  }
  
  .amazon-product-info {
    align-items: center;
  }
  
  .amazon-product-title {
    text-align: center;
  }
}
