/*
Theme Name: レン AIニュース速報
Theme URI: https://example.com/ren-ai-news
Author: pon
Description: AI関連ニュースをまとめるWordPressテーマ。VIPPER速報風の2chまとめサイトデザインをベースに、AIニュースに特化したブルー系テーマ。
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ren-ai-news
Tags: blog, news, two-columns, right-sidebar, custom-menu, featured-images
*/

/* ============================================
   リセット & ベーススタイル
   ============================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #1a73e8;
  --primary-dark: #1558b0;
  --primary-light: #e8f0fe;
  --accent: #00bcd4;
  --bg: #f0f2f5;
  --bg-white: #ffffff;
  --text: #333333;
  --text-light: #666666;
  --text-muted: #999999;
  --border: #dde1e6;
  --border-light: #e8ecf0;
  --red: #e53935;
  --orange: #ff9800;
  --green: #43a047;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-hover: 0 3px 8px rgba(0,0,0,0.12);
  --radius: 4px;
  --font-main: 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, 'Noto Sans JP', sans-serif;
}

html {
  font-size: 14px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-main);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

ul, ol {
  list-style: none;
}

/* ============================================
   レイアウト
   ============================================ */
.site-wrapper {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 10px;
}

.content-area {
  display: flex;
  gap: 20px;
  margin-top: 15px;
}

.main-content {
  flex: 1;
  min-width: 0;
}

.sidebar {
  width: 300px;
  flex-shrink: 0;
}

/* ============================================
   ヘッダー
   ============================================ */
.site-header {
  background: linear-gradient(135deg, #1a237e 0%, var(--primary) 50%, var(--accent) 100%);
  color: #fff;
  padding: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.site-branding {
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-logo {
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-logo:hover {
  color: #fff;
  text-decoration: none;
}

.site-logo .logo-icon {
  background: rgba(255,255,255,0.2);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 1.1rem;
}

.site-description {
  font-size: 0.75rem;
  opacity: 0.8;
  margin-left: 5px;
}

/* ヘッダーナビゲーション */
.header-nav {
  display: flex;
  align-items: center;
  gap: 5px;
}

.header-nav a {
  color: rgba(255,255,255,0.85);
  font-size: 0.85rem;
  padding: 6px 12px;
  border-radius: var(--radius);
  transition: all 0.2s;
}

.header-nav a:hover {
  color: #fff;
  background: rgba(255,255,255,0.15);
  text-decoration: none;
}

/* ヘッダー検索 */
.header-search {
  position: relative;
}

.header-search input[type="search"] {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 20px;
  color: #fff;
  font-size: 0.85rem;
  padding: 6px 35px 6px 14px;
  width: 200px;
  outline: none;
  transition: all 0.3s;
}

.header-search input[type="search"]::placeholder {
  color: rgba(255,255,255,0.6);
}

.header-search input[type="search"]:focus {
  background: rgba(255,255,255,0.25);
  border-color: rgba(255,255,255,0.4);
  width: 250px;
}

.header-search button {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  font-size: 0.9rem;
}

/* カテゴリバー */
.category-bar {
  background: #1a237e;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.category-bar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 10px;
  display: flex;
  overflow-x: auto;
  gap: 0;
}

.category-bar a {
  color: rgba(255,255,255,0.8);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 8px 14px;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.category-bar a:hover,
.category-bar a.current {
  color: #fff;
  background: rgba(255,255,255,0.08);
  border-bottom-color: var(--accent);
  text-decoration: none;
}

/* ============================================
   記事一覧（まとめサイト風）
   ============================================ */
.article-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.article-item {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.article-item:hover {
  box-shadow: var(--shadow-hover);
}

.article-item a.article-link {
  display: flex;
  align-items: stretch;
  color: var(--text);
  text-decoration: none;
  padding: 12px 15px;
  gap: 15px;
}

.article-item a.article-link:hover {
  text-decoration: none;
}

.article-thumb {
  width: 120px;
  height: 80px;
  flex-shrink: 0;
  border-radius: 3px;
  overflow: hidden;
  background: var(--border-light);
}

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

.article-thumb .no-thumb {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--primary);
  background: var(--primary-light);
}

.article-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.article-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.5;
  color: var(--text);
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-item:hover .article-title {
  color: var(--primary);
}

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

.article-meta .cat-label {
  background: var(--primary);
  color: #fff;
  padding: 1px 8px;
  border-radius: 2px;
  font-size: 0.7rem;
  font-weight: 600;
}

.article-meta .cat-label.cat-chatgpt { background: #10a37f; }
.article-meta .cat-label.cat-image { background: #7c4dff; }
.article-meta .cat-label.cat-robot { background: #e53935; }
.article-meta .cat-label.cat-business { background: #ff9800; }
.article-meta .cat-label.cat-research { background: #1a73e8; }
.article-meta .cat-label.cat-coding { background: #43a047; }

.article-meta .comment-count {
  color: var(--red);
  font-weight: 600;
}

/* 記事番号（まとめサイト風） */
.article-number {
  width: 36px;
  height: 36px;
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 800;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ============================================
   ページネーション
   ============================================ */
.pagination {
  display: flex;
  justify-content: center;
  gap: 5px;
  padding: 25px 0;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--bg-white);
  color: var(--text);
  transition: all 0.2s;
}

.pagination a:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  text-decoration: none;
}

.pagination .current {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ============================================
   シングル記事ページ
   ============================================ */
.single-article {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 25px 30px;
  margin-bottom: 15px;
}

.single-article .entry-header {
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--primary-light);
}

.single-article .entry-title {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.5;
  color: var(--text);
  margin-bottom: 10px;
}

.single-article .entry-meta {
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: 0.8rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.single-article .entry-meta .meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* 記事本文 */
.entry-content {
  font-size: 1rem;
  line-height: 1.9;
}

.entry-content h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin: 30px 0 15px;
  padding: 8px 15px;
  background: var(--primary-light);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.entry-content h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin: 25px 0 10px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--border);
}

.entry-content p {
  margin-bottom: 15px;
}

.entry-content blockquote {
  background: #f8f9fa;
  border-left: 4px solid var(--primary);
  padding: 15px 20px;
  margin: 20px 0;
  color: var(--text-light);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.entry-content img {
  border-radius: var(--radius);
  margin: 15px 0;
}

.entry-content ul,
.entry-content ol {
  padding-left: 25px;
  margin-bottom: 15px;
}

.entry-content ul {
  list-style: disc;
}

.entry-content ol {
  list-style: decimal;
}

.entry-content li {
  margin-bottom: 5px;
}

.entry-content a {
  color: var(--primary);
  text-decoration: underline;
}

.entry-content pre {
  background: #1e1e1e;
  color: #d4d4d4;
  padding: 15px 20px;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 15px 0;
  font-size: 0.85rem;
  line-height: 1.5;
}

.entry-content code {
  background: var(--primary-light);
  color: var(--primary-dark);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.9em;
}

.entry-content pre code {
  background: none;
  color: inherit;
  padding: 0;
}

/* 2chまとめ風レスブロック */
.res-block {
  background: #f8f9fa;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 12px 15px;
  margin: 10px 0;
}

.res-header {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.res-header .res-number {
  color: var(--primary);
  font-weight: 700;
}

.res-header .res-name {
  color: var(--green);
  font-weight: 600;
}

.res-body {
  font-size: 0.95rem;
}

/* タグ */
.entry-tags {
  margin-top: 25px;
  padding-top: 15px;
  border-top: 1px solid var(--border-light);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.entry-tags a {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 20px;
  transition: all 0.2s;
}

.entry-tags a:hover {
  background: var(--primary);
  color: #fff;
  text-decoration: none;
}

/* SNSシェアボタン */
.share-buttons {
  display: flex;
  gap: 8px;
  margin: 20px 0;
  padding: 15px 0;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}

.share-buttons .share-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  margin-right: 5px;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: var(--radius);
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  transition: opacity 0.2s;
}

.share-btn:hover {
  opacity: 0.85;
  color: #fff;
  text-decoration: none;
}

.share-btn.twitter { background: #1da1f2; }
.share-btn.facebook { background: #4267b2; }
.share-btn.hatena { background: #00a4de; }
.share-btn.line { background: #06c755; }
.share-btn.pocket { background: #ef4056; }

/* 関連記事 */
.related-posts {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 15px;
}

.related-posts .section-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 15px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.related-posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.related-post-item {
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.related-post-item:hover {
  box-shadow: var(--shadow-hover);
}

.related-post-item a {
  display: block;
  color: var(--text);
}

.related-post-item a:hover {
  text-decoration: none;
}

.related-post-item .rp-thumb {
  width: 100%;
  height: 100px;
  overflow: hidden;
  background: var(--primary-light);
}

.related-post-item .rp-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.related-post-item .rp-title {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 10px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============================================
   サイドバー
   ============================================ */
.sidebar-widget {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  margin-bottom: 15px;
  overflow: hidden;
}

.sidebar-widget .widget-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #1a237e, var(--primary));
  padding: 10px 15px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sidebar-widget .widget-content {
  padding: 0;
}

/* 人気記事ランキング */
.ranking-list {
  counter-reset: ranking;
}

.ranking-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
  transition: background 0.2s;
  counter-increment: ranking;
}

.ranking-item:last-child {
  border-bottom: none;
}

.ranking-item:hover {
  background: var(--primary-light);
}

.ranking-item a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  width: 100%;
}

.ranking-item a:hover {
  text-decoration: none;
}

.ranking-number {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  border-radius: 50%;
  flex-shrink: 0;
  color: #fff;
  background: var(--text-muted);
}

.ranking-item:nth-child(1) .ranking-number { background: #ffd700; color: #333; }
.ranking-item:nth-child(2) .ranking-number { background: #c0c0c0; color: #333; }
.ranking-item:nth-child(3) .ranking-number { background: #cd7f32; color: #fff; }

.ranking-thumb {
  width: 60px;
  height: 45px;
  flex-shrink: 0;
  border-radius: 3px;
  overflow: hidden;
  background: var(--border-light);
}

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

.ranking-title {
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.4;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* カテゴリウィジェット */
.category-list li {
  border-bottom: 1px solid var(--border-light);
}

.category-list li:last-child {
  border-bottom: none;
}

.category-list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  color: var(--text);
  font-size: 0.85rem;
  transition: all 0.2s;
}

.category-list a:hover {
  background: var(--primary-light);
  color: var(--primary);
  text-decoration: none;
}

.category-list .cat-count {
  background: var(--border-light);
  color: var(--text-muted);
  font-size: 0.7rem;
  padding: 1px 8px;
  border-radius: 10px;
}

/* タグクラウド */
.tag-cloud {
  padding: 15px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-cloud a {
  display: inline-block;
  background: var(--bg);
  color: var(--text-light);
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.tag-cloud a:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  text-decoration: none;
}

/* 最新ニュースティッカー風 */
.news-ticker {
  padding: 12px 15px;
}

.news-ticker li {
  padding: 6px 0;
  border-bottom: 1px dotted var(--border);
}

.news-ticker li:last-child {
  border-bottom: none;
}

.news-ticker a {
  font-size: 0.8rem;
  color: var(--text);
  display: flex;
  gap: 8px;
}

.news-ticker a:hover {
  color: var(--primary);
  text-decoration: none;
}

.news-ticker .tick-date {
  color: var(--text-muted);
  font-size: 0.7rem;
  white-space: nowrap;
}

/* ============================================
   フッター
   ============================================ */
.site-footer {
  background: #1a237e;
  color: rgba(255,255,255,0.7);
  margin-top: 30px;
  padding: 30px 0 20px;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 10px;
}

.footer-widgets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  margin-bottom: 25px;
}

.footer-widget h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.15);
}

.footer-widget a {
  color: rgba(255,255,255,0.6);
  font-size: 0.8rem;
}

.footer-widget a:hover {
  color: #fff;
}

.footer-widget li {
  padding: 4px 0;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 15px;
  text-align: center;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.5);
}

.footer-bottom a {
  color: rgba(255,255,255,0.6);
}

/* ============================================
   検索結果
   ============================================ */
.search-header {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 15px;
}

.search-header h1 {
  font-size: 1.1rem;
  font-weight: 700;
}

.search-header .search-count {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 5px;
}

/* ============================================
   レスポンシブ
   ============================================ */
@media (max-width: 768px) {
  .content-area {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
  }

  .header-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 10px;
    gap: 8px;
  }

  .header-nav {
    display: none;
  }

  .header-search input[type="search"] {
    width: 160px;
  }

  .header-search input[type="search"]:focus {
    width: 180px;
  }

  .article-item a.article-link {
    padding: 10px 12px;
  }

  .article-thumb {
    width: 90px;
    height: 65px;
  }

  .article-title {
    font-size: 0.9rem;
  }

  .single-article {
    padding: 18px 15px;
  }

  .single-article .entry-title {
    font-size: 1.2rem;
  }

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

  .footer-widgets {
    grid-template-columns: 1fr;
  }

  .share-buttons {
    flex-wrap: wrap;
  }

  .category-bar-inner {
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 13px;
  }

  .article-thumb {
    width: 75px;
    height: 55px;
  }

  .article-number {
    display: none;
  }

  .related-posts-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
}

/* ============================================
   アニメーション
   ============================================ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.article-item {
  animation: fadeIn 0.3s ease-out;
}

/* スクロールバー */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}
